summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2009-11-06 16:39:53 +0100
committerJørgen Lind <jorgen.lind@nokia.com>2009-11-06 16:39:53 +0100
commit53c36eb868a800569557e01ba075964127e9cffd (patch)
tree0847756bbed8c30268940334d1bf57d9fa509348 /src
parentdaf5f511ee813fc4fffba64bed558d0413270388 (diff)
parent6d7d54813f4cfc326fc52d3402653b924677124a (diff)
Merge branch 'feature' into 4.6
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qlibraryinfo.cpp2
-rw-r--r--src/corelib/global/qlibraryinfo.h2
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp17
-rw-r--r--src/gui/graphicsview/qgraphicsitem.h2
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h5
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp7
-rw-r--r--src/gui/graphicsview/qgraphicsscene_p.h4
-rw-r--r--src/gui/kernel/qgesturemanager.cpp2
-rw-r--r--src/gui/statemachine/qguistatemachine.cpp16
-rw-r--r--src/gui/widgets/qmenu.cpp2
-rw-r--r--src/plugins/accessible/widgets/simplewidgets.cpp4
11 files changed, 59 insertions, 4 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 15a06d7cf9..15325ae4be 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -212,11 +212,13 @@ QLibraryInfo::buildKey()
Returns the installation date for this build of Qt. The install date will
usually be the last time that Qt sources were configured.
*/
+#ifndef QT_NO_DATESTRING
QDate
QLibraryInfo::buildDate()
{
return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate);
}
+#endif //QT_NO_DATESTRING
/*!
Returns the location specified by \a loc.
diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h
index 88e85667a5..f65051d7c7 100644
--- a/src/corelib/global/qlibraryinfo.h
+++ b/src/corelib/global/qlibraryinfo.h
@@ -60,7 +60,9 @@ public:
static QString licensedProducts();
static QString buildKey();
+#ifndef QT_NO_DATESTRING
static QDate buildDate();
+#endif //QT_NO_DATESTRING
enum LibraryLocation
{
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 2fd499dc90..305fee1ef2 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1336,7 +1336,9 @@ QGraphicsItem::~QGraphicsItem()
d_ptr->setParentItemHelper(0);
}
+#ifndef QT_NO_GRAPHICSEFFECT
delete d_ptr->graphicsEffect;
+#endif //QT_NO_GRAPHICSEFFECT
if (d_ptr->transformData) {
for(int i = 0; i < d_ptr->transformData->graphicsTransforms.size(); ++i) {
QGraphicsTransform *t = d_ptr->transformData->graphicsTransforms.at(i);
@@ -2506,7 +2508,9 @@ void QGraphicsItem::setOpacity(qreal opacity)
// Update.
if (d_ptr->scene) {
+#ifndef QT_NO_GRAPHICSEFFECT
d_ptr->invalidateGraphicsEffectsRecursively();
+#endif //QT_NO_GRAPHICSEFFECT
d_ptr->scene->d_func()->markDirty(this, QRectF(),
/*invalidateChildren=*/true,
/*maybeDirtyClipPath=*/false,
@@ -2523,6 +2527,7 @@ void QGraphicsItem::setOpacity(qreal opacity)
\since 4.6
*/
+#ifndef QT_NO_GRAPHICSEFFECT
QGraphicsEffect *QGraphicsItem::graphicsEffect() const
{
return d_ptr->graphicsEffect;
@@ -2569,6 +2574,7 @@ void QGraphicsItem::setGraphicsEffect(QGraphicsEffect *effect)
prepareGeometryChange();
}
+#endif //QT_NO_GRAPHICSEFFECT
/*!
\internal
@@ -2582,6 +2588,7 @@ void QGraphicsItem::setGraphicsEffect(QGraphicsEffect *effect)
*/
QRectF QGraphicsItemPrivate::effectiveBoundingRect() const
{
+#ifndef QT_NO_GRAPHICSEFFECT
QGraphicsEffect *effect = graphicsEffect;
QRectF brect = effect && effect->isEnabled() ? effect->boundingRect() : q_ptr->boundingRect();
if (ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren)
@@ -2598,6 +2605,10 @@ QRectF QGraphicsItemPrivate::effectiveBoundingRect() const
}
return brect;
+#else //QT_NO_GRAPHICSEFFECT
+ return q_ptr->boundingRect();
+#endif //QT_NO_GRAPHICSEFFECT
+
}
/*!
@@ -4977,6 +4988,7 @@ int QGraphicsItemPrivate::depth() const
/*!
\internal
*/
+#ifndef QT_NO_GRAPHICSEFFECT
void QGraphicsItemPrivate::invalidateGraphicsEffectsRecursively()
{
QGraphicsItemPrivate *itemPrivate = this;
@@ -4989,6 +5001,7 @@ void QGraphicsItemPrivate::invalidateGraphicsEffectsRecursively()
}
} while ((itemPrivate = itemPrivate->parent ? itemPrivate->parent->d_ptr.data() : 0));
}
+#endif //QT_NO_GRAPHICSEFFECT
/*!
\internal
@@ -5324,7 +5337,9 @@ void QGraphicsItem::update(const QRectF &rect)
return;
// Make sure we notify effects about invalidated source.
+#ifndef QT_NO_GRAPHICSEFFECT
d_ptr->invalidateGraphicsEffectsRecursively();
+#endif //QT_NO_GRAPHICSEFFECT
if (CacheMode(d_ptr->cacheMode) != NoCache) {
// Invalidate cache.
@@ -10678,6 +10693,7 @@ int QGraphicsItemGroup::type() const
return Type;
}
+#ifndef QT_NO_GRAPHICSEFFECT
QRectF QGraphicsItemEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) const
{
const bool deviceCoordinates = (system == Qt::DeviceCoordinates);
@@ -10817,6 +10833,7 @@ QPixmap QGraphicsItemEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QP
return pixmap;
}
+#endif //QT_NO_GRAPHICSEFFECT
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug debug, QGraphicsItem *item)
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h
index f091e34a6a..84d9eafea8 100644
--- a/src/gui/graphicsview/qgraphicsitem.h
+++ b/src/gui/graphicsview/qgraphicsitem.h
@@ -225,9 +225,11 @@ public:
qreal effectiveOpacity() const;
void setOpacity(qreal opacity);
+#ifndef QT_NO_GRAPHICSEFFECT
// Effect
QGraphicsEffect *graphicsEffect() const;
void setGraphicsEffect(QGraphicsEffect *effect);
+#endif //QT_NO_GRAPHICSEFFECT
Qt::MouseButtons acceptedMouseButtons() const;
void setAcceptedMouseButtons(Qt::MouseButtons buttons);
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 51d2ffd005..b914c5c610 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -223,7 +223,9 @@ public:
bool discardUpdateRequest(bool ignoreClipping = false, bool ignoreVisibleBit = false,
bool ignoreDirtyBit = false, bool ignoreOpacity = false) const;
int depth() const;
+#ifndef QT_NO_GRAPHICSEFFECT
void invalidateGraphicsEffectsRecursively();
+#endif //QT_NO_GRAPHICSEFFECT
void invalidateDepthRecursively();
void resolveDepth();
void addChild(QGraphicsItem *child);
@@ -577,6 +579,7 @@ struct QGraphicsItemPaintInfo
quint32 drawItem : 1;
};
+#ifndef QT_NO_GRAPHICSEFFECT
class QGraphicsItemEffectSourcePrivate : public QGraphicsEffectSourcePrivate
{
public:
@@ -632,7 +635,7 @@ public:
QGraphicsItemPaintInfo *info;
QTransform lastEffectTransform;
};
-
+#endif //QT_NO_GRAPHICSEFFECT
/*!
Returns true if \a item1 is on top of \a item2.
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index dc036f84c8..c4771c17b9 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -4577,6 +4577,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter *
if (itemHasChildren && itemClipsChildrenToShape)
ENSURE_TRANSFORM_PTR;
+#ifndef QT_NO_GRAPHICSEFFECT
if (item->d_ptr->graphicsEffect && item->d_ptr->graphicsEffect->isEnabled()) {
ENSURE_TRANSFORM_PTR;
QGraphicsItemPaintInfo info(viewTransform, transformPtr, effectTransform, exposedRegion, widget, &styleOptionTmp,
@@ -4599,7 +4600,9 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter *
item->d_ptr->graphicsEffect->draw(painter, source);
painter->setWorldTransform(restoreTransform);
sourced->info = 0;
- } else {
+ } else
+#endif //QT_NO_GRAPHICSEFFECT
+ {
draw(item, painter, viewTransform, transformPtr, exposedRegion, widget, opacity,
effectTransform, wasDirtyParentSceneTransform, drawItem);
}
@@ -4768,10 +4771,12 @@ void QGraphicsScenePrivate::markDirty(QGraphicsItem *item, const QRectF &rect, b
QGraphicsItem *p = item->d_ptr->parent;
while (p) {
p->d_ptr->dirtyChildren = 1;
+#ifndef QT_NO_GRAPHICSEFFECT
if (p->d_ptr->graphicsEffect && p->d_ptr->graphicsEffect->isEnabled()) {
p->d_ptr->dirty = 1;
p->d_ptr->fullUpdatePending = 1;
}
+#endif //QT_NO_GRAPHICSEFFECT
p = p->d_ptr->parent;
}
}
diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h
index f8db08401e..a2a1ee1679 100644
--- a/src/gui/graphicsview/qgraphicsscene_p.h
+++ b/src/gui/graphicsview/qgraphicsscene_p.h
@@ -234,6 +234,7 @@ public:
item->d_ptr->fullUpdatePending = 0;
item->d_ptr->ignoreVisible = 0;
item->d_ptr->ignoreOpacity = 0;
+#ifndef QT_NO_GRAPHICSEFFECT
QGraphicsEffect::ChangeFlags flags;
if (item->d_ptr->notifyBoundingRectChanged) {
flags |= QGraphicsEffect::SourceBoundingRectChanged;
@@ -243,12 +244,15 @@ public:
flags |= QGraphicsEffect::SourceInvalidated;
item->d_ptr->notifyInvalidated = 0;
}
+#endif //QT_NO_GRAPHICSEFFECT
if (recursive) {
for (int i = 0; i < item->d_ptr->children.size(); ++i)
resetDirtyItem(item->d_ptr->children.at(i), recursive);
}
+#ifndef QT_NO_GRAPHICSEFFECT
if (flags && item->d_ptr->graphicsEffect)
item->d_ptr->graphicsEffect->sourceChanged(flags);
+#endif //QT_NO_GRAPHICSEFFECT
}
inline void ensureSortedTopLevelItems()
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index 375116f495..abd2128318 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -179,8 +179,10 @@ QGesture *QGestureManager::getState(QObject *object, QGestureRecognizer *recogni
return 0;
} else if (QGesture *g = qobject_cast<QGesture *>(object)) {
return g;
+#ifndef QT_NO_GRAPHICSVIEW
} else {
Q_ASSERT(qobject_cast<QGraphicsObject *>(object));
+#endif
}
QList<QGesture *> states =
diff --git a/src/gui/statemachine/qguistatemachine.cpp b/src/gui/statemachine/qguistatemachine.cpp
index 1de5ffa7d7..4f7806fe7e 100644
--- a/src/gui/statemachine/qguistatemachine.cpp
+++ b/src/gui/statemachine/qguistatemachine.cpp
@@ -106,8 +106,10 @@ static QEvent *cloneEvent(QEvent *e)
return new QEvent(*e);
case QEvent::HideToParent:
return new QEvent(*e);
+#ifndef QT_NO_WHEELEVENT
case QEvent::Wheel:
return new QWheelEvent(*static_cast<QWheelEvent*>(e));
+#endif //QT_NO_WHEELEVENT
case QEvent::WindowTitleChange:
return new QEvent(*e);
case QEvent::WindowIconChange:
@@ -190,8 +192,10 @@ static QEvent *cloneEvent(QEvent *e)
return new QInputMethodEvent(*static_cast<QInputMethodEvent*>(e));
case QEvent::AccessibilityPrepare:
return new QEvent(*e);
+#ifndef QT_NO_TABLETEVENT
case QEvent::TabletMove:
return new QTabletEvent(*static_cast<QTabletEvent*>(e));
+#endif //QT_NO_TABLETEVENT
case QEvent::LocaleChange:
return new QEvent(*e);
case QEvent::LanguageChange:
@@ -200,10 +204,12 @@ static QEvent *cloneEvent(QEvent *e)
return new QEvent(*e);
case QEvent::Style:
return new QEvent(*e);
+#ifndef QT_NO_TABLETEVENT
case QEvent::TabletPress:
return new QTabletEvent(*static_cast<QTabletEvent*>(e));
case QEvent::TabletRelease:
return new QTabletEvent(*static_cast<QTabletEvent*>(e));
+#endif //QT_NO_TABLETEVENT
case QEvent::OkRequest:
return new QEvent(*e);
case QEvent::HelpRequest:
@@ -238,8 +244,10 @@ static QEvent *cloneEvent(QEvent *e)
return new QHelpEvent(*static_cast<QHelpEvent*>(e));
case QEvent::WhatsThis:
return new QHelpEvent(*static_cast<QHelpEvent*>(e));
+#ifndef QT_NO_STATUSTIP
case QEvent::StatusTip:
return new QStatusTipEvent(*static_cast<QStatusTipEvent*>(e));
+#endif //QT_NO_STATUSTIP
#ifndef QT_NO_ACTION
case QEvent::ActionChanged:
case QEvent::ActionAdded:
@@ -249,8 +257,10 @@ static QEvent *cloneEvent(QEvent *e)
case QEvent::FileOpen:
return new QFileOpenEvent(*static_cast<QFileOpenEvent*>(e));
+#ifndef QT_NO_SHORTCUT
case QEvent::Shortcut:
return new QShortcutEvent(*static_cast<QShortcutEvent*>(e));
+#endif //QT_NO_SHORTCUT
case QEvent::ShortcutOverride:
return new QKeyEvent(*static_cast<QKeyEvent*>(e));
@@ -263,11 +273,15 @@ static QEvent *cloneEvent(QEvent *e)
break;
#endif
+#ifndef QT_NO_WHATSTHIS
case QEvent::WhatsThisClicked:
return new QWhatsThisClickedEvent(*static_cast<QWhatsThisClickedEvent*>(e));
+#endif //QT_NO_WHATSTHIS
+#ifndef QT_NO_TOOLBAR
case QEvent::ToolBarChange:
return new QToolBarChangeEvent(*static_cast<QToolBarChangeEvent*>(e));
+#endif //QT_NO_TOOLBAR
case QEvent::ApplicationActivate:
return new QEvent(*e);
@@ -397,9 +411,11 @@ static QEvent *cloneEvent(QEvent *e)
case QEvent::DynamicPropertyChange:
return new QDynamicPropertyChangeEvent(*static_cast<QDynamicPropertyChangeEvent*>(e));
+#ifndef QT_NO_TABLETEVENT
case QEvent::TabletEnterProximity:
case QEvent::TabletLeaveProximity:
return new QTabletEvent(*static_cast<QTabletEvent*>(e));
+#endif //QT_NO_TABLETEVENT
case QEvent::NonClientAreaMouseMove:
case QEvent::NonClientAreaMouseButtonPress:
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index 1b5d1cd1f5..c5679552f3 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -1878,9 +1878,11 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
if(snapToMouse) //position flowing left from the mouse
pos.setX(mouse.x()-size.width());
+#ifndef QT_NO_MENUBAR
//if in a menubar, it should be right-aligned
if (qobject_cast<QMenuBar*>(d->causedPopup.widget))
pos.rx() -= size.width();
+#endif //QT_NO_MENUBAR
if (pos.x() < screen.left()+desktopFrame)
pos.setX(qMax(p.x(), screen.left()+desktopFrame));
diff --git a/src/plugins/accessible/widgets/simplewidgets.cpp b/src/plugins/accessible/widgets/simplewidgets.cpp
index 1d801e4199..87d81f0689 100644
--- a/src/plugins/accessible/widgets/simplewidgets.cpp
+++ b/src/plugins/accessible/widgets/simplewidgets.cpp
@@ -256,9 +256,9 @@ QString QAccessibleButton::localizedName(int actionIndex)
QStringList QAccessibleButton::keyBindings(int actionIndex)
{
switch (actionIndex) {
-#ifdef QT_NO_SHORTCUT
+#ifndef QT_NO_SHORTCUT
case 0:
- return button()->shortcut().toString();
+ return QStringList() << button()->shortcut().toString();
#endif
default:
return QStringList();