Skip to content

Commit

Permalink
feat: add switch button
Browse files Browse the repository at this point in the history
Change-Id: Ifbd9ec6ac1aa21ebc7aea8b3e2253d2a9a9b9038
  • Loading branch information
justforlxz committed Jan 31, 2018
1 parent 6701186 commit ad5ed0e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
14 changes: 14 additions & 0 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#define MAINWINDOW_H

#include <ddialog.h>
#include <QPushButton>
#include <dimagebutton.h>

DWIDGET_USE_NAMESPACE

Expand All @@ -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

0 comments on commit ad5ed0e

Please sign in to comment.