summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp6
-rw-r--r--src/widgets/itemviews/qtablewidget.h2
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp6
-rw-r--r--src/widgets/itemviews/qtreewidget.h2
4 files changed, 16 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp
index 3e027920c67..8ba409191e4 100644
--- a/src/widgets/itemviews/qtablewidget.cpp
+++ b/src/widgets/itemviews/qtablewidget.cpp
@@ -871,8 +871,12 @@ Qt::DropActions QTableModel::supportedDropActions() const
Qt::DropActions QTableModel::supportedDragActions() const
{
+#if QT_CONFIG(draganddrop)
const QTableWidget *view = this->view();
return (view ? view->supportedDragActions() : Qt::DropActions(Qt::IgnoreAction));
+#else
+ return Qt::DropActions(Qt::IgnoreAction);
+#endif
}
/*!
@@ -2637,6 +2641,7 @@ Qt::DropActions QTableWidget::supportedDropActions() const
return d_func()->tableModel()->QAbstractTableModel::supportedDropActions() | Qt::MoveAction;
}
+#if QT_CONFIG(draganddrop)
/*!
\property QTableWidget::supportedDragActions
\brief the drag actions supported by this view
@@ -2655,6 +2660,7 @@ void QTableWidget::setSupportedDragActions(Qt::DropActions actions)
Q_D(QTableWidget);
d->supportedDragActions = actions;
}
+#endif // QT_CONFIG(draganddrop)
/*!
Returns a list of pointers to the items contained in the \a data object.
diff --git a/src/widgets/itemviews/qtablewidget.h b/src/widgets/itemviews/qtablewidget.h
index c7524101216..059a7a6a10a 100644
--- a/src/widgets/itemviews/qtablewidget.h
+++ b/src/widgets/itemviews/qtablewidget.h
@@ -194,7 +194,9 @@ class Q_WIDGETS_EXPORT QTableWidget : public QTableView
Q_OBJECT
Q_PROPERTY(int rowCount READ rowCount WRITE setRowCount)
Q_PROPERTY(int columnCount READ columnCount WRITE setColumnCount)
+#if QT_CONFIG(draganddrop)
Q_PROPERTY(Qt::DropActions supportedDragActions READ supportedDragActions WRITE setSupportedDragActions)
+#endif
friend class QTableModel;
public:
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index 759aee51ef8..d9f23b7c9db 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -739,7 +739,11 @@ Qt::DropActions QTreeModel::supportedDropActions() const
Qt::DropActions QTreeModel::supportedDragActions() const
{
+#if QT_CONFIG(draganddrop)
return view()->supportedDragActions();
+#else
+ return Qt::DropActions(Qt::IgnoreAction);
+#endif
}
void QTreeModel::itemChanged(QTreeWidgetItem *item)
@@ -3218,6 +3222,7 @@ Qt::DropActions QTreeWidget::supportedDropActions() const
return model()->QAbstractItemModel::supportedDropActions() | Qt::MoveAction;
}
+#if QT_CONFIG(draganddrop)
/*!
\property QTreeWidget::supportedDragActions
\brief the drag actions supported by this view
@@ -3236,6 +3241,7 @@ void QTreeWidget::setSupportedDragActions(Qt::DropActions actions)
Q_D(QTreeWidget);
d->supportedDragActions = actions;
}
+#endif // QT_CONFIG(draganddrop)
/*!
Returns the QModelIndex associated with the given \a item in the given \a column.
diff --git a/src/widgets/itemviews/qtreewidget.h b/src/widgets/itemviews/qtreewidget.h
index fadd9e09a58..bfeaa3ad669 100644
--- a/src/widgets/itemviews/qtreewidget.h
+++ b/src/widgets/itemviews/qtreewidget.h
@@ -227,7 +227,9 @@ class Q_WIDGETS_EXPORT QTreeWidget : public QTreeView
Q_OBJECT
Q_PROPERTY(int columnCount READ columnCount WRITE setColumnCount)
Q_PROPERTY(int topLevelItemCount READ topLevelItemCount)
+#if QT_CONFIG(draganddrop)
Q_PROPERTY(Qt::DropActions supportedDragActions READ supportedDragActions WRITE setSupportedDragActions)
+#endif
friend class QTreeModel;
friend class QTreeWidgetItem;