PDA

View Full Version : QScrollArea



ToddAtWSU
12th December 2007, 21:36
I have a QScrollArea and when I click on the Vertical scroll bar to scroll the window down, the scroll bar redraws in the new spot but doesn't erase the old bar. If I click in the trough 2-3 times to scroll down 2-3 pages, and then scroll back up, all the previous scroll bars erase leaving the new one and the one in the spot right before it. Then if I keep clicking up, I fill the trough up with more bars. Then click below the bar in the trough and it erases all the old scroll bars. I am guessing this is some code I have causing this, but has anyone else experienced this problem. I am using Qt 4.3.0. I am capturing valueChanged( ) rangeChanged( ) and actionTriggered( ) for the scroll bar, but I have commented these connect calls out and I am still getting the problem. Thanks for any ideas you may have!

jpn
13th December 2007, 06:53
I am guessing this is some code I have causing this
Don't guess but write a simple test application to see. :)

ToddAtWSU
13th December 2007, 13:43
What is something simple I can put inside a QScrollArea to test this out with? I was having problems figuring out what to put inside it. I didn't want to put the same thing I had in the current project in case this was causing the problem. I didn't write the original code with the QScrollArea and I was having problems trying to figure out what I could put inside that was bigger than the QScrollArea so I would have to attempt to scroll. Thanks!

Edit: Nevermind, I found the example in the Docs and realized I could do this with an image I have, so I will attempt this example and see what happens.

ToddAtWSU
13th December 2007, 14:44
So I have played around with it and I have narrowed the problem down to one area. It seems to be dealing with the QDesktopWidget stuff. I am working on a Sun box running Solaris 9. I have 4 monitors, each with its own desktop and graphics card, and whenever the QScrollArea is on monitors 1-3, this stuff acts up. If the QScrollArea opens on monitor 0, then it behaves like normal. I am going to look into our usage of QDesktopWidgets but does anybody know of any problems using these with QScrollAreas? Thanks!

ToddAtWSU
13th December 2007, 15:47
I have played around with the application and the QScrollArea works fine when I tell the window containing the QScrollArea to open on the primaryWindow( ), but if I open it on one of the 3 secondary windows, then it doesn't work. Any ideas? Thanks!

ToddAtWSU
13th December 2007, 17:20
Well, I found a work-around to this problem. I capture the valueChanged signal that the scroll bars emit and after I do what I need to do when the value of the scroll bar changes, I call repaint( ) on the scroll bar and this fixes the problem. Calling update( ) to do a graceful redraw would not work, but doing the repaint( ) did work. So I have found a work-around for this bug.