From f23729f109d8114fabfa22bb34b15d73c47ea453 Mon Sep 17 00:00:00 2001 From: David Marsh Date: Tue, 16 Jul 2024 17:41:19 +0100 Subject: [PATCH] move from qwizard -> qdialog --- output-dialog.cpp | 146 ++++++++++++++++++++++++++++++++++++++++------ output-dialog.hpp | 20 +++++-- 2 files changed, 143 insertions(+), 23 deletions(-) diff --git a/output-dialog.cpp b/output-dialog.cpp index c5ec4f1..8b18f7e 100644 --- a/output-dialog.cpp +++ b/output-dialog.cpp @@ -1,41 +1,153 @@ #include "output-dialog.hpp" #include -#include -#include +#include +#include +#include -OutputDialog::OutputDialog(QDialog *parent) : QWizard(parent) { - setWindowTitle("this is my wizard title!!"); +OutputDialog::OutputDialog(QDialog *parent) : QDialog(parent) { + stackedWidget = new QStackedWidget; - addPage(WizardPage1()); - addPage(WizardPage2()); - addPage(WizardPage3()); + // Service selection page + stackedWidget->addWidget(WizardServicePage()); + // 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(); } -QWizardPage *OutputDialog::WizardPage1() { - auto page = new QWizardPage(this); +QWidget *OutputDialog::WizardServicePage() { + auto page = new QWidget(this); + + auto pageLayout = new QVBoxLayout; - page->setTitle(QString("page 1")); + auto title = new QLabel(QString("This is my title")); + pageLayout->addWidget(title); + + page->setLayout(pageLayout); return page; } -QWizardPage *OutputDialog::WizardPage2() { - auto page = new QWizardPage(this); +QWidget *OutputDialog::WizardInfoKick() { + auto page = new QWidget(this); + + auto pageLayout = new QVBoxLayout; - page->setTitle(QString("page 2")); + auto title = new QLabel(QString("Kick Service page")); + pageLayout->addWidget(title); + + page->setLayout(pageLayout); return page; } -QWizardPage *OutputDialog::WizardPage3() { - auto page = new QWizardPage(this); +QWidget *OutputDialog::WizardInfoYouTube() { + auto page = new QWidget(this); + + auto pageLayout = new QVBoxLayout; - page->setTitle(QString("page 3")); - page->setFinalPage(true); + auto title = new QLabel(QString("YouTube Service page")); + pageLayout->addWidget(title); + + page->setLayout(pageLayout); 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; +} diff --git a/output-dialog.hpp b/output-dialog.hpp index 4470655..553073b 100644 --- a/output-dialog.hpp +++ b/output-dialog.hpp @@ -1,16 +1,24 @@ #pragma once -#include -#include #include +#include +#include -class OutputDialog : public QWizard { +class OutputDialog : public QDialog { Q_OBJECT private: - QWizardPage *WizardPage1(); - QWizardPage *WizardPage2(); - QWizardPage *WizardPage3(); + QWidget *WizardServicePage(); + QWidget *WizardInfoKick(); + QWidget *WizardInfoYouTube(); + QWidget *WizardInfoTwitter(); + QWidget *WizardInfoUnknown(); + QWidget *WizardInfoTwitch(); + QWidget *WizardInfoTrovo(); + QWidget *WizardInfoTikTok(); + QWidget *WizardInfoFacebook(); + + QStackedWidget *stackedWidget; public: OutputDialog(QDialog *parent); };