Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make the default UI elements in Qt more beautiful?

Tags:

c++

qt

I am learning to use Qt & currently able to develop an Application with most of the widgets in their standard format. Now I want to make my widgets more beautiful. The standard one's are very dull for Windows. I would like to know which properties of widget's are normally used to change their appearance. For example, the standard QPushButton doesn't have a glassy appearance as can be observed in this video. Please observe the feel of the button's at 0:10 (10 secs after starting the video). Here's another example. The up & down button's & the button's below. How do I do such editing in Qt? Please note that I do not want to copy the UI, just want to know how to create such beautiful widgets? Any help on this topic would be very helpful for me. Thank You.

like image 445
Cool_Coder Avatar asked Feb 26 '13 08:02

Cool_Coder


3 Answers

QStyle is one option, the other one is to edit the Stylesheet of a single component, In Qt Designer, you can open item's CSS sheet.

http://qt-project.org/doc/qt-4.8/stylesheet-examples.html

like image 121
Gjordis Avatar answered Oct 22 '22 19:10

Gjordis


You should have a look at the QStyle class http://doc.qt.io/qt-4.8/qstyle.html

like image 22
kassak Avatar answered Oct 22 '22 19:10

kassak


If you just started to learn Qt and you are not constrained to QWidget-style Qt by some Big Boss I'd recommend you to learn Qt QML because it is the future of Qt while QWidgets+stylesheets are becoming obsolete. Moreover it is much more simple to program against declarative QML than deal with buggy stylesheets.

like image 1
ixSci Avatar answered Oct 22 '22 21:10

ixSci