move from qwizard -> qdialog

This commit is contained in:
David Marsh 2024-07-16 17:41:19 +01:00
parent b1ad248ad0
commit f23729f109
2 changed files with 143 additions and 23 deletions

View File

@ -1,41 +1,153 @@
#include "output-dialog.hpp" #include "output-dialog.hpp"
#include <QDialog> #include <QDialog>
#include <QWizard> #include <QVBoxLayout>
#include <QWizardPage> #include <QLabel>
#include <QStackedWidget>
OutputDialog::OutputDialog(QDialog *parent) : QWizard(parent) { OutputDialog::OutputDialog(QDialog *parent) : QDialog(parent) {
setWindowTitle("this is my wizard title!!"); stackedWidget = new QStackedWidget;
addPage(WizardPage1()); // Service selection page
addPage(WizardPage2()); stackedWidget->addWidget(WizardServicePage());
addPage(WizardPage3());
// Pages for each service
stackedWidget->addWidget(WizardInfoKick());
stackedWidget->addWidget(WizardInfoYouTube());
stackedWidget->addWidget(WizardInfoTwitter());
stackedWidget->addWidget(WizardInfoUnknown());
stackedWidget->addWidget(WizardInfoTwitch());
stackedWidget->addWidget(WizardInfoTrovo());
stackedWidget->addWidget(WizardInfoTikTok());
stackedWidget->addWidget(WizardInfoFacebook());
stackedWidget->setCurrentIndex(0);
auto stackedLayout = new QVBoxLayout;
stackedLayout->addWidget(stackedWidget);
stackedLayout->setAlignment(stackedWidget, Qt::AlignTop);
stackedLayout->setContentsMargins(4, 4, 4, 4);
setMinimumSize(650, 400);
setLayout(stackedLayout);
show(); show();
} }
QWizardPage *OutputDialog::WizardPage1() { QWidget *OutputDialog::WizardServicePage() {
auto page = new QWizardPage(this); auto page = new QWidget(this);
page->setTitle(QString("page 1")); auto pageLayout = new QVBoxLayout;
auto title = new QLabel(QString("This is my title"));
pageLayout->addWidget(title);
page->setLayout(pageLayout);
return page; return page;
} }
QWizardPage *OutputDialog::WizardPage2() { QWidget *OutputDialog::WizardInfoKick() {
auto page = new QWizardPage(this); auto page = new QWidget(this);
page->setTitle(QString("page 2")); auto pageLayout = new QVBoxLayout;
auto title = new QLabel(QString("Kick Service page"));
pageLayout->addWidget(title);
page->setLayout(pageLayout);
return page; return page;
} }
QWizardPage *OutputDialog::WizardPage3() { QWidget *OutputDialog::WizardInfoYouTube() {
auto page = new QWizardPage(this); auto page = new QWidget(this);
page->setTitle(QString("page 3")); auto pageLayout = new QVBoxLayout;
page->setFinalPage(true);
auto title = new QLabel(QString("YouTube Service page"));
pageLayout->addWidget(title);
page->setLayout(pageLayout);
return page; return page;
} }
QWidget *OutputDialog::WizardInfoTwitter() {
auto page = new QWidget(this);
auto pageLayout = new QVBoxLayout;
auto title = new QLabel(QString("Twitter Service page"));
pageLayout->addWidget(title);
page->setLayout(pageLayout);
return page;
}
QWidget *OutputDialog::WizardInfoUnknown() {
auto page = new QWidget(this);
auto pageLayout = new QVBoxLayout;
auto title = new QLabel(QString("Unknown Service page"));
pageLayout->addWidget(title);
page->setLayout(pageLayout);
return page;
}
QWidget *OutputDialog::WizardInfoTwitch() {
auto page = new QWidget(this);
auto pageLayout = new QVBoxLayout;
auto title = new QLabel(QString("Twitch Service page"));
pageLayout->addWidget(title);
page->setLayout(pageLayout);
return page;
}
QWidget *OutputDialog::WizardInfoTrovo() {
auto page = new QWidget(this);
auto pageLayout = new QVBoxLayout;
auto title = new QLabel(QString("Trovo Service page"));
pageLayout->addWidget(title);
page->setLayout(pageLayout);
return page;
}
QWidget *OutputDialog::WizardInfoTikTok() {
auto page = new QWidget(this);
auto pageLayout = new QVBoxLayout;
auto title = new QLabel(QString("Tiktok Service page"));
pageLayout->addWidget(title);
page->setLayout(pageLayout);
return page;
}
QWidget *OutputDialog::WizardInfoFacebook() {
auto page = new QWidget(this);
auto pageLayout = new QVBoxLayout;
auto title = new QLabel(QString("Facebook Service page"));
pageLayout->addWidget(title);
page->setLayout(pageLayout);
return page;
}

View File

@ -1,16 +1,24 @@
#pragma once #pragma once
#include <QWizard>
#include <QWizardPage>
#include <QDialog> #include <QDialog>
#include <QWidget>
#include <QStackedWidget>
class OutputDialog : public QWizard { class OutputDialog : public QDialog {
Q_OBJECT Q_OBJECT
private: private:
QWizardPage *WizardPage1(); QWidget *WizardServicePage();
QWizardPage *WizardPage2();
QWizardPage *WizardPage3();
QWidget *WizardInfoKick();
QWidget *WizardInfoYouTube();
QWidget *WizardInfoTwitter();
QWidget *WizardInfoUnknown();
QWidget *WizardInfoTwitch();
QWidget *WizardInfoTrovo();
QWidget *WizardInfoTikTok();
QWidget *WizardInfoFacebook();
QStackedWidget *stackedWidget;
public: public:
OutputDialog(QDialog *parent); OutputDialog(QDialog *parent);
}; };