View Full Version : Scrollbar for lower resolution ...

12th March 2013, 11:13

I want a scrollbar for my application when I changes the resolution of the screen. I had tried to set the ScrollbarArea into the mainWindow, But that scrollbar appears when you resize the window of the application but it doesn't appear when I changes the resolution the system.
any solution??


12th March 2013, 20:54
When you change the screen resolution you aren't changing the size of the main window, just the percentage of the screen it occupies. The main window still occupies the same size in pixels, the pixels are just bigger (or smaller, if you make the resolution higher). So why should you expect the scrollbars to appear?

If you want to resize your main window when the screen resolution changes, then you should connect a slot to the QDesktopWidget workAreaResized() or resized() signals. Use QApplication::desktop() to get a pointer to this widget.

19th March 2013, 07:47
Hi Thanks For the answer and sorry for delay in my response.
I have connected the QDesktopWidget workAreaResized() with my own slot where I am setting the window size and it works fine.
But in my main window I have tab Widgets and innside that lots of contrrols.
after setting the resolution to lower value I am not able to see all the controls inside my tab widgets, and here I want a scroll bar for showing all the controls and their value.
when I add a Qscrollarea as my central widget for the main window and set my tabwidgets inside that scrollarea , my controls are not working. it doesn't get the focus and not allow to edit.
any solution??

19th March 2013, 08:18
any solution??
We cannot help with fixing your code... we cannot see it.
Post a minimal, complete program that demonstrates the problem you describe when you resize it. Chances are good you'll find the problem yourself while trying to do this.

21st March 2013, 16:14
How about instead of adding QScrollArea as the central widget, you place the QScrollArea inside the individual tabs of the tab widget and then place your controls inside the scroll area.
QTabWidget->individual tab -> QScrollArea -> controls.