X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fprojectlistview.h;h=e644be1bc7f1724174427faf92ac76cdc69f2f39;hb=56aee6aedeeed3efd10ada8fe3c229eddc01ef05;hp=da5756a5820006762a9eb1523d94f9cc3440a58d;hpb=2356a3cd98b41bf328eacf2501cd2a09cac5ea41;p=kdenlive diff --git a/src/projectlistview.h b/src/projectlistview.h index da5756a5..e644be1b 100644 --- a/src/projectlistview.h +++ b/src/projectlistview.h @@ -18,44 +18,79 @@ ***************************************************************************/ -#ifndef PRJECTLISTVIEW_H -#define PRJECTLISTVIEW_H +#ifndef PROJECTLISTVIEW_H +#define PROJECTLISTVIEW_H #include #include +#include +#include + +class DocClipBase; + + +class ItemDelegate: public QStyledItemDelegate +{ +public: + enum ItemRole { + NameRole = Qt::UserRole, + DurationRole, + UsageRole + }; + + ItemDelegate(QAbstractItemView* parent = 0) + : QStyledItemDelegate(parent) + { + } + + /*void drawFocus(QPainter *, const QStyleOptionViewItem &, const QRect &) const { + }*/ + + void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const; +}; class ProjectListView : public QTreeWidget { - Q_OBJECT - - public: - ProjectListView(QWidget *parent=0); - virtual ~ProjectListView(); - - protected: - virtual void contextMenuEvent ( QContextMenuEvent * event ); - virtual void mouseDoubleClickEvent ( QMouseEvent * event ); - virtual void mousePressEvent(QMouseEvent *event); - virtual void mouseMoveEvent(QMouseEvent *event); - virtual void dragEnterEvent(QDragEnterEvent *event); - virtual void dropEvent(QDropEvent *event); - virtual QStringList mimeTypes() const; - virtual Qt::DropActions supportedDropActions () const; - virtual void dragMoveEvent(QDragMoveEvent * event); - - public slots: - - - private: + Q_OBJECT + +public: + ProjectListView(QWidget *parent = 0); + ~ProjectListView(); + void processLayout(); + void updateStyleSheet(); + +protected: + void contextMenuEvent(QContextMenuEvent * event); + void mouseDoubleClickEvent(QMouseEvent * event); + void mousePressEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event); + void dropEvent(QDropEvent *event); + QStringList mimeTypes() const; + Qt::DropActions supportedDropActions() const; + void dragLeaveEvent(QDragLeaveEvent *); + + /** @brief Filters key events to make sure user can expand items with + / -. */ + bool eventFilter(QObject *obj, QEvent *ev); + +private: bool m_dragStarted; QPoint m_DragStartPosition; - private slots: +private slots: + void configureColumns(const QPoint& pos); + void slotCollapsed(QTreeWidgetItem *item); + void slotExpanded(QTreeWidgetItem *item); - signals: +signals: void requestMenu(const QPoint &, QTreeWidgetItem *); void addClip(); - void addClip(QUrl, const QString &); + void addClip(const QList &, const QString &, const QString &); + void showProperties(DocClipBase *); + void focusMonitor(bool forceRefresh); + void pauseMonitor(); + void addClipCut(const QString&, int, int); + void projectModified(); }; #endif