forked from ThisIsClark/Qt-RangeSlider
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ThisIsClark#3 from nasafix-nasser/multi-type-slider
Multi type slider
- Loading branch information
Showing
9 changed files
with
132 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*pro.user | ||
*autosave |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# Qt-RangeSlider | ||
Implement range slider in Qt<br> | ||
Here is the demo:<br> | ||
![image](https://github.com/ThisIsClark/Qt-RangeSlider/blob/master/demo.gif)<br> | ||
![image](https://github.com/nasafix-nasser/Qt-RangeSlider/blob/multi-type-slider/demo.gif)<br> | ||
## How to use | ||
1. Import RangeSlider.cpp & RangeSlider.h to your project. | ||
2. Add a widget in Qt Designer. | ||
3. Right click this widget to promote it to RangeSlider. | ||
4. Now you can use this RangeSlider in your code. | ||
4. Now you can use this RangeSlider in your code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
#include <QDesktopWidget> | ||
#include "mainwindow.h" | ||
#include "ui_mainwindow.h" | ||
|
||
MainWindow::MainWindow(QWidget *parent) : | ||
QMainWindow(parent), | ||
ui(new Ui::MainWindow) | ||
QMainWindow(parent) | ||
{ | ||
ui->setupUi(this); | ||
widget = new QWidget(this); | ||
rsH = new RangeSlider(Qt::Horizontal, RangeSlider::Option::DoubleHandles, nullptr); | ||
rsV = new RangeSlider(Qt::Vertical, RangeSlider::Option::DoubleHandles, nullptr); | ||
rsHsingleLeft = new RangeSlider(Qt::Horizontal, RangeSlider::Option::LeftHandle, nullptr); | ||
rsVsingleLeft = new RangeSlider(Qt::Vertical, RangeSlider::Option::LeftHandle, nullptr); | ||
rsHsingleRight = new RangeSlider(Qt::Horizontal, RangeSlider::Option::RightHandle, nullptr); | ||
rsVsingleRight = new RangeSlider(Qt::Vertical, RangeSlider::Option::RightHandle, nullptr); | ||
|
||
layout = new QHBoxLayout(); | ||
layout->addWidget(rsH); | ||
layout->addWidget(rsV); | ||
layout->addWidget(rsHsingleLeft); | ||
layout->addWidget(rsVsingleLeft); | ||
layout->addWidget(rsHsingleRight); | ||
layout->addWidget(rsVsingleRight); | ||
|
||
widget->setLayout(layout); | ||
setCentralWidget(widget); | ||
resize(QDesktopWidget().availableGeometry(this).size() * 0.7); | ||
} | ||
|
||
MainWindow::~MainWindow() | ||
{ | ||
delete ui; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.