Unsolved QGroupBox discrepancies between Linux and Win
-
-
Hi,
What exact OS are you talking about ?
What version of Qt are you using ? -
Ubuntu 18.04 LTS
I tested with Qt5.9 and Qt5.12
Kind regards,
willem -
Apologies. And Windows 7 as well as Windows 10.
Kind regards,
willem -
Can you provide a complete minimal project along your ui file ?
That will allow to test in the exact same conditions as you have. -
@SGaist
Thank you for your time! This is part of a larger project and I have no idea of how to scale it down into a minimal project. I do the layout in a .ui file which started in QtCreator but I hand-edit the .ui file by hand these days. Would it help at all if I send you the complete .ui file? -
@willemf said in QGroupBox discrepancies between Linux and Win:
This is part of a larger project and I have no idea of how to scale it down into a minimal project.
- Make a copy of your full project.
- In the copied project, start removing big chunks of code and UI components that are not related to your issue.
- After you have removed a big chunk of code or UI, build and run the reduced code.
- Repeat steps #2 and #3 until the problem disappears, or until your project is tiny.
If the problem disappears, examine the last thing that you removed.
-
@willemf
Something like https://stackoverflow.com/questions/37233885/qt-style-windows-vs-xubuntu-gtk-no-border-in-qgropbox makes clear there are/can be differences between OS/window managers. Also that there can be deliberate "native" style differences.One thing to check is that you are indeed using the same style? And/or, does the difference persist if you try other styles?
-
@JonB Yes, the alignment of the groupbox label is defined by the style.
-
Thank you very much for your responses. This explains the issue that I have been having and, fortunately, I do not have to create scaled-down minimum code for testing. I would like to explore the possibility of doing platform-dependent modification of the code by using CSS styles. I have looked everywhere but I cannot find an environmental variable within Qt that reflects the platform being used. Does anything like that exist at all? Thank you again for your time.
-
@willemf
There won't be a run-time environment variable. I don't know of any Qt-something to indicate what platform you are on, and the platform-specific calls to determine this won't help as they are platform-specific! However, you know at compile-time which platform you are compiling for, there should be compile-time#define
s for this, or if necessary you could make yourqmake
file pass a-D ...
for this. -
At compile time you have the various Q_OS_XXX that allows you to encapsulate code for a specific platform.
-
@SGaist that completely answers my question. I thank you for your time in answering this.
Kind regards,
willem