Important: Please read the Qt Code of Conduct -

Qt UI Different on different versions of linux

  • After updating to a newer version of linux, the UI files are now different in the sense of layouts, fonts, formatting, etc. I understand that QT pulls the native operating system's styling for QApplications; however, I wouldn't think that a change to a newer version of linux would change so much of my application. Has anyone every encountered this, and if so, what did you find helpful? If worse comes to worse, I will manually fix each UI file, but I'm sure there is an easier solution. Thanks ahead of time for any comments or suggestions.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What distributions are causing this ?

    Can you maybe share a picture to show what is happening ?

  • @SGaist Thanks for getting back to me! The new versions of Linux we are using is 6.7 and the older version was 6.2. Unfortunately, I cannot post any pictures of the software ;), but I can describe in detail the changes. For example in one QLabel, it was able to support 4 lines of text. However, the QLabel now cuts off a few words at the end. Furthermore, it looks as if the text throughout the entire project has changed. It looks crisper if that makes any sense. Button sizes have shifted - they've become wider and the spacing margins have changed all over. QMenu text originally fit, but now the words are cut off at the bottom. I apologize that I can't post any pictures, and I'm doing my best to recall the exact situation. Some coloration is also different. Could it perhaps be some of the CSS that used to change the QLabels. We utilize the setProperty() function when changed the attributes of labels, buttons, menus, etc. However, I just assumed that at the end of the day CSS colors are generally the same. I've never really posted on forums for support; however, this is a serious issue. I know there is a situation where you can do QApplication::setStyle(); however, I'm not sure that would solve the problem. I've seen where some people have tried setting the style to ("fusion"), but that never really worked. Any ideas would be much appreciated! Thanks again!

  • Lifetime Qt Champion

    Do you mean Red Hat 6.7 ?

    You can always show a dummy application before and after to show the differences.

    So If I understand correctly you are using Qt's Style Sheet to customize your application ?

  • @SGaist sorry, yes Red Hat 6.7. Yes we are using QT Style Sheet to customize the application.

  • @SGaist I'm sorry I mis-replied to your message. We use our own CSS styling in the project, which is read in and applied to our different UI components.

  • @SGaist out of curiosity does my CSS file need to have the .QSS extension? Would that make any difference?

  • Lifetime Qt Champion

    No it doesn't however that makes it clear that your style sheet is for Qt. Qt doesn't cover all CSS features.

    Can you make a small sample application that shows the cutoff problem of QMenu ?

  • @SGaist Thanks for the input! We have uncovered that it is an openGL issue.

  • Lifetime Qt Champion

    Glad you found out !

    Can you give more details ?

  • @SGaist We recently updated to a newer version of RedHat. The resulting update caused some graphics driver errors. These errors are in the process of being resolved.

  • Lifetime Qt Champion

    Thanks for sharing !