#include <QAction>
ProjectListView::ProjectListView(QWidget *parent)
- : QTreeWidget(parent), m_dragStarted(false) {
+ : QTreeWidget(parent), m_dragStarted(false)
+{
setSelectionMode(QAbstractItemView::ExtendedSelection);
setDragDropMode(QAbstractItemView::DragDrop);
setDropIndicatorShown(true);
setSortingEnabled(true);
}
-ProjectListView::~ProjectListView() {
+ProjectListView::~ProjectListView()
+{
}
-void ProjectListView::configureColumns(const QPoint& pos) {
+void ProjectListView::configureColumns(const QPoint& pos)
+{
KMenu popup(this);
popup.addTitle(i18nc("@title:menu", "Columns"));
}
// virtual
-void ProjectListView::contextMenuEvent(QContextMenuEvent * event) {
+void ProjectListView::contextMenuEvent(QContextMenuEvent * event)
+{
emit requestMenu(event->globalPos(), itemAt(event->pos()));
}
// virtual
-void ProjectListView::mouseDoubleClickEvent(QMouseEvent * event) {
+void ProjectListView::mouseDoubleClickEvent(QMouseEvent * event)
+{
ProjectItem *item = static_cast <ProjectItem *>(itemAt(event->pos()));
if (!item) emit addClip();
else if (item->isGroup()) {
}
// virtual
-void ProjectListView::dragEnterEvent(QDragEnterEvent *event) {
+void ProjectListView::dragEnterEvent(QDragEnterEvent *event)
+{
if (event->mimeData()->hasUrls() || event->mimeData()->hasText()) {
kDebug() << "//////////////// DRAG ENTR OK";
}
}
// virtual
-void ProjectListView::dropEvent(QDropEvent *event) {
+void ProjectListView::dropEvent(QDropEvent *event)
+{
kDebug() << "//////////////// DROPPED EVENT";
if (event->mimeData()->hasUrls()) {
QTreeWidgetItem *item = itemAt(event->pos());
}
// virtual
-void ProjectListView::mousePressEvent(QMouseEvent *event) {
+void ProjectListView::mousePressEvent(QMouseEvent *event)
+{
if (event->button() == Qt::LeftButton) {
m_DragStartPosition = event->pos();
m_dragStarted = true;
// virtual
-void ProjectListView::mouseMoveEvent(QMouseEvent *event) {
+void ProjectListView::mouseMoveEvent(QMouseEvent *event)
+{
//kDebug() << "// DRAG STARTED, MOUSE MOVED: ";
if (!m_dragStarted) return;
}
// virtual
-void ProjectListView::dragMoveEvent(QDragMoveEvent * event) {
+void ProjectListView::dragMoveEvent(QDragMoveEvent * event)
+{
event->setDropAction(Qt::IgnoreAction);
event->setDropAction(Qt::MoveAction);
if (event->mimeData()->hasText()) {
emit pauseMonitor();
}
-QStringList ProjectListView::mimeTypes() const {
+QStringList ProjectListView::mimeTypes() const
+{
QStringList qstrList;
qstrList << QTreeWidget::mimeTypes();
// list of accepted mime types for drop
}
-Qt::DropActions ProjectListView::supportedDropActions() const {
+Qt::DropActions ProjectListView::supportedDropActions() const
+{
// returns what actions are supported when dropping
return Qt::MoveAction;
}