diff options
Diffstat (limited to 'demos')
-rw-r--r-- | demos/embeddeddialogs/customproxy.cpp | 16 | ||||
-rw-r--r-- | demos/embeddeddialogs/customproxy.h | 1 | ||||
-rw-r--r-- | demos/qtdemo/colors.cpp | 3 | ||||
-rw-r--r-- | demos/qtdemo/menumanager.cpp | 3 | ||||
-rw-r--r-- | demos/qtdemo/xml/examples.xml | 1 |
5 files changed, 15 insertions, 9 deletions
diff --git a/demos/embeddeddialogs/customproxy.cpp b/demos/embeddeddialogs/customproxy.cpp index ed2fc76..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)), @@ -112,13 +112,17 @@ bool CustomProxy::sceneEventFilter(QGraphicsItem *watched, QEvent *event) QVariant CustomProxy::itemChange(GraphicsItemChange change, const QVariant &value) { if (change == ItemChildAddedChange || change == ItemChildRemovedChange) { - QGraphicsItem *item = qVariantValue<QGraphicsItem *>(value); if (change == ItemChildAddedChange) { - item->setCacheMode(ItemCoordinateCache); - item->installSceneEventFilter(this); - } else { - item->removeSceneEventFilter(this); + 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/qtdemo/colors.cpp b/demos/qtdemo/colors.cpp index 18343cb..41bbfb3 100644 --- a/demos/qtdemo/colors.cpp +++ b/demos/qtdemo/colors.cpp @@ -278,6 +278,9 @@ void Colors::parseArgs(int argc, char *argv[]) + "[-low] [-ticker-letters<int>] [-ticker-speed<float>] [-no-ticker-morph] " + "[-ticker-morph-speed<float>] [-ticker-text<string>]"); exit(0); + } else{ + QMessageBox::warning(0, "QtDemo", QString("Unrecognized argument:\n") + s); + exit(0); } } diff --git a/demos/qtdemo/menumanager.cpp b/demos/qtdemo/menumanager.cpp index bfa2e3f..a9e9b4b 100644 --- a/demos/qtdemo/menumanager.cpp +++ b/demos/qtdemo/menumanager.cpp @@ -184,7 +184,6 @@ void MenuManager::itemSelected(int userCode, const QString &menuName) this->tickerInAnim->startDelay = 2000; this->ticker->useGuideQt(); this->score->queueMovie("ticker", Score::NEW_ANIMATION_ONLY); - this->window->switchTimerOnOff(true); } break; case MENU1: @@ -220,7 +219,6 @@ void MenuManager::itemSelected(int userCode, const QString &menuName) this->score->queueMovie(this->currentInfo + " -buttons", Score::NEW_ANIMATION_ONLY); if (!Colors::noTicker){ this->score->queueMovie("ticker -out", Score::NEW_ANIMATION_ONLY); - this->window->switchTimerOnOff(false); } break; case UP:{ @@ -257,7 +255,6 @@ void MenuManager::itemSelected(int userCode, const QString &menuName) this->ticker->doIntroTransitions = false; this->tickerInAnim->startDelay = 500; this->score->queueMovie("ticker", Score::NEW_ANIMATION_ONLY); - this->window->switchTimerOnOff(true); } } else if (this->currentMenuCode != ROOT) itemSelected(ROOT, Colors::rootMenuName); diff --git a/demos/qtdemo/xml/examples.xml b/demos/qtdemo/xml/examples.xml index df2d93b..03b59f3 100644 --- a/demos/qtdemo/xml/examples.xml +++ b/demos/qtdemo/xml/examples.xml @@ -137,6 +137,7 @@ <example filename="fontsampler" name="Font Sampler" /> <example filename="imagecomposition" name="Image Composition" /> <example filename="painterpaths" name="Painter Paths" /> + <example filename="svggenerator" name="SVG Generator" /> <example filename="svgviewer" name="SVG Viewer" /> <example filename="transformations" name="Transformations" /> </category> |