Commit d4fae3f2 by Kai Westerkamp

slider fix

parent 194aa735
......@@ -47,7 +47,7 @@ MainWindow::MainWindow(QWidget *parent) :
subdivSlider->setSingleStep(1);
connect(subdivSlider, SIGNAL(valueChanged(int)),
m_centralWidget, SLOT(subdivide(int)));
this, SLOT(sliderfix(int)));
toolBar->addWidget(subdivSlider);
......@@ -56,6 +56,16 @@ MainWindow::MainWindow(QWidget *parent) :
// showMaximized();
}
void MainWindow::sliderfix(int pos){
int move = pos -oldSliderpos;
move >0 ? move = 1 : move = -1;
int newPos = oldSliderpos+move;
// qDebug()<<"SliderPos"<<oldSliderpos<<move<<newPos;
m_centralWidget->subdivide(newPos);
subdivSlider->setSliderPosition(newPos);
oldSliderpos = newPos;
}
MainWindow::~MainWindow()
{
}
......@@ -19,7 +19,11 @@ public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
public slots:
void sliderfix(int pos);
private:
int oldSliderpos = 0;
MainWidget *m_centralWidget;
QToolBar *toolBar;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment