#include "folderprojectitem.h"
-#include "definitions.h"
#include <KDebug>
#include <KLocale>
#include <QTreeWidgetItem>
#include <QTreeWidget>
+#include <KDebug>
+
+#include "definitions.h"
/** \brief Represents a clip or a folder in the projecttree
*
const QString groupName() const;
void setGroupName(const QString name);
+ /** Make sure folders appear on top of the tree widget */
+ virtual bool operator<(const QTreeWidgetItem &other)const {
+ int column = treeWidget()->sortColumn();
+ if (other.type() == PROJECTFOLDERTYPE)
+ return text(column).toLower() < other.text(column).toLower();
+ else return true;
+ }
+
private:
QString m_groupName;
QString m_clipId;
+
};
#endif
void clearProperty(const QString &key);
QString getClipHash() const;
+ virtual bool operator<(const QTreeWidgetItem &other)const {
+ int column = treeWidget()->sortColumn();
+ if (other.type() != PROJECTFOLDERTYPE)
+ return text(column).toLower() < other.text(column).toLower();
+ else return false;
+ }
+
private:
CLIPTYPE m_clipType;
QString m_clipId;
setDragEnabled(true);
setAcceptDrops(true);
+
setColumnCount(4);
QStringList headers;
headers << i18n("Thumbnail") << i18n("Filename") << i18n("Description") << i18n("Rating");
setHeaderLabels(headers);
- sortByColumn(1, Qt::AscendingOrder);
QHeaderView* headerView = header();
headerView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(headerView, SIGNAL(customContextMenuRequested(const QPoint&)),
this, SLOT(configureColumns(const QPoint&)));
-
- //connect(this, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(slotFocusOut(QTreeWidgetItem *, QTreeWidgetItem *)));
+ headerView->setClickable(true);
+ headerView->setSortIndicatorShown(true);
+ headerView->setMovable(false);
+ sortByColumn(1, Qt::AscendingOrder);
+ setSortingEnabled(true);
if (!KdenliveSettings::showdescriptioncolumn()) hideColumn(2);
if (!KdenliveSettings::showratingcolumn()) hideColumn(3);
-
- setSortingEnabled(true);
}
ProjectListView::~ProjectListView()
DocClipBase *referencedClip();
QPoint zone() const;
+ /** Make sure folders appear on top of the tree widget */
+ virtual bool operator<(const QTreeWidgetItem &other)const {
+ int column = treeWidget()->sortColumn();
+ if (other.type() != PROJECTFOLDERTYPE)
+ return text(column).toLower() < other.text(column).toLower();
+ else return false;
+ }
+
private:
int m_in;
int m_out;