Convert features.rubberband to QT_[REQUIRE_]CONFIG
Change-Id: I6d634bafa6d26c1e78069fddd412e6de24f5775c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
3906043f05
commit
3835194d34
@ -54,7 +54,9 @@
|
||||
#include "qwidget.h"
|
||||
#include "qdebug.h"
|
||||
#include <qmath.h>
|
||||
#if QT_CONFIG(rubberband)
|
||||
#include <QRubberBand>
|
||||
#endif
|
||||
#include <QFocusFrame>
|
||||
#include <QMenu>
|
||||
#include <QtWidgets/private/qwidget_p.h>
|
||||
|
@ -193,7 +193,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
|
||||
} else if (classname == QLatin1String("QDial")) {
|
||||
iface = new QAccessibleDial(widget);
|
||||
#endif
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
} else if (classname == QLatin1String("QRubberBand")) {
|
||||
iface = new QAccessibleWidget(widget, QAccessible::Border);
|
||||
#endif
|
||||
|
@ -58,7 +58,9 @@
|
||||
#include <QDialogButtonBox>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#if QT_CONFIG(rubberband)
|
||||
#include <QRubberBand>
|
||||
#endif
|
||||
#include <QTextBrowser>
|
||||
#include <QCalendarWidget>
|
||||
#include <QAbstractItemView>
|
||||
|
@ -353,7 +353,7 @@ QGraphicsViewPrivate::QGraphicsViewPrivate()
|
||||
viewportUpdateMode(QGraphicsView::MinimalViewportUpdate),
|
||||
optimizationFlags(0),
|
||||
scene(0),
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
rubberBanding(false),
|
||||
rubberBandSelectionMode(Qt::IntersectsItemShape),
|
||||
rubberBandSelectionOperation(Qt::ReplaceSelection),
|
||||
@ -633,7 +633,7 @@ void QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent *event)
|
||||
{
|
||||
Q_Q(QGraphicsView);
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
updateRubberBand(event);
|
||||
#endif
|
||||
|
||||
@ -708,7 +708,7 @@ void QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent *event)
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
QRegion QGraphicsViewPrivate::rubberBandRegion(const QWidget *widget, const QRect &rect) const
|
||||
{
|
||||
QStyleHintReturnMask mask;
|
||||
@ -1508,7 +1508,7 @@ void QGraphicsView::setDragMode(DragMode mode)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
/*!
|
||||
\property QGraphicsView::rubberBandSelectionMode
|
||||
\brief the behavior for selecting items with a rubber band selection rectangle.
|
||||
@ -3274,7 +3274,7 @@ void QGraphicsView::mousePressEvent(QMouseEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
if (d->dragMode == QGraphicsView::RubberBandDrag && !d->rubberBanding) {
|
||||
if (d->sceneInteractionAllowed) {
|
||||
// Rubberbanding is only allowed in interactive mode.
|
||||
@ -3336,7 +3336,7 @@ void QGraphicsView::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
Q_D(QGraphicsView);
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
if (d->dragMode == QGraphicsView::RubberBandDrag && d->sceneInteractionAllowed && !event->buttons()) {
|
||||
if (d->rubberBanding) {
|
||||
if (d->viewportUpdateMode != QGraphicsView::NoViewportUpdate){
|
||||
@ -3459,7 +3459,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event)
|
||||
|
||||
// Set up the painter
|
||||
QPainter painter(viewport());
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
if (d->rubberBanding && !d->rubberBandRect.isEmpty())
|
||||
painter.save();
|
||||
#endif
|
||||
@ -3583,7 +3583,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event)
|
||||
// Foreground
|
||||
drawForeground(&painter, exposedSceneRect);
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
// Rubberband
|
||||
if (d->rubberBanding && !d->rubberBandRect.isEmpty()) {
|
||||
painter.restore();
|
||||
@ -3651,7 +3651,7 @@ void QGraphicsView::scrollContentsBy(int dx, int dy)
|
||||
if (d->viewportUpdateMode != QGraphicsView::NoViewportUpdate) {
|
||||
if (d->viewportUpdateMode != QGraphicsView::FullViewportUpdate) {
|
||||
if (d->accelerateScrolling) {
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
// Update new and old rubberband regions
|
||||
if (!d->rubberBandRect.isEmpty()) {
|
||||
QRegion rubberBandRegion(d->rubberBandRegion(viewport(), d->rubberBandRect));
|
||||
|
@ -72,7 +72,7 @@ class Q_WIDGETS_EXPORT QGraphicsView : public QAbstractScrollArea
|
||||
Q_PROPERTY(ViewportAnchor transformationAnchor READ transformationAnchor WRITE setTransformationAnchor)
|
||||
Q_PROPERTY(ViewportAnchor resizeAnchor READ resizeAnchor WRITE setResizeAnchor)
|
||||
Q_PROPERTY(ViewportUpdateMode viewportUpdateMode READ viewportUpdateMode WRITE setViewportUpdateMode)
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
Q_PROPERTY(Qt::ItemSelectionMode rubberBandSelectionMode READ rubberBandSelectionMode WRITE setRubberBandSelectionMode)
|
||||
#endif
|
||||
Q_PROPERTY(OptimizationFlags optimizationFlags READ optimizationFlags WRITE setOptimizationFlags)
|
||||
@ -144,7 +144,7 @@ public:
|
||||
DragMode dragMode() const;
|
||||
void setDragMode(DragMode mode);
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
Qt::ItemSelectionMode rubberBandSelectionMode() const;
|
||||
void setRubberBandSelectionMode(Qt::ItemSelectionMode mode);
|
||||
QRect rubberBandRect() const;
|
||||
@ -228,7 +228,7 @@ public Q_SLOTS:
|
||||
void invalidateScene(const QRectF &rect = QRectF(), QGraphicsScene::SceneLayers layers = QGraphicsScene::AllLayers);
|
||||
void updateSceneRect(const QRectF &rect);
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
Q_SIGNALS:
|
||||
void rubberBandChanged(QRect viewportRect, QPointF fromScenePoint, QPointF toScenePoint);
|
||||
#endif
|
||||
|
@ -136,7 +136,7 @@ public:
|
||||
QGraphicsView::OptimizationFlags optimizationFlags;
|
||||
|
||||
QPointer<QGraphicsScene> scene;
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
QRect rubberBandRect;
|
||||
QRegion rubberBandRegion(const QWidget *widget, const QRect &rect) const;
|
||||
void updateRubberBand(const QMouseEvent *event);
|
||||
|
@ -50,7 +50,9 @@
|
||||
#include <qstyle.h>
|
||||
#include <qevent.h>
|
||||
#include <qscrollbar.h>
|
||||
#if QT_CONFIG(rubberband)
|
||||
#include <qrubberband.h>
|
||||
#endif
|
||||
#include <private/qlistview_p.h>
|
||||
#include <private/qscrollbar_p.h>
|
||||
#include <qdebug.h>
|
||||
@ -1043,7 +1045,7 @@ void QListView::paintEvent(QPaintEvent *e)
|
||||
d->commonListView->paintDragDrop(&painter);
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
// #### move this implementation into a dynamic class
|
||||
if (d->showElasticBand && d->elasticBand.isValid()) {
|
||||
QStyleOptionRubberBand opt;
|
||||
|
@ -53,7 +53,6 @@
|
||||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include "private/qabstractitemview_p.h"
|
||||
#include "qrubberband.h"
|
||||
#include "qbitarray.h"
|
||||
#include "qbsptree_p.h"
|
||||
#include <limits.h>
|
||||
|
@ -68,7 +68,9 @@
|
||||
#include <qtabwidget.h>
|
||||
#include <qtoolbar.h>
|
||||
#include <qtoolbutton.h>
|
||||
#if QT_CONFIG(rubberband)
|
||||
#include <qrubberband.h>
|
||||
#endif
|
||||
#include "qtreeview.h"
|
||||
#include <private/qcommonstylepixmaps_p.h>
|
||||
#include <private/qmath_p.h>
|
||||
@ -2002,7 +2004,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
|
||||
p->restore();
|
||||
break; }
|
||||
#endif // QT_NO_SIZEGRIP
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
case CE_RubberBand: {
|
||||
if (const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) {
|
||||
QPixmap tiledPixmap(16, 16);
|
||||
@ -2030,7 +2032,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
|
||||
p->restore();
|
||||
}
|
||||
break; }
|
||||
#endif // QT_NO_RUBBERBAND
|
||||
#endif // QT_CONFIG(rubberband)
|
||||
#ifndef QT_NO_DOCKWIDGET
|
||||
case CE_DockWidgetTitle:
|
||||
if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)) {
|
||||
@ -5093,7 +5095,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
|
||||
}
|
||||
}
|
||||
break;
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
case SH_RubberBand_Mask:
|
||||
if (const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) {
|
||||
ret = 0;
|
||||
@ -5107,7 +5109,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_RUBBERBAND
|
||||
#endif // QT_CONFIG(rubberband)
|
||||
case SH_SpinControls_DisableOnBounds:
|
||||
ret = 1;
|
||||
break;
|
||||
|
@ -80,7 +80,9 @@
|
||||
#include <qpushbutton.h>
|
||||
#endif
|
||||
#include <qradiobutton.h>
|
||||
#if QT_CONFIG(rubberband)
|
||||
#include <qrubberband.h>
|
||||
#endif
|
||||
#include <qscrollbar.h>
|
||||
#include <qsizegrip.h>
|
||||
#include <qstyleoption.h>
|
||||
|
@ -82,7 +82,9 @@
|
||||
#include <qpushbutton.h>
|
||||
#endif
|
||||
#include <qradiobutton.h>
|
||||
#if QT_CONFIG(rubberband)
|
||||
#include <qrubberband.h>
|
||||
#endif
|
||||
#include <qsizegrip.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qsplitter.h>
|
||||
|
@ -2797,7 +2797,7 @@ QStyleOptionToolBox::QStyleOptionToolBox(int version)
|
||||
a selected tab nor is it the selected tab.
|
||||
*/
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
/*!
|
||||
\class QStyleOptionRubberBand
|
||||
\brief The QStyleOptionRubberBand class is used to describe the
|
||||
@ -2887,7 +2887,7 @@ QStyleOptionRubberBand::QStyleOptionRubberBand(int version)
|
||||
|
||||
The default value is true.
|
||||
*/
|
||||
#endif // QT_NO_RUBBERBAND
|
||||
#endif // QT_CONFIG(rubberband)
|
||||
|
||||
/*!
|
||||
\class QStyleOptionTitleBar
|
||||
|
@ -49,7 +49,9 @@
|
||||
#include <QtWidgets/qstyle.h>
|
||||
#include <QtWidgets/qtabbar.h>
|
||||
#include <QtWidgets/qtabwidget.h>
|
||||
#if QT_CONFIG(rubberband)
|
||||
#include <QtWidgets/qrubberband.h>
|
||||
#endif
|
||||
#include <QtWidgets/qframe.h>
|
||||
#ifndef QT_NO_ITEMVIEWS
|
||||
# include <QtCore/qabstractitemmodel.h>
|
||||
@ -467,7 +469,7 @@ protected:
|
||||
|
||||
typedef Q_DECL_DEPRECATED QStyleOptionToolBox QStyleOptionToolBoxV2;
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
class Q_WIDGETS_EXPORT QStyleOptionRubberBand : public QStyleOption
|
||||
{
|
||||
public:
|
||||
@ -483,7 +485,7 @@ public:
|
||||
protected:
|
||||
QStyleOptionRubberBand(int version);
|
||||
};
|
||||
#endif // QT_NO_RUBBERBAND
|
||||
#endif // QT_CONFIG(rubberband)
|
||||
|
||||
// -------------------------- Complex style options -------------------------------
|
||||
class Q_WIDGETS_EXPORT QStyleOptionComplex : public QStyleOption
|
||||
|
@ -51,7 +51,9 @@
|
||||
#include <private/qmenubar_p.h>
|
||||
#include "qpaintengine.h"
|
||||
#include "qpainter.h"
|
||||
#if QT_CONFIG(rubberband)
|
||||
#include "qrubberband.h"
|
||||
#endif
|
||||
#include "qstyleoption.h"
|
||||
#include "qtabbar.h"
|
||||
#include "qwidget.h"
|
||||
@ -606,7 +608,7 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid
|
||||
ret = 400;
|
||||
break;
|
||||
}
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
case SH_RubberBand_Mask:
|
||||
if (const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) {
|
||||
ret = 0;
|
||||
@ -622,7 +624,7 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_RUBBERBAND
|
||||
#endif // QT_CONFIG(rubberband)
|
||||
#if QT_CONFIG(wizard)
|
||||
case SH_WizardStyle:
|
||||
ret = QWizard::ModernStyle;
|
||||
@ -1080,7 +1082,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
|
||||
const QWidget *widget) const
|
||||
{
|
||||
switch (ce) {
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
case CE_RubberBand:
|
||||
if (qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) {
|
||||
// ### workaround for slow general painter path
|
||||
@ -1103,7 +1105,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
|
||||
return;
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_RUBBERBAND
|
||||
#endif // QT_CONFIG(rubberband)
|
||||
|
||||
#if !defined(QT_NO_MENU) && !defined(QT_NO_MAINWINDOW)
|
||||
case CE_MenuBarEmptyArea:
|
||||
|
@ -1159,7 +1159,7 @@ void QWindowsXPStyle::polish(QWidget *widget)
|
||||
widget->setAttribute(Qt::WA_Hover);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
if (qobject_cast<QRubberBand*>(widget)) {
|
||||
widget->setWindowOpacity(0.6);
|
||||
}
|
||||
@ -1194,7 +1194,7 @@ void QWindowsXPStyle::polish(QPalette &pal)
|
||||
/*! \reimp */
|
||||
void QWindowsXPStyle::unpolish(QWidget *widget)
|
||||
{
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
if (qobject_cast<QRubberBand*>(widget)) {
|
||||
widget->setWindowOpacity(1.0);
|
||||
}
|
||||
@ -2412,7 +2412,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_DOCKWIDGET
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
case CE_RubberBand:
|
||||
if (qstyleoption_cast<const QStyleOptionRubberBand *>(option)) {
|
||||
QColor highlight = option->palette.color(QPalette::Active, QPalette::Highlight);
|
||||
@ -2428,7 +2428,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
|
||||
return;
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_RUBBERBAND
|
||||
#endif // QT_CONFIG(rubberband)
|
||||
case CE_HeaderEmptyArea:
|
||||
if (option->state & State_Horizontal)
|
||||
{
|
||||
@ -3752,12 +3752,12 @@ int QWindowsXPStyle::styleHint(StyleHint hint, const QStyleOption *option, const
|
||||
}
|
||||
}
|
||||
break;
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
case SH_RubberBand_Mask:
|
||||
if (qstyleoption_cast<const QStyleOptionRubberBand *>(option))
|
||||
res = 0;
|
||||
break;
|
||||
#endif // QT_NO_RUBBERBAND
|
||||
#endif // QT_CONFIG(rubberband)
|
||||
|
||||
case SH_ItemView_DrawDelegateFrame:
|
||||
res = 1;
|
||||
|
@ -49,7 +49,9 @@
|
||||
#include "qtoolbar.h"
|
||||
#include "qtoolbarlayout_p.h"
|
||||
#include "qwidgetanimator_p.h"
|
||||
#if QT_CONFIG(rubberband)
|
||||
#include "qrubberband.h"
|
||||
#endif
|
||||
#include "qtabbar_p.h"
|
||||
|
||||
#include <qapplication.h>
|
||||
@ -2449,7 +2451,7 @@ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group)
|
||||
|
||||
void QMainWindowLayout::updateGapIndicator()
|
||||
{
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
if ((!widgetAnimator.animating() && !currentGapPos.isEmpty())
|
||||
#if QT_CONFIG(dockwidget)
|
||||
|| currentHoveredFloat
|
||||
@ -2477,7 +2479,7 @@ void QMainWindowLayout::updateGapIndicator()
|
||||
} else if (gapIndicator) {
|
||||
gapIndicator->hide();
|
||||
}
|
||||
#endif //QT_NO_RUBBERBAND
|
||||
#endif // QT_CONFIG(rubberband)
|
||||
}
|
||||
|
||||
void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos)
|
||||
|
@ -301,7 +301,7 @@ public:
|
||||
QList<int> currentGapPos;
|
||||
QRect currentGapRect;
|
||||
QWidget *pluggingWidget;
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
QPointer<QRubberBand> gapIndicator;
|
||||
#endif
|
||||
#ifndef QT_NO_DOCKWIDGET
|
||||
|
@ -672,7 +672,7 @@ QMdiAreaPrivate::QMdiAreaPrivate()
|
||||
regularTiler(0),
|
||||
iconTiler(0),
|
||||
placer(0),
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
rubberBand(0),
|
||||
#endif
|
||||
#ifndef QT_NO_TABBAR
|
||||
@ -1036,7 +1036,7 @@ void QMdiAreaPrivate::activateHighlightedWindow()
|
||||
activateWindow(nextVisibleSubWindow(-1, QMdiArea::ActivationHistoryOrder));
|
||||
else
|
||||
activateWindow(childWindows.at(indexToHighlighted));
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
hideRubberBand();
|
||||
#endif
|
||||
}
|
||||
@ -1140,7 +1140,7 @@ void QMdiAreaPrivate::updateActiveWindow(int removedIndex, bool activeRemoved)
|
||||
}
|
||||
|
||||
if (indexToHighlighted >= 0) {
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
// Hide rubber band if highlighted window is removed.
|
||||
if (indexToHighlighted == removedIndex)
|
||||
hideRubberBand();
|
||||
@ -1514,7 +1514,7 @@ void QMdiAreaPrivate::highlightNextSubWindow(int increaseFactor)
|
||||
if (!highlight)
|
||||
return;
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
if (!rubberBand) {
|
||||
rubberBand = new QRubberBand(QRubberBand::Rectangle, q);
|
||||
// For accessibility to identify this special widget.
|
||||
@ -1524,7 +1524,7 @@ void QMdiAreaPrivate::highlightNextSubWindow(int increaseFactor)
|
||||
#endif
|
||||
|
||||
// Only highlight if we're not switching back to the previously active window (Ctrl-Tab once).
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
if (tabToPreviousTimerId == -1)
|
||||
showRubberBandFor(highlight);
|
||||
#endif
|
||||
@ -2351,7 +2351,7 @@ void QMdiArea::timerEvent(QTimerEvent *timerEvent)
|
||||
d->tabToPreviousTimerId = -1;
|
||||
if (d->indexToHighlighted < 0)
|
||||
return;
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
// We're not doing a "quick switch" ... show rubber band.
|
||||
Q_ASSERT(d->indexToHighlighted < d->childWindows.size());
|
||||
Q_ASSERT(d->rubberBand);
|
||||
@ -2594,7 +2594,7 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event)
|
||||
if (keyPress)
|
||||
area->d_func()->highlightNextSubWindow(keyEvent->key() == Qt::Key_Tab ? 1 : -1);
|
||||
return true;
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
case Qt::Key_Escape:
|
||||
area->d_func()->hideRubberBand();
|
||||
break;
|
||||
@ -2643,7 +2643,7 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event)
|
||||
case QEvent::Hide:
|
||||
d->isSubWindowsTiled = false;
|
||||
break;
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
case QEvent::Close:
|
||||
if (d->childWindows.indexOf(subWindow) == d->indexToHighlighted)
|
||||
d->hideRubberBand();
|
||||
|
@ -144,7 +144,7 @@ public:
|
||||
QMdi::Rearranger *regularTiler;
|
||||
QMdi::Rearranger *iconTiler;
|
||||
QMdi::Placer *placer;
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
QRubberBand *rubberBand;
|
||||
#endif
|
||||
QMdiAreaTabBar *tabBar;
|
||||
@ -254,7 +254,7 @@ public:
|
||||
subWindow->d_func()->setActive(active, changeFocus);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
void showRubberBandFor(QMdiSubWindow *subWindow);
|
||||
|
||||
inline void hideRubberBand()
|
||||
@ -263,7 +263,7 @@ public:
|
||||
rubberBand->hide();
|
||||
indexToHighlighted = -1;
|
||||
}
|
||||
#endif // QT_NO_RUBBERBAND
|
||||
#endif // QT_CONFIG(rubberband)
|
||||
};
|
||||
|
||||
#endif // QT_NO_MDIAREA
|
||||
|
@ -864,14 +864,14 @@ QMdiSubWindowPrivate::QMdiSubWindowPrivate()
|
||||
#ifndef QT_NO_SIZEGRIP
|
||||
sizeGrip(0),
|
||||
#endif
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
rubberBand(0),
|
||||
#endif
|
||||
userMinimumSize(0,0),
|
||||
resizeEnabled(true),
|
||||
moveEnabled(true),
|
||||
isInInteractiveMode(false),
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
isInRubberBandMode(false),
|
||||
#endif
|
||||
isShadeMode(false),
|
||||
@ -945,13 +945,13 @@ void QMdiSubWindowPrivate::_q_enterInteractiveMode()
|
||||
oldGeometry = q->geometry();
|
||||
isInInteractiveMode = true;
|
||||
q->setFocus();
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
if ((q->testOption(QMdiSubWindow::RubberBandResize)
|
||||
&& (currentOperation == BottomRightResize || currentOperation == BottomLeftResize))
|
||||
|| (q->testOption(QMdiSubWindow::RubberBandMove) && currentOperation == Move)) {
|
||||
enterRubberBandMode();
|
||||
} else
|
||||
#endif // QT_NO_RUBBERBAND
|
||||
#endif // QT_CONFIG(rubberband)
|
||||
{
|
||||
q->grabMouse();
|
||||
}
|
||||
@ -978,7 +978,7 @@ void QMdiSubWindowPrivate::_q_processFocusChanged(QWidget *old, QWidget *now)
|
||||
void QMdiSubWindowPrivate::leaveInteractiveMode()
|
||||
{
|
||||
Q_Q(QMdiSubWindow);
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
if (isInRubberBandMode)
|
||||
leaveRubberBandMode();
|
||||
else
|
||||
@ -1893,7 +1893,7 @@ void QMdiSubWindowPrivate::updateWindowTitle(bool isRequestFromChild)
|
||||
ignoreWindowTitleChange = false;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
void QMdiSubWindowPrivate::enterRubberBandMode()
|
||||
{
|
||||
Q_Q(QMdiSubWindow);
|
||||
@ -1925,7 +1925,7 @@ void QMdiSubWindowPrivate::leaveRubberBandMode()
|
||||
rubberBand->hide();
|
||||
currentOperation = None;
|
||||
}
|
||||
#endif // QT_NO_RUBBERBAND
|
||||
#endif // QT_CONFIG(rubberband)
|
||||
|
||||
// Taken from the old QWorkspace (::readColors())
|
||||
QPalette QMdiSubWindowPrivate::desktopPalette() const
|
||||
@ -2424,7 +2424,7 @@ void QMdiSubWindow::setOption(SubWindowOption option, bool on)
|
||||
Q_D(QMdiSubWindow);
|
||||
d->options.setFlag(option, on);
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
if ((option & (RubberBandResize | RubberBandMove)) && !on && d->isInRubberBandMode)
|
||||
d->leaveRubberBandMode();
|
||||
#endif
|
||||
@ -2723,7 +2723,7 @@ bool QMdiSubWindow::eventFilter(QObject *object, QEvent *event)
|
||||
d->oldGeometry = geometry();
|
||||
d->currentOperation = isLeftToRight() ? QMdiSubWindowPrivate::BottomRightResize
|
||||
: QMdiSubWindowPrivate::BottomLeftResize;
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
d->enterRubberBandMode();
|
||||
#endif
|
||||
return true;
|
||||
@ -2837,7 +2837,7 @@ bool QMdiSubWindow::event(QEvent *event)
|
||||
d->currentOperation = QMdiSubWindowPrivate::None;
|
||||
d->activeSubControl = QStyle::SC_None;
|
||||
d->hoveredSubControl = QStyle::SC_None;
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
if (d->isInRubberBandMode)
|
||||
d->leaveRubberBandMode();
|
||||
#endif
|
||||
@ -3196,7 +3196,7 @@ void QMdiSubWindow::mousePressEvent(QMouseEvent *mouseEvent)
|
||||
Q_D(QMdiSubWindow);
|
||||
if (d->isInInteractiveMode)
|
||||
d->leaveInteractiveMode();
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
if (d->isInRubberBandMode)
|
||||
d->leaveRubberBandMode();
|
||||
#endif
|
||||
@ -3211,7 +3211,7 @@ void QMdiSubWindow::mousePressEvent(QMouseEvent *mouseEvent)
|
||||
d->mousePressPosition = mapToParent(mouseEvent->pos());
|
||||
if (d->resizeEnabled || d->moveEnabled)
|
||||
d->oldGeometry = geometry();
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
if ((testOption(QMdiSubWindow::RubberBandResize) && d->isResizeOperation())
|
||||
|| (testOption(QMdiSubWindow::RubberBandMove) && d->isMoveOperation())) {
|
||||
d->enterRubberBandMode();
|
||||
@ -3291,7 +3291,7 @@ void QMdiSubWindow::mouseReleaseEvent(QMouseEvent *mouseEvent)
|
||||
|
||||
Q_D(QMdiSubWindow);
|
||||
if (d->currentOperation != QMdiSubWindowPrivate::None) {
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
if (d->isInRubberBandMode && !d->isInInteractiveMode)
|
||||
d->leaveRubberBandMode();
|
||||
#endif
|
||||
@ -3406,13 +3406,13 @@ void QMdiSubWindow::keyPressEvent(QKeyEvent *keyEvent)
|
||||
#ifndef QT_NO_CURSOR
|
||||
QPoint newPosition = parentWidget()->mapFromGlobal(cursor().pos() + delta);
|
||||
QRect oldGeometry =
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
d->isInRubberBandMode ? d->rubberBand->geometry() :
|
||||
#endif
|
||||
geometry();
|
||||
d->setNewGeometry(newPosition);
|
||||
QRect currentGeometry =
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
d->isInRubberBandMode ? d->rubberBand->geometry() :
|
||||
#endif
|
||||
geometry();
|
||||
|
@ -179,7 +179,7 @@ public:
|
||||
#ifndef QT_NO_SIZEGRIP
|
||||
QPointer<QSizeGrip> sizeGrip;
|
||||
#endif
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
QRubberBand *rubberBand;
|
||||
#endif
|
||||
QPoint mousePressPosition;
|
||||
@ -190,7 +190,7 @@ public:
|
||||
bool resizeEnabled;
|
||||
bool moveEnabled;
|
||||
bool isInInteractiveMode;
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
bool isInRubberBandMode;
|
||||
#endif
|
||||
bool isShadeMode;
|
||||
@ -258,7 +258,7 @@ public:
|
||||
void removeButtonsFromMenuBar();
|
||||
#endif
|
||||
void updateWindowTitle(bool requestFromChild);
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
void enterRubberBandMode();
|
||||
void leaveRubberBandMode();
|
||||
#endif
|
||||
@ -310,7 +310,7 @@ public:
|
||||
Q_Q(QMdiSubWindow);
|
||||
Q_ASSERT(parent);
|
||||
geometry->setSize(geometry->size().expandedTo(internalMinimumSize));
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
#if QT_CONFIG(rubberband)
|
||||
if (isInRubberBandMode)
|
||||
rubberBand->setGeometry(*geometry);
|
||||
else
|
||||
|
@ -43,8 +43,6 @@
|
||||
#include "qrubberband.h"
|
||||
#include "qtimer.h"
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
|
||||
#include "qstyle.h"
|
||||
#include "qstyleoption.h"
|
||||
#if 0 // Used to be included in Qt4 for Q_WS_MAC
|
||||
@ -334,5 +332,3 @@ bool QRubberBand::event(QEvent *e)
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "moc_qrubberband.cpp"
|
||||
|
||||
#endif // QT_NO_RUBBERBAND
|
||||
|
@ -43,11 +43,10 @@
|
||||
#include <QtWidgets/qtwidgetsglobal.h>
|
||||
#include <QtWidgets/qwidget.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(rubberband);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
|
||||
class QRubberBandPrivate;
|
||||
class QStyleOptionRubberBand;
|
||||
|
||||
@ -91,8 +90,6 @@ inline void QRubberBand::setGeometry(int ax, int ay, int aw, int ah)
|
||||
inline void QRubberBand::move(int ax, int ay)
|
||||
{ setGeometry(ax, ay, width(), height()); }
|
||||
|
||||
#endif // QT_NO_RUBBERBAND
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QRUBBERBAND_H
|
||||
|
@ -47,7 +47,9 @@
|
||||
#include "qlayout.h"
|
||||
#include "qlist.h"
|
||||
#include "qpainter.h"
|
||||
#if QT_CONFIG(rubberband)
|
||||
#include "qrubberband.h"
|
||||
#endif
|
||||
#include "qstyle.h"
|
||||
#include "qstyleoption.h"
|
||||
#include "qtextstream.h"
|
||||
|
@ -53,7 +53,6 @@
|
||||
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include "private/qframe_p.h"
|
||||
#include "qrubberband.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -48,7 +48,9 @@
|
||||
#include <qmainwindow.h>
|
||||
#include <qmenu.h>
|
||||
#include <qmenubar.h>
|
||||
#if QT_CONFIG(rubberband)
|
||||
#include <qrubberband.h>
|
||||
#endif
|
||||
#include <qsignalmapper.h>
|
||||
#include <qstylepainter.h>
|
||||
#include <qtoolbutton.h>
|
||||
|
@ -32,7 +32,6 @@ HEADERS += \
|
||||
widgets/qmenubar.h \
|
||||
widgets/qmenubar_p.h \
|
||||
widgets/qprogressbar.h \
|
||||
widgets/qrubberband.h \
|
||||
widgets/qscrollbar.h \
|
||||
widgets/qscrollbar_p.h \
|
||||
widgets/qscrollarea_p.h \
|
||||
@ -89,7 +88,6 @@ SOURCES += \
|
||||
widgets/qmenu.cpp \
|
||||
widgets/qmenubar.cpp \
|
||||
widgets/qprogressbar.cpp \
|
||||
widgets/qrubberband.cpp \
|
||||
widgets/qscrollbar.cpp \
|
||||
widgets/qsizegrip.cpp \
|
||||
widgets/qslider.cpp \
|
||||
@ -197,6 +195,11 @@ qtConfig(dialogbuttonbox) {
|
||||
widgets/qdialogbuttonbox.cpp
|
||||
}
|
||||
|
||||
qtConfig(rubberband) {
|
||||
HEADERS += widgets/qrubberband.h
|
||||
SOURCES += widgets/qrubberband.cpp
|
||||
}
|
||||
|
||||
qtConfig(splashscreen) {
|
||||
HEADERS += \
|
||||
widgets/qsplashscreen.h
|
||||
|
Loading…
Reference in New Issue
Block a user