From 9343fc6c77da8678df98ceb6330c61f43aa48737 Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 5 Mar 2017 05:51:22 +0100 Subject: 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... --- playerwidget.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'playerwidget.h') diff --git a/playerwidget.h b/playerwidget.h index e2ac24d..5f9210c 100644 --- a/playerwidget.h +++ b/playerwidget.h @@ -47,6 +47,7 @@ class PlayerWidget : public QWidget { void setDuration(qint64 dur); void slide(int value); void continuePlaying(QMediaPlayer::State state); + void expand(); private: void setupGui(); @@ -59,6 +60,7 @@ class PlayerWidget : public QWidget { void addSong(const QModelIndex &idx); void play(const QString &fullPath); void advance(int numSongs); + void expandRecursive(const QModelIndex &idx); QLineEdit *mSearch; QMediaPlayer *mPlayer; BeetView *mView; -- cgit v1.2.3-70-g09d2