Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
Unterteilungsalgorithmen
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kai Westerkamp
Unterteilungsalgorithmen
Commits
d4fae3f2
Commit
d4fae3f2
authored
Sep 01, 2016
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slider fix
parent
194aa735
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
mainwindow.cpp
QTProject/mainwindow.cpp
+11
-1
mainwindow.h
QTProject/mainwindow.h
+4
-0
No files found.
QTProject/mainwindow.cpp
View file @
d4fae3f2
...
@@ -47,7 +47,7 @@ MainWindow::MainWindow(QWidget *parent) :
...
@@ -47,7 +47,7 @@ MainWindow::MainWindow(QWidget *parent) :
subdivSlider
->
setSingleStep
(
1
);
subdivSlider
->
setSingleStep
(
1
);
connect
(
subdivSlider
,
SIGNAL
(
valueChanged
(
int
)),
connect
(
subdivSlider
,
SIGNAL
(
valueChanged
(
int
)),
m_centralWidget
,
SLOT
(
subdivide
(
int
)));
this
,
SLOT
(
sliderfix
(
int
)));
toolBar
->
addWidget
(
subdivSlider
);
toolBar
->
addWidget
(
subdivSlider
);
...
@@ -56,6 +56,16 @@ MainWindow::MainWindow(QWidget *parent) :
...
@@ -56,6 +56,16 @@ MainWindow::MainWindow(QWidget *parent) :
// showMaximized();
// 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
()
MainWindow
::~
MainWindow
()
{
{
}
}
QTProject/mainwindow.h
View file @
d4fae3f2
...
@@ -19,7 +19,11 @@ public:
...
@@ -19,7 +19,11 @@ public:
explicit
MainWindow
(
QWidget
*
parent
=
0
);
explicit
MainWindow
(
QWidget
*
parent
=
0
);
~
MainWindow
();
~
MainWindow
();
public
slots
:
void
sliderfix
(
int
pos
);
private
:
private
:
int
oldSliderpos
=
0
;
MainWidget
*
m_centralWidget
;
MainWidget
*
m_centralWidget
;
QToolBar
*
toolBar
;
QToolBar
*
toolBar
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment