Unsolved General design
-
Hello,
I have a problem of design between the designer and the result.
Here is the designer:
http://www.hostingpics.net/viewer.php?id=821087imagedesigner.pngand here is the result:
http://www.hostingpics.net/viewer.php?id=586226imageresukt.pngWhy there is these difference in the theme?
How can I keep the theme from the designer? -
I think that you have to play with stretch property
you can put4 for the first element
1 for the second elementfor example
To understand what is stretch factor have a look at this link from qt doc:
http://doc.qt.io/qt-4.8/layout.html#stretch-factors
Hope this can help !
-
- How can I keep the theme from the designer?
You cannot. The dark style used in
Designer is not there as a selectable style when run outside.
Its a custom fusion based style.
You can re-create it with style sheets. -
Thank you for the replay but my problem was about the color and the theme of the elements.
-
How are you changing the color in qt designer?
-
@mrjj
I try to use that line to change the color and the theme but it is not working:QApplication a(argc, argv); MainWindow w; w.show(); a.setStyle("plastique");
-
@Xav12358 said in General design:
@mrjj
I try to use that line to change the color and the theme but it is not working:QApplication a(argc, argv); MainWindow w; w.show(); a.setStyle("plastique");
Are you in qt4 or qt5?
If qt5 you have to use QStyleFactory
QApplication::setStyle(QStyleFactory::create("Plastique"));
Have a look at this link from qt doc:
http://doc.qt.io/qt-5/qstylefactory.html#details
Depending or operating system styles are available to find which styles are available you can add this line :
qDebug() << QStyleFactory::keys();
For example for my operating system i have these available styles:
("Windows", "Motif", "CDE", "Plastique", "GTK+", "Cleanlooks")
-
Ok I get it , only Windows and fusion are available.
Noow it works.
Thank you really much. -
@Xav12358 said in General design:
Ok I get it , only Windows and fusion are available.
Noow it works.
Thank you really much.You are welcome !