summaryrefslogtreecommitdiffstats
path: root/demos/embeddeddialogs
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-04-24 14:03:55 (GMT)
committeraxis <qt-info@nokia.com>2009-04-27 07:09:01 (GMT)
commite74c8dc65e2feffb9a55d00aee5ca634fba41df8 (patch)
tree3a131f9235fb6a455793178d8313655e4fd0036e /demos/embeddeddialogs
parent8f427b2b914d5b575a4a7c0ed65d2fb8f45acc76 (diff)
parent211bea9838bcc2acd7f54b65468fe1be2d81b1e0 (diff)
downloadQt-e74c8dc65e2feffb9a55d00aee5ca634fba41df8.zip
Qt-e74c8dc65e2feffb9a55d00aee5ca634fba41df8.tar.gz
Qt-e74c8dc65e2feffb9a55d00aee5ca634fba41df8.tar.bz2
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt
Configure.exe recompiled with MSVC6. Conflicts: configure.exe examples/network/network.pro src/gui/dialogs/qfiledialog_p.h src/gui/dialogs/qfilesystemmodel_p.h src/gui/kernel/qapplication.cpp tests/auto/_Categories/qmake.txt tests/auto/qfile/test/test.pro tests/auto/qfile/tst_qfile.cpp tests/auto/qlibrary/tst_qlibrary.cpp tests/auto/qline/tst_qline.cpp tests/auto/qstyle/tst_qstyle.cpp tests/auto/qtextstream/tst_qtextstream.cpp tests/auto/qtranslator/qtranslator.pro tests/auto/qwaitcondition/tst_qwaitcondition.cpp translations/qt_ja_JP.ts
Diffstat (limited to 'demos/embeddeddialogs')
-rw-r--r--demos/embeddeddialogs/customproxy.cpp17
-rw-r--r--demos/embeddeddialogs/customproxy.h1
-rw-r--r--demos/embeddeddialogs/main.cpp1
3 files changed, 15 insertions, 4 deletions
diff --git a/demos/embeddeddialogs/customproxy.cpp b/demos/embeddeddialogs/customproxy.cpp
index 56a0548..dd8766f 100644
--- a/demos/embeddeddialogs/customproxy.cpp
+++ b/demos/embeddeddialogs/customproxy.cpp
@@ -44,7 +44,7 @@
#include <QtGui>
CustomProxy::CustomProxy(QGraphicsItem *parent, Qt::WindowFlags wFlags)
- : QGraphicsProxyWidget(parent, wFlags), popupShown(false)
+ : QGraphicsProxyWidget(parent, wFlags), popupShown(false), currentPopup(0)
{
timeLine = new QTimeLine(250, this);
connect(timeLine, SIGNAL(valueChanged(qreal)),
@@ -111,8 +111,19 @@ bool CustomProxy::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
QVariant CustomProxy::itemChange(GraphicsItemChange change, const QVariant &value)
{
- if (change == ItemChildRemovedChange)
- removeSceneEventFilter(this);
+ if (change == ItemChildAddedChange || change == ItemChildRemovedChange) {
+ if (change == ItemChildAddedChange) {
+ currentPopup = qVariantValue<QGraphicsItem *>(value);
+ currentPopup->setCacheMode(ItemCoordinateCache);
+ if (scene())
+ currentPopup->installSceneEventFilter(this);
+ } else if (scene()) {
+ currentPopup->removeSceneEventFilter(this);
+ currentPopup = 0;
+ }
+ } else if (currentPopup && change == ItemSceneHasChanged) {
+ currentPopup->installSceneEventFilter(this);
+ }
return QGraphicsProxyWidget::itemChange(change, value);
}
diff --git a/demos/embeddeddialogs/customproxy.h b/demos/embeddeddialogs/customproxy.h
index 0a5fbaf..d324426 100644
--- a/demos/embeddeddialogs/customproxy.h
+++ b/demos/embeddeddialogs/customproxy.h
@@ -70,6 +70,7 @@ private slots:
private:
QTimeLine *timeLine;
bool popupShown;
+ QGraphicsItem *currentPopup;
};
#endif
diff --git a/demos/embeddeddialogs/main.cpp b/demos/embeddeddialogs/main.cpp
index 4cf7325..cfb31c4 100644
--- a/demos/embeddeddialogs/main.cpp
+++ b/demos/embeddeddialogs/main.cpp
@@ -68,7 +68,6 @@ int main(int argc, char *argv[])
proxy->setCacheMode(QGraphicsItem::DeviceCoordinateCache);
scene.addItem(proxy);
- proxy->installSceneEventFilter(proxy);
}
}
scene.setSceneRect(scene.itemsBoundingRect());