- QtmadsBannerAd *adWidget1 = new QtmadsBannerAd("ADHERE", 0, noFit, this);
- adWidget1->setAsBannerAd();
- adWidget1->setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum));
- adWidget1->setMaximumSize(QSize(216,36));
- layout->addWidget(adWidget1, 0, 0, 1, 2, Qt::AlignCenter);
+ splashScreenAd = new QtmadsLabelAd("ADHERE", 0, noFit, this);
+ splashScreenAd->setAsImageAd();
+ mainLayout->addWidget(splashScreenAd);
+ splashScreenAd->startSingleShotAd(10);
+ connect(splashScreenAd, SIGNAL(adStopped()),this, SLOT(splashStopped()));
+
+ widget->setLayout(mainLayout);
+
+ this->setCentralWidget(widget);
+}
+
+void MainWindow::splashStopped()
+{
+ qDebug() << "splashStopped()";
+ this->mainLayout->removeWidget(splashScreenAd);
+ splashScreenAd->clearAd();
+ this->init();
+}
+
+void MainWindow::init()
+{
+ QtmadsBannerAd *adWidget1 = new QtmadsBannerAd("ADHERE", 0, noFit, this);
+ adWidget1->setAsBannerAd();
+ adWidget1->setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum));
+ adWidget1->setMaximumSize(QSize(216,36));
+ mainLayout->addWidget(adWidget1, 0, 0, 1, 2, Qt::AlignCenter);