dila
New member
Finding nice artwork for your UI is a pain, especially if you want a consistent look.
But Qt DLL's have a bunch of icons (also known as "pixmaps" in the Qt world) built in. They are there, so you might as well use them:
This will create a standard Qt button, but will have a "file open" icon, suitable for use on a browse button for a save dialog, for example.
You can see that the icon is defined as an enum as a member of the QStyle class. A full list of the icons available in Qt 5.0 is here:
http://doc.qt.io/qt-5/qstyle.html#StandardPixmap-enum
Hope you find this tip useful to improve the look of your own Qt applications.
Regards, dila
But Qt DLL's have a bunch of icons (also known as "pixmaps" in the Qt world) built in. They are there, so you might as well use them:
Code:
#include <QPushButton>
#include <QStyle>
QPushButton* button = new QPushButton(this);
button->setIcon(style()->standardIcon(QStyle::SP_DirOpenIcon));
This will create a standard Qt button, but will have a "file open" icon, suitable for use on a browse button for a save dialog, for example.
You can see that the icon is defined as an enum as a member of the QStyle class. A full list of the icons available in Qt 5.0 is here:
http://doc.qt.io/qt-5/qstyle.html#StandardPixmap-enum
Hope you find this tip useful to improve the look of your own Qt applications.
Regards, dila