/** * Constructor that sets the first screen, "welcome" screen. * * @param *parent Pointer to the QWidget * */ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); this->setStyleSheet( "QPushButton#pushButton_2 {" "background-color: rgb(125,125,175);" "border-style: outset;" "border-width: 2px;" "border-color: rgb(50,50,75);" "font: bold 22px;" "border-radius: 5px;" "min-width: 7em;}" "QPushButton#pushButton_2:hover:pressed {" "background-color: rgb(100,100,145);" "border-style:inset;}" "QPushButton#pushButton_2:hover {" "background-color: rgb(130,130,180);}" "QGraphicsView#graphicsView_2 {" "border-style: inset;" "border-width: 2px;" "border-radius: 5px;" "border-color: rgb(150,150,175); }" "QGraphicsView#graphicsView {" "border: transparent;}" "QGraphicsView#graphicsView_3 {" "border-style: inset;" "border-width: 2px;" "border-radius: 5px;" "border-color: rgb(150,150,175); }" ); //set the screen switching to get out of welcome screen connect(ui->pushButton_2, SIGNAL(clicked()), SLOT(hide())); connect(ui->pushButton_2, SIGNAL(clicked()), SIGNAL(showOtherWindow())); //insert the logo image on the welcome screen std :: string backgroundImage = "ombi-logo2.png"; QPixmap pixmap1(backgroundImage.c_str()); QRect rect = ui->graphicsView->rect(); QSize sizeLogo(rect.width() , rect.height()); QPixmap pixmap(pixmap1.scaled(sizeLogo)); QGraphicsScene* scene = new QGraphicsScene(this); scene->addPixmap(pixmap); ui->graphicsView->setScene(scene); }
int main(int argc, char *argv[]) { _beginthread(Three_day,0,NULL); QApplication a(argc, argv); QCoreApplication::removeLibraryPath ("C:/Qt/4.8.5/plugins/"); a.addLibraryPath(QCoreApplication::applicationDirPath ()+"/plugins"); DeltaForce w; w.show(); Regwin g; QObject::connect(&w, SIGNAL(showOtherWindow()), &g, SLOT(show())); Funcs l; l.LoadVars(); w.days_remaining=l.days_remaining; w.registration=l.registration; if ((w.days_remaining<1)) { w.Lcd_Display("NO DAY"); } else if((l.registration==1)) w.Lcd_Display("------"); else w.Lcd_Display(l.days_remaining); return a.exec(); }