Bug #1102
closedUsing horizontal WSlider with WVBoxLayout or WHBoxLayout
0%
Description
Hi all,
I have a problem using a WSlider with WVBoxLayout. The slider is always moving ...
Here my code :
WSlider *sliderHorizontal = new WSlider(Horizontal);
//we put the range of the slider
sliderHorizontal->setRange(0,100);
//the first value
sliderHorizontal->setValue(10);
//the interval between each tick
sliderHorizontal->setTickInterval(5);
//the position of the tick
sliderHorizontal->setTickPosition(WSlider::TicksBothSides);
//we resize the slider
sliderHorizontal->resize(300, 50);
WVBoxLayout *vBoxLayout = new WVBoxLayout(this);
vBoxLayout->addWidget(sliderHorizontal);
this->setLayout(vBoxLayout);
Thanks
Bart.
Files
Updated by Koen Deforche almost 13 years ago
- Status changed from New to InProgress
- Assignee set to Pieter Libin
- Target version set to 3.2.1
Updated by Pieter Libin almost 13 years ago
Hi,
I've made a small test case (see the attachment of this message) based on your example code,
but I was not able to notice any problem with it in Firefox/Chrome/IE9.
Can you explain what exactly goes wrong, and how it can be reproduced?
Please also let us know which browser(s) you are using.
kind regards,
Pieter
Updated by Arribe Barthelemy almost 13 years ago
Hi,
I'm using the mozilla firefox, an old version, 3.6.24 and I am on Ubuntu 10.04.
Sorry, I was wrong. The bug happens using a WGridLayout like this :
WGridLayout *gridLayout = new WGridLayout(this);
// we add it to the container
gridLayout->addWidget(sliderHorizontal,1,1);
gridLayout->addWidget(sliderVertical,3,3);
You have two screenshot where you can see the difference between two seconds, the two sliders growing.
Regards.
Bart
Updated by Pieter Libin almost 13 years ago
- File hello.C hello.C added
- File Screenshot-3.png Screenshot-3.png added
Hi,
I tried to reproduce the problem with a WGridLayout (see my new hello.C file),
but was not able to do so (see the attached screenshot Screenshot-3.png).
I used the same version version of FireFox as you mentioned, and the git version of Wt.
Can you try to change the attached program in order to make the issue reproducable?
kind regards,
Pieter
Updated by Arribe Barthelemy almost 13 years ago
- File pbSliders.zip pbSliders.zip added
Hi,
It's doing the same with the last version of Firefox and too in google Chrome, built in fast CGI or http. I give you my source code, I made this in QtCreator.
After that, I don't know what else I can say you ...
Thank you
Bart
Updated by Pieter Libin almost 13 years ago
Hi,
with this example, I can reproduce the problem,
Thanks,
Pieter
Updated by Pieter Libin almost 13 years ago
- File sliderbug.zip sliderbug.zip added
- Assignee changed from Pieter Libin to Koen Deforche
A slightly updated test case, that reproduces the problem.
Updated by Pieter Libin almost 13 years ago
- Assignee changed from Koen Deforche to Pieter Libin
Updated by Pieter Libin almost 13 years ago
- File fixed_bug1102.zip fixed_bug1102.zip added
- Status changed from InProgress to Resolved
Hi,
when using a layout, you need to resize the container where you use the layout manager on (see the WGridLayout documentation).
Also, if you put a widget in a layout manager, you cannot resize the widget.
When making these changes to the example, everything seems to work fine.
I attached the fixed code in fixed_bug1102.zip.
Kind regards,
Pieter
Updated by Pieter Libin almost 13 years ago
- Assignee changed from Pieter Libin to Koen Deforche