[SOLVED] How to prevent text from growing when user changes resolution when working with custom layouts



  • Hi,
    How can I prevent the text on buttons, labels etc. from scaling when the user changes its resolution in Windows 7 (small 100% -Medium 125% -Larger 150%)?

    What I would like to do is to fix the text so it doesn't change even if the user changes its resolution because I have noticed that if the resolution is changed the text grows and is not fully visible anymore.

    How do you usually design your applications so they look good on every possible resolution? I know this may be solved by applying a layout but I tried and I couldn't make it look the way I want to if I apply a layout.

    How do you usually deal with these issues when working with custom layouts?

    Thanks



  • I found my own answar.

    Use StyleSheets and assign the font size, this will maintain the specified size regardless of what resolution\zoom the user is using.

    @// you can change multiple widgets with one line of code, by doing this...
    setStyleSheet("QPushButton, QLabel, QGroupBox {font-size:10px}");@

    Thanks


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.