diff options
author | Arno <arno@disconnect.de> | 2018-02-19 02:07:23 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2018-02-19 02:07:23 +0100 |
commit | 1789930645650d9302b484cf21317e606e8f14e8 (patch) | |
tree | 343f9941383b457601365557489e92b44b9128a5 | |
parent | b7775f392fe9f5d61e2d77c73a6509fa64626a51 (diff) | |
download | BeetPlayer-1789930645650d9302b484cf21317e606e8f14e8.tar.gz BeetPlayer-1789930645650d9302b484cf21317e606e8f14e8.tar.bz2 BeetPlayer-1789930645650d9302b484cf21317e606e8f14e8.zip |
Add customActions to CollectionWidget
This is supposed to be an easy way to add custom QActions to the context
menu. The idea seems sound, but let's see how it turns out...
-rw-r--r-- | collectionwidget.cpp | 1 | ||||
-rw-r--r-- | collectionwidget.h | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/collectionwidget.cpp b/collectionwidget.cpp index 0fda8c0..96c46fc 100644 --- a/collectionwidget.cpp +++ b/collectionwidget.cpp @@ -10,6 +10,7 @@ #include "collectionwidgetproxy.h" CollectionWidget::CollectionWidget(QWidget *parent) : QWidget(parent){ + mCustomActions = new QActionGroup(this); mView = new BeetView; mModel = new QStandardItemModel(this); CollectionWidgetProxy *proxy = new CollectionWidgetProxy(this); diff --git a/collectionwidget.h b/collectionwidget.h index bb85e49..d464054 100644 --- a/collectionwidget.h +++ b/collectionwidget.h @@ -8,6 +8,7 @@ class QStandardItemModel; class QSortFilterProxyModel; class QLineEdit; +class QActionGroup; class CollectionWidget : public QWidget { Q_OBJECT @@ -21,6 +22,7 @@ class CollectionWidget : public QWidget { const QStringList headers() const { return mHeaders; } void disableSorting() { mView->setSortingEnabled(false); } void enableSorting(int column = 0, Qt::SortOrder sortOrder = Qt::AscendingOrder); + QActionGroup *customActions() { return mCustomActions; } public slots: virtual void populate() { return; } @@ -30,7 +32,7 @@ class CollectionWidget : public QWidget { QStandardItemModel *mModel; QLineEdit *mFilter; QStringList mHeaders; - + QActionGroup *mCustomActions; }; #endif // COLLECTIONWIDGET_H |