Qt 6.12 LTS is out! See what's new in the release
blog
How to go from animated intro to main menu
-
hey i am new at Qt development, i am trying to create an instrument cluster gui that displays an animated intro (logo fade in) upon boot.
i only created the animated intro and now i want to go to the main menu when the animated intro ends.
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); //Background ui->setupUi(this); QPixmap bkgnd(":/rec/Images/backgorund.png"); bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio); QPalette palette; palette.setBrush(QPalette::Window, bkgnd); this->setPalette(palette); //Logo QPixmap iti(":/rec/Images/logo.png"); QLabel *label = new QLabel(this); label->setPixmap(iti); QHBoxLayout *layout = new QHBoxLayout(this); layout->addWidget(label); layout->setAlignment(Qt::AlignCenter); QWidget *centralWidget = new QWidget(this); centralWidget->setLayout(layout); setCentralWidget(centralWidget); //Fade in effect QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(this); label->setGraphicsEffect(eff); QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity"); a->setDuration(4000); a->setStartValue(0); a->setEndValue(1); a->setEasingCurve(QEasingCurve::InBack); a->start(QPropertyAnimation::DeleteWhenStopped); } -
hey i am new at Qt development, i am trying to create an instrument cluster gui that displays an animated intro (logo fade in) upon boot.
i only created the animated intro and now i want to go to the main menu when the animated intro ends.
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); //Background ui->setupUi(this); QPixmap bkgnd(":/rec/Images/backgorund.png"); bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio); QPalette palette; palette.setBrush(QPalette::Window, bkgnd); this->setPalette(palette); //Logo QPixmap iti(":/rec/Images/logo.png"); QLabel *label = new QLabel(this); label->setPixmap(iti); QHBoxLayout *layout = new QHBoxLayout(this); layout->addWidget(label); layout->setAlignment(Qt::AlignCenter); QWidget *centralWidget = new QWidget(this); centralWidget->setLayout(layout); setCentralWidget(centralWidget); //Fade in effect QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(this); label->setGraphicsEffect(eff); QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity"); a->setDuration(4000); a->setStartValue(0); a->setEndValue(1); a->setEasingCurve(QEasingCurve::InBack); a->start(QPropertyAnimation::DeleteWhenStopped); } -
@omardmf
I thought somebody posted just this question a couple of hours ago and I replied to it? Did you delete that?@JonB said in How to go from animated intro to main menu:
Did you delete that?
Yes, it was deleted by him.