From 3032c0021389b2a5211b4a6e5d1c2929ce307bf5 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Tue, 8 Oct 2019 11:18:27 +0800 Subject: Continue reducing usage of widgets in QTableWidget. --- qmidiplayer-desktop/qmpchannelswindow.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qmidiplayer-desktop/qmpchannelswindow.hpp') diff --git a/qmidiplayer-desktop/qmpchannelswindow.hpp b/qmidiplayer-desktop/qmpchannelswindow.hpp index 93742a2..072f9d3 100644 --- a/qmidiplayer-desktop/qmpchannelswindow.hpp +++ b/qmidiplayer-desktop/qmpchannelswindow.hpp @@ -40,6 +40,7 @@ class qmpChannelsModel:public QAbstractTableModel int rowCount(const QModelIndex&parent=QModelIndex())const override; QModelIndex parent(const QModelIndex&child)const override; QVariant data(const QModelIndex&index,int role=Qt::ItemDataRole::DisplayRole)const override; + bool setData(const QModelIndex &index,const QVariant &value,int role=Qt::EditRole)override; QVariant headerData(int section,Qt::Orientation orientation,int role=Qt::ItemDataRole::DisplayRole)const override; Qt::ItemFlags flags(const QModelIndex&idx)const override; public slots: @@ -56,7 +57,7 @@ class qmpDeviceItemDelegate:public QStyledItemDelegate { Q_OBJECT public: - explicit qmpDeviceItemDelegate(QWidget*parent=nullptr); + explicit qmpDeviceItemDelegate(bool ignoreInternal=false,QWidget*parent=nullptr); void paint(QPainter*painter,const QStyleOptionViewItem&option,const QModelIndex&index)const override; QSize sizeHint(const QStyleOptionViewItem&option,const QModelIndex&index)const override; QWidget* createEditor(QWidget*parent,const QStyleOptionViewItem&option,const QModelIndex&index)const override; @@ -65,6 +66,7 @@ class qmpDeviceItemDelegate:public QStyledItemDelegate void updateEditorGeometry(QWidget*editor,const QStyleOptionViewItem&option,const QModelIndex&index)const override; private: QWidget *par; + bool nofs; }; class qmpChannelsWindow:public QWidget -- cgit v1.2.3