diff options
author | Arno <arno@disconnect.de> | 2017-03-05 05:51:22 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2017-03-05 05:51:22 +0100 |
commit | 9343fc6c77da8678df98ceb6330c61f43aa48737 (patch) | |
tree | 3bd77d7c874e4d7d31f81339f7623cef0fa33eb9 /helper.h | |
parent | 4126723a86bfa09a830c1e41fb1b49e6a114218a (diff) | |
download | BeetPlayer-9343fc6c77da8678df98ceb6330c61f43aa48737.tar.gz BeetPlayer-9343fc6c77da8678df98ceb6330c61f43aa48737.tar.bz2 BeetPlayer-9343fc6c77da8678df98ceb6330c61f43aa48737.zip |
Implement expand and collapse for DB view
Sounds easy, right? It is, if you don't try to create a QIcon from a
QChar. That took me a while...
First, it's not a good idea to fill the QPixmap for the QIcon with
transparency. That gives you a random background. Fill it with palette
color instead.
Then there's QFont's pixelSize(). I have absolutely no idea how it
corresponds to the pixmap's size, but roughly double the width of the
pixmap is a good guess...
Diffstat (limited to 'helper.h')
-rw-r--r-- | helper.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/helper.h b/helper.h new file mode 100644 index 0000000..9b4a5c9 --- /dev/null +++ b/helper.h @@ -0,0 +1,14 @@ +#ifndef HELPER_H +#define HELPER_H + +#include <QIcon> +#include <QChar> + +class QAction; + +namespace Helper { + QIcon iconFromQChar(const QChar &c, int pixelSize); + QAction* createSeparator(QObject *parent); +} + +#endif // HELPER_H |