From a4e40f771e7f6df9dc8d7e63c5460761eb0e33c0 Mon Sep 17 00:00:00 2001 From: Arno Moeller Date: Thu, 17 Jun 2010 17:59:39 +0200 Subject: Partial implementation of adding new Series Adding an item to the TreeView works, but it doesn't get focus after inserting. Also the data is not shown. And setting the title of the new item should make the database puke. --- seriestreewidget.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'seriestreewidget.h') diff --git a/seriestreewidget.h b/seriestreewidget.h index fa84419..6e949b2 100644 --- a/seriestreewidget.h +++ b/seriestreewidget.h @@ -13,13 +13,18 @@ class QLineEdit; class QPushButton; -class QTreeView; class QSortFilterProxyModel; +class SeriesTreeModel; +class SeriesTreeView; class SeriesTreeWidget : public QWidget { Q_OBJECT public: explicit SeriesTreeWidget(QWidget *parent = 0); + SeriesTreeView *seriesTree() { return mView; } + + public slots: + void newSeries(); private slots: void filter(); @@ -28,14 +33,18 @@ class SeriesTreeWidget : public QWidget { private: QLineEdit *mFilterEdit; QPushButton *mFilter; - QTreeView *mView; + SeriesTreeView *mView; QSortFilterProxyModel *mProxy; + SeriesTreeModel *mModel; }; class SeriesTreeView : public QTreeView { Q_OBJECT public: explicit SeriesTreeView(QWidget *parent = 0); + + protected: + virtual void contextMenuEvent(QContextMenuEvent *e); }; #endif -- cgit v1.2.3-70-g09d2