Fix build with -no-feature-dragandrop
Change-Id: I9ac2a9edb747608ef93008ac865886b1ee0ea82a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: David Redondo <qt@david-redondo.de>
This commit is contained in:
parent
3965d52ad5
commit
7301cd5cfa
@ -780,7 +780,9 @@ void QDockWidgetPrivate::startDrag(bool group)
|
|||||||
QMainWindowLayout *layout = qt_mainwindow_layout_from_dock(q);
|
QMainWindowLayout *layout = qt_mainwindow_layout_from_dock(q);
|
||||||
Q_ASSERT(layout != nullptr);
|
Q_ASSERT(layout != nullptr);
|
||||||
|
|
||||||
|
#if QT_CONFIG(draganddrop)
|
||||||
bool wasFloating = q->isFloating();
|
bool wasFloating = q->isFloating();
|
||||||
|
#endif
|
||||||
|
|
||||||
state->widgetItem = layout->unplug(q, group);
|
state->widgetItem = layout->unplug(q, group);
|
||||||
if (state->widgetItem == nullptr) {
|
if (state->widgetItem == nullptr) {
|
||||||
@ -1056,10 +1058,12 @@ bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event)
|
|||||||
bool QDockWidgetPrivate::mouseReleaseEvent(QMouseEvent *event)
|
bool QDockWidgetPrivate::mouseReleaseEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
#if QT_CONFIG(mainwindow)
|
#if QT_CONFIG(mainwindow)
|
||||||
|
#if QT_CONFIG(draganddrop)
|
||||||
// if we are peforming a platform drag ignore the release here and end the drag when the actual
|
// if we are peforming a platform drag ignore the release here and end the drag when the actual
|
||||||
// drag ends.
|
// drag ends.
|
||||||
if (QMainWindowLayout::needsPlatformDrag())
|
if (QMainWindowLayout::needsPlatformDrag())
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (event->button() == Qt::LeftButton && state && !state->nca) {
|
if (event->button() == Qt::LeftButton && state && !state->nca) {
|
||||||
endDrag();
|
endDrag();
|
||||||
@ -1207,10 +1211,12 @@ void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect
|
|||||||
flags |= Qt::FramelessWindowHint;
|
flags |= Qt::FramelessWindowHint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_CONFIG(draganddrop)
|
||||||
// If we are performing a platform drag the flag is not needed and we want to avoid recreating
|
// If we are performing a platform drag the flag is not needed and we want to avoid recreating
|
||||||
// the platform window when it would be removed later
|
// the platform window when it would be removed later
|
||||||
if (unplug && !QMainWindowLayout::needsPlatformDrag())
|
if (unplug && !QMainWindowLayout::needsPlatformDrag())
|
||||||
flags |= Qt::X11BypassWindowManagerHint;
|
flags |= Qt::X11BypassWindowManagerHint;
|
||||||
|
#endif
|
||||||
|
|
||||||
q->setWindowFlags(flags);
|
q->setWindowFlags(flags);
|
||||||
|
|
||||||
|
@ -111,10 +111,12 @@ void QToolBarPrivate::updateWindowFlags(bool floating, bool unplug)
|
|||||||
|
|
||||||
flags |= Qt::FramelessWindowHint;
|
flags |= Qt::FramelessWindowHint;
|
||||||
|
|
||||||
|
#if QT_CONFIG(draganddrop)
|
||||||
// If we are performing a platform drag the flag is not needed and we want to avoid recreating
|
// If we are performing a platform drag the flag is not needed and we want to avoid recreating
|
||||||
// the platform window when it would be removed later
|
// the platform window when it would be removed later
|
||||||
if (unplug && !QMainWindowLayout::needsPlatformDrag())
|
if (unplug && !QMainWindowLayout::needsPlatformDrag())
|
||||||
flags |= Qt::X11BypassWindowManagerHint;
|
flags |= Qt::X11BypassWindowManagerHint;
|
||||||
|
#endif
|
||||||
|
|
||||||
q->setWindowFlags(flags);
|
q->setWindowFlags(flags);
|
||||||
}
|
}
|
||||||
@ -178,7 +180,9 @@ void QToolBarPrivate::startDrag(bool moving)
|
|||||||
QMainWindowLayout *layout = qt_mainwindow_layout(win);
|
QMainWindowLayout *layout = qt_mainwindow_layout(win);
|
||||||
Q_ASSERT(layout != nullptr);
|
Q_ASSERT(layout != nullptr);
|
||||||
|
|
||||||
|
#if QT_CONFIG(draganddrop)
|
||||||
const bool wasFloating = q->isFloating();
|
const bool wasFloating = q->isFloating();
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!moving) {
|
if (!moving) {
|
||||||
state->widgetItem = layout->unplug(q);
|
state->widgetItem = layout->unplug(q);
|
||||||
@ -264,10 +268,12 @@ bool QToolBarPrivate::mousePressEvent(QMouseEvent *event)
|
|||||||
|
|
||||||
bool QToolBarPrivate::mouseReleaseEvent(QMouseEvent*)
|
bool QToolBarPrivate::mouseReleaseEvent(QMouseEvent*)
|
||||||
{
|
{
|
||||||
|
#if QT_CONFIG(draganddrop)
|
||||||
// if we are peforming a platform drag ignore the release here and end the drag when the actual
|
// if we are peforming a platform drag ignore the release here and end the drag when the actual
|
||||||
// drag ends.
|
// drag ends.
|
||||||
if (QMainWindowLayout::needsPlatformDrag())
|
if (QMainWindowLayout::needsPlatformDrag())
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (state != nullptr) {
|
if (state != nullptr) {
|
||||||
endDrag();
|
endDrag();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user