PDA

View Full Version : How to add a plattform specific stylesheet to a window directly the designer



Infinity
14th October 2012, 02:28
Hi,

I have created a QT application using QT Creator and I compiled a Linux version and a Windows version. For the design of the windows/widgets I'm using a stylesheet. I added that stylesheet to the windows directly in the designer.

My Question: Is it possible to assign different stylesheets for the different platforms directly in the designer or by modifying the XML-File which is created by the designer? I could simply use the setStyleSheet-Function of the window to set the different stylesheets manually but I would prefer to do that directly in the designer because then I have a preview of my design.

Is it maybe possible to use a resource file as stylesheet via designer or by modifying the XML-File? If that was possible, is could simply use different stylesheets for the different plattforms by using a platform condition in the project file.

wysota
14th October 2012, 09:05
My Question: Is it possible to assign different stylesheets for the different platforms directly in the designer or by modifying the XML-File which is created by the designer?
No, I don't think so.


Is it maybe possible to use a resource file as stylesheet via designer or by modifying the XML-File?
Not in Designer. The tool only allows editing a stylesheet in a text window.

What I can suggest is to have a stylesheet in external file and test it by running your application with a command line argument that will load the stylesheet from this file. Then you can edit the stylesheet in an external tool and still have a quick preview available.

Another solution would be to implement a global shortcut that will ask the user for a stylesheet file or reload the current one. Then you'll have a live preview too.

Infinity
14th October 2012, 20:37
No, I don't think so.
I already expected that because I found nothing on the Internet.

But if someone else has an idea, let me know!