X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Feffectslistwidget.h;h=04ee8544612f86866097c1fff271de5842499431;hb=3577376c5e5b6cc533af0edc9d4f03d0b3770f9e;hp=92dc14548577bbe599085f7700a38ce5cc98a7e1;hpb=8f240cad50d7652c698d73ed3c14ba77db04209b;p=kdenlive diff --git a/src/effectslistwidget.h b/src/effectslistwidget.h index 92dc1454..04ee8544 100644 --- a/src/effectslistwidget.h +++ b/src/effectslistwidget.h @@ -18,34 +18,50 @@ ***************************************************************************/ -#ifndef EFFECTLISTWIDGET_H -#define EFFECTLISTWIDGET_H +#ifndef EFFECTSLISTWIDGET_H +#define EFFECTSLISTWIDGET_H -#include +#include #include class EffectsList; +class KIcon; -class EffectsListWidget : public KListWidget { +class EffectsListWidget : public QTreeWidget +{ Q_OBJECT public: - EffectsListWidget(QWidget *parent = 0); + explicit EffectsListWidget(QMenu *menu, QWidget *parent = 0); virtual ~EffectsListWidget(); - QDomElement currentEffect(); + const QDomElement currentEffect() const; QString currentInfo(); - QDomElement itemEffect(QListWidgetItem *item); + const QDomElement itemEffect(QTreeWidgetItem *item) const; + void initList(); protected: - virtual void mousePressEvent(QMouseEvent *event); - virtual void mouseMoveEvent(QMouseEvent *event); virtual void dragMoveEvent(QDragMoveEvent *event); + virtual void contextMenuEvent(QContextMenuEvent * event); + virtual QMimeData *mimeData(const QList list) const; private: - bool m_dragStarted; - QPoint m_DragStartPosition; - void initList(); + QMenu *m_menu; + /** @brief Returns the folder item whose name == @param name. */ + QTreeWidgetItem *findFolder(const QString name); + + /** @brief Loads the effects from the given effectlist as item of this widget. + * @param effectlist effectlist containing the effects that should be loaded + * @param icon the icon to be used for the QTreeWidgetItems + * @param defaultFolder parent item which will be used by default + * @param folders list of folders which might be used instead for specific effects + * @param type type of the effects + * @param current name of selected effect before reload; if an effect name matches this one it will become selected + * @param found will be set to true if an effect name matches current + */ + void loadEffects(const EffectsList *effectlist, KIcon icon, QTreeWidgetItem *defaultFolder, const QList *folders, const QString type, const QString current, bool *found); +private slots: + void slotExpandItem(const QModelIndex & index); }; #endif