From ad5ed0e619deebd3ac6ad3be6c2f0395c6dd7686 Mon Sep 17 00:00:00 2001 From: haruyukilxz Date: Wed, 31 Jan 2018 15:01:35 +0800 Subject: [PATCH] feat: add switch button Change-Id: Ifbd9ec6ac1aa21ebc7aea8b3e2253d2a9a9b9038 --- src/mainwindow.cpp | 22 ++++++++++++++++++++++ src/mainwindow.h | 14 ++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 6d7dde2..833cae1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -29,3 +29,25 @@ MainWindow::~MainWindow() { } + +void MainWindow::previous() +{ + +} + +void MainWindow::next() +{ + +} + +void MainWindow::initUI() +{ + m_previousBtn = new DImageButton; + m_nextBtn = new QPushButton; +} + +void MainWindow::initConnect() +{ + connect(m_previousBtn, &DImageButton::clicked, this, &MainWindow::previous); + connect(m_nextBtn, &QPushButton::clicked, this, &MainWindow::next); +} diff --git a/src/mainwindow.h b/src/mainwindow.h index 1cae227..d5026de 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -20,6 +20,8 @@ #define MAINWINDOW_H #include +#include +#include DWIDGET_USE_NAMESPACE @@ -30,6 +32,18 @@ class MainWindow : public DDialog public: MainWindow(QWidget *parent = 0); ~MainWindow(); + +private Q_SLOTS: + void previous(); + void next(); + +private: + void initUI(); + void initConnect(); + +private: + QPushButton* m_nextBtn; + DImageButton* m_previousBtn; }; #endif // MAINWINDOW_H