From f045367df74fbb5befeef81afa9102d0a6e59d54 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 5 May 2011 18:50:35 +0200 Subject: Remove stray semicolon. Reviewed-by: TrustMe --- src/plugins/accessible/widgets/simplewidgets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/accessible/widgets/simplewidgets.cpp b/src/plugins/accessible/widgets/simplewidgets.cpp index aa64630..73ffc9f 100644 --- a/src/plugins/accessible/widgets/simplewidgets.cpp +++ b/src/plugins/accessible/widgets/simplewidgets.cpp @@ -176,7 +176,7 @@ QString QAccessibleButton::text(Text t, int child) const break; } if (str.isEmpty()) - str = QAccessibleWidgetEx::text(t, child);; + str = QAccessibleWidgetEx::text(t, child); return qt_accStripAmp(str); } -- cgit v0.12 From e29ef45e404dbe888c0848eb28317a10b2aff768 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 5 May 2011 18:51:59 +0200 Subject: QAccessibleToolButton::text should return accessibleName if set. This was most likely a copy and paste error. Reviewed-by: Denis Dzyubenko --- src/plugins/accessible/widgets/simplewidgets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/accessible/widgets/simplewidgets.cpp b/src/plugins/accessible/widgets/simplewidgets.cpp index 73ffc9f..8001eae 100644 --- a/src/plugins/accessible/widgets/simplewidgets.cpp +++ b/src/plugins/accessible/widgets/simplewidgets.cpp @@ -396,7 +396,7 @@ QString QAccessibleToolButton::text(Text t, int child) const QString str; switch (t) { case Name: - str = toolButton()->text(); + str = toolButton()->accessibleName(); if (str.isEmpty()) str = toolButton()->text(); break; -- cgit v0.12 From df73b1a324cbdadae9e4128879fdaa65dd7d2a77 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 16 May 2011 18:02:58 +0200 Subject: Fix a problem where the video would'nt show on some containers The problem was linked to the detection of a video stream in the graph. Only the decoders were tested but the demuxer can directly provide the video stream. Reviewed-By: TrustMe Task-Number: QTBUG-19348 --- src/3rdparty/phonon/ds9/mediagraph.cpp | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/3rdparty/phonon/ds9/mediagraph.cpp b/src/3rdparty/phonon/ds9/mediagraph.cpp index 3e7a68b..153cd7e 100644 --- a/src/3rdparty/phonon/ds9/mediagraph.cpp +++ b/src/3rdparty/phonon/ds9/mediagraph.cpp @@ -781,6 +781,23 @@ namespace Phonon } } + const QList demuxOutputs = BackendNode::pins(m_demux, PINDIR_OUTPUT); + for (int i = 0; i < demuxOutputs.count(); ++i) { + //...and the output must be decoded + QAMMediaType type; + hr = demuxOutputs.at(i)->ConnectionMediaType(&type); + if (FAILED(hr)) { + continue; + } + + if (type.majortype == MEDIATYPE_Video) { + m_hasVideo = true; + } else if (type.majortype == MEDIATYPE_Audio) { + m_hasAudio = true; + } + } + + for (int i = 0; i < m_decoders.count(); ++i) { QList chain = getFilterChain(m_demux, m_decoders.at(i)); for (int i = 0; i < chain.count(); ++i) { @@ -806,14 +823,11 @@ namespace Phonon } //we need to do something smart to detect if the streams are unencoded - if (m_demux) { - const QList outputs = BackendNode::pins(m_demux, PINDIR_OUTPUT); - for (int i = 0; i < outputs.count(); ++i) { - const OutputPin &out = outputs.at(i); - InputPin pin; - if (out->ConnectedTo(pin.pparam()) == HRESULT(VFW_E_NOT_CONNECTED)) { - m_decoderPins += out; //unconnected outputs can be decoded outputs - } + for (int i = 0; i < demuxOutputs.count(); ++i) { + const OutputPin &out = demuxOutputs.at(i); + InputPin pin; + if (out->ConnectedTo(pin.pparam()) == HRESULT(VFW_E_NOT_CONNECTED)) { + m_decoderPins += out; //unconnected outputs can be decoded outputs } } -- cgit v0.12 From b6a6953d21a95c402e8a5010c1ea5131509eeea3 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Wed, 18 May 2011 21:46:26 +0200 Subject: Remove more inconsistencies with invisible. Visible status should not influence child count and other properties. Reviewed-by: Jan-Arve --- src/plugins/accessible/widgets/rangecontrols.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/plugins/accessible/widgets/rangecontrols.cpp b/src/plugins/accessible/widgets/rangecontrols.cpp index 1f5407a..736ed88 100644 --- a/src/plugins/accessible/widgets/rangecontrols.cpp +++ b/src/plugins/accessible/widgets/rangecontrols.cpp @@ -83,8 +83,6 @@ QAbstractSpinBox *QAccessibleAbstractSpinBox::abstractSpinBox() const /*! \reimp */ int QAccessibleAbstractSpinBox::childCount() const { - if (!abstractSpinBox()->isVisible()) - return 0; return ValueDown; } @@ -344,8 +342,6 @@ QDoubleSpinBox *QAccessibleDoubleSpinBox::doubleSpinBox() const /*! \reimp */ int QAccessibleDoubleSpinBox::childCount() const { - if (!doubleSpinBox()->isVisible()) - return 0; return ValueDown; } @@ -410,8 +406,6 @@ QVariant QAccessibleDoubleSpinBox::invokeMethodEx(QAccessible::Method, int, cons /*! \reimp */ QString QAccessibleDoubleSpinBox::text(Text textType, int child) const { - if (!doubleSpinBox()->isVisible()) - return QString(); switch (textType) { case Name: if (child == ValueUp) @@ -540,16 +534,12 @@ QRect QAccessibleScrollBar::rect(int child) const /*! \reimp */ int QAccessibleScrollBar::childCount() const { - if (!scrollBar()->isVisible()) - return 0; return LineDown; } /*! \reimp */ QString QAccessibleScrollBar::text(Text t, int child) const { - if (!scrollBar()->isVisible()) - return QString(); switch (t) { case Value: if (!child || child == Position) @@ -698,16 +688,12 @@ QRect QAccessibleSlider::rect(int child) const /*! \reimp */ int QAccessibleSlider::childCount() const { - if (!slider()->isVisible()) - return 0; return PageRight; } /*! \reimp */ QString QAccessibleSlider::text(Text t, int child) const { - if (!slider()->isVisible()) - return QString(); switch (t) { case Value: if (!child || child == 2) @@ -932,15 +918,11 @@ QRect QAccessibleDial::rect(int child) const int QAccessibleDial::childCount() const { - if (!dial()->isVisible()) - return 0; return SliderHandle; } QString QAccessibleDial::text(Text textType, int child) const { - if (!dial()->isVisible()) - return QString(); if (textType == Value && child >= Self && child <= SliderHandle) return QString::number(dial()->value()); if (textType == Name) { -- cgit v0.12 From a816cb0d26ebcef54e9e61c72455509edf6c44b9 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Wed, 18 May 2011 18:20:38 +0200 Subject: When asking for relations, don't crash on children that don't return an interface. Reviewed-by: Jan-Arve --- src/gui/accessible/qaccessiblewidget.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/accessible/qaccessiblewidget.cpp b/src/gui/accessible/qaccessiblewidget.cpp index 2b2cec0..52aab32 100644 --- a/src/gui/accessible/qaccessiblewidget.cpp +++ b/src/gui/accessible/qaccessiblewidget.cpp @@ -704,13 +704,16 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry, int sibCount = pIface->childCount(); QAccessibleInterface *candidate = 0; for (int i = 0; i < sibCount && entry; ++i) { - pIface->navigate(Child, i+1, &candidate); - Q_ASSERT(candidate); - if (candidate->relationTo(0, this, 0) & Label) + const int childId = pIface->navigate(Child, i+1, &candidate); + Q_ASSERT(childId >= 0); + if (childId > 0) + candidate = pIface; + if (candidate->relationTo(childId, this, 0) & Label) --entry; if (!entry) break; - delete candidate; + if (candidate != pIface) + delete candidate; candidate = 0; } if (!candidate) { -- cgit v0.12 From f75fda0365a4e4bf1f26dedc40d96d37a2599174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Wed, 25 May 2011 13:42:48 +0200 Subject: DeclarativeObserver: Fixed duplicates in item selection Only add items to the current selection that aren't already part of it. Also removed checking item for null, since it doesn't make sense to include null pointers in the list of items to select. Task-number: QTCREATORBUG-3426 Change-Id: I5a365570f87f72665b3382d05ca9937f56e8956b Reviewed-by: Christiaan Janssen --- .../qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp b/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp index a49a758..bb23831 100644 --- a/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp +++ b/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp @@ -494,8 +494,8 @@ void QDeclarativeViewObserverPrivate::setSelectedItemsForTools(const QListtoGraphicsObject()) { + if (QGraphicsObject *obj = item->toGraphicsObject()) { + if (!currentSelection.contains(obj)) { QObject::connect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(_q_removeFromSelection(QObject*))); currentSelection.append(obj); -- cgit v0.12 From b9d5cb9334e7d9da71af169802a01f8d344151a7 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 30 May 2011 15:26:06 +1000 Subject: ListView segmentation fault when setting highlight to null Setting view highlight to null due to focus change caused a crash since graphicsview accessed the highlight item after it had been deleted. Remove highlight item from scene and deleteLater(), as is done for delegates. Change-Id: I5bfd59095aca90d3adca805bc4f61c92c192ee1b Task-number: QTBUG-19509 Reviewed-by: Bea Lam --- src/declarative/graphicsitems/qdeclarativegridview.cpp | 4 +++- src/declarative/graphicsitems/qdeclarativelistview.cpp | 4 +++- src/declarative/graphicsitems/qdeclarativepathview.cpp | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 34925f1..36f6e29 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -818,7 +818,9 @@ void QDeclarativeGridViewPrivate::createHighlight() if (highlight) { if (trackedItem == highlight) trackedItem = 0; - delete highlight->item; + if (highlight->item->scene()) + highlight->item->scene()->removeItem(highlight->item); + highlight->item->deleteLater(); delete highlight; highlight = 0; delete highlightXAnimator; diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index b52b6fc..225b031 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -943,7 +943,9 @@ void QDeclarativeListViewPrivate::createHighlight() if (highlight) { if (trackedItem == highlight) trackedItem = 0; - delete highlight->item; + if (highlight->item->scene()) + highlight->item->scene()->removeItem(highlight->item); + highlight->item->deleteLater(); delete highlight; highlight = 0; delete highlightPosAnimator; diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index 79e52cd..94f128d 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -203,7 +203,9 @@ void QDeclarativePathViewPrivate::createHighlight() bool changed = false; if (highlightItem) { - delete highlightItem; + if (highlightItem->scene()) + highlightItem->scene()->removeItem(highlightItem); + highlightItem->deleteLater(); highlightItem = 0; changed = true; } -- cgit v0.12 From 49a94f19b6a4407df42b8462e52922bec42de1ba Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Mon, 30 May 2011 09:14:38 +0200 Subject: qmlplugindump: Fix --path usage with drive letters on Windows. Since we can't import by such a path, we instead use a "." import and set the uri of the component to the correct path. Mirrors a change to qmldump in qt-creator/0c8b4e38fab1862e3427aac7e7db68623bc7f174 Reviewed-by: Thomas Hartmann (cherry picked from commit 3904e604f453b43b2a0e45a882283e26a27eaa18) --- tools/qmlplugindump/main.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index 5667c7a..03bc313 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -65,6 +65,8 @@ #include #endif +QString pluginImportPath; + void collectReachableMetaObjects(const QMetaObject *meta, QSet *metas) { if (! meta || metas->contains(meta)) @@ -194,7 +196,7 @@ QSet collectReachableMetaObjects(const QString &importCode, code += " {}\n"; QDeclarativeComponent c(engine); - c.setData(code, QUrl("typeinstance")); + c.setData(code, QUrl::fromLocalFile(pluginImportPath + "/typeinstance.qml")); QObject *object = c.create(); if (object) @@ -451,7 +453,6 @@ int main(int argc, char *argv[]) QString pluginImportUri; QString pluginImportVersion; - QString pluginImportPath; bool relocatable = true; bool pathImport = false; if (args.size() >= 3) { @@ -488,7 +489,7 @@ int main(int argc, char *argv[]) qWarning() << "Incorrect number of positional arguments"; return EXIT_INVALIDARGUMENTS; } - pluginImportPath = positionalArgs[1]; + pluginImportPath = QDir::fromNativeSeparators(positionalArgs[1]); if (positionalArgs.size() == 3) pluginImportVersion = positionalArgs[2]; } @@ -514,7 +515,7 @@ int main(int argc, char *argv[]) importCode += QString("import %0 %1\n").arg(pluginImportUri, pluginImportVersion).toAscii(); } else { // pluginImportVersion can be empty - importCode += QString("import \"%1\" %2\n").arg(pluginImportPath, pluginImportVersion).toAscii(); + importCode += QString("import \".\" %2\n").arg(pluginImportVersion).toAscii(); } // create a component with these imports to make sure the imports are valid @@ -524,7 +525,7 @@ int main(int argc, char *argv[]) code += "QtObject {}"; QDeclarativeComponent c(engine); - c.setData(code, QUrl("typelist")); + c.setData(code, QUrl::fromLocalFile(pluginImportPath + "/typelist.qml")); c.create(); if (!c.errors().isEmpty()) { foreach (const QDeclarativeError &error, c.errors()) -- cgit v0.12 From b0392d398e2f28682cdce6e85546d38a838440f7 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Mon, 30 May 2011 09:24:20 +0200 Subject: qmlplugindump: Dump revision property. Mirrors a change to qmldump in qt-creator/6e3274240077fc356a37d3de735b3b2da9654d2e Reviewed-by: Roberto Raggi --- tools/qmlplugindump/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index 03bc313..acc1b19 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -336,6 +336,10 @@ private: qml->writeStartObject("Property"); qml->writeScriptBinding(QLatin1String("name"), enquote(QString::fromUtf8(prop.name()))); +#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 4)) + if (int revision = prop.revision()) + qml->writeScriptBinding(QLatin1String("revision"), QString::number(revision)); +#endif writeTypeProperties(prop.typeName(), prop.isWritable()); qml->writeEndObject(); @@ -364,6 +368,11 @@ private: qml->writeScriptBinding(QLatin1String("name"), enquote(name)); +#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 4)) + if (int revision = meth.revision()) + qml->writeScriptBinding(QLatin1String("revision"), QString::number(revision)); +#endif + const QString typeName = convertToId(meth.typeName()); if (! typeName.isEmpty()) qml->writeScriptBinding(QLatin1String("type"), enquote(typeName)); -- cgit v0.12 From 10f16bc55b9e5535bc3353260f97a32e18d70cf1 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Mon, 30 May 2011 10:20:29 +0200 Subject: qmlplugindump: Bump QtQuick.tooling version to 1.1. Mirrors a change to qmlplugindump in qtcreator/715cee76a9e46efb7f8245004aaa8a1c47b1618d Reviewed-by: Kai Koehne --- tools/qmlplugindump/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index acc1b19..f398358 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -510,7 +510,7 @@ int main(int argc, char *argv[]) engine->addImportPath(pluginImportPath); // find all QMetaObjects reachable from the builtin module - QByteArray importCode("import QtQuick 1.0\n"); + QByteArray importCode("import QtQuick 1.1\n"); QSet defaultReachable = collectReachableMetaObjects(importCode, engine); // this will hold the meta objects we want to dump information of -- cgit v0.12 From a5926145407103ed2e3e6ee0369358709a50c551 Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Fri, 15 Apr 2011 16:26:44 +0200 Subject: QmlDebugger: parsing packets iteratively in the communication protocol Reviewed-by: Kai Koehne (reapplied commit fea13a449c59690ae7b7f43aa64f50c0a290a2cf from qtcreator) Change-Id: I0c78188994029b2ac7daa3d59182566c5ec6c8b5 --- src/declarative/debugger/qpacketprotocol.cpp | 73 +++++++++++++--------------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/src/declarative/debugger/qpacketprotocol.cpp b/src/declarative/debugger/qpacketprotocol.cpp index c24df61..77c5f44 100644 --- a/src/declarative/debugger/qpacketprotocol.cpp +++ b/src/declarative/debugger/qpacketprotocol.cpp @@ -164,47 +164,44 @@ public Q_SLOTS: void readyToRead() { - if(-1 == inProgressSize) { - // We need a size header of sizeof(qint32) - if(sizeof(qint32) > (uint)dev->bytesAvailable()) - return; - - // Read size header - int read = dev->read((char *)&inProgressSize, sizeof(qint32)); - Q_ASSERT(read == sizeof(qint32)); - Q_UNUSED(read); - - // Check sizing constraints - if(inProgressSize > maxPacketSize) { - QObject::disconnect(dev, SIGNAL(readyRead()), - this, SLOT(readyToRead())); - QObject::disconnect(dev, SIGNAL(aboutToClose()), - this, SLOT(aboutToClose())); - QObject::disconnect(dev, SIGNAL(bytesWritten(qint64)), - this, SLOT(bytesWritten(qint64))); - dev = 0; - emit invalidPacket(); - return; - } - - inProgressSize -= sizeof(qint32); - + while (true) { // Need to get trailing data - readyToRead(); - } else { - inProgress.append(dev->read(inProgressSize - inProgress.size())); - - if(inProgressSize == inProgress.size()) { - // Packet has arrived! - packets.append(inProgress); - inProgressSize = -1; - inProgress.clear(); + if (-1 == inProgressSize) { + // We need a size header of sizeof(qint32) + if (sizeof(qint32) > (uint)dev->bytesAvailable()) + return; + + // Read size header + int read = dev->read((char *)&inProgressSize, sizeof(qint32)); + Q_ASSERT(read == sizeof(qint32)); + Q_UNUSED(read); + + // Check sizing constraints + if (inProgressSize > maxPacketSize) { + QObject::disconnect(dev, SIGNAL(readyRead()), + this, SLOT(readyToRead())); + QObject::disconnect(dev, SIGNAL(aboutToClose()), + this, SLOT(aboutToClose())); + QObject::disconnect(dev, SIGNAL(bytesWritten(qint64)), + this, SLOT(bytesWritten(qint64))); + dev = 0; + emit invalidPacket(); + return; + } + + inProgressSize -= sizeof(qint32); + } else { + inProgress.append(dev->read(inProgressSize - inProgress.size())); - emit readyRead(); - waitingForPacket = false; + if (inProgressSize == inProgress.size()) { + // Packet has arrived! + packets.append(inProgress); + inProgressSize = -1; + inProgress.clear(); - // Need to get trailing data - readyToRead(); + emit readyRead(); + } else + return; } } } -- cgit v0.12 From f564f2786ddea1cf9bdc5cceee68ff206f0c5c69 Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Fri, 27 May 2011 17:40:16 +0200 Subject: QmlDebugger: adding slots to items in Live Preview Reviewed-by: Kai Koehne (reapplied commit 89d9b83aa26db4f528250c3fe4716b81955c6929 from qtcreator) Change-Id: I4cbfba2e854dd98a4e1012c71c40520f57fa9664 --- src/declarative/debugger/qdeclarativedebug.cpp | 5 +++-- src/declarative/debugger/qdeclarativedebug_p.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/declarative/debugger/qdeclarativedebug.cpp b/src/declarative/debugger/qdeclarativedebug.cpp index 32c2b47..620ee1d 100644 --- a/src/declarative/debugger/qdeclarativedebug.cpp +++ b/src/declarative/debugger/qdeclarativedebug.cpp @@ -638,14 +638,15 @@ QDeclarativeDebugExpressionQuery *QDeclarativeEngineDebug::queryExpressionResult bool QDeclarativeEngineDebug::setBindingForObject(int objectDebugId, const QString &propertyName, const QVariant &bindingExpression, - bool isLiteralValue) + bool isLiteralValue, + QString source, int line) { Q_D(QDeclarativeEngineDebug); if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) { QByteArray message; QDataStream ds(&message, QIODevice::WriteOnly); - ds << QByteArray("SET_BINDING") << objectDebugId << propertyName << bindingExpression << isLiteralValue; + ds << QByteArray("SET_BINDING") << objectDebugId << propertyName << bindingExpression << isLiteralValue << source << line; d->client->sendMessage(message); return true; } else { diff --git a/src/declarative/debugger/qdeclarativedebug_p.h b/src/declarative/debugger/qdeclarativedebug_p.h index ae92d6a..f822637 100644 --- a/src/declarative/debugger/qdeclarativedebug_p.h +++ b/src/declarative/debugger/qdeclarativedebug_p.h @@ -101,7 +101,8 @@ public: const QString &expr, QObject *parent = 0); bool setBindingForObject(int objectDebugId, const QString &propertyName, - const QVariant &bindingExpression, bool isLiteralValue); + const QVariant &bindingExpression, bool isLiteralValue, + QString source = QString(), int line = -1); bool resetBindingForObject(int objectDebugId, const QString &propertyName); bool setMethodBody(int objectDebugId, const QString &methodName, const QString &methodBody); -- cgit v0.12 From 206ebd5af21d94c3f3b49d2cb645105a63e6f5fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Mon, 30 May 2011 12:51:45 +0200 Subject: Renamed declarativeobserver plugin to qmldbg_inspector Mainly since it's a good idea to prefix the plugin on Symbian, and at the same time it's now consistency called 'inspector' rather than 'observer'. Symbian .def files will need to be updated. Change-Id: I43071331c8002f8844efd14105d01c730d97e946 Reviewed-by: Kai Koehne --- src/declarative/debugger/debugger.pri | 6 +- .../debugger/qdeclarativeinspectorinterface_p.h | 69 ++ .../debugger/qdeclarativeinspectorservice.cpp | 137 +++ .../debugger/qdeclarativeinspectorservice_p.h | 91 ++ .../debugger/qdeclarativeobserverinterface_p.h | 69 -- .../debugger/qdeclarativeobserverservice.cpp | 137 --- .../debugger/qdeclarativeobserverservice_p.h | 91 -- src/declarative/util/qdeclarativeview.cpp | 6 +- .../declarativeobserver/declarativeobserver.pro | 51 - .../editor/abstractliveedittool.cpp | 195 ---- .../editor/abstractliveedittool_p.h | 119 --- .../editor/boundingrecthighlighter.cpp | 282 ------ .../editor/boundingrecthighlighter_p.h | 126 --- .../declarativeobserver/editor/colorpickertool.cpp | 131 --- .../declarativeobserver/editor/colorpickertool_p.h | 99 -- .../declarativeobserver/editor/editor.qrc | 24 - .../editor/images/color-picker-24.png | Bin 3440 -> 0 bytes .../editor/images/color-picker-hicontrast.png | Bin 3192 -> 0 bytes .../editor/images/color-picker.png | Bin 3173 -> 0 bytes .../editor/images/from-qml-24.png | Bin 3395 -> 0 bytes .../declarativeobserver/editor/images/from-qml.png | Bin 3205 -> 0 bytes .../editor/images/observermode-24.png | Bin 1283 -> 0 bytes .../editor/images/observermode.png | Bin 3539 -> 0 bytes .../declarativeobserver/editor/images/pause-24.png | Bin 3307 -> 0 bytes .../declarativeobserver/editor/images/pause.png | Bin 3097 -> 0 bytes .../declarativeobserver/editor/images/play-24.png | Bin 3655 -> 0 bytes .../declarativeobserver/editor/images/play.png | Bin 3363 -> 0 bytes .../declarativeobserver/editor/images/reload.png | Bin 3418 -> 0 bytes .../editor/images/resize_handle.png | Bin 160 -> 0 bytes .../editor/images/select-24.png | Bin 3510 -> 0 bytes .../editor/images/select-marquee-24.png | Bin 2891 -> 0 bytes .../editor/images/select-marquee.png | Bin 2871 -> 0 bytes .../declarativeobserver/editor/images/select.png | Bin 3308 -> 0 bytes .../editor/images/to-qml-24.png | Bin 3407 -> 0 bytes .../declarativeobserver/editor/images/to-qml.png | Bin 3227 -> 0 bytes .../declarativeobserver/editor/images/zoom-24.png | Bin 3566 -> 0 bytes .../declarativeobserver/editor/images/zoom.png | Bin 3347 -> 0 bytes .../declarativeobserver/editor/livelayeritem.cpp | 92 -- .../declarativeobserver/editor/livelayeritem_p.h | 73 -- .../editor/liverubberbandselectionmanipulator.cpp | 165 ---- .../editor/liverubberbandselectionmanipulator_p.h | 102 -- .../editor/liveselectionindicator.cpp | 117 --- .../editor/liveselectionindicator_p.h | 86 -- .../editor/liveselectionrectangle.cpp | 113 --- .../editor/liveselectionrectangle_p.h | 83 -- .../editor/liveselectiontool.cpp | 438 --------- .../editor/liveselectiontool_p.h | 126 --- .../editor/livesingleselectionmanipulator.cpp | 151 --- .../editor/livesingleselectionmanipulator_p.h | 95 -- .../declarativeobserver/editor/qmltoolbar.cpp | 328 ------- .../declarativeobserver/editor/qmltoolbar_p.h | 138 --- .../editor/subcomponentmasklayeritem.cpp | 130 --- .../editor/subcomponentmasklayeritem_p.h | 77 -- .../declarativeobserver/editor/toolbarcolorbox.cpp | 134 --- .../declarativeobserver/editor/toolbarcolorbox_p.h | 87 -- .../declarativeobserver/editor/zoomtool.cpp | 336 ------- .../declarativeobserver/editor/zoomtool_p.h | 113 --- .../qdeclarativeobserverplugin.cpp | 81 -- .../qdeclarativeobserverplugin.h | 71 -- .../qdeclarativeobserverprotocol.h | 143 --- .../qdeclarativeviewobserver.cpp | 1021 -------------------- .../qdeclarativeviewobserver_p.h | 147 --- .../qdeclarativeviewobserver_p_p.h | 152 --- .../declarativeobserver/qmlobserverconstants_p.h | 90 -- .../editor/abstractliveedittool.cpp | 195 ++++ .../editor/abstractliveedittool_p.h | 119 +++ .../editor/boundingrecthighlighter.cpp | 282 ++++++ .../editor/boundingrecthighlighter_p.h | 126 +++ .../qmldbg_inspector/editor/colorpickertool.cpp | 131 +++ .../qmldbg_inspector/editor/colorpickertool_p.h | 99 ++ .../qmltooling/qmldbg_inspector/editor/editor.qrc | 24 + .../editor/images/color-picker-24.png | Bin 0 -> 3440 bytes .../editor/images/color-picker-hicontrast.png | Bin 0 -> 3192 bytes .../editor/images/color-picker.png | Bin 0 -> 3173 bytes .../qmldbg_inspector/editor/images/from-qml-24.png | Bin 0 -> 3395 bytes .../qmldbg_inspector/editor/images/from-qml.png | Bin 0 -> 3205 bytes .../editor/images/inspectormode-24.png | Bin 0 -> 1283 bytes .../editor/images/inspectormode.png | Bin 0 -> 3539 bytes .../qmldbg_inspector/editor/images/pause-24.png | Bin 0 -> 3307 bytes .../qmldbg_inspector/editor/images/pause.png | Bin 0 -> 3097 bytes .../qmldbg_inspector/editor/images/play-24.png | Bin 0 -> 3655 bytes .../qmldbg_inspector/editor/images/play.png | Bin 0 -> 3363 bytes .../qmldbg_inspector/editor/images/reload.png | Bin 0 -> 3418 bytes .../editor/images/resize_handle.png | Bin 0 -> 160 bytes .../qmldbg_inspector/editor/images/select-24.png | Bin 0 -> 3510 bytes .../editor/images/select-marquee-24.png | Bin 0 -> 2891 bytes .../editor/images/select-marquee.png | Bin 0 -> 2871 bytes .../qmldbg_inspector/editor/images/select.png | Bin 0 -> 3308 bytes .../qmldbg_inspector/editor/images/to-qml-24.png | Bin 0 -> 3407 bytes .../qmldbg_inspector/editor/images/to-qml.png | Bin 0 -> 3227 bytes .../qmldbg_inspector/editor/images/zoom-24.png | Bin 0 -> 3566 bytes .../qmldbg_inspector/editor/images/zoom.png | Bin 0 -> 3347 bytes .../qmldbg_inspector/editor/livelayeritem.cpp | 92 ++ .../qmldbg_inspector/editor/livelayeritem_p.h | 73 ++ .../editor/liverubberbandselectionmanipulator.cpp | 165 ++++ .../editor/liverubberbandselectionmanipulator_p.h | 102 ++ .../editor/liveselectionindicator.cpp | 117 +++ .../editor/liveselectionindicator_p.h | 86 ++ .../editor/liveselectionrectangle.cpp | 113 +++ .../editor/liveselectionrectangle_p.h | 83 ++ .../qmldbg_inspector/editor/liveselectiontool.cpp | 438 +++++++++ .../qmldbg_inspector/editor/liveselectiontool_p.h | 126 +++ .../editor/livesingleselectionmanipulator.cpp | 151 +++ .../editor/livesingleselectionmanipulator_p.h | 95 ++ .../qmldbg_inspector/editor/qmltoolbar.cpp | 328 +++++++ .../qmldbg_inspector/editor/qmltoolbar_p.h | 138 +++ .../editor/subcomponentmasklayeritem.cpp | 130 +++ .../editor/subcomponentmasklayeritem_p.h | 77 ++ .../qmldbg_inspector/editor/toolbarcolorbox.cpp | 134 +++ .../qmldbg_inspector/editor/toolbarcolorbox_p.h | 87 ++ .../qmldbg_inspector/editor/zoomtool.cpp | 336 +++++++ .../qmldbg_inspector/editor/zoomtool_p.h | 113 +++ .../qdeclarativeinspectorplugin.cpp | 81 ++ .../qmldbg_inspector/qdeclarativeinspectorplugin.h | 71 ++ .../qdeclarativeinspectorprotocol.h | 143 +++ .../qmldbg_inspector/qdeclarativeviewinspector.cpp | 1021 ++++++++++++++++++++ .../qmldbg_inspector/qdeclarativeviewinspector_p.h | 147 +++ .../qdeclarativeviewinspector_p_p.h | 152 +++ .../qmldbg_inspector/qmldbg_inspector.pro | 51 + .../qmldbg_inspector/qmlinspectorconstants_p.h | 90 ++ src/plugins/qmltooling/qmltooling.pro | 2 +- 121 files changed, 6020 insertions(+), 6020 deletions(-) create mode 100644 src/declarative/debugger/qdeclarativeinspectorinterface_p.h create mode 100644 src/declarative/debugger/qdeclarativeinspectorservice.cpp create mode 100644 src/declarative/debugger/qdeclarativeinspectorservice_p.h delete mode 100644 src/declarative/debugger/qdeclarativeobserverinterface_p.h delete mode 100644 src/declarative/debugger/qdeclarativeobserverservice.cpp delete mode 100644 src/declarative/debugger/qdeclarativeobserverservice_p.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/declarativeobserver.pro delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/abstractliveedittool.cpp delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/abstractliveedittool_p.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/boundingrecthighlighter.cpp delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/boundingrecthighlighter_p.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/colorpickertool.cpp delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/colorpickertool_p.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/editor.qrc delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/color-picker-24.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/color-picker-hicontrast.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/color-picker.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/from-qml-24.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/from-qml.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/observermode-24.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/observermode.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/pause-24.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/pause.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/play-24.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/play.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/reload.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/resize_handle.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/select-24.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/select-marquee-24.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/select-marquee.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/select.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/to-qml-24.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/to-qml.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/zoom-24.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/images/zoom.png delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/livelayeritem.cpp delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/livelayeritem_p.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/liverubberbandselectionmanipulator.cpp delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/liverubberbandselectionmanipulator_p.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/liveselectionindicator.cpp delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/liveselectionindicator_p.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/liveselectionrectangle.cpp delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/liveselectionrectangle_p.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/liveselectiontool.cpp delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/liveselectiontool_p.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/livesingleselectionmanipulator.cpp delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/livesingleselectionmanipulator_p.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/qmltoolbar.cpp delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/qmltoolbar_p.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/subcomponentmasklayeritem.cpp delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/subcomponentmasklayeritem_p.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/toolbarcolorbox.cpp delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/toolbarcolorbox_p.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/zoomtool.cpp delete mode 100644 src/plugins/qmltooling/declarativeobserver/editor/zoomtool_p.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverplugin.cpp delete mode 100644 src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverplugin.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverprotocol.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp delete mode 100644 src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver_p.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver_p_p.h delete mode 100644 src/plugins/qmltooling/declarativeobserver/qmlobserverconstants_p.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool.cpp create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool_p.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.cpp create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter_p.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool_p.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/editor.qrc create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-24.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-hicontrast.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml-24.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode-24.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/pause-24.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/pause.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/play-24.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/play.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/reload.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/resize_handle.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/select-24.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee-24.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/select.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml-24.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom-24.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom.png create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem.cpp create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem_p.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator.cpp create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator_p.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator_p.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.cpp create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle_p.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool_p.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator.cpp create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator_p.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar.cpp create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar_p.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem.cpp create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem_p.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox.cpp create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox_p.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.cpp create mode 100644 src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool_p.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.cpp create mode 100644 src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorprotocol.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp create mode 100644 src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p_p.h create mode 100644 src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro create mode 100644 src/plugins/qmltooling/qmldbg_inspector/qmlinspectorconstants_p.h diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri index 044db3c..3134c79 100644 --- a/src/declarative/debugger/debugger.pri +++ b/src/declarative/debugger/debugger.pri @@ -9,7 +9,7 @@ SOURCES += \ $$PWD/qdeclarativedebugtrace.cpp \ $$PWD/qdeclarativedebughelper.cpp \ $$PWD/qdeclarativedebugserver.cpp \ - $$PWD/qdeclarativeobserverservice.cpp \ + $$PWD/qdeclarativeinspectorservice.cpp \ $$PWD/qjsdebuggeragent.cpp \ $$PWD/qjsdebugservice.cpp @@ -24,7 +24,7 @@ HEADERS += \ $$PWD/qdeclarativedebughelper_p.h \ $$PWD/qdeclarativedebugserver_p.h \ $$PWD/qdeclarativedebugserverconnection_p.h \ - $$PWD/qdeclarativeobserverservice_p.h \ - $$PWD/qdeclarativeobserverinterface_p.h \ + $$PWD/qdeclarativeinspectorservice_p.h \ + $$PWD/qdeclarativeinspectorinterface_p.h \ $$PWD/qjsdebuggeragent_p.h \ $$PWD/qjsdebugservice_p.h diff --git a/src/declarative/debugger/qdeclarativeinspectorinterface_p.h b/src/declarative/debugger/qdeclarativeinspectorinterface_p.h new file mode 100644 index 0000000..aa29d68 --- /dev/null +++ b/src/declarative/debugger/qdeclarativeinspectorinterface_p.h @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEOBSERVERINTERFACE_H +#define QDECLARATIVEOBSERVERINTERFACE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class Q_DECLARATIVE_EXPORT QDeclarativeInspectorInterface +{ +public: + QDeclarativeInspectorInterface() {} + virtual ~QDeclarativeInspectorInterface() {} + + virtual void activate() = 0; + virtual void deactivate() = 0; +}; + +Q_DECLARE_INTERFACE(QDeclarativeInspectorInterface, "com.trolltech.Qt.QDeclarativeInspectorInterface/1.0") + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QDECLARATIVEOBSERVERINTERFACE_H diff --git a/src/declarative/debugger/qdeclarativeinspectorservice.cpp b/src/declarative/debugger/qdeclarativeinspectorservice.cpp new file mode 100644 index 0000000..9fec006 --- /dev/null +++ b/src/declarative/debugger/qdeclarativeinspectorservice.cpp @@ -0,0 +1,137 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "private/qdeclarativeinspectorservice_p.h" +#include "private/qdeclarativeinspectorinterface_p.h" + +#include +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +Q_GLOBAL_STATIC(QDeclarativeInspectorService, serviceInstance) + +QDeclarativeInspectorService::QDeclarativeInspectorService() + : QDeclarativeDebugService(QLatin1String("QDeclarativeObserverMode")) + , m_inspectorPlugin(0) +{ +} + +QDeclarativeInspectorService *QDeclarativeInspectorService::instance() +{ + return serviceInstance(); +} + +void QDeclarativeInspectorService::addView(QDeclarativeView *view) +{ + m_views.append(view); +} + +void QDeclarativeInspectorService::removeView(QDeclarativeView *view) +{ + m_views.removeAll(view); +} + +void QDeclarativeInspectorService::sendMessage(const QByteArray &message) +{ + if (status() != Enabled) + return; + + QDeclarativeDebugService::sendMessage(message); +} + +void QDeclarativeInspectorService::statusChanged(Status status) +{ + if (m_views.isEmpty()) + return; + + if (status == Enabled) { + if (!m_inspectorPlugin) + m_inspectorPlugin = loadInspectorPlugin(); + + if (!m_inspectorPlugin) { + qWarning() << "Error while loading inspector plugin"; + return; + } + + m_inspectorPlugin->activate(); + } else { + if (m_inspectorPlugin) + m_inspectorPlugin->deactivate(); + } +} + +void QDeclarativeInspectorService::messageReceived(const QByteArray &message) +{ + emit gotMessage(message); +} + +QDeclarativeInspectorInterface *QDeclarativeInspectorService::loadInspectorPlugin() +{ + QStringList pluginCandidates; + const QStringList paths = QCoreApplication::libraryPaths(); + foreach (const QString &libPath, paths) { + const QDir dir(libPath + QLatin1String("/qmltooling")); + if (dir.exists()) + foreach (const QString &pluginPath, dir.entryList(QDir::Files)) + pluginCandidates << dir.absoluteFilePath(pluginPath); + } + + foreach (const QString &pluginPath, pluginCandidates) { + QPluginLoader loader(pluginPath); + if (!loader.load()) + continue; + + QDeclarativeInspectorInterface *inspector = + qobject_cast(loader.instance()); + + if (inspector) + return inspector; + loader.unload(); + } + return 0; +} + +QT_END_NAMESPACE diff --git a/src/declarative/debugger/qdeclarativeinspectorservice_p.h b/src/declarative/debugger/qdeclarativeinspectorservice_p.h new file mode 100644 index 0000000..9fe0d601f --- /dev/null +++ b/src/declarative/debugger/qdeclarativeinspectorservice_p.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEOBSERVERSERVICE_H +#define QDECLARATIVEOBSERVERSERVICE_H + +#include "private/qdeclarativedebugservice_p.h" +#include + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QDeclarativeView; +class QDeclarativeInspectorInterface; + +class Q_DECLARATIVE_EXPORT QDeclarativeInspectorService : public QDeclarativeDebugService +{ + Q_OBJECT + +public: + QDeclarativeInspectorService(); + static QDeclarativeInspectorService *instance(); + + void addView(QDeclarativeView *); + void removeView(QDeclarativeView *); + QList views() const { return m_views; } + + void sendMessage(const QByteArray &message); + +Q_SIGNALS: + void gotMessage(const QByteArray &message); + +protected: + virtual void statusChanged(Status status); + virtual void messageReceived(const QByteArray &); + +private: + static QDeclarativeInspectorInterface *loadInspectorPlugin(); + + QList m_views; + QDeclarativeInspectorInterface *m_inspectorPlugin; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QDECLARATIVEOBSERVERSERVICE_H diff --git a/src/declarative/debugger/qdeclarativeobserverinterface_p.h b/src/declarative/debugger/qdeclarativeobserverinterface_p.h deleted file mode 100644 index efb47fa..0000000 --- a/src/declarative/debugger/qdeclarativeobserverinterface_p.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QDECLARATIVEOBSERVERINTERFACE_H -#define QDECLARATIVEOBSERVERINTERFACE_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class Q_DECLARATIVE_EXPORT QDeclarativeObserverInterface -{ -public: - QDeclarativeObserverInterface() {} - virtual ~QDeclarativeObserverInterface() {} - - virtual void activate() = 0; - virtual void deactivate() = 0; -}; - -Q_DECLARE_INTERFACE(QDeclarativeObserverInterface, "com.trolltech.Qt.QDeclarativeObserverInterface/1.0") - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QDECLARATIVEOBSERVERINTERFACE_H diff --git a/src/declarative/debugger/qdeclarativeobserverservice.cpp b/src/declarative/debugger/qdeclarativeobserverservice.cpp deleted file mode 100644 index 43d9281..0000000 --- a/src/declarative/debugger/qdeclarativeobserverservice.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "private/qdeclarativeobserverservice_p.h" -#include "private/qdeclarativeobserverinterface_p.h" - -#include -#include -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -Q_GLOBAL_STATIC(QDeclarativeObserverService, serviceInstance) - -QDeclarativeObserverService::QDeclarativeObserverService() - : QDeclarativeDebugService(QLatin1String("QDeclarativeObserverMode")) - , m_observer(0) -{ -} - -QDeclarativeObserverService *QDeclarativeObserverService::instance() -{ - return serviceInstance(); -} - -void QDeclarativeObserverService::addView(QDeclarativeView *view) -{ - m_views.append(view); -} - -void QDeclarativeObserverService::removeView(QDeclarativeView *view) -{ - m_views.removeAll(view); -} - -void QDeclarativeObserverService::sendMessage(const QByteArray &message) -{ - if (status() != Enabled) - return; - - QDeclarativeDebugService::sendMessage(message); -} - -void QDeclarativeObserverService::statusChanged(Status status) -{ - if (m_views.isEmpty()) - return; - - if (status == Enabled) { - if (!m_observer) - m_observer = loadObserverPlugin(); - - if (!m_observer) { - qWarning() << "Error while loading observer plugin"; - return; - } - - m_observer->activate(); - } else { - if (m_observer) - m_observer->deactivate(); - } -} - -void QDeclarativeObserverService::messageReceived(const QByteArray &message) -{ - emit gotMessage(message); -} - -QDeclarativeObserverInterface *QDeclarativeObserverService::loadObserverPlugin() -{ - QStringList pluginCandidates; - const QStringList paths = QCoreApplication::libraryPaths(); - foreach (const QString &libPath, paths) { - const QDir dir(libPath + QLatin1String("/qmltooling")); - if (dir.exists()) - foreach (const QString &pluginPath, dir.entryList(QDir::Files)) - pluginCandidates << dir.absoluteFilePath(pluginPath); - } - - foreach (const QString &pluginPath, pluginCandidates) { - QPluginLoader loader(pluginPath); - if (!loader.load()) - continue; - - QDeclarativeObserverInterface *observer = - qobject_cast(loader.instance()); - - if (observer) - return observer; - loader.unload(); - } - return 0; -} - -QT_END_NAMESPACE diff --git a/src/declarative/debugger/qdeclarativeobserverservice_p.h b/src/declarative/debugger/qdeclarativeobserverservice_p.h deleted file mode 100644 index c883d4b..0000000 --- a/src/declarative/debugger/qdeclarativeobserverservice_p.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QDECLARATIVEOBSERVERSERVICE_H -#define QDECLARATIVEOBSERVERSERVICE_H - -#include "private/qdeclarativedebugservice_p.h" -#include - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QDeclarativeView; -class QDeclarativeObserverInterface; - -class Q_DECLARATIVE_EXPORT QDeclarativeObserverService : public QDeclarativeDebugService -{ - Q_OBJECT - -public: - QDeclarativeObserverService(); - static QDeclarativeObserverService *instance(); - - void addView(QDeclarativeView *); - void removeView(QDeclarativeView *); - QList views() const { return m_views; } - - void sendMessage(const QByteArray &message); - -Q_SIGNALS: - void gotMessage(const QByteArray &message); - -protected: - virtual void statusChanged(Status status); - virtual void messageReceived(const QByteArray &); - -private: - static QDeclarativeObserverInterface *loadObserverPlugin(); - - QList m_views; - QDeclarativeObserverInterface *m_observer; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QDECLARATIVEOBSERVERSERVICE_H diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index f6be2d7..bab991b 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -49,7 +49,7 @@ #include #include -#include +#include #include #include @@ -301,7 +301,7 @@ void QDeclarativeViewPrivate::init() q->viewport()->setAttribute(Qt::WA_NoSystemBackground); #endif - QDeclarativeObserverService::instance()->addView(q); + QDeclarativeInspectorService::instance()->addView(q); } /*! @@ -309,7 +309,7 @@ void QDeclarativeViewPrivate::init() */ QDeclarativeView::~QDeclarativeView() { - QDeclarativeObserverService::instance()->removeView(this); + QDeclarativeInspectorService::instance()->removeView(this); } /*! \property QDeclarativeView::source diff --git a/src/plugins/qmltooling/declarativeobserver/declarativeobserver.pro b/src/plugins/qmltooling/declarativeobserver/declarativeobserver.pro deleted file mode 100644 index e7a69f2..0000000 --- a/src/plugins/qmltooling/declarativeobserver/declarativeobserver.pro +++ /dev/null @@ -1,51 +0,0 @@ -TARGET = declarativeobserver -QT += declarative - -include(../../qpluginbase.pri) - -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/qmltooling -QTDIR_build:REQUIRES += "contains(QT_CONFIG, declarative)" - -SOURCES += \ - qdeclarativeobserverplugin.cpp \ - qdeclarativeviewobserver.cpp \ - editor/abstractliveedittool.cpp \ - editor/liveselectiontool.cpp \ - editor/livelayeritem.cpp \ - editor/livesingleselectionmanipulator.cpp \ - editor/liverubberbandselectionmanipulator.cpp \ - editor/liveselectionrectangle.cpp \ - editor/liveselectionindicator.cpp \ - editor/boundingrecthighlighter.cpp \ - editor/subcomponentmasklayeritem.cpp \ - editor/zoomtool.cpp \ - editor/colorpickertool.cpp \ - editor/qmltoolbar.cpp \ - editor/toolbarcolorbox.cpp - -HEADERS += \ - qdeclarativeobserverplugin.h \ - qdeclarativeobserverprotocol.h \ - qdeclarativeviewobserver_p.h \ - qdeclarativeviewobserver_p_p.h \ - qmlobserverconstants_p.h \ - editor/abstractliveedittool_p.h \ - editor/liveselectiontool_p.h \ - editor/livelayeritem_p.h \ - editor/livesingleselectionmanipulator_p.h \ - editor/liverubberbandselectionmanipulator_p.h \ - editor/liveselectionrectangle_p.h \ - editor/liveselectionindicator_p.h \ - editor/boundingrecthighlighter_p.h \ - editor/subcomponentmasklayeritem_p.h \ - editor/zoomtool_p.h \ - editor/colorpickertool_p.h \ - editor/qmltoolbar_p.h \ - editor/toolbarcolorbox_p.h - -RESOURCES += editor/editor.qrc - -target.path += $$[QT_INSTALL_PLUGINS]/qmltooling -INSTALLS += target - -symbian:TARGET.UID3=0x20031E90 diff --git a/src/plugins/qmltooling/declarativeobserver/editor/abstractliveedittool.cpp b/src/plugins/qmltooling/declarativeobserver/editor/abstractliveedittool.cpp deleted file mode 100644 index a97a537..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/abstractliveedittool.cpp +++ /dev/null @@ -1,195 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "abstractliveedittool_p.h" -#include "../qdeclarativeviewobserver_p_p.h" - -#include - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -AbstractLiveEditTool::AbstractLiveEditTool(QDeclarativeViewObserver *editorView) - : QObject(editorView), m_observer(editorView) -{ -} - - -AbstractLiveEditTool::~AbstractLiveEditTool() -{ -} - -QDeclarativeViewObserver *AbstractLiveEditTool::observer() const -{ - return m_observer; -} - -QDeclarativeView *AbstractLiveEditTool::view() const -{ - return m_observer->declarativeView(); -} - -QGraphicsScene* AbstractLiveEditTool::scene() const -{ - return view()->scene(); -} - -void AbstractLiveEditTool::updateSelectedItems() -{ - selectedItemsChanged(items()); -} - -QList AbstractLiveEditTool::items() const -{ - return observer()->selectedItems(); -} - -bool AbstractLiveEditTool::topItemIsMovable(const QList & itemList) -{ - QGraphicsItem *firstSelectableItem = topMovableGraphicsItem(itemList); - if (firstSelectableItem == 0) - return false; - if (toQDeclarativeItem(firstSelectableItem) != 0) - return true; - - return false; - -} - -bool AbstractLiveEditTool::topSelectedItemIsMovable(const QList &itemList) -{ - QList selectedItems = observer()->selectedItems(); - - foreach (QGraphicsItem *item, itemList) { - QDeclarativeItem *declarativeItem = toQDeclarativeItem(item); - if (declarativeItem - && selectedItems.contains(declarativeItem) - /*&& (declarativeItem->qmlItemNode().hasShowContent() || selectNonContentItems)*/) - return true; - } - - return false; - -} - -bool AbstractLiveEditTool::topItemIsResizeHandle(const QList &/*itemList*/) -{ - return false; -} - -QDeclarativeItem *AbstractLiveEditTool::toQDeclarativeItem(QGraphicsItem *item) -{ - return qobject_cast(item->toGraphicsObject()); -} - -QGraphicsItem *AbstractLiveEditTool::topMovableGraphicsItem(const QList &itemList) -{ - foreach (QGraphicsItem *item, itemList) { - if (item->flags().testFlag(QGraphicsItem::ItemIsMovable)) - return item; - } - return 0; -} - -QDeclarativeItem *AbstractLiveEditTool::topMovableDeclarativeItem(const QList - &itemList) -{ - foreach (QGraphicsItem *item, itemList) { - QDeclarativeItem *declarativeItem = toQDeclarativeItem(item); - if (declarativeItem /*&& (declarativeItem->qmlItemNode().hasShowContent())*/) - return declarativeItem; - } - - return 0; -} - -QList AbstractLiveEditTool::toGraphicsObjectList(const QList - &itemList) -{ - QList gfxObjects; - foreach (QGraphicsItem *item, itemList) { - QGraphicsObject *obj = item->toGraphicsObject(); - if (obj) - gfxObjects << obj; - } - - return gfxObjects; -} - -QString AbstractLiveEditTool::titleForItem(QGraphicsItem *item) -{ - QString className(QLatin1String("QGraphicsItem")); - QString objectStringId; - - QString constructedName; - - QGraphicsObject *gfxObject = item->toGraphicsObject(); - if (gfxObject) { - className = QLatin1String(gfxObject->metaObject()->className()); - - className.remove(QRegExp(QLatin1String("_QMLTYPE_\\d+"))); - className.remove(QRegExp(QLatin1String("_QML_\\d+"))); - if (className.startsWith(QLatin1String("QDeclarative"))) - className = className.remove(QLatin1String("QDeclarative")); - - QDeclarativeItem *declarativeItem = qobject_cast(gfxObject); - if (declarativeItem) { - objectStringId = m_observer->idStringForObject(declarativeItem); - } - - if (!objectStringId.isEmpty()) { - constructedName = objectStringId + QLatin1String(" (") + className + QLatin1Char(')'); - } else { - if (!gfxObject->objectName().isEmpty()) { - constructedName = gfxObject->objectName() + QLatin1String(" (") + className + QLatin1Char(')'); - } else { - constructedName = className; - } - } - } - - return constructedName; -} - -QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/declarativeobserver/editor/abstractliveedittool_p.h b/src/plugins/qmltooling/declarativeobserver/editor/abstractliveedittool_p.h deleted file mode 100644 index 97aac35..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/abstractliveedittool_p.h +++ /dev/null @@ -1,119 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef ABSTRACTLIVEEDITTOOL_H -#define ABSTRACTLIVEEDITTOOL_H - -#include -#include - -QT_BEGIN_NAMESPACE -class QMouseEvent; -class QGraphicsItem; -class QDeclarativeItem; -class QKeyEvent; -class QGraphicsScene; -class QGraphicsObject; -class QWheelEvent; -class QDeclarativeView; -QT_END_NAMESPACE - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QDeclarativeViewObserver; - -class AbstractLiveEditTool : public QObject -{ - Q_OBJECT -public: - AbstractLiveEditTool(QDeclarativeViewObserver *observer); - - virtual ~AbstractLiveEditTool(); - - virtual void mousePressEvent(QMouseEvent *event) = 0; - virtual void mouseMoveEvent(QMouseEvent *event) = 0; - virtual void mouseReleaseEvent(QMouseEvent *event) = 0; - virtual void mouseDoubleClickEvent(QMouseEvent *event) = 0; - - virtual void hoverMoveEvent(QMouseEvent *event) = 0; - virtual void wheelEvent(QWheelEvent *event) = 0; - - virtual void keyPressEvent(QKeyEvent *event) = 0; - virtual void keyReleaseEvent(QKeyEvent *keyEvent) = 0; - virtual void itemsAboutToRemoved(const QList &itemList) = 0; - - virtual void clear() = 0; - - void updateSelectedItems(); - QList items() const; - - bool topItemIsMovable(const QList &itemList); - bool topItemIsResizeHandle(const QList &itemList); - bool topSelectedItemIsMovable(const QList &itemList); - - QString titleForItem(QGraphicsItem *item); - - static QList toGraphicsObjectList(const QList &itemList); - static QGraphicsItem* topMovableGraphicsItem(const QList &itemList); - static QDeclarativeItem* topMovableDeclarativeItem(const QList &itemList); - static QDeclarativeItem *toQDeclarativeItem(QGraphicsItem *item); - -protected: - virtual void selectedItemsChanged(const QList &objectList) = 0; - - QDeclarativeViewObserver *observer() const; - QDeclarativeView *view() const; - QGraphicsScene *scene() const; - -private: - QDeclarativeViewObserver *m_observer; - QList m_itemList; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // ABSTRACTLIVEEDITTOOL_H diff --git a/src/plugins/qmltooling/declarativeobserver/editor/boundingrecthighlighter.cpp b/src/plugins/qmltooling/declarativeobserver/editor/boundingrecthighlighter.cpp deleted file mode 100644 index e9594d5..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/boundingrecthighlighter.cpp +++ /dev/null @@ -1,282 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "boundingrecthighlighter_p.h" - -#include "../qdeclarativeviewobserver_p.h" -#include "../qmlobserverconstants_p.h" - -#include - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -const qreal AnimDelta = 0.025f; -const int AnimInterval = 30; -const int AnimFrames = 10; - -BoundingBox::BoundingBox(QGraphicsObject *itemToHighlight, QGraphicsItem *parentItem, - QObject *parent) - : QObject(parent), - highlightedObject(itemToHighlight), - highlightPolygon(0), - highlightPolygonEdge(0) -{ - highlightPolygon = new BoundingBoxPolygonItem(parentItem); - highlightPolygonEdge = new BoundingBoxPolygonItem(parentItem); - - highlightPolygon->setPen(QPen(QColor(0, 22, 159))); - highlightPolygonEdge->setPen(QPen(QColor(158, 199, 255))); - - highlightPolygon->setFlag(QGraphicsItem::ItemIsSelectable, false); - highlightPolygonEdge->setFlag(QGraphicsItem::ItemIsSelectable, false); -} - -BoundingBox::~BoundingBox() -{ - highlightedObject.clear(); -} - -BoundingBoxPolygonItem::BoundingBoxPolygonItem(QGraphicsItem *item) : QGraphicsPolygonItem(item) -{ - QPen pen; - pen.setColor(QColor(108, 141, 221)); - pen.setWidth(1); - setPen(pen); -} - -int BoundingBoxPolygonItem::type() const -{ - return Constants::EditorItemType; -} - -BoundingRectHighlighter::BoundingRectHighlighter(QDeclarativeViewObserver *view) : - LiveLayerItem(view->declarativeView()->scene()), - m_view(view), - m_animFrame(0) -{ - m_animTimer = new QTimer(this); - m_animTimer->setInterval(AnimInterval); - connect(m_animTimer, SIGNAL(timeout()), SLOT(animTimeout())); -} - -BoundingRectHighlighter::~BoundingRectHighlighter() -{ - -} - -void BoundingRectHighlighter::animTimeout() -{ - ++m_animFrame; - if (m_animFrame == AnimFrames) { - m_animTimer->stop(); - } - - qreal alpha = m_animFrame / float(AnimFrames); - - foreach (BoundingBox *box, m_boxes) { - box->highlightPolygonEdge->setOpacity(alpha); - } -} - -void BoundingRectHighlighter::clear() -{ - if (m_boxes.length()) { - m_animTimer->stop(); - - foreach (BoundingBox *box, m_boxes) { - freeBoundingBox(box); - } - } -} - -BoundingBox *BoundingRectHighlighter::boxFor(QGraphicsObject *item) const -{ - foreach (BoundingBox *box, m_boxes) { - if (box->highlightedObject.data() == item) { - return box; - } - } - return 0; -} - -void BoundingRectHighlighter::highlight(QList items) -{ - if (items.isEmpty()) - return; - - bool animate = false; - - QList newBoxes; - foreach (QGraphicsObject *itemToHighlight, items) { - BoundingBox *box = boxFor(itemToHighlight); - if (!box) { - box = createBoundingBox(itemToHighlight); - animate = true; - } - - newBoxes << box; - } - qSort(newBoxes); - - if (newBoxes != m_boxes) { - clear(); - m_boxes << newBoxes; - } - - highlightAll(animate); -} - -void BoundingRectHighlighter::highlight(QGraphicsObject* itemToHighlight) -{ - if (!itemToHighlight) - return; - - bool animate = false; - - BoundingBox *box = boxFor(itemToHighlight); - if (!box) { - box = createBoundingBox(itemToHighlight); - m_boxes << box; - animate = true; - qSort(m_boxes); - } - - highlightAll(animate); -} - -BoundingBox *BoundingRectHighlighter::createBoundingBox(QGraphicsObject *itemToHighlight) -{ - if (!m_freeBoxes.isEmpty()) { - BoundingBox *box = m_freeBoxes.last(); - if (box->highlightedObject.isNull()) { - box->highlightedObject = itemToHighlight; - box->highlightPolygon->show(); - box->highlightPolygonEdge->show(); - m_freeBoxes.removeLast(); - return box; - } - } - - BoundingBox *box = new BoundingBox(itemToHighlight, this, this); - - connect(itemToHighlight, SIGNAL(xChanged()), this, SLOT(refresh())); - connect(itemToHighlight, SIGNAL(yChanged()), this, SLOT(refresh())); - connect(itemToHighlight, SIGNAL(widthChanged()), this, SLOT(refresh())); - connect(itemToHighlight, SIGNAL(heightChanged()), this, SLOT(refresh())); - connect(itemToHighlight, SIGNAL(rotationChanged()), this, SLOT(refresh())); - connect(itemToHighlight, SIGNAL(destroyed(QObject*)), this, SLOT(itemDestroyed(QObject*))); - - return box; -} - -void BoundingRectHighlighter::removeBoundingBox(BoundingBox *box) -{ - delete box; - box = 0; -} - -void BoundingRectHighlighter::freeBoundingBox(BoundingBox *box) -{ - if (!box->highlightedObject.isNull()) { - disconnect(box->highlightedObject.data(), SIGNAL(xChanged()), this, SLOT(refresh())); - disconnect(box->highlightedObject.data(), SIGNAL(yChanged()), this, SLOT(refresh())); - disconnect(box->highlightedObject.data(), SIGNAL(widthChanged()), this, SLOT(refresh())); - disconnect(box->highlightedObject.data(), SIGNAL(heightChanged()), this, SLOT(refresh())); - disconnect(box->highlightedObject.data(), SIGNAL(rotationChanged()), this, SLOT(refresh())); - } - - box->highlightedObject.clear(); - box->highlightPolygon->hide(); - box->highlightPolygonEdge->hide(); - m_boxes.removeOne(box); - m_freeBoxes << box; -} - -void BoundingRectHighlighter::itemDestroyed(QObject *obj) -{ - foreach (BoundingBox *box, m_boxes) { - if (box->highlightedObject.data() == obj) { - freeBoundingBox(box); - break; - } - } -} - -void BoundingRectHighlighter::highlightAll(bool animate) -{ - foreach (BoundingBox *box, m_boxes) { - if (box && box->highlightedObject.isNull()) { - // clear all highlights - clear(); - return; - } - QGraphicsObject *item = box->highlightedObject.data(); - - QRectF boundingRectInSceneSpace(item->mapToScene(item->boundingRect()).boundingRect()); - QRectF boundingRectInLayerItemSpace = mapRectFromScene(boundingRectInSceneSpace); - QRectF bboxRect = m_view->adjustToScreenBoundaries(boundingRectInLayerItemSpace); - QRectF edgeRect = bboxRect; - edgeRect.adjust(-1, -1, 1, 1); - - box->highlightPolygon->setPolygon(QPolygonF(bboxRect)); - box->highlightPolygonEdge->setPolygon(QPolygonF(edgeRect)); - - if (animate) - box->highlightPolygonEdge->setOpacity(0); - } - - if (animate) { - m_animFrame = 0; - m_animTimer->start(); - } -} - -void BoundingRectHighlighter::refresh() -{ - if (!m_boxes.isEmpty()) - highlightAll(true); -} - -QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/declarativeobserver/editor/boundingrecthighlighter_p.h b/src/plugins/qmltooling/declarativeobserver/editor/boundingrecthighlighter_p.h deleted file mode 100644 index ab7e595..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/boundingrecthighlighter_p.h +++ /dev/null @@ -1,126 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BOUNDINGRECTHIGHLIGHTER_H -#define BOUNDINGRECTHIGHLIGHTER_H - -#include "livelayeritem_p.h" - -#include -#include - -QT_FORWARD_DECLARE_CLASS(QGraphicsItem) -QT_FORWARD_DECLARE_CLASS(QPainter) -QT_FORWARD_DECLARE_CLASS(QWidget) -QT_FORWARD_DECLARE_CLASS(QStyleOptionGraphicsItem) -QT_FORWARD_DECLARE_CLASS(QTimer) - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QDeclarativeViewObserver; -class BoundingBox; - -class BoundingRectHighlighter : public LiveLayerItem -{ - Q_OBJECT -public: - explicit BoundingRectHighlighter(QDeclarativeViewObserver *view); - ~BoundingRectHighlighter(); - void clear(); - void highlight(QList items); - void highlight(QGraphicsObject* item); - -private slots: - void refresh(); - void animTimeout(); - void itemDestroyed(QObject *); - -private: - BoundingBox *boxFor(QGraphicsObject *item) const; - void highlightAll(bool animate); - BoundingBox *createBoundingBox(QGraphicsObject *itemToHighlight); - void removeBoundingBox(BoundingBox *box); - void freeBoundingBox(BoundingBox *box); - -private: - Q_DISABLE_COPY(BoundingRectHighlighter) - - QDeclarativeViewObserver *m_view; - QList m_boxes; - QList m_freeBoxes; - QTimer *m_animTimer; - qreal m_animScale; - int m_animFrame; - -}; - -class BoundingBox : public QObject -{ - Q_OBJECT -public: - explicit BoundingBox(QGraphicsObject *itemToHighlight, QGraphicsItem *parentItem, - QObject *parent = 0); - ~BoundingBox(); - QWeakPointer highlightedObject; - QGraphicsPolygonItem *highlightPolygon; - QGraphicsPolygonItem *highlightPolygonEdge; - -private: - Q_DISABLE_COPY(BoundingBox) - -}; - -class BoundingBoxPolygonItem : public QGraphicsPolygonItem -{ -public: - explicit BoundingBoxPolygonItem(QGraphicsItem *item); - int type() const; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // BOUNDINGRECTHIGHLIGHTER_H diff --git a/src/plugins/qmltooling/declarativeobserver/editor/colorpickertool.cpp b/src/plugins/qmltooling/declarativeobserver/editor/colorpickertool.cpp deleted file mode 100644 index 50d724e..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/colorpickertool.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "colorpickertool_p.h" - -#include "../qdeclarativeviewobserver_p.h" - -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -ColorPickerTool::ColorPickerTool(QDeclarativeViewObserver *view) : - AbstractLiveEditTool(view) -{ - m_selectedColor.setRgb(0,0,0); -} - -ColorPickerTool::~ColorPickerTool() -{ - -} - -void ColorPickerTool::mousePressEvent(QMouseEvent * /*event*/) -{ -} - -void ColorPickerTool::mouseMoveEvent(QMouseEvent *event) -{ - pickColor(event->pos()); -} - -void ColorPickerTool::mouseReleaseEvent(QMouseEvent *event) -{ - pickColor(event->pos()); -} - -void ColorPickerTool::mouseDoubleClickEvent(QMouseEvent * /*event*/) -{ -} - - -void ColorPickerTool::hoverMoveEvent(QMouseEvent * /*event*/) -{ -} - -void ColorPickerTool::keyPressEvent(QKeyEvent * /*event*/) -{ -} - -void ColorPickerTool::keyReleaseEvent(QKeyEvent * /*keyEvent*/) -{ -} -void ColorPickerTool::wheelEvent(QWheelEvent * /*event*/) -{ -} - -void ColorPickerTool::itemsAboutToRemoved(const QList &/*itemList*/) -{ -} - -void ColorPickerTool::clear() -{ - view()->setCursor(Qt::CrossCursor); -} - -void ColorPickerTool::selectedItemsChanged(const QList &/*itemList*/) -{ -} - -void ColorPickerTool::pickColor(const QPoint &pos) -{ - QRgb fillColor = view()->backgroundBrush().color().rgb(); - if (view()->backgroundBrush().style() == Qt::NoBrush) - fillColor = view()->palette().color(QPalette::Base).rgb(); - - QRectF target(0,0, 1, 1); - QRect source(pos.x(), pos.y(), 1, 1); - QImage img(1, 1, QImage::Format_ARGB32); - img.fill(fillColor); - QPainter painter(&img); - view()->render(&painter, target, source); - m_selectedColor = QColor::fromRgb(img.pixel(0, 0)); - - emit selectedColorChanged(m_selectedColor); -} - -QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/declarativeobserver/editor/colorpickertool_p.h b/src/plugins/qmltooling/declarativeobserver/editor/colorpickertool_p.h deleted file mode 100644 index b955eee..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/colorpickertool_p.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef COLORPICKERTOOL_H -#define COLORPICKERTOOL_H - -#include "abstractliveedittool_p.h" - -#include - -QT_FORWARD_DECLARE_CLASS(QPoint) - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class ColorPickerTool : public AbstractLiveEditTool -{ - Q_OBJECT -public: - explicit ColorPickerTool(QDeclarativeViewObserver *view); - - virtual ~ColorPickerTool(); - - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - void mouseDoubleClickEvent(QMouseEvent *event); - - void hoverMoveEvent(QMouseEvent *event); - - void keyPressEvent(QKeyEvent *event); - void keyReleaseEvent(QKeyEvent *keyEvent); - - void wheelEvent(QWheelEvent *event); - - void itemsAboutToRemoved(const QList &itemList); - - void clear(); - -signals: - void selectedColorChanged(const QColor &color); - -protected: - - void selectedItemsChanged(const QList &itemList); - -private: - void pickColor(const QPoint &pos); - -private: - QColor m_selectedColor; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // COLORPICKERTOOL_H diff --git a/src/plugins/qmltooling/declarativeobserver/editor/editor.qrc b/src/plugins/qmltooling/declarativeobserver/editor/editor.qrc deleted file mode 100644 index 77744d5..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/editor.qrc +++ /dev/null @@ -1,24 +0,0 @@ - - - images/resize_handle.png - images/select.png - images/select-marquee.png - images/color-picker.png - images/play.png - images/pause.png - images/from-qml.png - images/to-qml.png - images/color-picker-hicontrast.png - images/zoom.png - images/color-picker-24.png - images/from-qml-24.png - images/pause-24.png - images/play-24.png - images/to-qml-24.png - images/zoom-24.png - images/select-24.png - images/select-marquee-24.png - images/observermode.png - images/observermode-24.png - - diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/color-picker-24.png b/src/plugins/qmltooling/declarativeobserver/editor/images/color-picker-24.png deleted file mode 100644 index cff4721..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/color-picker-24.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/color-picker-hicontrast.png b/src/plugins/qmltooling/declarativeobserver/editor/images/color-picker-hicontrast.png deleted file mode 100644 index b953d08..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/color-picker-hicontrast.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/color-picker.png b/src/plugins/qmltooling/declarativeobserver/editor/images/color-picker.png deleted file mode 100644 index 026c31b..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/color-picker.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/from-qml-24.png b/src/plugins/qmltooling/declarativeobserver/editor/images/from-qml-24.png deleted file mode 100644 index 0ad21f3..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/from-qml-24.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/from-qml.png b/src/plugins/qmltooling/declarativeobserver/editor/images/from-qml.png deleted file mode 100644 index 666382c..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/from-qml.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/observermode-24.png b/src/plugins/qmltooling/declarativeobserver/editor/images/observermode-24.png deleted file mode 100644 index 5e74d86..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/observermode-24.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/observermode.png b/src/plugins/qmltooling/declarativeobserver/editor/images/observermode.png deleted file mode 100644 index daed21c..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/observermode.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/pause-24.png b/src/plugins/qmltooling/declarativeobserver/editor/images/pause-24.png deleted file mode 100644 index d9a2f6f..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/pause-24.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/pause.png b/src/plugins/qmltooling/declarativeobserver/editor/images/pause.png deleted file mode 100644 index 114d89b..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/pause.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/play-24.png b/src/plugins/qmltooling/declarativeobserver/editor/images/play-24.png deleted file mode 100644 index e2b9fbc..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/play-24.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/play.png b/src/plugins/qmltooling/declarativeobserver/editor/images/play.png deleted file mode 100644 index 011598a..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/play.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/reload.png b/src/plugins/qmltooling/declarativeobserver/editor/images/reload.png deleted file mode 100644 index 7042bec..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/reload.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/resize_handle.png b/src/plugins/qmltooling/declarativeobserver/editor/images/resize_handle.png deleted file mode 100644 index 2934f25..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/resize_handle.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/select-24.png b/src/plugins/qmltooling/declarativeobserver/editor/images/select-24.png deleted file mode 100644 index 5388a9d..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/select-24.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/select-marquee-24.png b/src/plugins/qmltooling/declarativeobserver/editor/images/select-marquee-24.png deleted file mode 100644 index 0111dda..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/select-marquee-24.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/select-marquee.png b/src/plugins/qmltooling/declarativeobserver/editor/images/select-marquee.png deleted file mode 100644 index 92fe40d..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/select-marquee.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/select.png b/src/plugins/qmltooling/declarativeobserver/editor/images/select.png deleted file mode 100644 index 6722855..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/select.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/to-qml-24.png b/src/plugins/qmltooling/declarativeobserver/editor/images/to-qml-24.png deleted file mode 100644 index b72450d..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/to-qml-24.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/to-qml.png b/src/plugins/qmltooling/declarativeobserver/editor/images/to-qml.png deleted file mode 100644 index 2ab951f..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/to-qml.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/zoom-24.png b/src/plugins/qmltooling/declarativeobserver/editor/images/zoom-24.png deleted file mode 100644 index 0346200..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/zoom-24.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/images/zoom.png b/src/plugins/qmltooling/declarativeobserver/editor/images/zoom.png deleted file mode 100644 index 17f0da6..0000000 Binary files a/src/plugins/qmltooling/declarativeobserver/editor/images/zoom.png and /dev/null differ diff --git a/src/plugins/qmltooling/declarativeobserver/editor/livelayeritem.cpp b/src/plugins/qmltooling/declarativeobserver/editor/livelayeritem.cpp deleted file mode 100644 index 73cc5a0..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/livelayeritem.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "livelayeritem_p.h" - -#include "../qmlobserverconstants_p.h" - -#include - -QT_BEGIN_NAMESPACE - -LiveLayerItem::LiveLayerItem(QGraphicsScene* scene) - : QGraphicsObject() -{ - scene->addItem(this); - setZValue(1); - setFlag(QGraphicsItem::ItemIsMovable, false); -} - -LiveLayerItem::~LiveLayerItem() -{ -} - -void LiveLayerItem::paint(QPainter * /*painter*/, const QStyleOptionGraphicsItem * /*option*/, - QWidget * /*widget*/) -{ -} - -int LiveLayerItem::type() const -{ - return Constants::EditorItemType; -} - -QRectF LiveLayerItem::boundingRect() const -{ - return childrenBoundingRect(); -} - -QList LiveLayerItem::findAllChildItems() const -{ - return findAllChildItems(this); -} - -QList LiveLayerItem::findAllChildItems(const QGraphicsItem *item) const -{ - QList itemList(item->childItems()); - - foreach (QGraphicsItem *childItem, item->childItems()) - itemList += findAllChildItems(childItem); - - return itemList; -} - -QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/declarativeobserver/editor/livelayeritem_p.h b/src/plugins/qmltooling/declarativeobserver/editor/livelayeritem_p.h deleted file mode 100644 index da622e1..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/livelayeritem_p.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef LIVELAYERITEM_H -#define LIVELAYERITEM_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class LiveLayerItem : public QGraphicsObject -{ -public: - LiveLayerItem(QGraphicsScene *scene); - ~LiveLayerItem(); - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, - QWidget *widget = 0); - QRectF boundingRect() const; - int type() const; - - QList findAllChildItems() const; - -protected: - QList findAllChildItems(const QGraphicsItem *item) const; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // LIVELAYERITEM_H diff --git a/src/plugins/qmltooling/declarativeobserver/editor/liverubberbandselectionmanipulator.cpp b/src/plugins/qmltooling/declarativeobserver/editor/liverubberbandselectionmanipulator.cpp deleted file mode 100644 index 18341de..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/liverubberbandselectionmanipulator.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "liverubberbandselectionmanipulator_p.h" - -#include "../qdeclarativeviewobserver_p_p.h" - -#include - -#include - -QT_BEGIN_NAMESPACE - -LiveRubberBandSelectionManipulator::LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem, - QDeclarativeViewObserver *editorView) - : m_selectionRectangleElement(layerItem), - m_editorView(editorView), - m_beginFormEditorItem(0), - m_isActive(false) -{ - m_selectionRectangleElement.hide(); -} - -void LiveRubberBandSelectionManipulator::clear() -{ - m_selectionRectangleElement.clear(); - m_isActive = false; - m_beginPoint = QPointF(); - m_itemList.clear(); - m_oldSelectionList.clear(); -} - -QGraphicsItem *LiveRubberBandSelectionManipulator::topFormEditorItem(const QList - &itemList) -{ - if (itemList.isEmpty()) - return 0; - - return itemList.first(); -} - -void LiveRubberBandSelectionManipulator::begin(const QPointF &beginPoint) -{ - m_beginPoint = beginPoint; - m_selectionRectangleElement.setRect(m_beginPoint, m_beginPoint); - m_selectionRectangleElement.show(); - m_isActive = true; - QDeclarativeViewObserverPrivate *observerPrivate - = QDeclarativeViewObserverPrivate::get(m_editorView); - m_beginFormEditorItem = topFormEditorItem(observerPrivate->selectableItems(beginPoint)); - m_oldSelectionList = m_editorView->selectedItems(); -} - -void LiveRubberBandSelectionManipulator::update(const QPointF &updatePoint) -{ - m_selectionRectangleElement.setRect(m_beginPoint, updatePoint); -} - -void LiveRubberBandSelectionManipulator::end() -{ - m_oldSelectionList.clear(); - m_selectionRectangleElement.hide(); - m_isActive = false; -} - -void LiveRubberBandSelectionManipulator::select(SelectionType selectionType) -{ - QDeclarativeViewObserverPrivate *observerPrivate - = QDeclarativeViewObserverPrivate::get(m_editorView); - QList itemList - = observerPrivate->selectableItems(m_selectionRectangleElement.rect(), - Qt::IntersectsItemShape); - QList newSelectionList; - - foreach (QGraphicsItem* item, itemList) { - if (item - && item->parentItem() - && !newSelectionList.contains(item) - //&& m_beginFormEditorItem->childItems().contains(item) // TODO activate this test - ) - { - newSelectionList.append(item); - } - } - - if (newSelectionList.isEmpty() && m_beginFormEditorItem) - newSelectionList.append(m_beginFormEditorItem); - - QList resultList; - - switch (selectionType) { - case AddToSelection: { - resultList.append(m_oldSelectionList); - resultList.append(newSelectionList); - } - break; - case ReplaceSelection: { - resultList.append(newSelectionList); - } - break; - case RemoveFromSelection: { - QSet oldSelectionSet(m_oldSelectionList.toSet()); - QSet newSelectionSet(newSelectionList.toSet()); - resultList.append(oldSelectionSet.subtract(newSelectionSet).toList()); - } - } - - m_editorView->setSelectedItems(resultList); -} - - -void LiveRubberBandSelectionManipulator::setItems(const QList &itemList) -{ - m_itemList = itemList; -} - -QPointF LiveRubberBandSelectionManipulator::beginPoint() const -{ - return m_beginPoint; -} - -bool LiveRubberBandSelectionManipulator::isActive() const -{ - return m_isActive; -} - -QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/declarativeobserver/editor/liverubberbandselectionmanipulator_p.h b/src/plugins/qmltooling/declarativeobserver/editor/liverubberbandselectionmanipulator_p.h deleted file mode 100644 index a71caa2..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/liverubberbandselectionmanipulator_p.h +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef RUBBERBANDSELECTIONMANIPULATOR_H -#define RUBBERBANDSELECTIONMANIPULATOR_H - -#include "liveselectionrectangle_p.h" - -#include - -QT_FORWARD_DECLARE_CLASS(QGraphicsItem) - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QDeclarativeViewObserver; - -class LiveRubberBandSelectionManipulator -{ -public: - enum SelectionType { - ReplaceSelection, - AddToSelection, - RemoveFromSelection - }; - - LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem, - QDeclarativeViewObserver *editorView); - - void setItems(const QList &itemList); - - void begin(const QPointF& beginPoint); - void update(const QPointF& updatePoint); - void end(); - - void clear(); - - void select(SelectionType selectionType); - - QPointF beginPoint() const; - - bool isActive() const; - -protected: - QGraphicsItem *topFormEditorItem(const QList &itemList); - -private: - QList m_itemList; - QList m_oldSelectionList; - LiveSelectionRectangle m_selectionRectangleElement; - QPointF m_beginPoint; - QDeclarativeViewObserver *m_editorView; - QGraphicsItem *m_beginFormEditorItem; - bool m_isActive; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // RUBBERBANDSELECTIONMANIPULATOR_H diff --git a/src/plugins/qmltooling/declarativeobserver/editor/liveselectionindicator.cpp b/src/plugins/qmltooling/declarativeobserver/editor/liveselectionindicator.cpp deleted file mode 100644 index 2752957..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/liveselectionindicator.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "liveselectionindicator_p.h" - -#include "../qdeclarativeviewobserver_p_p.h" -#include "../qmlobserverconstants_p.h" - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -LiveSelectionIndicator::LiveSelectionIndicator(QDeclarativeViewObserver *viewObserver, - QGraphicsObject *layerItem) - : m_layerItem(layerItem) - , m_view(viewObserver) -{ -} - -LiveSelectionIndicator::~LiveSelectionIndicator() -{ - clear(); -} - -void LiveSelectionIndicator::show() -{ - foreach (QGraphicsRectItem *item, m_indicatorShapeHash) - item->show(); -} - -void LiveSelectionIndicator::hide() -{ - foreach (QGraphicsRectItem *item, m_indicatorShapeHash) - item->hide(); -} - -void LiveSelectionIndicator::clear() -{ - if (!m_layerItem.isNull()) { - QGraphicsScene *scene = m_layerItem.data()->scene(); - foreach (QGraphicsRectItem *item, m_indicatorShapeHash) { - scene->removeItem(item); - delete item; - } - } - - m_indicatorShapeHash.clear(); - -} - -void LiveSelectionIndicator::setItems(const QList > &itemList) -{ - clear(); - - foreach (const QWeakPointer &object, itemList) { - if (object.isNull()) - continue; - - QGraphicsItem *item = object.data(); - - if (!m_indicatorShapeHash.contains(item)) { - QGraphicsRectItem *selectionIndicator = new QGraphicsRectItem(m_layerItem.data()); - m_indicatorShapeHash.insert(item, selectionIndicator); - - const QRectF boundingRect = m_view->adjustToScreenBoundaries(item->mapRectToScene(item->boundingRect())); - const QRectF boundingRectInLayerItemSpace = m_layerItem.data()->mapRectFromScene(boundingRect); - - selectionIndicator->setData(Constants::EditorItemDataKey, true); - selectionIndicator->setFlag(QGraphicsItem::ItemIsSelectable, false); - selectionIndicator->setRect(boundingRectInLayerItemSpace); - selectionIndicator->setPen(QColor(108, 141, 221)); - } - } -} - -QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/declarativeobserver/editor/liveselectionindicator_p.h b/src/plugins/qmltooling/declarativeobserver/editor/liveselectionindicator_p.h deleted file mode 100644 index efd2c5f..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/liveselectionindicator_p.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef LIVESELECTIONINDICATOR_H -#define LIVESELECTIONINDICATOR_H - -#include -#include - -QT_BEGIN_NAMESPACE -class QGraphicsObject; -class QGraphicsRectItem; -class QGraphicsItem; -class QPolygonF; -QT_END_NAMESPACE - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QDeclarativeViewObserver; - -class LiveSelectionIndicator -{ -public: - LiveSelectionIndicator(QDeclarativeViewObserver *viewObserver, QGraphicsObject *layerItem); - ~LiveSelectionIndicator(); - - void show(); - void hide(); - - void clear(); - - void setItems(const QList > &itemList); - -private: - QHash m_indicatorShapeHash; - QWeakPointer m_layerItem; - QDeclarativeViewObserver *m_view; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // LIVESELECTIONINDICATOR_H diff --git a/src/plugins/qmltooling/declarativeobserver/editor/liveselectionrectangle.cpp b/src/plugins/qmltooling/declarativeobserver/editor/liveselectionrectangle.cpp deleted file mode 100644 index 6da1d6f..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/liveselectionrectangle.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "liveselectionrectangle_p.h" - -#include "../qmlobserverconstants_p.h" - -#include -#include -#include -#include - -#include - -#include - -QT_BEGIN_NAMESPACE - -class SelectionRectShape : public QGraphicsRectItem -{ -public: - SelectionRectShape(QGraphicsItem *parent = 0) : QGraphicsRectItem(parent) {} - int type() const { return Constants::EditorItemType; } -}; - -LiveSelectionRectangle::LiveSelectionRectangle(QGraphicsObject *layerItem) - : m_controlShape(new SelectionRectShape(layerItem)), - m_layerItem(layerItem) -{ - m_controlShape->setPen(QPen(Qt::black)); - m_controlShape->setBrush(QColor(128, 128, 128, 50)); -} - -LiveSelectionRectangle::~LiveSelectionRectangle() -{ - if (m_layerItem) - m_layerItem.data()->scene()->removeItem(m_controlShape); -} - -void LiveSelectionRectangle::clear() -{ - hide(); -} -void LiveSelectionRectangle::show() -{ - m_controlShape->show(); -} - -void LiveSelectionRectangle::hide() -{ - m_controlShape->hide(); -} - -QRectF LiveSelectionRectangle::rect() const -{ - return m_controlShape->mapFromScene(m_controlShape->rect()).boundingRect(); -} - -void LiveSelectionRectangle::setRect(const QPointF &firstPoint, - const QPointF &secondPoint) -{ - double firstX = std::floor(firstPoint.x()) + 0.5; - double firstY = std::floor(firstPoint.y()) + 0.5; - double secondX = std::floor(secondPoint.x()) + 0.5; - double secondY = std::floor(secondPoint.y()) + 0.5; - QPointF topLeftPoint(firstX < secondX ? firstX : secondX, - firstY < secondY ? firstY : secondY); - QPointF bottomRightPoint(firstX > secondX ? firstX : secondX, - firstY > secondY ? firstY : secondY); - - QRectF rect(topLeftPoint, bottomRightPoint); - m_controlShape->setRect(rect); -} - -QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/declarativeobserver/editor/liveselectionrectangle_p.h b/src/plugins/qmltooling/declarativeobserver/editor/liveselectionrectangle_p.h deleted file mode 100644 index 5da9fb8..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/liveselectionrectangle_p.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef LIVESELECTIONRECTANGLE_H -#define LIVESELECTIONRECTANGLE_H - -#include - -QT_FORWARD_DECLARE_CLASS(QGraphicsObject) -QT_FORWARD_DECLARE_CLASS(QGraphicsRectItem) -QT_FORWARD_DECLARE_CLASS(QPointF) -QT_FORWARD_DECLARE_CLASS(QRectF) - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class LiveSelectionRectangle -{ -public: - LiveSelectionRectangle(QGraphicsObject *layerItem); - ~LiveSelectionRectangle(); - - void show(); - void hide(); - - void clear(); - - void setRect(const QPointF &firstPoint, - const QPointF &secondPoint); - - QRectF rect() const; - -private: - QGraphicsRectItem *m_controlShape; - QWeakPointer m_layerItem; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // LIVESELECTIONRECTANGLE_H diff --git a/src/plugins/qmltooling/declarativeobserver/editor/liveselectiontool.cpp b/src/plugins/qmltooling/declarativeobserver/editor/liveselectiontool.cpp deleted file mode 100644 index 872832c..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/liveselectiontool.cpp +++ /dev/null @@ -1,438 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "liveselectiontool_p.h" -#include "livelayeritem_p.h" - -#include "../qdeclarativeviewobserver_p_p.h" - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -LiveSelectionTool::LiveSelectionTool(QDeclarativeViewObserver *editorView) : - AbstractLiveEditTool(editorView), - m_rubberbandSelectionMode(false), - m_rubberbandSelectionManipulator( - QDeclarativeViewObserverPrivate::get(editorView)->manipulatorLayer, editorView), - m_singleSelectionManipulator(editorView), - m_selectionIndicator(editorView, - QDeclarativeViewObserverPrivate::get(editorView)->manipulatorLayer), - //m_resizeIndicator(editorView->manipulatorLayer()), - m_selectOnlyContentItems(true) -{ - -} - -LiveSelectionTool::~LiveSelectionTool() -{ -} - -void LiveSelectionTool::setRubberbandSelectionMode(bool value) -{ - m_rubberbandSelectionMode = value; -} - -LiveSingleSelectionManipulator::SelectionType LiveSelectionTool::getSelectionType(Qt::KeyboardModifiers - modifiers) -{ - LiveSingleSelectionManipulator::SelectionType selectionType - = LiveSingleSelectionManipulator::ReplaceSelection; - if (modifiers.testFlag(Qt::ControlModifier)) { - selectionType = LiveSingleSelectionManipulator::RemoveFromSelection; - } else if (modifiers.testFlag(Qt::ShiftModifier)) { - selectionType = LiveSingleSelectionManipulator::AddToSelection; - } - return selectionType; -} - -bool LiveSelectionTool::alreadySelected(const QList &itemList) const -{ - QDeclarativeViewObserverPrivate *observerPrivate - = QDeclarativeViewObserverPrivate::get(observer()); - const QList selectedItems = observerPrivate->selectedItems(); - - if (selectedItems.isEmpty()) - return false; - - foreach (QGraphicsItem *item, itemList) - if (selectedItems.contains(item)) - return true; - - return false; -} - -void LiveSelectionTool::mousePressEvent(QMouseEvent *event) -{ - QDeclarativeViewObserverPrivate *observerPrivate - = QDeclarativeViewObserverPrivate::get(observer()); - QList itemList = observerPrivate->selectableItems(event->pos()); - LiveSingleSelectionManipulator::SelectionType selectionType = getSelectionType(event->modifiers()); - - if (event->buttons() & Qt::LeftButton) { - m_mousePressTimer.start(); - - if (m_rubberbandSelectionMode) { - m_rubberbandSelectionManipulator.begin(event->pos()); - } else { - m_singleSelectionManipulator.begin(event->pos()); - m_singleSelectionManipulator.select(selectionType, m_selectOnlyContentItems); - } - } else if (event->buttons() & Qt::RightButton) { - createContextMenu(itemList, event->globalPos()); - } -} - -void LiveSelectionTool::createContextMenu(QList itemList, QPoint globalPos) -{ - QMenu contextMenu; - connect(&contextMenu, SIGNAL(hovered(QAction*)), - this, SLOT(contextMenuElementHovered(QAction*))); - - m_contextMenuItemList = itemList; - - contextMenu.addAction(tr("Items")); - contextMenu.addSeparator(); - int shortcutKey = Qt::Key_1; - bool addKeySequence = true; - int i = 0; - - foreach (QGraphicsItem * const item, itemList) { - QString itemTitle = titleForItem(item); - QAction *elementAction = contextMenu.addAction(itemTitle, this, - SLOT(contextMenuElementSelected())); - - if (observer()->selectedItems().contains(item)) { - QFont boldFont = elementAction->font(); - boldFont.setBold(true); - elementAction->setFont(boldFont); - } - - elementAction->setData(i); - if (addKeySequence) - elementAction->setShortcut(QKeySequence(shortcutKey)); - - shortcutKey++; - if (shortcutKey > Qt::Key_9) - addKeySequence = false; - - ++i; - } - // add root item separately - // QString itemTitle = QString(tr("%1")).arg(titleForItem(view()->currentRootItem())); - // contextMenu.addAction(itemTitle, this, SLOT(contextMenuElementSelected())); - // m_contextMenuItemList.append(view()->currentRootItem()); - - contextMenu.exec(globalPos); - m_contextMenuItemList.clear(); -} - -void LiveSelectionTool::contextMenuElementSelected() -{ - QAction *senderAction = static_cast(sender()); - int itemListIndex = senderAction->data().toInt(); - if (itemListIndex >= 0 && itemListIndex < m_contextMenuItemList.length()) { - - QPointF updatePt(0, 0); - QGraphicsItem *item = m_contextMenuItemList.at(itemListIndex); - m_singleSelectionManipulator.begin(updatePt); - m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::InvertSelection, - QList() << item, - false); - m_singleSelectionManipulator.end(updatePt); - } -} - -void LiveSelectionTool::contextMenuElementHovered(QAction *action) -{ - int itemListIndex = action->data().toInt(); - if (itemListIndex >= 0 && itemListIndex < m_contextMenuItemList.length()) { - QGraphicsObject *item = m_contextMenuItemList.at(itemListIndex)->toGraphicsObject(); - QDeclarativeViewObserverPrivate::get(observer())->highlight(item); - } -} - -void LiveSelectionTool::mouseMoveEvent(QMouseEvent *event) -{ - if (m_singleSelectionManipulator.isActive()) { - QPointF mouseMovementVector = m_singleSelectionManipulator.beginPoint() - event->pos(); - - if ((mouseMovementVector.toPoint().manhattanLength() > Constants::DragStartDistance) - && (m_mousePressTimer.elapsed() > Constants::DragStartTime)) - { - m_singleSelectionManipulator.end(event->pos()); - //view()->changeToMoveTool(m_singleSelectionManipulator.beginPoint()); - return; - } - } else if (m_rubberbandSelectionManipulator.isActive()) { - QPointF mouseMovementVector = m_rubberbandSelectionManipulator.beginPoint() - event->pos(); - - if ((mouseMovementVector.toPoint().manhattanLength() > Constants::DragStartDistance) - && (m_mousePressTimer.elapsed() > Constants::DragStartTime)) { - m_rubberbandSelectionManipulator.update(event->pos()); - - if (event->modifiers().testFlag(Qt::ControlModifier)) - m_rubberbandSelectionManipulator.select( - LiveRubberBandSelectionManipulator::RemoveFromSelection); - else if (event->modifiers().testFlag(Qt::ShiftModifier)) - m_rubberbandSelectionManipulator.select( - LiveRubberBandSelectionManipulator::AddToSelection); - else - m_rubberbandSelectionManipulator.select( - LiveRubberBandSelectionManipulator::ReplaceSelection); - } - } -} - -void LiveSelectionTool::hoverMoveEvent(QMouseEvent * event) -{ -// ### commented out until move tool is re-enabled -// QList itemList = view()->items(event->pos()); -// if (!itemList.isEmpty() && !m_rubberbandSelectionMode) { -// -// foreach (QGraphicsItem *item, itemList) { -// if (item->type() == Constants::ResizeHandleItemType) { -// ResizeHandleItem* resizeHandle = ResizeHandleItem::fromGraphicsItem(item); -// if (resizeHandle) -// view()->changeTool(Constants::ResizeToolMode); -// return; -// } -// } -// if (topSelectedItemIsMovable(itemList)) -// view()->changeTool(Constants::MoveToolMode); -// } - QDeclarativeViewObserverPrivate *observerPrivate - = QDeclarativeViewObserverPrivate::get(observer()); - - QList selectableItemList = observerPrivate->selectableItems(event->pos()); - if (!selectableItemList.isEmpty()) { - QGraphicsObject *item = selectableItemList.first()->toGraphicsObject(); - if (item) - QDeclarativeViewObserverPrivate::get(observer())->highlight(item); - - return; - } - - QDeclarativeViewObserverPrivate::get(observer())->clearHighlight(); -} - -void LiveSelectionTool::mouseReleaseEvent(QMouseEvent *event) -{ - if (m_singleSelectionManipulator.isActive()) { - m_singleSelectionManipulator.end(event->pos()); - } - else if (m_rubberbandSelectionManipulator.isActive()) { - - QPointF mouseMovementVector = m_rubberbandSelectionManipulator.beginPoint() - event->pos(); - if (mouseMovementVector.toPoint().manhattanLength() < Constants::DragStartDistance) { - m_singleSelectionManipulator.begin(event->pos()); - - if (event->modifiers().testFlag(Qt::ControlModifier)) - m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::RemoveFromSelection, - m_selectOnlyContentItems); - else if (event->modifiers().testFlag(Qt::ShiftModifier)) - m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::AddToSelection, - m_selectOnlyContentItems); - else - m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::InvertSelection, - m_selectOnlyContentItems); - - m_singleSelectionManipulator.end(event->pos()); - } else { - m_rubberbandSelectionManipulator.update(event->pos()); - - if (event->modifiers().testFlag(Qt::ControlModifier)) - m_rubberbandSelectionManipulator.select( - LiveRubberBandSelectionManipulator::RemoveFromSelection); - else if (event->modifiers().testFlag(Qt::ShiftModifier)) - m_rubberbandSelectionManipulator.select( - LiveRubberBandSelectionManipulator::AddToSelection); - else - m_rubberbandSelectionManipulator.select( - LiveRubberBandSelectionManipulator::ReplaceSelection); - - m_rubberbandSelectionManipulator.end(); - } - } -} - -void LiveSelectionTool::mouseDoubleClickEvent(QMouseEvent * /*event*/) -{ -} - -void LiveSelectionTool::keyPressEvent(QKeyEvent *event) -{ - switch (event->key()) { - case Qt::Key_Left: - case Qt::Key_Right: - case Qt::Key_Up: - case Qt::Key_Down: - // disabled for now, cannot move stuff yet. - //view()->changeTool(Constants::MoveToolMode); - //view()->currentTool()->keyPressEvent(event); - break; - } -} - -void LiveSelectionTool::keyReleaseEvent(QKeyEvent * /*keyEvent*/) -{ - -} - -void LiveSelectionTool::wheelEvent(QWheelEvent *event) -{ - if (event->orientation() == Qt::Horizontal || m_rubberbandSelectionMode) - return; - - QDeclarativeViewObserverPrivate *observerPrivate - = QDeclarativeViewObserverPrivate::get(observer()); - QList itemList = observerPrivate->selectableItems(event->pos()); - - if (itemList.isEmpty()) - return; - - int selectedIdx = 0; - if (!observer()->selectedItems().isEmpty()) { - selectedIdx = itemList.indexOf(observer()->selectedItems().first()); - if (selectedIdx >= 0) { - if (event->delta() > 0) { - selectedIdx++; - if (selectedIdx == itemList.length()) - selectedIdx = 0; - } else if (event->delta() < 0) { - selectedIdx--; - if (selectedIdx == -1) - selectedIdx = itemList.length() - 1; - } - } else { - selectedIdx = 0; - } - } - - QPointF updatePt(0, 0); - m_singleSelectionManipulator.begin(updatePt); - m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::ReplaceSelection, - QList() << itemList.at(selectedIdx), - false); - m_singleSelectionManipulator.end(updatePt); - -} - -void LiveSelectionTool::setSelectOnlyContentItems(bool selectOnlyContentItems) -{ - m_selectOnlyContentItems = selectOnlyContentItems; -} - -void LiveSelectionTool::itemsAboutToRemoved(const QList &/*itemList*/) -{ -} - -void LiveSelectionTool::clear() -{ - view()->setCursor(Qt::ArrowCursor); - m_rubberbandSelectionManipulator.clear(), - m_singleSelectionManipulator.clear(); - m_selectionIndicator.clear(); - //m_resizeIndicator.clear(); -} - -void LiveSelectionTool::selectedItemsChanged(const QList &itemList) -{ - foreach (const QWeakPointer &obj, m_selectedItemList) { - if (!obj.isNull()) { - disconnect(obj.data(), SIGNAL(xChanged()), this, SLOT(repaintBoundingRects())); - disconnect(obj.data(), SIGNAL(yChanged()), this, SLOT(repaintBoundingRects())); - disconnect(obj.data(), SIGNAL(widthChanged()), this, SLOT(repaintBoundingRects())); - disconnect(obj.data(), SIGNAL(heightChanged()), this, SLOT(repaintBoundingRects())); - disconnect(obj.data(), SIGNAL(rotationChanged()), this, SLOT(repaintBoundingRects())); - } - } - - QList objects = toGraphicsObjectList(itemList); - m_selectedItemList.clear(); - - foreach (QGraphicsObject *obj, objects) { - m_selectedItemList.append(obj); - connect(obj, SIGNAL(xChanged()), this, SLOT(repaintBoundingRects())); - connect(obj, SIGNAL(yChanged()), this, SLOT(repaintBoundingRects())); - connect(obj, SIGNAL(widthChanged()), this, SLOT(repaintBoundingRects())); - connect(obj, SIGNAL(heightChanged()), this, SLOT(repaintBoundingRects())); - connect(obj, SIGNAL(rotationChanged()), this, SLOT(repaintBoundingRects())); - } - - m_selectionIndicator.setItems(m_selectedItemList); - //m_resizeIndicator.setItems(toGraphicsObjectList(itemList)); -} - -void LiveSelectionTool::repaintBoundingRects() -{ - m_selectionIndicator.setItems(m_selectedItemList); -} - -void LiveSelectionTool::selectUnderPoint(QMouseEvent *event) -{ - m_singleSelectionManipulator.begin(event->pos()); - - if (event->modifiers().testFlag(Qt::ControlModifier)) - m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::RemoveFromSelection, - m_selectOnlyContentItems); - else if (event->modifiers().testFlag(Qt::ShiftModifier)) - m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::AddToSelection, - m_selectOnlyContentItems); - else - m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::InvertSelection, - m_selectOnlyContentItems); - - m_singleSelectionManipulator.end(event->pos()); -} - -QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/declarativeobserver/editor/liveselectiontool_p.h b/src/plugins/qmltooling/declarativeobserver/editor/liveselectiontool_p.h deleted file mode 100644 index 4ecf9f6..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/liveselectiontool_p.h +++ /dev/null @@ -1,126 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef LIVESELECTIONTOOL_H -#define LIVESELECTIONTOOL_H - -#include "abstractliveedittool_p.h" -#include "liverubberbandselectionmanipulator_p.h" -#include "livesingleselectionmanipulator_p.h" -#include "liveselectionindicator_p.h" - -#include -#include - -QT_FORWARD_DECLARE_CLASS(QGraphicsItem) -QT_FORWARD_DECLARE_CLASS(QMouseEvent) -QT_FORWARD_DECLARE_CLASS(QKeyEvent) -QT_FORWARD_DECLARE_CLASS(QAction) - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class LiveSelectionTool : public AbstractLiveEditTool -{ - Q_OBJECT - -public: - LiveSelectionTool(QDeclarativeViewObserver* editorView); - ~LiveSelectionTool(); - - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - void mouseDoubleClickEvent(QMouseEvent *event); - void hoverMoveEvent(QMouseEvent *event); - void keyPressEvent(QKeyEvent *event); - void keyReleaseEvent(QKeyEvent *keyEvent); - void wheelEvent(QWheelEvent *event); - - void itemsAboutToRemoved(const QList &itemList); -// QVariant itemChange(const QList &itemList, -// QGraphicsItem::GraphicsItemChange change, -// const QVariant &value ); - -// void update(); - - void clear(); - - void selectedItemsChanged(const QList &itemList); - - void selectUnderPoint(QMouseEvent *event); - - void setSelectOnlyContentItems(bool selectOnlyContentItems); - - void setRubberbandSelectionMode(bool value); - -private slots: - void contextMenuElementSelected(); - void contextMenuElementHovered(QAction *action); - void repaintBoundingRects(); - -private: - void createContextMenu(QList itemList, QPoint globalPos); - LiveSingleSelectionManipulator::SelectionType getSelectionType(Qt::KeyboardModifiers modifiers); - bool alreadySelected(const QList &itemList) const; - -private: - bool m_rubberbandSelectionMode; - LiveRubberBandSelectionManipulator m_rubberbandSelectionManipulator; - LiveSingleSelectionManipulator m_singleSelectionManipulator; - LiveSelectionIndicator m_selectionIndicator; - //ResizeIndicator m_resizeIndicator; - QTime m_mousePressTimer; - bool m_selectOnlyContentItems; - - QList > m_selectedItemList; - - QList m_contextMenuItemList; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // LIVESELECTIONTOOL_H diff --git a/src/plugins/qmltooling/declarativeobserver/editor/livesingleselectionmanipulator.cpp b/src/plugins/qmltooling/declarativeobserver/editor/livesingleselectionmanipulator.cpp deleted file mode 100644 index 1ffd7a9..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/livesingleselectionmanipulator.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "livesingleselectionmanipulator_p.h" - -#include "../qdeclarativeviewobserver_p_p.h" - -#include - -QT_BEGIN_NAMESPACE - -LiveSingleSelectionManipulator::LiveSingleSelectionManipulator(QDeclarativeViewObserver *editorView) - : m_editorView(editorView), - m_isActive(false) -{ -} - - -void LiveSingleSelectionManipulator::begin(const QPointF &beginPoint) -{ - m_beginPoint = beginPoint; - m_isActive = true; - m_oldSelectionList = QDeclarativeViewObserverPrivate::get(m_editorView)->selectedItems(); -} - -void LiveSingleSelectionManipulator::update(const QPointF &/*updatePoint*/) -{ - m_oldSelectionList.clear(); -} - -void LiveSingleSelectionManipulator::clear() -{ - m_beginPoint = QPointF(); - m_oldSelectionList.clear(); -} - - -void LiveSingleSelectionManipulator::end(const QPointF &/*updatePoint*/) -{ - m_oldSelectionList.clear(); - m_isActive = false; -} - -void LiveSingleSelectionManipulator::select(SelectionType selectionType, - const QList &items, - bool /*selectOnlyContentItems*/) -{ - QGraphicsItem *selectedItem = 0; - - foreach (QGraphicsItem* item, items) - { - //FormEditorItem *formEditorItem = FormEditorItem::fromQGraphicsItem(item); - if (item - /*&& !formEditorItem->qmlItemNode().isRootNode() - && (formEditorItem->qmlItemNode().hasShowContent() || !selectOnlyContentItems)*/) - { - selectedItem = item; - break; - } - } - - QList resultList; - - switch (selectionType) { - case AddToSelection: { - resultList.append(m_oldSelectionList); - if (selectedItem && !m_oldSelectionList.contains(selectedItem)) - resultList.append(selectedItem); - } - break; - case ReplaceSelection: { - if (selectedItem) - resultList.append(selectedItem); - } - break; - case RemoveFromSelection: { - resultList.append(m_oldSelectionList); - if (selectedItem) - resultList.removeAll(selectedItem); - } - break; - case InvertSelection: { - if (selectedItem - && !m_oldSelectionList.contains(selectedItem)) - { - resultList.append(selectedItem); - } - } - } - - m_editorView->setSelectedItems(resultList); -} - -void LiveSingleSelectionManipulator::select(SelectionType selectionType, bool selectOnlyContentItems) -{ - QDeclarativeViewObserverPrivate *observerPrivate = - QDeclarativeViewObserverPrivate::get(m_editorView); - QList itemList = observerPrivate->selectableItems(m_beginPoint); - select(selectionType, itemList, selectOnlyContentItems); -} - - -bool LiveSingleSelectionManipulator::isActive() const -{ - return m_isActive; -} - -QPointF LiveSingleSelectionManipulator::beginPoint() const -{ - return m_beginPoint; -} - -QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/declarativeobserver/editor/livesingleselectionmanipulator_p.h b/src/plugins/qmltooling/declarativeobserver/editor/livesingleselectionmanipulator_p.h deleted file mode 100644 index ea0406b..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/livesingleselectionmanipulator_p.h +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef LIVESINGLESELECTIONMANIPULATOR_H -#define LIVESINGLESELECTIONMANIPULATOR_H - -#include -#include - -QT_FORWARD_DECLARE_CLASS(QGraphicsItem) - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QDeclarativeViewObserver; - -class LiveSingleSelectionManipulator -{ -public: - LiveSingleSelectionManipulator(QDeclarativeViewObserver *editorView); - - enum SelectionType { - ReplaceSelection, - AddToSelection, - RemoveFromSelection, - InvertSelection - }; - - void begin(const QPointF& beginPoint); - void update(const QPointF& updatePoint); - void end(const QPointF& updatePoint); - - void select(SelectionType selectionType, const QList &items, - bool selectOnlyContentItems); - void select(SelectionType selectionType, bool selectOnlyContentItems); - - void clear(); - - QPointF beginPoint() const; - - bool isActive() const; - -private: - QList m_oldSelectionList; - QPointF m_beginPoint; - QDeclarativeViewObserver *m_editorView; - bool m_isActive; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // LIVESINGLESELECTIONMANIPULATOR_H diff --git a/src/plugins/qmltooling/declarativeobserver/editor/qmltoolbar.cpp b/src/plugins/qmltooling/declarativeobserver/editor/qmltoolbar.cpp deleted file mode 100644 index 9ad5b24..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/qmltoolbar.cpp +++ /dev/null @@ -1,328 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qmltoolbar_p.h" -#include "toolbarcolorbox_p.h" - -#include -#include -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -QmlToolBar::QmlToolBar(QWidget *parent) - : QToolBar(parent) - , m_emitSignals(true) - , m_paused(false) - , m_animationSpeed(1.0f) - , ui(new Ui) -{ - ui->playIcon = QIcon(QLatin1String(":/qml/images/play-24.png")); - ui->pauseIcon = QIcon(QLatin1String(":/qml/images/pause-24.png")); - - ui->designmode = new QAction(QIcon(QLatin1String(":/qml/images/observermode-24.png")), - tr("Observer Mode"), this); - ui->play = new QAction(ui->pauseIcon, tr("Play/Pause Animations"), this); - ui->select = new QAction(QIcon(QLatin1String(":/qml/images/select-24.png")), tr("Select"), this); - ui->selectMarquee = new QAction(QIcon(QLatin1String(":/qml/images/select-marquee-24.png")), - tr("Select (Marquee)"), this); - ui->zoom = new QAction(QIcon(QLatin1String(":/qml/images/zoom-24.png")), tr("Zoom"), this); - ui->colorPicker = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-24.png")), - tr("Color Picker"), this); - ui->toQml = new QAction(QIcon(QLatin1String(":/qml/images/to-qml-24.png")), - tr("Apply Changes to QML Viewer"), this); - ui->fromQml = new QAction(QIcon(QLatin1String(":/qml/images/from-qml-24.png")), - tr("Apply Changes to Document"), this); - ui->designmode->setCheckable(true); - ui->designmode->setChecked(false); - - ui->play->setCheckable(false); - ui->select->setCheckable(true); - ui->selectMarquee->setCheckable(true); - ui->zoom->setCheckable(true); - ui->colorPicker->setCheckable(true); - - setWindowTitle(tr("Tools")); - - addAction(ui->designmode); - addAction(ui->play); - addSeparator(); - - addAction(ui->select); - // disabled because multi selection does not do anything useful without design mode - //addAction(ui->selectMarquee); - addSeparator(); - addAction(ui->zoom); - addAction(ui->colorPicker); - //addAction(ui->fromQml); - - ui->colorBox = new ToolBarColorBox(this); - ui->colorBox->setMinimumSize(24, 24); - ui->colorBox->setMaximumSize(28, 28); - ui->colorBox->setColor(Qt::black); - addWidget(ui->colorBox); - - setWindowFlags(Qt::Tool); - - QMenu *playSpeedMenu = new QMenu(this); - ui->playSpeedMenuActions = new QActionGroup(this); - ui->playSpeedMenuActions->setExclusive(true); - - QAction *speedAction = playSpeedMenu->addAction(tr("1x"), this, SLOT(changeAnimationSpeed())); - speedAction->setCheckable(true); - speedAction->setChecked(true); - speedAction->setData(1.0f); - ui->playSpeedMenuActions->addAction(speedAction); - - speedAction = playSpeedMenu->addAction(tr("0.5x"), this, SLOT(changeAnimationSpeed())); - speedAction->setCheckable(true); - speedAction->setData(2.0f); - ui->playSpeedMenuActions->addAction(speedAction); - - speedAction = playSpeedMenu->addAction(tr("0.25x"), this, SLOT(changeAnimationSpeed())); - speedAction->setCheckable(true); - speedAction->setData(4.0f); - ui->playSpeedMenuActions->addAction(speedAction); - - speedAction = playSpeedMenu->addAction(tr("0.125x"), this, SLOT(changeAnimationSpeed())); - speedAction->setCheckable(true); - speedAction->setData(8.0f); - ui->playSpeedMenuActions->addAction(speedAction); - - speedAction = playSpeedMenu->addAction(tr("0.1x"), this, SLOT(changeAnimationSpeed())); - speedAction->setCheckable(true); - speedAction->setData(10.0f); - ui->playSpeedMenuActions->addAction(speedAction); - - ui->play->setMenu(playSpeedMenu); - - connect(ui->designmode, SIGNAL(toggled(bool)), SLOT(setDesignModeBehaviorOnClick(bool))); - - connect(ui->colorPicker, SIGNAL(triggered()), SLOT(activateColorPickerOnClick())); - - connect(ui->play, SIGNAL(triggered()), SLOT(activatePlayOnClick())); - - connect(ui->zoom, SIGNAL(triggered()), SLOT(activateZoomOnClick())); - connect(ui->colorPicker, SIGNAL(triggered()), SLOT(activateColorPickerOnClick())); - connect(ui->select, SIGNAL(triggered()), SLOT(activateSelectToolOnClick())); - connect(ui->selectMarquee, SIGNAL(triggered()), SLOT(activateMarqueeSelectToolOnClick())); - - connect(ui->toQml, SIGNAL(triggered()), SLOT(activateToQml())); - connect(ui->fromQml, SIGNAL(triggered()), SLOT(activateFromQml())); -} - -QmlToolBar::~QmlToolBar() -{ - delete ui; -} - -void QmlToolBar::activateColorPicker() -{ - m_emitSignals = false; - activateColorPickerOnClick(); - m_emitSignals = true; -} - -void QmlToolBar::activateSelectTool() -{ - m_emitSignals = false; - activateSelectToolOnClick(); - m_emitSignals = true; -} - -void QmlToolBar::activateMarqueeSelectTool() -{ - m_emitSignals = false; - activateMarqueeSelectToolOnClick(); - m_emitSignals = true; -} - -void QmlToolBar::activateZoom() -{ - m_emitSignals = false; - activateZoomOnClick(); - m_emitSignals = true; -} - -void QmlToolBar::setAnimationSpeed(qreal slowDownFactor) -{ - if (m_animationSpeed == slowDownFactor) - return; - - m_emitSignals = false; - m_animationSpeed = slowDownFactor; - - foreach (QAction *action, ui->playSpeedMenuActions->actions()) { - if (action->data().toReal() == slowDownFactor) { - action->setChecked(true); - break; - } - } - - m_emitSignals = true; -} - -void QmlToolBar::setAnimationPaused(bool paused) -{ - if (m_paused == paused) - return; - - m_paused = paused; - updatePlayAction(); -} - -void QmlToolBar::changeAnimationSpeed() -{ - QAction *action = qobject_cast(sender()); - m_animationSpeed = action->data().toReal(); - emit animationSpeedChanged(m_animationSpeed); -} - -void QmlToolBar::setDesignModeBehavior(bool inDesignMode) -{ - m_emitSignals = false; - ui->designmode->setChecked(inDesignMode); - setDesignModeBehaviorOnClick(inDesignMode); - m_emitSignals = true; -} - -void QmlToolBar::setDesignModeBehaviorOnClick(bool checked) -{ - ui->select->setEnabled(checked); - ui->selectMarquee->setEnabled(checked); - ui->zoom->setEnabled(checked); - ui->colorPicker->setEnabled(checked); - ui->toQml->setEnabled(checked); - ui->fromQml->setEnabled(checked); - - if (m_emitSignals) - emit designModeBehaviorChanged(checked); -} - -void QmlToolBar::setColorBoxColor(const QColor &color) -{ - ui->colorBox->setColor(color); -} - -void QmlToolBar::activatePlayOnClick() -{ - m_paused = !m_paused; - emit animationPausedChanged(m_paused); - updatePlayAction(); -} - -void QmlToolBar::updatePlayAction() -{ - ui->play->setIcon(m_paused ? ui->playIcon : ui->pauseIcon); -} - -void QmlToolBar::activateColorPickerOnClick() -{ - ui->zoom->setChecked(false); - ui->select->setChecked(false); - ui->selectMarquee->setChecked(false); - - ui->colorPicker->setChecked(true); - if (m_activeTool != Constants::ColorPickerMode) { - m_activeTool = Constants::ColorPickerMode; - if (m_emitSignals) - emit colorPickerSelected(); - } -} - -void QmlToolBar::activateSelectToolOnClick() -{ - ui->zoom->setChecked(false); - ui->selectMarquee->setChecked(false); - ui->colorPicker->setChecked(false); - - ui->select->setChecked(true); - if (m_activeTool != Constants::SelectionToolMode) { - m_activeTool = Constants::SelectionToolMode; - if (m_emitSignals) - emit selectToolSelected(); - } -} - -void QmlToolBar::activateMarqueeSelectToolOnClick() -{ - ui->zoom->setChecked(false); - ui->select->setChecked(false); - ui->colorPicker->setChecked(false); - - ui->selectMarquee->setChecked(true); - if (m_activeTool != Constants::MarqueeSelectionToolMode) { - m_activeTool = Constants::MarqueeSelectionToolMode; - if (m_emitSignals) - emit marqueeSelectToolSelected(); - } -} - -void QmlToolBar::activateZoomOnClick() -{ - ui->select->setChecked(false); - ui->selectMarquee->setChecked(false); - ui->colorPicker->setChecked(false); - - ui->zoom->setChecked(true); - if (m_activeTool != Constants::ZoomMode) { - m_activeTool = Constants::ZoomMode; - if (m_emitSignals) - emit zoomToolSelected(); - } -} - -void QmlToolBar::activateFromQml() -{ - if (m_emitSignals) - emit applyChangesFromQmlFileSelected(); -} - -void QmlToolBar::activateToQml() -{ - if (m_emitSignals) - emit applyChangesToQmlFileSelected(); -} - -QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/declarativeobserver/editor/qmltoolbar_p.h b/src/plugins/qmltooling/declarativeobserver/editor/qmltoolbar_p.h deleted file mode 100644 index a3da1f7..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/qmltoolbar_p.h +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLTOOLBAR_H -#define QMLTOOLBAR_H - -#include -#include - -#include "../qmlobserverconstants_p.h" - -QT_FORWARD_DECLARE_CLASS(QActionGroup) - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class ToolBarColorBox; - -class QmlToolBar : public QToolBar -{ - Q_OBJECT - -public: - explicit QmlToolBar(QWidget *parent = 0); - ~QmlToolBar(); - -public slots: - void setDesignModeBehavior(bool inDesignMode); - void setColorBoxColor(const QColor &color); - void activateColorPicker(); - void activateSelectTool(); - void activateMarqueeSelectTool(); - void activateZoom(); - - void setAnimationSpeed(qreal slowDownFactor); - void setAnimationPaused(bool paused); - -signals: - void animationSpeedChanged(qreal factor); - void animationPausedChanged(bool paused); - - void designModeBehaviorChanged(bool inDesignMode); - void colorPickerSelected(); - void selectToolSelected(); - void marqueeSelectToolSelected(); - void zoomToolSelected(); - - void applyChangesToQmlFileSelected(); - void applyChangesFromQmlFileSelected(); - -private slots: - void setDesignModeBehaviorOnClick(bool inDesignMode); - void activatePlayOnClick(); - void activateColorPickerOnClick(); - void activateSelectToolOnClick(); - void activateMarqueeSelectToolOnClick(); - void activateZoomOnClick(); - - void activateFromQml(); - void activateToQml(); - - void changeAnimationSpeed(); - - void updatePlayAction(); - -private: - class Ui { - public: - QAction *designmode; - QAction *play; - QAction *select; - QAction *selectMarquee; - QAction *zoom; - QAction *colorPicker; - QAction *toQml; - QAction *fromQml; - QIcon playIcon; - QIcon pauseIcon; - ToolBarColorBox *colorBox; - - QActionGroup *playSpeedMenuActions; - }; - - bool m_emitSignals; - bool m_paused; - qreal m_animationSpeed; - - Constants::DesignTool m_activeTool; - - Ui *ui; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMLTOOLBAR_H diff --git a/src/plugins/qmltooling/declarativeobserver/editor/subcomponentmasklayeritem.cpp b/src/plugins/qmltooling/declarativeobserver/editor/subcomponentmasklayeritem.cpp deleted file mode 100644 index 27e2079..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/subcomponentmasklayeritem.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "subcomponentmasklayeritem_p.h" - -#include "../qmlobserverconstants_p.h" -#include "../qdeclarativeviewobserver_p.h" - -#include - -QT_BEGIN_NAMESPACE - -SubcomponentMaskLayerItem::SubcomponentMaskLayerItem(QDeclarativeViewObserver *observer, - QGraphicsItem *parentItem) : - QGraphicsPolygonItem(parentItem), - m_observer(observer), - m_currentItem(0), - m_borderRect(new QGraphicsRectItem(this)) -{ - m_borderRect->setRect(0,0,0,0); - m_borderRect->setPen(QPen(QColor(60, 60, 60), 1)); - m_borderRect->setData(Constants::EditorItemDataKey, QVariant(true)); - - setBrush(QBrush(QColor(160,160,160))); - setPen(Qt::NoPen); -} - -int SubcomponentMaskLayerItem::type() const -{ - return Constants::EditorItemType; -} - -static QRectF resizeRect(const QRectF &newRect, const QRectF &oldRect) -{ - QRectF result = newRect; - if (oldRect.left() < newRect.left()) - result.setLeft(oldRect.left()); - - if (oldRect.top() < newRect.top()) - result.setTop(oldRect.top()); - - if (oldRect.right() > newRect.right()) - result.setRight(oldRect.right()); - - if (oldRect.bottom() > newRect.bottom()) - result.setBottom(oldRect.bottom()); - - return result; -} - -static QPolygonF regionToPolygon(const QRegion ®ion) -{ - QPainterPath path; - foreach (const QRect &rect, region.rects()) - path.addRect(rect); - return path.toFillPolygon(); -} - -void SubcomponentMaskLayerItem::setCurrentItem(QGraphicsItem *item) -{ - QGraphicsItem *prevItem = m_currentItem; - m_currentItem = item; - - if (!m_currentItem) - return; - - QRect viewRect = m_observer->declarativeView()->rect(); - viewRect = m_observer->declarativeView()->mapToScene(viewRect).boundingRect().toRect(); - - QRectF itemRect = item->boundingRect() | item->childrenBoundingRect(); - itemRect = item->mapRectToScene(itemRect); - - // if updating the same item as before, resize the rectangle only bigger, not smaller. - if (prevItem == item && prevItem != 0) { - m_itemPolyRect = resizeRect(itemRect, m_itemPolyRect); - } else { - m_itemPolyRect = itemRect; - } - QRectF borderRect = m_itemPolyRect; - borderRect.adjust(-1, -1, 1, 1); - m_borderRect->setRect(borderRect); - - const QRegion externalRegion = QRegion(viewRect).subtracted(m_itemPolyRect.toRect()); - setPolygon(regionToPolygon(externalRegion)); -} - -QGraphicsItem *SubcomponentMaskLayerItem::currentItem() const -{ - return m_currentItem; -} - -QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/declarativeobserver/editor/subcomponentmasklayeritem_p.h b/src/plugins/qmltooling/declarativeobserver/editor/subcomponentmasklayeritem_p.h deleted file mode 100644 index 7a77253..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/subcomponentmasklayeritem_p.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef SUBCOMPONENTMASKLAYERITEM_H -#define SUBCOMPONENTMASKLAYERITEM_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QDeclarativeViewObserver; - -class SubcomponentMaskLayerItem : public QGraphicsPolygonItem -{ -public: - explicit SubcomponentMaskLayerItem(QDeclarativeViewObserver *observer, - QGraphicsItem *parentItem = 0); - int type() const; - void setCurrentItem(QGraphicsItem *item); - void setBoundingBox(const QRectF &boundingBox); - QGraphicsItem *currentItem() const; - QRectF itemRect() const; - -private: - QDeclarativeViewObserver *m_observer; - QGraphicsItem *m_currentItem; - QGraphicsRectItem *m_borderRect; - QRectF m_itemPolyRect; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // SUBCOMPONENTMASKLAYERITEM_H diff --git a/src/plugins/qmltooling/declarativeobserver/editor/toolbarcolorbox.cpp b/src/plugins/qmltooling/declarativeobserver/editor/toolbarcolorbox.cpp deleted file mode 100644 index d3a5a37..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/toolbarcolorbox.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "toolbarcolorbox_p.h" - -#include "../qmlobserverconstants_p.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -ToolBarColorBox::ToolBarColorBox(QWidget *parent) : - QLabel(parent) -{ - m_copyHexColor = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-hicontrast.png")), - tr("Copy Color"), this); - connect(m_copyHexColor, SIGNAL(triggered()), SLOT(copyColorToClipboard())); - setScaledContents(false); -} - -void ToolBarColorBox::setColor(const QColor &color) -{ - m_color = color; - - QPixmap pix = createDragPixmap(width()); - setPixmap(pix); - update(); -} - -void ToolBarColorBox::mousePressEvent(QMouseEvent *event) -{ - m_dragBeginPoint = event->pos(); - m_dragStarted = false; -} - -void ToolBarColorBox::mouseMoveEvent(QMouseEvent *event) -{ - - if (event->buttons() & Qt::LeftButton - && (QPoint(event->pos() - m_dragBeginPoint).manhattanLength() - > Constants::DragStartDistance) - && !m_dragStarted) - { - m_dragStarted = true; - QDrag *drag = new QDrag(this); - QMimeData *mimeData = new QMimeData; - - mimeData->setText(m_color.name()); - drag->setMimeData(mimeData); - drag->setPixmap(createDragPixmap()); - - drag->exec(); - } -} - -QPixmap ToolBarColorBox::createDragPixmap(int size) const -{ - QPixmap pix(size, size); - QPainter p(&pix); - - QColor borderColor1 = QColor(143, 143 ,143); - QColor borderColor2 = QColor(43, 43, 43); - - p.setBrush(QBrush(m_color)); - p.setPen(QPen(QBrush(borderColor2),1)); - - p.fillRect(0, 0, size, size, borderColor1); - p.drawRect(1,1, size - 3, size - 3); - return pix; -} - -void ToolBarColorBox::contextMenuEvent(QContextMenuEvent *ev) -{ - QMenu contextMenu; - contextMenu.addAction(m_copyHexColor); - contextMenu.exec(ev->globalPos()); -} - -void ToolBarColorBox::copyColorToClipboard() -{ - QClipboard *clipboard = QApplication::clipboard(); - clipboard->setText(m_color.name()); -} - -QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/declarativeobserver/editor/toolbarcolorbox_p.h b/src/plugins/qmltooling/declarativeobserver/editor/toolbarcolorbox_p.h deleted file mode 100644 index c3e064c..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/toolbarcolorbox_p.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef TOOLBARCOLORBOX_H -#define TOOLBARCOLORBOX_H - -#include -#include -#include - -QT_FORWARD_DECLARE_CLASS(QContextMenuEvent) -QT_FORWARD_DECLARE_CLASS(QAction) - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class ToolBarColorBox : public QLabel -{ - Q_OBJECT - -public: - explicit ToolBarColorBox(QWidget *parent = 0); - void setColor(const QColor &color); - -protected: - void contextMenuEvent(QContextMenuEvent *ev); - void mousePressEvent(QMouseEvent *ev); - void mouseMoveEvent(QMouseEvent *ev); -private slots: - void copyColorToClipboard(); - -private: - QPixmap createDragPixmap(int size = 24) const; - -private: - bool m_dragStarted; - QPoint m_dragBeginPoint; - QAction *m_copyHexColor; - QColor m_color; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // TOOLBARCOLORBOX_H diff --git a/src/plugins/qmltooling/declarativeobserver/editor/zoomtool.cpp b/src/plugins/qmltooling/declarativeobserver/editor/zoomtool.cpp deleted file mode 100644 index 68d67cc..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/zoomtool.cpp +++ /dev/null @@ -1,336 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "zoomtool_p.h" - -#include "../qdeclarativeviewobserver_p_p.h" - -#include -#include -#include -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -ZoomTool::ZoomTool(QDeclarativeViewObserver *view) : - AbstractLiveEditTool(view), - m_rubberbandManipulator(), - m_smoothZoomMultiplier(0.05f), - m_currentScale(1.0f) -{ - m_zoomTo100Action = new QAction(tr("Zoom to &100%"), this); - m_zoomInAction = new QAction(tr("Zoom In"), this); - m_zoomOutAction = new QAction(tr("Zoom Out"), this); - m_zoomInAction->setShortcut(QKeySequence(Qt::Key_Plus)); - m_zoomOutAction->setShortcut(QKeySequence(Qt::Key_Minus)); - - - LiveLayerItem *layerItem = QDeclarativeViewObserverPrivate::get(view)->manipulatorLayer; - QGraphicsObject *layerObject = reinterpret_cast(layerItem); - m_rubberbandManipulator = new LiveRubberBandSelectionManipulator(layerObject, view); - - - connect(m_zoomTo100Action, SIGNAL(triggered()), SLOT(zoomTo100())); - connect(m_zoomInAction, SIGNAL(triggered()), SLOT(zoomIn())); - connect(m_zoomOutAction, SIGNAL(triggered()), SLOT(zoomOut())); -} - -ZoomTool::~ZoomTool() -{ - delete m_rubberbandManipulator; -} - -void ZoomTool::mousePressEvent(QMouseEvent *event) -{ - m_mousePos = event->pos(); - - QPointF scenePos = view()->mapToScene(event->pos()); - - if (event->buttons() & Qt::RightButton) { - QMenu contextMenu; - contextMenu.addAction(m_zoomTo100Action); - contextMenu.addSeparator(); - contextMenu.addAction(m_zoomInAction); - contextMenu.addAction(m_zoomOutAction); - contextMenu.exec(event->globalPos()); - } else if (event->buttons() & Qt::LeftButton) { - m_dragBeginPos = scenePos; - m_dragStarted = false; - } -} - -void ZoomTool::mouseMoveEvent(QMouseEvent *event) -{ - m_mousePos = event->pos(); - - QPointF scenePos = view()->mapToScene(event->pos()); - - if (event->buttons() & Qt::LeftButton - && (QPointF(scenePos - m_dragBeginPos).manhattanLength() - > Constants::DragStartDistance / 3) - && !m_dragStarted) - { - m_dragStarted = true; - m_rubberbandManipulator->begin(m_dragBeginPos); - return; - } - - if (m_dragStarted) - m_rubberbandManipulator->update(scenePos); - -} - -void ZoomTool::mouseReleaseEvent(QMouseEvent *event) -{ - m_mousePos = event->pos(); - QPointF scenePos = view()->mapToScene(event->pos()); - - if (m_dragStarted) { - m_rubberbandManipulator->end(); - - int x1 = qMin(scenePos.x(), m_rubberbandManipulator->beginPoint().x()); - int x2 = qMax(scenePos.x(), m_rubberbandManipulator->beginPoint().x()); - int y1 = qMin(scenePos.y(), m_rubberbandManipulator->beginPoint().y()); - int y2 = qMax(scenePos.y(), m_rubberbandManipulator->beginPoint().y()); - - QPointF scenePosTopLeft = QPoint(x1, y1); - QPointF scenePosBottomRight = QPoint(x2, y2); - - QRectF sceneArea(scenePosTopLeft, scenePosBottomRight); - - m_currentScale = qMin(view()->rect().width() / sceneArea.width(), - view()->rect().height() / sceneArea.height()); - - - QTransform transform; - transform.scale(m_currentScale, m_currentScale); - - view()->setTransform(transform); - view()->setSceneRect(sceneArea); - } else { - Qt::KeyboardModifier modifierKey = Qt::ControlModifier; -#ifdef Q_WS_MAC - modifierKey = Qt::AltModifier; -#endif - if (event->modifiers() & modifierKey) { - zoomOut(); - } else { - zoomIn(); - } - } -} - -void ZoomTool::zoomIn() -{ - m_currentScale = nextZoomScale(ZoomIn); - scaleView(view()->mapToScene(m_mousePos)); -} - -void ZoomTool::zoomOut() -{ - m_currentScale = nextZoomScale(ZoomOut); - scaleView(view()->mapToScene(m_mousePos)); -} - -void ZoomTool::mouseDoubleClickEvent(QMouseEvent *event) -{ - m_mousePos = event->pos(); -} - - -void ZoomTool::hoverMoveEvent(QMouseEvent *event) -{ - m_mousePos = event->pos(); -} - - -void ZoomTool::keyPressEvent(QKeyEvent * /*event*/) -{ -} - -void ZoomTool::wheelEvent(QWheelEvent *event) -{ - if (event->orientation() != Qt::Vertical) - return; - - Qt::KeyboardModifier smoothZoomModifier = Qt::ControlModifier; - if (event->modifiers() & smoothZoomModifier) { - int numDegrees = event->delta() / 8; - m_currentScale += m_smoothZoomMultiplier * (numDegrees / 15.0f); - - scaleView(view()->mapToScene(m_mousePos)); - - } else if (!event->modifiers()) { - if (event->delta() > 0) { - m_currentScale = nextZoomScale(ZoomIn); - } else if (event->delta() < 0) { - m_currentScale = nextZoomScale(ZoomOut); - } - scaleView(view()->mapToScene(m_mousePos)); - } -} - -void ZoomTool::keyReleaseEvent(QKeyEvent *event) -{ - switch (event->key()) { - case Qt::Key_Plus: - zoomIn(); - break; - case Qt::Key_Minus: - zoomOut(); - break; - case Qt::Key_1: - case Qt::Key_2: - case Qt::Key_3: - case Qt::Key_4: - case Qt::Key_5: - case Qt::Key_6: - case Qt::Key_7: - case Qt::Key_8: - case Qt::Key_9: - { - m_currentScale = ((event->key() - Qt::Key_0) * 1.0f); - scaleView(view()->mapToScene(m_mousePos)); // view()->mapToScene(view()->rect().center()) - break; - } - - default: - break; - } - -} - -void ZoomTool::itemsAboutToRemoved(const QList &/*itemList*/) -{ -} - -void ZoomTool::clear() -{ - view()->setCursor(Qt::ArrowCursor); -} - -void ZoomTool::selectedItemsChanged(const QList &/*itemList*/) -{ -} - -void ZoomTool::scaleView(const QPointF ¢erPos) -{ - - QTransform transform; - transform.scale(m_currentScale, m_currentScale); - view()->setTransform(transform); - - QPointF adjustedCenterPos = centerPos; - QSize rectSize(view()->rect().width() / m_currentScale, - view()->rect().height() / m_currentScale); - - QRectF sceneRect; - if (qAbs(m_currentScale - 1.0f) < Constants::ZoomSnapDelta) { - adjustedCenterPos.rx() = rectSize.width() / 2; - adjustedCenterPos.ry() = rectSize.height() / 2; - } - - if (m_currentScale < 1.0f) { - adjustedCenterPos.rx() = rectSize.width() / 2; - adjustedCenterPos.ry() = rectSize.height() / 2; - sceneRect.setRect(view()->rect().width() / 2 -rectSize.width() / 2, - view()->rect().height() / 2 -rectSize.height() / 2, - rectSize.width(), - rectSize.height()); - } else { - sceneRect.setRect(adjustedCenterPos.x() - rectSize.width() / 2, - adjustedCenterPos.y() - rectSize.height() / 2, - rectSize.width(), - rectSize.height()); - } - - view()->setSceneRect(sceneRect); -} - -void ZoomTool::zoomTo100() -{ - m_currentScale = 1.0f; - scaleView(view()->mapToScene(view()->rect().center())); -} - -qreal ZoomTool::nextZoomScale(ZoomDirection direction) const -{ - static QList zoomScales = - QList() - << 0.125f - << 1.0f / 6.0f - << 0.25f - << 1.0f / 3.0f - << 0.5f - << 2.0f / 3.0f - << 1.0f - << 2.0f - << 3.0f - << 4.0f - << 5.0f - << 6.0f - << 7.0f - << 8.0f - << 12.0f - << 16.0f - << 32.0f - << 48.0f; - - if (direction == ZoomIn) { - for (int i = 0; i < zoomScales.length(); ++i) { - if (zoomScales[i] > m_currentScale || i == zoomScales.length() - 1) - return zoomScales[i]; - } - } else { - for (int i = zoomScales.length() - 1; i >= 0; --i) { - if (zoomScales[i] < m_currentScale || i == 0) - return zoomScales[i]; - } - } - - return 1.0f; -} - -QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/declarativeobserver/editor/zoomtool_p.h b/src/plugins/qmltooling/declarativeobserver/editor/zoomtool_p.h deleted file mode 100644 index ef5c2e6..0000000 --- a/src/plugins/qmltooling/declarativeobserver/editor/zoomtool_p.h +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef ZOOMTOOL_H -#define ZOOMTOOL_H - -#include "abstractliveedittool_p.h" -#include "liverubberbandselectionmanipulator_p.h" - -QT_FORWARD_DECLARE_CLASS(QAction) - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class ZoomTool : public AbstractLiveEditTool -{ - Q_OBJECT - -public: - enum ZoomDirection { - ZoomIn, - ZoomOut - }; - - explicit ZoomTool(QDeclarativeViewObserver *view); - - virtual ~ZoomTool(); - - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - void mouseDoubleClickEvent(QMouseEvent *event); - - void hoverMoveEvent(QMouseEvent *event); - void wheelEvent(QWheelEvent *event); - - void keyPressEvent(QKeyEvent *event); - void keyReleaseEvent(QKeyEvent *keyEvent); - void itemsAboutToRemoved(const QList &itemList); - - void clear(); - -protected: - void selectedItemsChanged(const QList &itemList); - -private slots: - void zoomTo100(); - void zoomIn(); - void zoomOut(); - -private: - qreal nextZoomScale(ZoomDirection direction) const; - void scaleView(const QPointF ¢erPos); - -private: - bool m_dragStarted; - QPoint m_mousePos; // in view coords - QPointF m_dragBeginPos; - QAction *m_zoomTo100Action; - QAction *m_zoomInAction; - QAction *m_zoomOutAction; - LiveRubberBandSelectionManipulator *m_rubberbandManipulator; - - qreal m_smoothZoomMultiplier; - qreal m_currentScale; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // ZOOMTOOL_H diff --git a/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverplugin.cpp b/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverplugin.cpp deleted file mode 100644 index a00bc6f..0000000 --- a/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverplugin.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qdeclarativeobserverplugin.h" - -#include "qdeclarativeviewobserver_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -QDeclarativeObserverPlugin::QDeclarativeObserverPlugin() : - m_observer(0) -{ -} - -QDeclarativeObserverPlugin::~QDeclarativeObserverPlugin() -{ - delete m_observer; -} - -void QDeclarativeObserverPlugin::activate() -{ - QDeclarativeObserverService *service = QDeclarativeObserverService::instance(); - QList views = service->views(); - if (views.isEmpty()) - return; - - // TODO: Support multiple views - QDeclarativeView *view = service->views().at(0); - m_observer = new QDeclarativeViewObserver(view, view); -} - -void QDeclarativeObserverPlugin::deactivate() -{ - delete m_observer; -} - -Q_EXPORT_PLUGIN2(declarativeobserver, QDeclarativeObserverPlugin) - -QT_END_NAMESPACE - diff --git a/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverplugin.h b/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverplugin.h deleted file mode 100644 index 7bc7626..0000000 --- a/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverplugin.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QDECLARATIVEOBSERVERPLUGIN_H -#define QDECLARATIVEOBSERVERPLUGIN_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class QDeclarativeViewObserver; - -class QDeclarativeObserverPlugin : public QObject, public QDeclarativeObserverInterface -{ - Q_OBJECT - Q_DISABLE_COPY(QDeclarativeObserverPlugin) - Q_INTERFACES(QDeclarativeObserverInterface) - -public: - QDeclarativeObserverPlugin(); - ~QDeclarativeObserverPlugin(); - - void activate(); - void deactivate(); - -private: - QPointer m_observer; -}; - -QT_END_NAMESPACE - -#endif // QDECLARATIVEOBSERVERPLUGIN_H diff --git a/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverprotocol.h b/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverprotocol.h deleted file mode 100644 index 62722acc..0000000 --- a/src/plugins/qmltooling/declarativeobserver/qdeclarativeobserverprotocol.h +++ /dev/null @@ -1,143 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QDECLARATIVEOBSERVERPROTOCOL_H -#define QDECLARATIVEOBSERVERPROTOCOL_H - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class ObserverProtocol : public QObject -{ - Q_OBJECT - Q_ENUMS(Message Tool) - -public: - enum Message { - AnimationSpeedChanged = 0, - AnimationPausedChanged = 19, // highest value - ChangeTool = 1, - ClearComponentCache = 2, - ColorChanged = 3, - CreateObject = 5, - CurrentObjectsChanged = 6, - DestroyObject = 7, - MoveObject = 8, - ObjectIdList = 9, - Reload = 10, - Reloaded = 11, - SetAnimationSpeed = 12, - SetAnimationPaused = 18, - SetCurrentObjects = 14, - SetDesignMode = 15, - ShowAppOnTop = 16, - ToolChanged = 17 - }; - - enum Tool { - ColorPickerTool, - SelectMarqueeTool, - SelectTool, - ZoomTool - }; - - static inline QString toString(Message message) - { - return QLatin1String(staticMetaObject.enumerator(0).valueToKey(message)); - } - - static inline QString toString(Tool tool) - { - return QLatin1String(staticMetaObject.enumerator(1).valueToKey(tool)); - } -}; - -inline QDataStream & operator<< (QDataStream &stream, ObserverProtocol::Message message) -{ - return stream << static_cast(message); -} - -inline QDataStream & operator>> (QDataStream &stream, ObserverProtocol::Message &message) -{ - quint32 i; - stream >> i; - message = static_cast(i); - return stream; -} - -inline QDebug operator<< (QDebug dbg, ObserverProtocol::Message message) -{ - dbg << ObserverProtocol::toString(message); - return dbg; -} - -inline QDataStream & operator<< (QDataStream &stream, ObserverProtocol::Tool tool) -{ - return stream << static_cast(tool); -} - -inline QDataStream & operator>> (QDataStream &stream, ObserverProtocol::Tool &tool) -{ - quint32 i; - stream >> i; - tool = static_cast(i); - return stream; -} - -inline QDebug operator<< (QDebug dbg, ObserverProtocol::Tool tool) -{ - dbg << ObserverProtocol::toString(tool); - return dbg; -} - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QDECLARATIVEOBSERVERPROTOCOL_H diff --git a/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp b/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp deleted file mode 100644 index bb23831..0000000 --- a/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp +++ /dev/null @@ -1,1021 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "QtDeclarative/private/qdeclarativeobserverservice_p.h" -#include "QtDeclarative/private/qdeclarativedebughelper_p.h" - -#include "qdeclarativeviewobserver_p.h" -#include "qdeclarativeviewobserver_p_p.h" -#include "qdeclarativeobserverprotocol.h" - -#include "editor/liveselectiontool_p.h" -#include "editor/zoomtool_p.h" -#include "editor/colorpickertool_p.h" -#include "editor/livelayeritem_p.h" -#include "editor/boundingrecthighlighter_p.h" -#include "editor/qmltoolbar_p.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static inline void initEditorResource() { Q_INIT_RESOURCE(editor); } - -QT_BEGIN_NAMESPACE - -const char * const KEY_TOOLBOX_GEOMETRY = "toolBox/geometry"; - -const int SceneChangeUpdateInterval = 5000; - - -class ToolBox : public QWidget -{ - Q_OBJECT - -public: - ToolBox(QWidget *parent = 0); - ~ToolBox(); - - QmlToolBar *toolBar() const { return m_toolBar; } - -private: - QSettings m_settings; - QmlToolBar *m_toolBar; -}; - -ToolBox::ToolBox(QWidget *parent) - : QWidget(parent, Qt::Tool) - , m_settings(QLatin1String("Nokia"), QLatin1String("QmlObserver"), this) - , m_toolBar(new QmlToolBar) -{ - setWindowFlags((windowFlags() & ~Qt::WindowCloseButtonHint) | Qt::CustomizeWindowHint); - setWindowTitle(tr("Qt Quick Toolbox")); - - QVBoxLayout *verticalLayout = new QVBoxLayout; - verticalLayout->setMargin(0); - verticalLayout->addWidget(m_toolBar); - setLayout(verticalLayout); - - restoreGeometry(m_settings.value(QLatin1String(KEY_TOOLBOX_GEOMETRY)).toByteArray()); -} - -ToolBox::~ToolBox() -{ - m_settings.setValue(QLatin1String(KEY_TOOLBOX_GEOMETRY), saveGeometry()); -} - - -QDeclarativeViewObserverPrivate::QDeclarativeViewObserverPrivate(QDeclarativeViewObserver *q) : - q(q), - designModeBehavior(false), - showAppOnTop(false), - animationPaused(false), - slowDownFactor(1.0f), - toolBox(0) -{ -} - -QDeclarativeViewObserverPrivate::~QDeclarativeViewObserverPrivate() -{ -} - -QDeclarativeViewObserver::QDeclarativeViewObserver(QDeclarativeView *view, - QObject *parent) : - QObject(parent), - data(new QDeclarativeViewObserverPrivate(this)) -{ - initEditorResource(); - - data->view = view; - data->manipulatorLayer = new LiveLayerItem(view->scene()); - data->selectionTool = new LiveSelectionTool(this); - data->zoomTool = new ZoomTool(this); - data->colorPickerTool = new ColorPickerTool(this); - data->boundingRectHighlighter = new BoundingRectHighlighter(this); - data->currentTool = data->selectionTool; - - // to capture ChildRemoved event when viewport changes - data->view->installEventFilter(this); - - data->setViewport(data->view->viewport()); - - data->debugService = QDeclarativeObserverService::instance(); - connect(data->debugService, SIGNAL(gotMessage(QByteArray)), - this, SLOT(handleMessage(QByteArray))); - - connect(data->view, SIGNAL(statusChanged(QDeclarativeView::Status)), - data.data(), SLOT(_q_onStatusChanged(QDeclarativeView::Status))); - - connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)), - SIGNAL(selectedColorChanged(QColor))); - connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)), - this, SLOT(sendColorChanged(QColor))); - - data->_q_changeToSingleSelectTool(); -} - -QDeclarativeViewObserver::~QDeclarativeViewObserver() -{ -} - -void QDeclarativeViewObserverPrivate::_q_setToolBoxVisible(bool visible) -{ -#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR) - if (!toolBox && visible) - createToolBox(); - if (toolBox) - toolBox->setVisible(visible); -#else - Q_UNUSED(visible) -#endif -} - -void QDeclarativeViewObserverPrivate::_q_reloadView() -{ - clearHighlight(); - emit q->reloadRequested(); -} - -void QDeclarativeViewObserverPrivate::setViewport(QWidget *widget) -{ - if (viewport.data() == widget) - return; - - if (viewport) - viewport.data()->removeEventFilter(q); - - viewport = widget; - if (viewport) { - // make sure we get mouse move events - viewport.data()->setMouseTracking(true); - viewport.data()->installEventFilter(q); - } -} - -void QDeclarativeViewObserverPrivate::clearEditorItems() -{ - clearHighlight(); - setSelectedItems(QList()); -} - -bool QDeclarativeViewObserver::eventFilter(QObject *obj, QEvent *event) -{ - if (obj == data->view) { - // Event from view - if (event->type() == QEvent::ChildRemoved) { - // Might mean that viewport has changed - if (data->view->viewport() != data->viewport.data()) - data->setViewport(data->view->viewport()); - } - return QObject::eventFilter(obj, event); - } - - // Event from viewport - switch (event->type()) { - case QEvent::Leave: { - if (leaveEvent(event)) - return true; - break; - } - case QEvent::MouseButtonPress: { - if (mousePressEvent(static_cast(event))) - return true; - break; - } - case QEvent::MouseMove: { - if (mouseMoveEvent(static_cast(event))) - return true; - break; - } - case QEvent::MouseButtonRelease: { - if (mouseReleaseEvent(static_cast(event))) - return true; - break; - } - case QEvent::KeyPress: { - if (keyPressEvent(static_cast(event))) - return true; - break; - } - case QEvent::KeyRelease: { - if (keyReleaseEvent(static_cast(event))) - return true; - break; - } - case QEvent::MouseButtonDblClick: { - if (mouseDoubleClickEvent(static_cast(event))) - return true; - break; - } - case QEvent::Wheel: { - if (wheelEvent(static_cast(event))) - return true; - break; - } - default: { - break; - } - } //switch - - // standard event processing - return QObject::eventFilter(obj, event); -} - -bool QDeclarativeViewObserver::leaveEvent(QEvent * /*event*/) -{ - if (!data->designModeBehavior) - return false; - data->clearHighlight(); - return true; -} - -bool QDeclarativeViewObserver::mousePressEvent(QMouseEvent *event) -{ - if (!data->designModeBehavior) - return false; - data->cursorPos = event->pos(); - data->currentTool->mousePressEvent(event); - return true; -} - -bool QDeclarativeViewObserver::mouseMoveEvent(QMouseEvent *event) -{ - if (!data->designModeBehavior) { - data->clearEditorItems(); - return false; - } - data->cursorPos = event->pos(); - - QList selItems = data->selectableItems(event->pos()); - if (!selItems.isEmpty()) { - declarativeView()->setToolTip(data->currentTool->titleForItem(selItems.first())); - } else { - declarativeView()->setToolTip(QString()); - } - if (event->buttons()) { - data->currentTool->mouseMoveEvent(event); - } else { - data->currentTool->hoverMoveEvent(event); - } - return true; -} - -bool QDeclarativeViewObserver::mouseReleaseEvent(QMouseEvent *event) -{ - if (!data->designModeBehavior) - return false; - - data->cursorPos = event->pos(); - data->currentTool->mouseReleaseEvent(event); - return true; -} - -bool QDeclarativeViewObserver::keyPressEvent(QKeyEvent *event) -{ - if (!data->designModeBehavior) - return false; - - data->currentTool->keyPressEvent(event); - return true; -} - -bool QDeclarativeViewObserver::keyReleaseEvent(QKeyEvent *event) -{ - if (!data->designModeBehavior) - return false; - - switch (event->key()) { - case Qt::Key_V: - data->_q_changeToSingleSelectTool(); - break; -// disabled because multiselection does not do anything useful without design mode -// case Qt::Key_M: -// data->_q_changeToMarqueeSelectTool(); -// break; - case Qt::Key_I: - data->_q_changeToColorPickerTool(); - break; - case Qt::Key_Z: - data->_q_changeToZoomTool(); - break; - case Qt::Key_Space: - setAnimationPaused(!data->animationPaused); - break; - default: - break; - } - - data->currentTool->keyReleaseEvent(event); - return true; -} - -void QDeclarativeViewObserverPrivate::_q_createQmlObject(const QString &qml, QObject *parent, - const QStringList &importList, - const QString &filename) -{ - if (!parent) - return; - - QString imports; - foreach (const QString &s, importList) { - imports += s; - imports += QLatin1Char('\n'); - } - - QDeclarativeContext *parentContext = view->engine()->contextForObject(parent); - QDeclarativeComponent component(view->engine(), q); - QByteArray constructedQml = QString(imports + qml).toLatin1(); - - component.setData(constructedQml, QUrl::fromLocalFile(filename)); - QObject *newObject = component.create(parentContext); - if (newObject) { - newObject->setParent(parent); - QDeclarativeItem *parentItem = qobject_cast(parent); - QDeclarativeItem *newItem = qobject_cast(newObject); - if (parentItem && newItem) - newItem->setParentItem(parentItem); - } -} - -void QDeclarativeViewObserverPrivate::_q_reparentQmlObject(QObject *object, QObject *newParent) -{ - if (!newParent) - return; - - object->setParent(newParent); - QDeclarativeItem *newParentItem = qobject_cast(newParent); - QDeclarativeItem *item = qobject_cast(object); - if (newParentItem && item) - item->setParentItem(newParentItem); -} - -void QDeclarativeViewObserverPrivate::_q_clearComponentCache() -{ - view->engine()->clearComponentCache(); -} - -void QDeclarativeViewObserverPrivate::_q_removeFromSelection(QObject *obj) -{ - QList items = selectedItems(); - if (QGraphicsItem *item = qobject_cast(obj)) - items.removeOne(item); - setSelectedItems(items); -} - -bool QDeclarativeViewObserver::mouseDoubleClickEvent(QMouseEvent * /*event*/) -{ - if (!data->designModeBehavior) - return false; - - return true; -} - -bool QDeclarativeViewObserver::wheelEvent(QWheelEvent *event) -{ - if (!data->designModeBehavior) - return false; - data->currentTool->wheelEvent(event); - return true; -} - -void QDeclarativeViewObserver::setDesignModeBehavior(bool value) -{ - emit designModeBehaviorChanged(value); - - if (data->toolBox) - data->toolBox->toolBar()->setDesignModeBehavior(value); - sendDesignModeBehavior(value); - - data->designModeBehavior = value; - - if (!data->designModeBehavior) - data->clearEditorItems(); -} - -bool QDeclarativeViewObserver::designModeBehavior() -{ - return data->designModeBehavior; -} - -bool QDeclarativeViewObserver::showAppOnTop() const -{ - return data->showAppOnTop; -} - -void QDeclarativeViewObserver::setShowAppOnTop(bool appOnTop) -{ - if (data->view) { - QWidget *window = data->view->window(); - Qt::WindowFlags flags = window->windowFlags(); - if (appOnTop) - flags |= Qt::WindowStaysOnTopHint; - else - flags &= ~Qt::WindowStaysOnTopHint; - - window->setWindowFlags(flags); - window->show(); - } - - data->showAppOnTop = appOnTop; - sendShowAppOnTop(appOnTop); - - emit showAppOnTopChanged(appOnTop); -} - -void QDeclarativeViewObserverPrivate::changeTool(Constants::DesignTool tool, - Constants::ToolFlags /*flags*/) -{ - switch (tool) { - case Constants::SelectionToolMode: - _q_changeToSingleSelectTool(); - break; - case Constants::NoTool: - default: - currentTool = 0; - break; - } -} - -void QDeclarativeViewObserverPrivate::setSelectedItemsForTools(const QList &items) -{ - foreach (const QWeakPointer &obj, currentSelection) { - if (QGraphicsItem *item = obj.data()) { - if (!items.contains(item)) { - QObject::disconnect(obj.data(), SIGNAL(destroyed(QObject*)), - this, SLOT(_q_removeFromSelection(QObject*))); - currentSelection.removeOne(obj); - } - } - } - - foreach (QGraphicsItem *item, items) { - if (QGraphicsObject *obj = item->toGraphicsObject()) { - if (!currentSelection.contains(obj)) { - QObject::connect(obj, SIGNAL(destroyed(QObject*)), - this, SLOT(_q_removeFromSelection(QObject*))); - currentSelection.append(obj); - } - } - } - - currentTool->updateSelectedItems(); -} - -void QDeclarativeViewObserverPrivate::setSelectedItems(const QList &items) -{ - QList > oldList = currentSelection; - setSelectedItemsForTools(items); - if (oldList != currentSelection) { - QList objectList; - foreach (const QWeakPointer &graphicsObject, currentSelection) { - if (graphicsObject) - objectList << graphicsObject.data(); - } - - q->sendCurrentObjects(objectList); - } -} - -QList QDeclarativeViewObserverPrivate::selectedItems() const -{ - QList selection; - foreach (const QWeakPointer &selectedObject, currentSelection) { - if (selectedObject.data()) - selection << selectedObject.data(); - } - - return selection; -} - -void QDeclarativeViewObserver::setSelectedItems(QList items) -{ - data->setSelectedItems(items); -} - -QList QDeclarativeViewObserver::selectedItems() const -{ - return data->selectedItems(); -} - -QDeclarativeView *QDeclarativeViewObserver::declarativeView() -{ - return data->view; -} - -void QDeclarativeViewObserverPrivate::clearHighlight() -{ - boundingRectHighlighter->clear(); -} - -void QDeclarativeViewObserverPrivate::highlight(const QList &items) -{ - if (items.isEmpty()) - return; - - QList objectList; - foreach (QGraphicsItem *item, items) { - QGraphicsItem *child = item; - - if (child) { - QGraphicsObject *childObject = child->toGraphicsObject(); - if (childObject) - objectList << childObject; - } - } - - boundingRectHighlighter->highlight(objectList); -} - -QList QDeclarativeViewObserverPrivate::selectableItems( - const QPointF &scenePos) const -{ - QList itemlist = view->scene()->items(scenePos); - return filterForSelection(itemlist); -} - -QList QDeclarativeViewObserverPrivate::selectableItems(const QPoint &pos) const -{ - QList itemlist = view->items(pos); - return filterForSelection(itemlist); -} - -QList QDeclarativeViewObserverPrivate::selectableItems( - const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const -{ - QList itemlist = view->scene()->items(sceneRect, selectionMode); - return filterForSelection(itemlist); -} - -void QDeclarativeViewObserverPrivate::_q_changeToSingleSelectTool() -{ - currentToolMode = Constants::SelectionToolMode; - selectionTool->setRubberbandSelectionMode(false); - - changeToSelectTool(); - - emit q->selectToolActivated(); - q->sendCurrentTool(Constants::SelectionToolMode); -} - -void QDeclarativeViewObserverPrivate::changeToSelectTool() -{ - if (currentTool == selectionTool) - return; - - currentTool->clear(); - currentTool = selectionTool; - currentTool->clear(); - currentTool->updateSelectedItems(); -} - -void QDeclarativeViewObserverPrivate::_q_changeToMarqueeSelectTool() -{ - changeToSelectTool(); - currentToolMode = Constants::MarqueeSelectionToolMode; - selectionTool->setRubberbandSelectionMode(true); - - emit q->marqueeSelectToolActivated(); - q->sendCurrentTool(Constants::MarqueeSelectionToolMode); -} - -void QDeclarativeViewObserverPrivate::_q_changeToZoomTool() -{ - currentToolMode = Constants::ZoomMode; - currentTool->clear(); - currentTool = zoomTool; - currentTool->clear(); - - emit q->zoomToolActivated(); - q->sendCurrentTool(Constants::ZoomMode); -} - -void QDeclarativeViewObserverPrivate::_q_changeToColorPickerTool() -{ - if (currentTool == colorPickerTool) - return; - - currentToolMode = Constants::ColorPickerMode; - currentTool->clear(); - currentTool = colorPickerTool; - currentTool->clear(); - - emit q->colorPickerActivated(); - q->sendCurrentTool(Constants::ColorPickerMode); -} - -void QDeclarativeViewObserver::setAnimationSpeed(qreal slowDownFactor) -{ - Q_ASSERT(slowDownFactor > 0); - if (data->slowDownFactor == slowDownFactor) - return; - - animationSpeedChangeRequested(slowDownFactor); - sendAnimationSpeed(slowDownFactor); -} - -void QDeclarativeViewObserver::setAnimationPaused(bool paused) -{ - if (data->animationPaused == paused) - return; - - animationPausedChangeRequested(paused); - sendAnimationPaused(paused); -} - -void QDeclarativeViewObserver::animationSpeedChangeRequested(qreal factor) -{ - if (data->slowDownFactor != factor) { - data->slowDownFactor = factor; - emit animationSpeedChanged(factor); - } - - const float effectiveFactor = data->animationPaused ? 0 : factor; - QDeclarativeDebugHelper::setAnimationSlowDownFactor(effectiveFactor); -} - -void QDeclarativeViewObserver::animationPausedChangeRequested(bool paused) -{ - if (data->animationPaused != paused) { - data->animationPaused = paused; - emit animationPausedChanged(paused); - } - - const float effectiveFactor = paused ? 0 : data->slowDownFactor; - QDeclarativeDebugHelper::setAnimationSlowDownFactor(effectiveFactor); -} - - -void QDeclarativeViewObserverPrivate::_q_applyChangesFromClient() -{ -} - - -QList QDeclarativeViewObserverPrivate::filterForSelection( - QList &itemlist) const -{ - foreach (QGraphicsItem *item, itemlist) { - if (isEditorItem(item)) - itemlist.removeOne(item); - } - - return itemlist; -} - -bool QDeclarativeViewObserverPrivate::isEditorItem(QGraphicsItem *item) const -{ - return (item->type() == Constants::EditorItemType - || item->type() == Constants::ResizeHandleItemType - || item->data(Constants::EditorItemDataKey).toBool()); -} - -void QDeclarativeViewObserverPrivate::_q_onStatusChanged(QDeclarativeView::Status status) -{ - if (status == QDeclarativeView::Ready) - q->sendReloaded(); -} - -void QDeclarativeViewObserverPrivate::_q_onCurrentObjectsChanged(QList objects) -{ - QList items; - QList gfxObjects; - foreach (QObject *obj, objects) { - if (QDeclarativeItem *declarativeItem = qobject_cast(obj)) { - items << declarativeItem; - gfxObjects << declarativeItem; - } - } - if (designModeBehavior) { - setSelectedItemsForTools(items); - clearHighlight(); - highlight(gfxObjects); - } -} - -// adjusts bounding boxes on edges of screen to be visible -QRectF QDeclarativeViewObserver::adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace) -{ - int marginFromEdge = 1; - QRectF boundingRect(boundingRectInSceneSpace); - if (qAbs(boundingRect.left()) - 1 < 2) - boundingRect.setLeft(marginFromEdge); - - QRect rect = data->view->rect(); - - if (boundingRect.right() >= rect.right()) - boundingRect.setRight(rect.right() - marginFromEdge); - - if (qAbs(boundingRect.top()) - 1 < 2) - boundingRect.setTop(marginFromEdge); - - if (boundingRect.bottom() >= rect.bottom()) - boundingRect.setBottom(rect.bottom() - marginFromEdge); - - return boundingRect; -} - -void QDeclarativeViewObserverPrivate::createToolBox() -{ - toolBox = new ToolBox(q->declarativeView()); - - QmlToolBar *toolBar = toolBox->toolBar(); - - QObject::connect(q, SIGNAL(selectedColorChanged(QColor)), - toolBar, SLOT(setColorBoxColor(QColor))); - - QObject::connect(q, SIGNAL(designModeBehaviorChanged(bool)), - toolBar, SLOT(setDesignModeBehavior(bool))); - - QObject::connect(toolBar, SIGNAL(designModeBehaviorChanged(bool)), - q, SLOT(setDesignModeBehavior(bool))); - QObject::connect(toolBar, SIGNAL(animationSpeedChanged(qreal)), q, SLOT(setAnimationSpeed(qreal))); - QObject::connect(toolBar, SIGNAL(animationPausedChanged(bool)), q, SLOT(setAnimationPaused(bool))); - QObject::connect(toolBar, SIGNAL(colorPickerSelected()), this, SLOT(_q_changeToColorPickerTool())); - QObject::connect(toolBar, SIGNAL(zoomToolSelected()), this, SLOT(_q_changeToZoomTool())); - QObject::connect(toolBar, SIGNAL(selectToolSelected()), this, SLOT(_q_changeToSingleSelectTool())); - QObject::connect(toolBar, SIGNAL(marqueeSelectToolSelected()), - this, SLOT(_q_changeToMarqueeSelectTool())); - - QObject::connect(toolBar, SIGNAL(applyChangesFromQmlFileSelected()), - this, SLOT(_q_applyChangesFromClient())); - - QObject::connect(q, SIGNAL(animationSpeedChanged(qreal)), toolBar, SLOT(setAnimationSpeed(qreal))); - QObject::connect(q, SIGNAL(animationPausedChanged(bool)), toolBar, SLOT(setAnimationPaused(bool))); - - QObject::connect(q, SIGNAL(selectToolActivated()), toolBar, SLOT(activateSelectTool())); - - // disabled features - //connect(d->m_toolBar, SIGNAL(applyChangesToQmlFileSelected()), SLOT(applyChangesToClient())); - //connect(q, SIGNAL(resizeToolActivated()), d->m_toolBar, SLOT(activateSelectTool())); - //connect(q, SIGNAL(moveToolActivated()), d->m_toolBar, SLOT(activateSelectTool())); - - QObject::connect(q, SIGNAL(colorPickerActivated()), toolBar, SLOT(activateColorPicker())); - QObject::connect(q, SIGNAL(zoomToolActivated()), toolBar, SLOT(activateZoom())); - QObject::connect(q, SIGNAL(marqueeSelectToolActivated()), - toolBar, SLOT(activateMarqueeSelectTool())); -} - -void QDeclarativeViewObserver::handleMessage(const QByteArray &message) -{ - QDataStream ds(message); - - ObserverProtocol::Message type; - ds >> type; - - switch (type) { - case ObserverProtocol::SetCurrentObjects: { - int itemCount = 0; - ds >> itemCount; - - QList selectedObjects; - for (int i = 0; i < itemCount; ++i) { - int debugId = -1; - ds >> debugId; - if (QObject *obj = QDeclarativeDebugService::objectForId(debugId)) - selectedObjects << obj; - } - - data->_q_onCurrentObjectsChanged(selectedObjects); - break; - } - case ObserverProtocol::Reload: { - data->_q_reloadView(); - break; - } - case ObserverProtocol::SetAnimationSpeed: { - qreal speed; - ds >> speed; - animationSpeedChangeRequested(speed); - break; - } - case ObserverProtocol::SetAnimationPaused: { - bool paused; - ds >> paused; - animationPausedChangeRequested(paused); - break; - } - case ObserverProtocol::ChangeTool: { - ObserverProtocol::Tool tool; - ds >> tool; - switch (tool) { - case ObserverProtocol::ColorPickerTool: - data->_q_changeToColorPickerTool(); - break; - case ObserverProtocol::SelectTool: - data->_q_changeToSingleSelectTool(); - break; - case ObserverProtocol::SelectMarqueeTool: - data->_q_changeToMarqueeSelectTool(); - break; - case ObserverProtocol::ZoomTool: - data->_q_changeToZoomTool(); - break; - default: - qWarning() << "Warning: Unhandled tool:" << tool; - } - break; - } - case ObserverProtocol::SetDesignMode: { - bool inDesignMode; - ds >> inDesignMode; - setDesignModeBehavior(inDesignMode); - break; - } - case ObserverProtocol::ShowAppOnTop: { - bool showOnTop; - ds >> showOnTop; - setShowAppOnTop(showOnTop); - break; - } - case ObserverProtocol::CreateObject: { - QString qml; - int parentId; - QString filename; - QStringList imports; - ds >> qml >> parentId >> imports >> filename; - data->_q_createQmlObject(qml, QDeclarativeDebugService::objectForId(parentId), - imports, filename); - break; - } - case ObserverProtocol::DestroyObject: { - int debugId; - ds >> debugId; - if (QObject* obj = QDeclarativeDebugService::objectForId(debugId)) - obj->deleteLater(); - break; - } - case ObserverProtocol::MoveObject: { - int debugId, newParent; - ds >> debugId >> newParent; - data->_q_reparentQmlObject(QDeclarativeDebugService::objectForId(debugId), - QDeclarativeDebugService::objectForId(newParent)); - break; - } - case ObserverProtocol::ObjectIdList: { - int itemCount; - ds >> itemCount; - data->stringIdForObjectId.clear(); - for (int i = 0; i < itemCount; ++i) { - int itemDebugId; - QString itemIdString; - ds >> itemDebugId - >> itemIdString; - - data->stringIdForObjectId.insert(itemDebugId, itemIdString); - } - break; - } - case ObserverProtocol::ClearComponentCache: { - data->_q_clearComponentCache(); - break; - } - default: - qWarning() << "Warning: Not handling message:" << type; - } -} - -void QDeclarativeViewObserver::sendDesignModeBehavior(bool inDesignMode) -{ - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - - ds << ObserverProtocol::SetDesignMode - << inDesignMode; - - data->debugService->sendMessage(message); -} - -void QDeclarativeViewObserver::sendCurrentObjects(const QList &objects) -{ - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - - ds << ObserverProtocol::CurrentObjectsChanged - << objects.length(); - - foreach (QObject *object, objects) { - int id = QDeclarativeDebugService::idForObject(object); - ds << id; - } - - data->debugService->sendMessage(message); -} - -void QDeclarativeViewObserver::sendCurrentTool(Constants::DesignTool toolId) -{ - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - - ds << ObserverProtocol::ToolChanged - << toolId; - - data->debugService->sendMessage(message); -} - -void QDeclarativeViewObserver::sendAnimationSpeed(qreal slowDownFactor) -{ - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - - ds << ObserverProtocol::AnimationSpeedChanged - << slowDownFactor; - - data->debugService->sendMessage(message); -} - -void QDeclarativeViewObserver::sendAnimationPaused(bool paused) -{ - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - - ds << ObserverProtocol::AnimationPausedChanged - << paused; - - data->debugService->sendMessage(message); -} - -void QDeclarativeViewObserver::sendReloaded() -{ - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - - ds << ObserverProtocol::Reloaded; - - data->debugService->sendMessage(message); -} - -void QDeclarativeViewObserver::sendShowAppOnTop(bool showAppOnTop) -{ - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - - ds << ObserverProtocol::ShowAppOnTop << showAppOnTop; - - data->debugService->sendMessage(message); -} - -void QDeclarativeViewObserver::sendColorChanged(const QColor &color) -{ - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - - ds << ObserverProtocol::ColorChanged - << color; - - data->debugService->sendMessage(message); -} - -QString QDeclarativeViewObserver::idStringForObject(QObject *obj) const -{ - int id = QDeclarativeDebugService::idForObject(obj); - QString idString = data->stringIdForObjectId.value(id, QString()); - return idString; -} - -QT_END_NAMESPACE - -#include "qdeclarativeviewobserver.moc" diff --git a/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver_p.h b/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver_p.h deleted file mode 100644 index 5c70c98..0000000 --- a/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver_p.h +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QDECLARATIVEVIEWOBSERVER_P_H -#define QDECLARATIVEVIEWOBSERVER_P_H - -#include -#include "qmlobserverconstants_p.h" - -#include -#include - -QT_FORWARD_DECLARE_CLASS(QDeclarativeItem) -QT_FORWARD_DECLARE_CLASS(QMouseEvent) -QT_FORWARD_DECLARE_CLASS(QToolBar) - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QDeclarativeViewObserverPrivate; - -class QDeclarativeViewObserver : public QObject -{ - Q_OBJECT - -public: - explicit QDeclarativeViewObserver(QDeclarativeView *view, QObject *parent = 0); - ~QDeclarativeViewObserver(); - - void setSelectedItems(QList items); - QList selectedItems() const; - - QDeclarativeView *declarativeView(); - - QRectF adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace); - - bool showAppOnTop() const; - - void sendDesignModeBehavior(bool inDesignMode); - void sendCurrentObjects(const QList &); - void sendAnimationSpeed(qreal slowDownFactor); - void sendAnimationPaused(bool paused); - void sendCurrentTool(Constants::DesignTool toolId); - void sendReloaded(); - void sendShowAppOnTop(bool showAppOnTop); - - QString idStringForObject(QObject *obj) const; - -public Q_SLOTS: - void sendColorChanged(const QColor &color); - - void setDesignModeBehavior(bool value); - bool designModeBehavior(); - - void setShowAppOnTop(bool appOnTop); - - void setAnimationSpeed(qreal factor); - void setAnimationPaused(bool paused); - -Q_SIGNALS: - void designModeBehaviorChanged(bool inDesignMode); - void showAppOnTopChanged(bool showAppOnTop); - void reloadRequested(); - void marqueeSelectToolActivated(); - void selectToolActivated(); - void zoomToolActivated(); - void colorPickerActivated(); - void selectedColorChanged(const QColor &color); - - void animationSpeedChanged(qreal factor); - void animationPausedChanged(bool paused); - -protected: - bool eventFilter(QObject *obj, QEvent *event); - - bool leaveEvent(QEvent *); - bool mousePressEvent(QMouseEvent *event); - bool mouseMoveEvent(QMouseEvent *event); - bool mouseReleaseEvent(QMouseEvent *event); - bool keyPressEvent(QKeyEvent *event); - bool keyReleaseEvent(QKeyEvent *keyEvent); - bool mouseDoubleClickEvent(QMouseEvent *event); - bool wheelEvent(QWheelEvent *event); - - void setSelectedItemsForTools(QList items); - -private slots: - void handleMessage(const QByteArray &message); - - void animationSpeedChangeRequested(qreal factor); - void animationPausedChangeRequested(bool paused); - -private: - Q_DISABLE_COPY(QDeclarativeViewObserver) - - inline QDeclarativeViewObserverPrivate *d_func() { return data.data(); } - QScopedPointer data; - friend class QDeclarativeViewObserverPrivate; - friend class AbstractLiveEditTool; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QDECLARATIVEVIEWOBSERVER_P_H diff --git a/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver_p_p.h b/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver_p_p.h deleted file mode 100644 index 19e4898..0000000 --- a/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver_p_p.h +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QDECLARATIVEVIEWOBSERVER_P_P_H -#define QDECLARATIVEVIEWOBSERVER_P_P_H - -#include "qdeclarativeviewobserver_p.h" - -#include -#include - -#include "QtDeclarative/private/qdeclarativeobserverservice_p.h" - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QDeclarativeViewObserver; -class LiveSelectionTool; -class ZoomTool; -class ColorPickerTool; -class LiveLayerItem; -class BoundingRectHighlighter; -class ToolBox; -class AbstractLiveEditTool; - -class QDeclarativeViewObserverPrivate : public QObject -{ - Q_OBJECT -public: - QDeclarativeViewObserverPrivate(QDeclarativeViewObserver *); - ~QDeclarativeViewObserverPrivate(); - - QDeclarativeView *view; - QDeclarativeViewObserver *q; - QDeclarativeObserverService *debugService; - QWeakPointer viewport; - QHash stringIdForObjectId; - - QPointF cursorPos; - QList > currentSelection; - - Constants::DesignTool currentToolMode; - AbstractLiveEditTool *currentTool; - - LiveSelectionTool *selectionTool; - ZoomTool *zoomTool; - ColorPickerTool *colorPickerTool; - LiveLayerItem *manipulatorLayer; - - BoundingRectHighlighter *boundingRectHighlighter; - - bool designModeBehavior; - bool showAppOnTop; - - bool animationPaused; - qreal slowDownFactor; - - ToolBox *toolBox; - - void setViewport(QWidget *widget); - - void clearEditorItems(); - void createToolBox(); - void changeToSelectTool(); - QList filterForSelection(QList &itemlist) const; - - QList selectableItems(const QPoint &pos) const; - QList selectableItems(const QPointF &scenePos) const; - QList selectableItems(const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const; - - void setSelectedItemsForTools(const QList &items); - void setSelectedItems(const QList &items); - QList selectedItems() const; - - void changeTool(Constants::DesignTool tool, - Constants::ToolFlags flags = Constants::NoToolFlags); - - void clearHighlight(); - void highlight(const QList &item); - inline void highlight(QGraphicsObject *item) - { highlight(QList() << item); } - - bool isEditorItem(QGraphicsItem *item) const; - -public slots: - void _q_setToolBoxVisible(bool visible); - - void _q_reloadView(); - void _q_onStatusChanged(QDeclarativeView::Status status); - void _q_onCurrentObjectsChanged(QList objects); - void _q_applyChangesFromClient(); - void _q_createQmlObject(const QString &qml, QObject *parent, - const QStringList &imports, const QString &filename = QString()); - void _q_reparentQmlObject(QObject *, QObject *); - - void _q_changeToSingleSelectTool(); - void _q_changeToMarqueeSelectTool(); - void _q_changeToZoomTool(); - void _q_changeToColorPickerTool(); - void _q_clearComponentCache(); - void _q_removeFromSelection(QObject *); - -public: - static QDeclarativeViewObserverPrivate *get(QDeclarativeViewObserver *v) { return v->d_func(); } -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QDECLARATIVEVIEWOBSERVER_P_P_H diff --git a/src/plugins/qmltooling/declarativeobserver/qmlobserverconstants_p.h b/src/plugins/qmltooling/declarativeobserver/qmlobserverconstants_p.h deleted file mode 100644 index 6d0a263..0000000 --- a/src/plugins/qmltooling/declarativeobserver/qmlobserverconstants_p.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLOBSERVERCONSTANTS_H -#define QMLOBSERVERCONSTANTS_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -namespace Constants { - -enum DesignTool { - NoTool = 0, - SelectionToolMode = 1, - MarqueeSelectionToolMode = 2, - MoveToolMode = 3, - ResizeToolMode = 4, - ColorPickerMode = 5, - ZoomMode = 6 -}; - -enum ToolFlags { - NoToolFlags = 0, - UseCursorPos = 1 -}; - -static const int DragStartTime = 50; - -static const int DragStartDistance = 20; - -static const double ZoomSnapDelta = 0.04; - -static const int EditorItemDataKey = 1000; - -enum GraphicsItemTypes { - EditorItemType = 0xEAAA, - ResizeHandleItemType = 0xEAEA -}; - - -} // namespace Constants - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMLOBSERVERCONSTANTS_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool.cpp new file mode 100644 index 0000000..36e6ba0 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool.cpp @@ -0,0 +1,195 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "abstractliveedittool_p.h" +#include "../qdeclarativeviewinspector_p_p.h" + +#include + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +AbstractLiveEditTool::AbstractLiveEditTool(QDeclarativeViewInspector *editorView) + : QObject(editorView), m_inspector(editorView) +{ +} + + +AbstractLiveEditTool::~AbstractLiveEditTool() +{ +} + +QDeclarativeViewInspector *AbstractLiveEditTool::inspector() const +{ + return m_inspector; +} + +QDeclarativeView *AbstractLiveEditTool::view() const +{ + return m_inspector->declarativeView(); +} + +QGraphicsScene* AbstractLiveEditTool::scene() const +{ + return view()->scene(); +} + +void AbstractLiveEditTool::updateSelectedItems() +{ + selectedItemsChanged(items()); +} + +QList AbstractLiveEditTool::items() const +{ + return inspector()->selectedItems(); +} + +bool AbstractLiveEditTool::topItemIsMovable(const QList & itemList) +{ + QGraphicsItem *firstSelectableItem = topMovableGraphicsItem(itemList); + if (firstSelectableItem == 0) + return false; + if (toQDeclarativeItem(firstSelectableItem) != 0) + return true; + + return false; + +} + +bool AbstractLiveEditTool::topSelectedItemIsMovable(const QList &itemList) +{ + QList selectedItems = inspector()->selectedItems(); + + foreach (QGraphicsItem *item, itemList) { + QDeclarativeItem *declarativeItem = toQDeclarativeItem(item); + if (declarativeItem + && selectedItems.contains(declarativeItem) + /*&& (declarativeItem->qmlItemNode().hasShowContent() || selectNonContentItems)*/) + return true; + } + + return false; + +} + +bool AbstractLiveEditTool::topItemIsResizeHandle(const QList &/*itemList*/) +{ + return false; +} + +QDeclarativeItem *AbstractLiveEditTool::toQDeclarativeItem(QGraphicsItem *item) +{ + return qobject_cast(item->toGraphicsObject()); +} + +QGraphicsItem *AbstractLiveEditTool::topMovableGraphicsItem(const QList &itemList) +{ + foreach (QGraphicsItem *item, itemList) { + if (item->flags().testFlag(QGraphicsItem::ItemIsMovable)) + return item; + } + return 0; +} + +QDeclarativeItem *AbstractLiveEditTool::topMovableDeclarativeItem(const QList + &itemList) +{ + foreach (QGraphicsItem *item, itemList) { + QDeclarativeItem *declarativeItem = toQDeclarativeItem(item); + if (declarativeItem /*&& (declarativeItem->qmlItemNode().hasShowContent())*/) + return declarativeItem; + } + + return 0; +} + +QList AbstractLiveEditTool::toGraphicsObjectList(const QList + &itemList) +{ + QList gfxObjects; + foreach (QGraphicsItem *item, itemList) { + QGraphicsObject *obj = item->toGraphicsObject(); + if (obj) + gfxObjects << obj; + } + + return gfxObjects; +} + +QString AbstractLiveEditTool::titleForItem(QGraphicsItem *item) +{ + QString className(QLatin1String("QGraphicsItem")); + QString objectStringId; + + QString constructedName; + + QGraphicsObject *gfxObject = item->toGraphicsObject(); + if (gfxObject) { + className = QLatin1String(gfxObject->metaObject()->className()); + + className.remove(QRegExp(QLatin1String("_QMLTYPE_\\d+"))); + className.remove(QRegExp(QLatin1String("_QML_\\d+"))); + if (className.startsWith(QLatin1String("QDeclarative"))) + className = className.remove(QLatin1String("QDeclarative")); + + QDeclarativeItem *declarativeItem = qobject_cast(gfxObject); + if (declarativeItem) { + objectStringId = m_inspector->idStringForObject(declarativeItem); + } + + if (!objectStringId.isEmpty()) { + constructedName = objectStringId + QLatin1String(" (") + className + QLatin1Char(')'); + } else { + if (!gfxObject->objectName().isEmpty()) { + constructedName = gfxObject->objectName() + QLatin1String(" (") + className + QLatin1Char(')'); + } else { + constructedName = className; + } + } + } + + return constructedName; +} + +QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool_p.h new file mode 100644 index 0000000..17eb6ea --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool_p.h @@ -0,0 +1,119 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef ABSTRACTLIVEEDITTOOL_H +#define ABSTRACTLIVEEDITTOOL_H + +#include +#include + +QT_BEGIN_NAMESPACE +class QMouseEvent; +class QGraphicsItem; +class QDeclarativeItem; +class QKeyEvent; +class QGraphicsScene; +class QGraphicsObject; +class QWheelEvent; +class QDeclarativeView; +QT_END_NAMESPACE + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QDeclarativeViewInspector; + +class AbstractLiveEditTool : public QObject +{ + Q_OBJECT +public: + AbstractLiveEditTool(QDeclarativeViewInspector *inspector); + + virtual ~AbstractLiveEditTool(); + + virtual void mousePressEvent(QMouseEvent *event) = 0; + virtual void mouseMoveEvent(QMouseEvent *event) = 0; + virtual void mouseReleaseEvent(QMouseEvent *event) = 0; + virtual void mouseDoubleClickEvent(QMouseEvent *event) = 0; + + virtual void hoverMoveEvent(QMouseEvent *event) = 0; + virtual void wheelEvent(QWheelEvent *event) = 0; + + virtual void keyPressEvent(QKeyEvent *event) = 0; + virtual void keyReleaseEvent(QKeyEvent *keyEvent) = 0; + virtual void itemsAboutToRemoved(const QList &itemList) = 0; + + virtual void clear() = 0; + + void updateSelectedItems(); + QList items() const; + + bool topItemIsMovable(const QList &itemList); + bool topItemIsResizeHandle(const QList &itemList); + bool topSelectedItemIsMovable(const QList &itemList); + + QString titleForItem(QGraphicsItem *item); + + static QList toGraphicsObjectList(const QList &itemList); + static QGraphicsItem* topMovableGraphicsItem(const QList &itemList); + static QDeclarativeItem* topMovableDeclarativeItem(const QList &itemList); + static QDeclarativeItem *toQDeclarativeItem(QGraphicsItem *item); + +protected: + virtual void selectedItemsChanged(const QList &objectList) = 0; + + QDeclarativeViewInspector *inspector() const; + QDeclarativeView *view() const; + QGraphicsScene *scene() const; + +private: + QDeclarativeViewInspector *m_inspector; + QList m_itemList; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // ABSTRACTLIVEEDITTOOL_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.cpp new file mode 100644 index 0000000..8e551d2 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.cpp @@ -0,0 +1,282 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "boundingrecthighlighter_p.h" + +#include "../qdeclarativeviewinspector_p.h" +#include "../qmlinspectorconstants_p.h" + +#include + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +const qreal AnimDelta = 0.025f; +const int AnimInterval = 30; +const int AnimFrames = 10; + +BoundingBox::BoundingBox(QGraphicsObject *itemToHighlight, QGraphicsItem *parentItem, + QObject *parent) + : QObject(parent), + highlightedObject(itemToHighlight), + highlightPolygon(0), + highlightPolygonEdge(0) +{ + highlightPolygon = new BoundingBoxPolygonItem(parentItem); + highlightPolygonEdge = new BoundingBoxPolygonItem(parentItem); + + highlightPolygon->setPen(QPen(QColor(0, 22, 159))); + highlightPolygonEdge->setPen(QPen(QColor(158, 199, 255))); + + highlightPolygon->setFlag(QGraphicsItem::ItemIsSelectable, false); + highlightPolygonEdge->setFlag(QGraphicsItem::ItemIsSelectable, false); +} + +BoundingBox::~BoundingBox() +{ + highlightedObject.clear(); +} + +BoundingBoxPolygonItem::BoundingBoxPolygonItem(QGraphicsItem *item) : QGraphicsPolygonItem(item) +{ + QPen pen; + pen.setColor(QColor(108, 141, 221)); + pen.setWidth(1); + setPen(pen); +} + +int BoundingBoxPolygonItem::type() const +{ + return Constants::EditorItemType; +} + +BoundingRectHighlighter::BoundingRectHighlighter(QDeclarativeViewInspector *view) : + LiveLayerItem(view->declarativeView()->scene()), + m_view(view), + m_animFrame(0) +{ + m_animTimer = new QTimer(this); + m_animTimer->setInterval(AnimInterval); + connect(m_animTimer, SIGNAL(timeout()), SLOT(animTimeout())); +} + +BoundingRectHighlighter::~BoundingRectHighlighter() +{ + +} + +void BoundingRectHighlighter::animTimeout() +{ + ++m_animFrame; + if (m_animFrame == AnimFrames) { + m_animTimer->stop(); + } + + qreal alpha = m_animFrame / float(AnimFrames); + + foreach (BoundingBox *box, m_boxes) { + box->highlightPolygonEdge->setOpacity(alpha); + } +} + +void BoundingRectHighlighter::clear() +{ + if (m_boxes.length()) { + m_animTimer->stop(); + + foreach (BoundingBox *box, m_boxes) { + freeBoundingBox(box); + } + } +} + +BoundingBox *BoundingRectHighlighter::boxFor(QGraphicsObject *item) const +{ + foreach (BoundingBox *box, m_boxes) { + if (box->highlightedObject.data() == item) { + return box; + } + } + return 0; +} + +void BoundingRectHighlighter::highlight(QList items) +{ + if (items.isEmpty()) + return; + + bool animate = false; + + QList newBoxes; + foreach (QGraphicsObject *itemToHighlight, items) { + BoundingBox *box = boxFor(itemToHighlight); + if (!box) { + box = createBoundingBox(itemToHighlight); + animate = true; + } + + newBoxes << box; + } + qSort(newBoxes); + + if (newBoxes != m_boxes) { + clear(); + m_boxes << newBoxes; + } + + highlightAll(animate); +} + +void BoundingRectHighlighter::highlight(QGraphicsObject* itemToHighlight) +{ + if (!itemToHighlight) + return; + + bool animate = false; + + BoundingBox *box = boxFor(itemToHighlight); + if (!box) { + box = createBoundingBox(itemToHighlight); + m_boxes << box; + animate = true; + qSort(m_boxes); + } + + highlightAll(animate); +} + +BoundingBox *BoundingRectHighlighter::createBoundingBox(QGraphicsObject *itemToHighlight) +{ + if (!m_freeBoxes.isEmpty()) { + BoundingBox *box = m_freeBoxes.last(); + if (box->highlightedObject.isNull()) { + box->highlightedObject = itemToHighlight; + box->highlightPolygon->show(); + box->highlightPolygonEdge->show(); + m_freeBoxes.removeLast(); + return box; + } + } + + BoundingBox *box = new BoundingBox(itemToHighlight, this, this); + + connect(itemToHighlight, SIGNAL(xChanged()), this, SLOT(refresh())); + connect(itemToHighlight, SIGNAL(yChanged()), this, SLOT(refresh())); + connect(itemToHighlight, SIGNAL(widthChanged()), this, SLOT(refresh())); + connect(itemToHighlight, SIGNAL(heightChanged()), this, SLOT(refresh())); + connect(itemToHighlight, SIGNAL(rotationChanged()), this, SLOT(refresh())); + connect(itemToHighlight, SIGNAL(destroyed(QObject*)), this, SLOT(itemDestroyed(QObject*))); + + return box; +} + +void BoundingRectHighlighter::removeBoundingBox(BoundingBox *box) +{ + delete box; + box = 0; +} + +void BoundingRectHighlighter::freeBoundingBox(BoundingBox *box) +{ + if (!box->highlightedObject.isNull()) { + disconnect(box->highlightedObject.data(), SIGNAL(xChanged()), this, SLOT(refresh())); + disconnect(box->highlightedObject.data(), SIGNAL(yChanged()), this, SLOT(refresh())); + disconnect(box->highlightedObject.data(), SIGNAL(widthChanged()), this, SLOT(refresh())); + disconnect(box->highlightedObject.data(), SIGNAL(heightChanged()), this, SLOT(refresh())); + disconnect(box->highlightedObject.data(), SIGNAL(rotationChanged()), this, SLOT(refresh())); + } + + box->highlightedObject.clear(); + box->highlightPolygon->hide(); + box->highlightPolygonEdge->hide(); + m_boxes.removeOne(box); + m_freeBoxes << box; +} + +void BoundingRectHighlighter::itemDestroyed(QObject *obj) +{ + foreach (BoundingBox *box, m_boxes) { + if (box->highlightedObject.data() == obj) { + freeBoundingBox(box); + break; + } + } +} + +void BoundingRectHighlighter::highlightAll(bool animate) +{ + foreach (BoundingBox *box, m_boxes) { + if (box && box->highlightedObject.isNull()) { + // clear all highlights + clear(); + return; + } + QGraphicsObject *item = box->highlightedObject.data(); + + QRectF boundingRectInSceneSpace(item->mapToScene(item->boundingRect()).boundingRect()); + QRectF boundingRectInLayerItemSpace = mapRectFromScene(boundingRectInSceneSpace); + QRectF bboxRect = m_view->adjustToScreenBoundaries(boundingRectInLayerItemSpace); + QRectF edgeRect = bboxRect; + edgeRect.adjust(-1, -1, 1, 1); + + box->highlightPolygon->setPolygon(QPolygonF(bboxRect)); + box->highlightPolygonEdge->setPolygon(QPolygonF(edgeRect)); + + if (animate) + box->highlightPolygonEdge->setOpacity(0); + } + + if (animate) { + m_animFrame = 0; + m_animTimer->start(); + } +} + +void BoundingRectHighlighter::refresh() +{ + if (!m_boxes.isEmpty()) + highlightAll(true); +} + +QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter_p.h new file mode 100644 index 0000000..89a9cf2 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter_p.h @@ -0,0 +1,126 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef BOUNDINGRECTHIGHLIGHTER_H +#define BOUNDINGRECTHIGHLIGHTER_H + +#include "livelayeritem_p.h" + +#include +#include + +QT_FORWARD_DECLARE_CLASS(QGraphicsItem) +QT_FORWARD_DECLARE_CLASS(QPainter) +QT_FORWARD_DECLARE_CLASS(QWidget) +QT_FORWARD_DECLARE_CLASS(QStyleOptionGraphicsItem) +QT_FORWARD_DECLARE_CLASS(QTimer) + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QDeclarativeViewInspector; +class BoundingBox; + +class BoundingRectHighlighter : public LiveLayerItem +{ + Q_OBJECT +public: + explicit BoundingRectHighlighter(QDeclarativeViewInspector *view); + ~BoundingRectHighlighter(); + void clear(); + void highlight(QList items); + void highlight(QGraphicsObject* item); + +private slots: + void refresh(); + void animTimeout(); + void itemDestroyed(QObject *); + +private: + BoundingBox *boxFor(QGraphicsObject *item) const; + void highlightAll(bool animate); + BoundingBox *createBoundingBox(QGraphicsObject *itemToHighlight); + void removeBoundingBox(BoundingBox *box); + void freeBoundingBox(BoundingBox *box); + +private: + Q_DISABLE_COPY(BoundingRectHighlighter) + + QDeclarativeViewInspector *m_view; + QList m_boxes; + QList m_freeBoxes; + QTimer *m_animTimer; + qreal m_animScale; + int m_animFrame; + +}; + +class BoundingBox : public QObject +{ + Q_OBJECT +public: + explicit BoundingBox(QGraphicsObject *itemToHighlight, QGraphicsItem *parentItem, + QObject *parent = 0); + ~BoundingBox(); + QWeakPointer highlightedObject; + QGraphicsPolygonItem *highlightPolygon; + QGraphicsPolygonItem *highlightPolygonEdge; + +private: + Q_DISABLE_COPY(BoundingBox) + +}; + +class BoundingBoxPolygonItem : public QGraphicsPolygonItem +{ +public: + explicit BoundingBoxPolygonItem(QGraphicsItem *item); + int type() const; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // BOUNDINGRECTHIGHLIGHTER_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp new file mode 100644 index 0000000..bdae3d8 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp @@ -0,0 +1,131 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "colorpickertool_p.h" + +#include "../qdeclarativeviewinspector_p.h" + +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +ColorPickerTool::ColorPickerTool(QDeclarativeViewInspector *view) : + AbstractLiveEditTool(view) +{ + m_selectedColor.setRgb(0,0,0); +} + +ColorPickerTool::~ColorPickerTool() +{ + +} + +void ColorPickerTool::mousePressEvent(QMouseEvent * /*event*/) +{ +} + +void ColorPickerTool::mouseMoveEvent(QMouseEvent *event) +{ + pickColor(event->pos()); +} + +void ColorPickerTool::mouseReleaseEvent(QMouseEvent *event) +{ + pickColor(event->pos()); +} + +void ColorPickerTool::mouseDoubleClickEvent(QMouseEvent * /*event*/) +{ +} + + +void ColorPickerTool::hoverMoveEvent(QMouseEvent * /*event*/) +{ +} + +void ColorPickerTool::keyPressEvent(QKeyEvent * /*event*/) +{ +} + +void ColorPickerTool::keyReleaseEvent(QKeyEvent * /*keyEvent*/) +{ +} +void ColorPickerTool::wheelEvent(QWheelEvent * /*event*/) +{ +} + +void ColorPickerTool::itemsAboutToRemoved(const QList &/*itemList*/) +{ +} + +void ColorPickerTool::clear() +{ + view()->setCursor(Qt::CrossCursor); +} + +void ColorPickerTool::selectedItemsChanged(const QList &/*itemList*/) +{ +} + +void ColorPickerTool::pickColor(const QPoint &pos) +{ + QRgb fillColor = view()->backgroundBrush().color().rgb(); + if (view()->backgroundBrush().style() == Qt::NoBrush) + fillColor = view()->palette().color(QPalette::Base).rgb(); + + QRectF target(0,0, 1, 1); + QRect source(pos.x(), pos.y(), 1, 1); + QImage img(1, 1, QImage::Format_ARGB32); + img.fill(fillColor); + QPainter painter(&img); + view()->render(&painter, target, source); + m_selectedColor = QColor::fromRgb(img.pixel(0, 0)); + + emit selectedColorChanged(m_selectedColor); +} + +QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool_p.h new file mode 100644 index 0000000..580c175 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool_p.h @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef COLORPICKERTOOL_H +#define COLORPICKERTOOL_H + +#include "abstractliveedittool_p.h" + +#include + +QT_FORWARD_DECLARE_CLASS(QPoint) + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class ColorPickerTool : public AbstractLiveEditTool +{ + Q_OBJECT +public: + explicit ColorPickerTool(QDeclarativeViewInspector *view); + + virtual ~ColorPickerTool(); + + void mousePressEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); + void mouseDoubleClickEvent(QMouseEvent *event); + + void hoverMoveEvent(QMouseEvent *event); + + void keyPressEvent(QKeyEvent *event); + void keyReleaseEvent(QKeyEvent *keyEvent); + + void wheelEvent(QWheelEvent *event); + + void itemsAboutToRemoved(const QList &itemList); + + void clear(); + +signals: + void selectedColorChanged(const QColor &color); + +protected: + + void selectedItemsChanged(const QList &itemList); + +private: + void pickColor(const QPoint &pos); + +private: + QColor m_selectedColor; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // COLORPICKERTOOL_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/editor.qrc b/src/plugins/qmltooling/qmldbg_inspector/editor/editor.qrc new file mode 100644 index 0000000..fb2393c --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/editor.qrc @@ -0,0 +1,24 @@ + + + images/resize_handle.png + images/select.png + images/select-marquee.png + images/color-picker.png + images/play.png + images/pause.png + images/from-qml.png + images/to-qml.png + images/color-picker-hicontrast.png + images/zoom.png + images/color-picker-24.png + images/from-qml-24.png + images/pause-24.png + images/play-24.png + images/to-qml-24.png + images/zoom-24.png + images/select-24.png + images/select-marquee-24.png + images/inspectormode.png + images/inspectormode-24.png + + diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-24.png new file mode 100644 index 0000000..cff4721 Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-24.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-hicontrast.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-hicontrast.png new file mode 100644 index 0000000..b953d08 Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-hicontrast.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker.png new file mode 100644 index 0000000..026c31b Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml-24.png new file mode 100644 index 0000000..0ad21f3 Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml-24.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml.png new file mode 100644 index 0000000..666382c Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode-24.png new file mode 100644 index 0000000..5e74d86 Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode-24.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode.png new file mode 100644 index 0000000..daed21c Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/pause-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/pause-24.png new file mode 100644 index 0000000..d9a2f6f Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/pause-24.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/pause.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/pause.png new file mode 100644 index 0000000..114d89b Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/pause.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/play-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/play-24.png new file mode 100644 index 0000000..e2b9fbc Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/play-24.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/play.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/play.png new file mode 100644 index 0000000..011598a Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/play.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/reload.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/reload.png new file mode 100644 index 0000000..7042bec Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/reload.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/resize_handle.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/resize_handle.png new file mode 100644 index 0000000..2934f25 Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/resize_handle.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-24.png new file mode 100644 index 0000000..5388a9d Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-24.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee-24.png new file mode 100644 index 0000000..0111dda Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee-24.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee.png new file mode 100644 index 0000000..92fe40d Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/select.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select.png new file mode 100644 index 0000000..6722855 Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml-24.png new file mode 100644 index 0000000..b72450d Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml-24.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml.png new file mode 100644 index 0000000..2ab951f Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom-24.png new file mode 100644 index 0000000..0346200 Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom-24.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom.png new file mode 100644 index 0000000..17f0da6 Binary files /dev/null and b/src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom.png differ diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem.cpp new file mode 100644 index 0000000..c28893e --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem.cpp @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "livelayeritem_p.h" + +#include "../qmlinspectorconstants_p.h" + +#include + +QT_BEGIN_NAMESPACE + +LiveLayerItem::LiveLayerItem(QGraphicsScene* scene) + : QGraphicsObject() +{ + scene->addItem(this); + setZValue(1); + setFlag(QGraphicsItem::ItemIsMovable, false); +} + +LiveLayerItem::~LiveLayerItem() +{ +} + +void LiveLayerItem::paint(QPainter * /*painter*/, const QStyleOptionGraphicsItem * /*option*/, + QWidget * /*widget*/) +{ +} + +int LiveLayerItem::type() const +{ + return Constants::EditorItemType; +} + +QRectF LiveLayerItem::boundingRect() const +{ + return childrenBoundingRect(); +} + +QList LiveLayerItem::findAllChildItems() const +{ + return findAllChildItems(this); +} + +QList LiveLayerItem::findAllChildItems(const QGraphicsItem *item) const +{ + QList itemList(item->childItems()); + + foreach (QGraphicsItem *childItem, item->childItems()) + itemList += findAllChildItems(childItem); + + return itemList; +} + +QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem_p.h new file mode 100644 index 0000000..da622e1 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem_p.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef LIVELAYERITEM_H +#define LIVELAYERITEM_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class LiveLayerItem : public QGraphicsObject +{ +public: + LiveLayerItem(QGraphicsScene *scene); + ~LiveLayerItem(); + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, + QWidget *widget = 0); + QRectF boundingRect() const; + int type() const; + + QList findAllChildItems() const; + +protected: + QList findAllChildItems(const QGraphicsItem *item) const; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // LIVELAYERITEM_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator.cpp new file mode 100644 index 0000000..d32847d --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator.cpp @@ -0,0 +1,165 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "liverubberbandselectionmanipulator_p.h" + +#include "../qdeclarativeviewinspector_p_p.h" + +#include + +#include + +QT_BEGIN_NAMESPACE + +LiveRubberBandSelectionManipulator::LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem, + QDeclarativeViewInspector *editorView) + : m_selectionRectangleElement(layerItem), + m_editorView(editorView), + m_beginFormEditorItem(0), + m_isActive(false) +{ + m_selectionRectangleElement.hide(); +} + +void LiveRubberBandSelectionManipulator::clear() +{ + m_selectionRectangleElement.clear(); + m_isActive = false; + m_beginPoint = QPointF(); + m_itemList.clear(); + m_oldSelectionList.clear(); +} + +QGraphicsItem *LiveRubberBandSelectionManipulator::topFormEditorItem(const QList + &itemList) +{ + if (itemList.isEmpty()) + return 0; + + return itemList.first(); +} + +void LiveRubberBandSelectionManipulator::begin(const QPointF &beginPoint) +{ + m_beginPoint = beginPoint; + m_selectionRectangleElement.setRect(m_beginPoint, m_beginPoint); + m_selectionRectangleElement.show(); + m_isActive = true; + QDeclarativeViewInspectorPrivate *inspectorPrivate + = QDeclarativeViewInspectorPrivate::get(m_editorView); + m_beginFormEditorItem = topFormEditorItem(inspectorPrivate->selectableItems(beginPoint)); + m_oldSelectionList = m_editorView->selectedItems(); +} + +void LiveRubberBandSelectionManipulator::update(const QPointF &updatePoint) +{ + m_selectionRectangleElement.setRect(m_beginPoint, updatePoint); +} + +void LiveRubberBandSelectionManipulator::end() +{ + m_oldSelectionList.clear(); + m_selectionRectangleElement.hide(); + m_isActive = false; +} + +void LiveRubberBandSelectionManipulator::select(SelectionType selectionType) +{ + QDeclarativeViewInspectorPrivate *inspectorPrivate + = QDeclarativeViewInspectorPrivate::get(m_editorView); + QList itemList + = inspectorPrivate->selectableItems(m_selectionRectangleElement.rect(), + Qt::IntersectsItemShape); + QList newSelectionList; + + foreach (QGraphicsItem* item, itemList) { + if (item + && item->parentItem() + && !newSelectionList.contains(item) + //&& m_beginFormEditorItem->childItems().contains(item) // TODO activate this test + ) + { + newSelectionList.append(item); + } + } + + if (newSelectionList.isEmpty() && m_beginFormEditorItem) + newSelectionList.append(m_beginFormEditorItem); + + QList resultList; + + switch (selectionType) { + case AddToSelection: { + resultList.append(m_oldSelectionList); + resultList.append(newSelectionList); + } + break; + case ReplaceSelection: { + resultList.append(newSelectionList); + } + break; + case RemoveFromSelection: { + QSet oldSelectionSet(m_oldSelectionList.toSet()); + QSet newSelectionSet(newSelectionList.toSet()); + resultList.append(oldSelectionSet.subtract(newSelectionSet).toList()); + } + } + + m_editorView->setSelectedItems(resultList); +} + + +void LiveRubberBandSelectionManipulator::setItems(const QList &itemList) +{ + m_itemList = itemList; +} + +QPointF LiveRubberBandSelectionManipulator::beginPoint() const +{ + return m_beginPoint; +} + +bool LiveRubberBandSelectionManipulator::isActive() const +{ + return m_isActive; +} + +QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator_p.h new file mode 100644 index 0000000..9abcb2b --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator_p.h @@ -0,0 +1,102 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef RUBBERBANDSELECTIONMANIPULATOR_H +#define RUBBERBANDSELECTIONMANIPULATOR_H + +#include "liveselectionrectangle_p.h" + +#include + +QT_FORWARD_DECLARE_CLASS(QGraphicsItem) + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QDeclarativeViewInspector; + +class LiveRubberBandSelectionManipulator +{ +public: + enum SelectionType { + ReplaceSelection, + AddToSelection, + RemoveFromSelection + }; + + LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem, + QDeclarativeViewInspector *editorView); + + void setItems(const QList &itemList); + + void begin(const QPointF& beginPoint); + void update(const QPointF& updatePoint); + void end(); + + void clear(); + + void select(SelectionType selectionType); + + QPointF beginPoint() const; + + bool isActive() const; + +protected: + QGraphicsItem *topFormEditorItem(const QList &itemList); + +private: + QList m_itemList; + QList m_oldSelectionList; + LiveSelectionRectangle m_selectionRectangleElement; + QPointF m_beginPoint; + QDeclarativeViewInspector *m_editorView; + QGraphicsItem *m_beginFormEditorItem; + bool m_isActive; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // RUBBERBANDSELECTIONMANIPULATOR_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp new file mode 100644 index 0000000..4450fc5 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "liveselectionindicator_p.h" + +#include "../qdeclarativeviewinspector_p_p.h" +#include "../qmlinspectorconstants_p.h" + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +LiveSelectionIndicator::LiveSelectionIndicator(QDeclarativeViewInspector *viewInspector, + QGraphicsObject *layerItem) + : m_layerItem(layerItem) + , m_view(viewInspector) +{ +} + +LiveSelectionIndicator::~LiveSelectionIndicator() +{ + clear(); +} + +void LiveSelectionIndicator::show() +{ + foreach (QGraphicsRectItem *item, m_indicatorShapeHash) + item->show(); +} + +void LiveSelectionIndicator::hide() +{ + foreach (QGraphicsRectItem *item, m_indicatorShapeHash) + item->hide(); +} + +void LiveSelectionIndicator::clear() +{ + if (!m_layerItem.isNull()) { + QGraphicsScene *scene = m_layerItem.data()->scene(); + foreach (QGraphicsRectItem *item, m_indicatorShapeHash) { + scene->removeItem(item); + delete item; + } + } + + m_indicatorShapeHash.clear(); + +} + +void LiveSelectionIndicator::setItems(const QList > &itemList) +{ + clear(); + + foreach (const QWeakPointer &object, itemList) { + if (object.isNull()) + continue; + + QGraphicsItem *item = object.data(); + + if (!m_indicatorShapeHash.contains(item)) { + QGraphicsRectItem *selectionIndicator = new QGraphicsRectItem(m_layerItem.data()); + m_indicatorShapeHash.insert(item, selectionIndicator); + + const QRectF boundingRect = m_view->adjustToScreenBoundaries(item->mapRectToScene(item->boundingRect())); + const QRectF boundingRectInLayerItemSpace = m_layerItem.data()->mapRectFromScene(boundingRect); + + selectionIndicator->setData(Constants::EditorItemDataKey, true); + selectionIndicator->setFlag(QGraphicsItem::ItemIsSelectable, false); + selectionIndicator->setRect(boundingRectInLayerItemSpace); + selectionIndicator->setPen(QColor(108, 141, 221)); + } + } +} + +QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator_p.h new file mode 100644 index 0000000..fa6eb30 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator_p.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef LIVESELECTIONINDICATOR_H +#define LIVESELECTIONINDICATOR_H + +#include +#include + +QT_BEGIN_NAMESPACE +class QGraphicsObject; +class QGraphicsRectItem; +class QGraphicsItem; +class QPolygonF; +QT_END_NAMESPACE + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QDeclarativeViewInspector; + +class LiveSelectionIndicator +{ +public: + LiveSelectionIndicator(QDeclarativeViewInspector *viewInspector, QGraphicsObject *layerItem); + ~LiveSelectionIndicator(); + + void show(); + void hide(); + + void clear(); + + void setItems(const QList > &itemList); + +private: + QHash m_indicatorShapeHash; + QWeakPointer m_layerItem; + QDeclarativeViewInspector *m_view; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // LIVESELECTIONINDICATOR_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.cpp new file mode 100644 index 0000000..267079a --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.cpp @@ -0,0 +1,113 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "liveselectionrectangle_p.h" + +#include "../qmlinspectorconstants_p.h" + +#include +#include +#include +#include + +#include + +#include + +QT_BEGIN_NAMESPACE + +class SelectionRectShape : public QGraphicsRectItem +{ +public: + SelectionRectShape(QGraphicsItem *parent = 0) : QGraphicsRectItem(parent) {} + int type() const { return Constants::EditorItemType; } +}; + +LiveSelectionRectangle::LiveSelectionRectangle(QGraphicsObject *layerItem) + : m_controlShape(new SelectionRectShape(layerItem)), + m_layerItem(layerItem) +{ + m_controlShape->setPen(QPen(Qt::black)); + m_controlShape->setBrush(QColor(128, 128, 128, 50)); +} + +LiveSelectionRectangle::~LiveSelectionRectangle() +{ + if (m_layerItem) + m_layerItem.data()->scene()->removeItem(m_controlShape); +} + +void LiveSelectionRectangle::clear() +{ + hide(); +} +void LiveSelectionRectangle::show() +{ + m_controlShape->show(); +} + +void LiveSelectionRectangle::hide() +{ + m_controlShape->hide(); +} + +QRectF LiveSelectionRectangle::rect() const +{ + return m_controlShape->mapFromScene(m_controlShape->rect()).boundingRect(); +} + +void LiveSelectionRectangle::setRect(const QPointF &firstPoint, + const QPointF &secondPoint) +{ + double firstX = std::floor(firstPoint.x()) + 0.5; + double firstY = std::floor(firstPoint.y()) + 0.5; + double secondX = std::floor(secondPoint.x()) + 0.5; + double secondY = std::floor(secondPoint.y()) + 0.5; + QPointF topLeftPoint(firstX < secondX ? firstX : secondX, + firstY < secondY ? firstY : secondY); + QPointF bottomRightPoint(firstX > secondX ? firstX : secondX, + firstY > secondY ? firstY : secondY); + + QRectF rect(topLeftPoint, bottomRightPoint); + m_controlShape->setRect(rect); +} + +QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle_p.h new file mode 100644 index 0000000..5da9fb8 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle_p.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef LIVESELECTIONRECTANGLE_H +#define LIVESELECTIONRECTANGLE_H + +#include + +QT_FORWARD_DECLARE_CLASS(QGraphicsObject) +QT_FORWARD_DECLARE_CLASS(QGraphicsRectItem) +QT_FORWARD_DECLARE_CLASS(QPointF) +QT_FORWARD_DECLARE_CLASS(QRectF) + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class LiveSelectionRectangle +{ +public: + LiveSelectionRectangle(QGraphicsObject *layerItem); + ~LiveSelectionRectangle(); + + void show(); + void hide(); + + void clear(); + + void setRect(const QPointF &firstPoint, + const QPointF &secondPoint); + + QRectF rect() const; + +private: + QGraphicsRectItem *m_controlShape; + QWeakPointer m_layerItem; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // LIVESELECTIONRECTANGLE_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp new file mode 100644 index 0000000..c55cba3 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp @@ -0,0 +1,438 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "liveselectiontool_p.h" +#include "livelayeritem_p.h" + +#include "../qdeclarativeviewinspector_p_p.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +LiveSelectionTool::LiveSelectionTool(QDeclarativeViewInspector *editorView) : + AbstractLiveEditTool(editorView), + m_rubberbandSelectionMode(false), + m_rubberbandSelectionManipulator( + QDeclarativeViewInspectorPrivate::get(editorView)->manipulatorLayer, editorView), + m_singleSelectionManipulator(editorView), + m_selectionIndicator(editorView, + QDeclarativeViewInspectorPrivate::get(editorView)->manipulatorLayer), + //m_resizeIndicator(editorView->manipulatorLayer()), + m_selectOnlyContentItems(true) +{ + +} + +LiveSelectionTool::~LiveSelectionTool() +{ +} + +void LiveSelectionTool::setRubberbandSelectionMode(bool value) +{ + m_rubberbandSelectionMode = value; +} + +LiveSingleSelectionManipulator::SelectionType LiveSelectionTool::getSelectionType(Qt::KeyboardModifiers + modifiers) +{ + LiveSingleSelectionManipulator::SelectionType selectionType + = LiveSingleSelectionManipulator::ReplaceSelection; + if (modifiers.testFlag(Qt::ControlModifier)) { + selectionType = LiveSingleSelectionManipulator::RemoveFromSelection; + } else if (modifiers.testFlag(Qt::ShiftModifier)) { + selectionType = LiveSingleSelectionManipulator::AddToSelection; + } + return selectionType; +} + +bool LiveSelectionTool::alreadySelected(const QList &itemList) const +{ + QDeclarativeViewInspectorPrivate *inspectorPrivate + = QDeclarativeViewInspectorPrivate::get(inspector()); + const QList selectedItems = inspectorPrivate->selectedItems(); + + if (selectedItems.isEmpty()) + return false; + + foreach (QGraphicsItem *item, itemList) + if (selectedItems.contains(item)) + return true; + + return false; +} + +void LiveSelectionTool::mousePressEvent(QMouseEvent *event) +{ + QDeclarativeViewInspectorPrivate *inspectorPrivate + = QDeclarativeViewInspectorPrivate::get(inspector()); + QList itemList = inspectorPrivate->selectableItems(event->pos()); + LiveSingleSelectionManipulator::SelectionType selectionType = getSelectionType(event->modifiers()); + + if (event->buttons() & Qt::LeftButton) { + m_mousePressTimer.start(); + + if (m_rubberbandSelectionMode) { + m_rubberbandSelectionManipulator.begin(event->pos()); + } else { + m_singleSelectionManipulator.begin(event->pos()); + m_singleSelectionManipulator.select(selectionType, m_selectOnlyContentItems); + } + } else if (event->buttons() & Qt::RightButton) { + createContextMenu(itemList, event->globalPos()); + } +} + +void LiveSelectionTool::createContextMenu(QList itemList, QPoint globalPos) +{ + QMenu contextMenu; + connect(&contextMenu, SIGNAL(hovered(QAction*)), + this, SLOT(contextMenuElementHovered(QAction*))); + + m_contextMenuItemList = itemList; + + contextMenu.addAction(tr("Items")); + contextMenu.addSeparator(); + int shortcutKey = Qt::Key_1; + bool addKeySequence = true; + int i = 0; + + foreach (QGraphicsItem * const item, itemList) { + QString itemTitle = titleForItem(item); + QAction *elementAction = contextMenu.addAction(itemTitle, this, + SLOT(contextMenuElementSelected())); + + if (inspector()->selectedItems().contains(item)) { + QFont boldFont = elementAction->font(); + boldFont.setBold(true); + elementAction->setFont(boldFont); + } + + elementAction->setData(i); + if (addKeySequence) + elementAction->setShortcut(QKeySequence(shortcutKey)); + + shortcutKey++; + if (shortcutKey > Qt::Key_9) + addKeySequence = false; + + ++i; + } + // add root item separately + // QString itemTitle = QString(tr("%1")).arg(titleForItem(view()->currentRootItem())); + // contextMenu.addAction(itemTitle, this, SLOT(contextMenuElementSelected())); + // m_contextMenuItemList.append(view()->currentRootItem()); + + contextMenu.exec(globalPos); + m_contextMenuItemList.clear(); +} + +void LiveSelectionTool::contextMenuElementSelected() +{ + QAction *senderAction = static_cast(sender()); + int itemListIndex = senderAction->data().toInt(); + if (itemListIndex >= 0 && itemListIndex < m_contextMenuItemList.length()) { + + QPointF updatePt(0, 0); + QGraphicsItem *item = m_contextMenuItemList.at(itemListIndex); + m_singleSelectionManipulator.begin(updatePt); + m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::InvertSelection, + QList() << item, + false); + m_singleSelectionManipulator.end(updatePt); + } +} + +void LiveSelectionTool::contextMenuElementHovered(QAction *action) +{ + int itemListIndex = action->data().toInt(); + if (itemListIndex >= 0 && itemListIndex < m_contextMenuItemList.length()) { + QGraphicsObject *item = m_contextMenuItemList.at(itemListIndex)->toGraphicsObject(); + QDeclarativeViewInspectorPrivate::get(inspector())->highlight(item); + } +} + +void LiveSelectionTool::mouseMoveEvent(QMouseEvent *event) +{ + if (m_singleSelectionManipulator.isActive()) { + QPointF mouseMovementVector = m_singleSelectionManipulator.beginPoint() - event->pos(); + + if ((mouseMovementVector.toPoint().manhattanLength() > Constants::DragStartDistance) + && (m_mousePressTimer.elapsed() > Constants::DragStartTime)) + { + m_singleSelectionManipulator.end(event->pos()); + //view()->changeToMoveTool(m_singleSelectionManipulator.beginPoint()); + return; + } + } else if (m_rubberbandSelectionManipulator.isActive()) { + QPointF mouseMovementVector = m_rubberbandSelectionManipulator.beginPoint() - event->pos(); + + if ((mouseMovementVector.toPoint().manhattanLength() > Constants::DragStartDistance) + && (m_mousePressTimer.elapsed() > Constants::DragStartTime)) { + m_rubberbandSelectionManipulator.update(event->pos()); + + if (event->modifiers().testFlag(Qt::ControlModifier)) + m_rubberbandSelectionManipulator.select( + LiveRubberBandSelectionManipulator::RemoveFromSelection); + else if (event->modifiers().testFlag(Qt::ShiftModifier)) + m_rubberbandSelectionManipulator.select( + LiveRubberBandSelectionManipulator::AddToSelection); + else + m_rubberbandSelectionManipulator.select( + LiveRubberBandSelectionManipulator::ReplaceSelection); + } + } +} + +void LiveSelectionTool::hoverMoveEvent(QMouseEvent * event) +{ +// ### commented out until move tool is re-enabled +// QList itemList = view()->items(event->pos()); +// if (!itemList.isEmpty() && !m_rubberbandSelectionMode) { +// +// foreach (QGraphicsItem *item, itemList) { +// if (item->type() == Constants::ResizeHandleItemType) { +// ResizeHandleItem* resizeHandle = ResizeHandleItem::fromGraphicsItem(item); +// if (resizeHandle) +// view()->changeTool(Constants::ResizeToolMode); +// return; +// } +// } +// if (topSelectedItemIsMovable(itemList)) +// view()->changeTool(Constants::MoveToolMode); +// } + QDeclarativeViewInspectorPrivate *inspectorPrivate + = QDeclarativeViewInspectorPrivate::get(inspector()); + + QList selectableItemList = inspectorPrivate->selectableItems(event->pos()); + if (!selectableItemList.isEmpty()) { + QGraphicsObject *item = selectableItemList.first()->toGraphicsObject(); + if (item) + QDeclarativeViewInspectorPrivate::get(inspector())->highlight(item); + + return; + } + + QDeclarativeViewInspectorPrivate::get(inspector())->clearHighlight(); +} + +void LiveSelectionTool::mouseReleaseEvent(QMouseEvent *event) +{ + if (m_singleSelectionManipulator.isActive()) { + m_singleSelectionManipulator.end(event->pos()); + } + else if (m_rubberbandSelectionManipulator.isActive()) { + + QPointF mouseMovementVector = m_rubberbandSelectionManipulator.beginPoint() - event->pos(); + if (mouseMovementVector.toPoint().manhattanLength() < Constants::DragStartDistance) { + m_singleSelectionManipulator.begin(event->pos()); + + if (event->modifiers().testFlag(Qt::ControlModifier)) + m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::RemoveFromSelection, + m_selectOnlyContentItems); + else if (event->modifiers().testFlag(Qt::ShiftModifier)) + m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::AddToSelection, + m_selectOnlyContentItems); + else + m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::InvertSelection, + m_selectOnlyContentItems); + + m_singleSelectionManipulator.end(event->pos()); + } else { + m_rubberbandSelectionManipulator.update(event->pos()); + + if (event->modifiers().testFlag(Qt::ControlModifier)) + m_rubberbandSelectionManipulator.select( + LiveRubberBandSelectionManipulator::RemoveFromSelection); + else if (event->modifiers().testFlag(Qt::ShiftModifier)) + m_rubberbandSelectionManipulator.select( + LiveRubberBandSelectionManipulator::AddToSelection); + else + m_rubberbandSelectionManipulator.select( + LiveRubberBandSelectionManipulator::ReplaceSelection); + + m_rubberbandSelectionManipulator.end(); + } + } +} + +void LiveSelectionTool::mouseDoubleClickEvent(QMouseEvent * /*event*/) +{ +} + +void LiveSelectionTool::keyPressEvent(QKeyEvent *event) +{ + switch (event->key()) { + case Qt::Key_Left: + case Qt::Key_Right: + case Qt::Key_Up: + case Qt::Key_Down: + // disabled for now, cannot move stuff yet. + //view()->changeTool(Constants::MoveToolMode); + //view()->currentTool()->keyPressEvent(event); + break; + } +} + +void LiveSelectionTool::keyReleaseEvent(QKeyEvent * /*keyEvent*/) +{ + +} + +void LiveSelectionTool::wheelEvent(QWheelEvent *event) +{ + if (event->orientation() == Qt::Horizontal || m_rubberbandSelectionMode) + return; + + QDeclarativeViewInspectorPrivate *inspectorPrivate + = QDeclarativeViewInspectorPrivate::get(inspector()); + QList itemList = inspectorPrivate->selectableItems(event->pos()); + + if (itemList.isEmpty()) + return; + + int selectedIdx = 0; + if (!inspector()->selectedItems().isEmpty()) { + selectedIdx = itemList.indexOf(inspector()->selectedItems().first()); + if (selectedIdx >= 0) { + if (event->delta() > 0) { + selectedIdx++; + if (selectedIdx == itemList.length()) + selectedIdx = 0; + } else if (event->delta() < 0) { + selectedIdx--; + if (selectedIdx == -1) + selectedIdx = itemList.length() - 1; + } + } else { + selectedIdx = 0; + } + } + + QPointF updatePt(0, 0); + m_singleSelectionManipulator.begin(updatePt); + m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::ReplaceSelection, + QList() << itemList.at(selectedIdx), + false); + m_singleSelectionManipulator.end(updatePt); + +} + +void LiveSelectionTool::setSelectOnlyContentItems(bool selectOnlyContentItems) +{ + m_selectOnlyContentItems = selectOnlyContentItems; +} + +void LiveSelectionTool::itemsAboutToRemoved(const QList &/*itemList*/) +{ +} + +void LiveSelectionTool::clear() +{ + view()->setCursor(Qt::ArrowCursor); + m_rubberbandSelectionManipulator.clear(), + m_singleSelectionManipulator.clear(); + m_selectionIndicator.clear(); + //m_resizeIndicator.clear(); +} + +void LiveSelectionTool::selectedItemsChanged(const QList &itemList) +{ + foreach (const QWeakPointer &obj, m_selectedItemList) { + if (!obj.isNull()) { + disconnect(obj.data(), SIGNAL(xChanged()), this, SLOT(repaintBoundingRects())); + disconnect(obj.data(), SIGNAL(yChanged()), this, SLOT(repaintBoundingRects())); + disconnect(obj.data(), SIGNAL(widthChanged()), this, SLOT(repaintBoundingRects())); + disconnect(obj.data(), SIGNAL(heightChanged()), this, SLOT(repaintBoundingRects())); + disconnect(obj.data(), SIGNAL(rotationChanged()), this, SLOT(repaintBoundingRects())); + } + } + + QList objects = toGraphicsObjectList(itemList); + m_selectedItemList.clear(); + + foreach (QGraphicsObject *obj, objects) { + m_selectedItemList.append(obj); + connect(obj, SIGNAL(xChanged()), this, SLOT(repaintBoundingRects())); + connect(obj, SIGNAL(yChanged()), this, SLOT(repaintBoundingRects())); + connect(obj, SIGNAL(widthChanged()), this, SLOT(repaintBoundingRects())); + connect(obj, SIGNAL(heightChanged()), this, SLOT(repaintBoundingRects())); + connect(obj, SIGNAL(rotationChanged()), this, SLOT(repaintBoundingRects())); + } + + m_selectionIndicator.setItems(m_selectedItemList); + //m_resizeIndicator.setItems(toGraphicsObjectList(itemList)); +} + +void LiveSelectionTool::repaintBoundingRects() +{ + m_selectionIndicator.setItems(m_selectedItemList); +} + +void LiveSelectionTool::selectUnderPoint(QMouseEvent *event) +{ + m_singleSelectionManipulator.begin(event->pos()); + + if (event->modifiers().testFlag(Qt::ControlModifier)) + m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::RemoveFromSelection, + m_selectOnlyContentItems); + else if (event->modifiers().testFlag(Qt::ShiftModifier)) + m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::AddToSelection, + m_selectOnlyContentItems); + else + m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::InvertSelection, + m_selectOnlyContentItems); + + m_singleSelectionManipulator.end(event->pos()); +} + +QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool_p.h new file mode 100644 index 0000000..7562f3e --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool_p.h @@ -0,0 +1,126 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef LIVESELECTIONTOOL_H +#define LIVESELECTIONTOOL_H + +#include "abstractliveedittool_p.h" +#include "liverubberbandselectionmanipulator_p.h" +#include "livesingleselectionmanipulator_p.h" +#include "liveselectionindicator_p.h" + +#include +#include + +QT_FORWARD_DECLARE_CLASS(QGraphicsItem) +QT_FORWARD_DECLARE_CLASS(QMouseEvent) +QT_FORWARD_DECLARE_CLASS(QKeyEvent) +QT_FORWARD_DECLARE_CLASS(QAction) + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class LiveSelectionTool : public AbstractLiveEditTool +{ + Q_OBJECT + +public: + LiveSelectionTool(QDeclarativeViewInspector* editorView); + ~LiveSelectionTool(); + + void mousePressEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); + void mouseDoubleClickEvent(QMouseEvent *event); + void hoverMoveEvent(QMouseEvent *event); + void keyPressEvent(QKeyEvent *event); + void keyReleaseEvent(QKeyEvent *keyEvent); + void wheelEvent(QWheelEvent *event); + + void itemsAboutToRemoved(const QList &itemList); +// QVariant itemChange(const QList &itemList, +// QGraphicsItem::GraphicsItemChange change, +// const QVariant &value ); + +// void update(); + + void clear(); + + void selectedItemsChanged(const QList &itemList); + + void selectUnderPoint(QMouseEvent *event); + + void setSelectOnlyContentItems(bool selectOnlyContentItems); + + void setRubberbandSelectionMode(bool value); + +private slots: + void contextMenuElementSelected(); + void contextMenuElementHovered(QAction *action); + void repaintBoundingRects(); + +private: + void createContextMenu(QList itemList, QPoint globalPos); + LiveSingleSelectionManipulator::SelectionType getSelectionType(Qt::KeyboardModifiers modifiers); + bool alreadySelected(const QList &itemList) const; + +private: + bool m_rubberbandSelectionMode; + LiveRubberBandSelectionManipulator m_rubberbandSelectionManipulator; + LiveSingleSelectionManipulator m_singleSelectionManipulator; + LiveSelectionIndicator m_selectionIndicator; + //ResizeIndicator m_resizeIndicator; + QTime m_mousePressTimer; + bool m_selectOnlyContentItems; + + QList > m_selectedItemList; + + QList m_contextMenuItemList; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // LIVESELECTIONTOOL_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator.cpp new file mode 100644 index 0000000..ee9843b --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator.cpp @@ -0,0 +1,151 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "livesingleselectionmanipulator_p.h" + +#include "../qdeclarativeviewinspector_p_p.h" + +#include + +QT_BEGIN_NAMESPACE + +LiveSingleSelectionManipulator::LiveSingleSelectionManipulator(QDeclarativeViewInspector *editorView) + : m_editorView(editorView), + m_isActive(false) +{ +} + + +void LiveSingleSelectionManipulator::begin(const QPointF &beginPoint) +{ + m_beginPoint = beginPoint; + m_isActive = true; + m_oldSelectionList = QDeclarativeViewInspectorPrivate::get(m_editorView)->selectedItems(); +} + +void LiveSingleSelectionManipulator::update(const QPointF &/*updatePoint*/) +{ + m_oldSelectionList.clear(); +} + +void LiveSingleSelectionManipulator::clear() +{ + m_beginPoint = QPointF(); + m_oldSelectionList.clear(); +} + + +void LiveSingleSelectionManipulator::end(const QPointF &/*updatePoint*/) +{ + m_oldSelectionList.clear(); + m_isActive = false; +} + +void LiveSingleSelectionManipulator::select(SelectionType selectionType, + const QList &items, + bool /*selectOnlyContentItems*/) +{ + QGraphicsItem *selectedItem = 0; + + foreach (QGraphicsItem* item, items) + { + //FormEditorItem *formEditorItem = FormEditorItem::fromQGraphicsItem(item); + if (item + /*&& !formEditorItem->qmlItemNode().isRootNode() + && (formEditorItem->qmlItemNode().hasShowContent() || !selectOnlyContentItems)*/) + { + selectedItem = item; + break; + } + } + + QList resultList; + + switch (selectionType) { + case AddToSelection: { + resultList.append(m_oldSelectionList); + if (selectedItem && !m_oldSelectionList.contains(selectedItem)) + resultList.append(selectedItem); + } + break; + case ReplaceSelection: { + if (selectedItem) + resultList.append(selectedItem); + } + break; + case RemoveFromSelection: { + resultList.append(m_oldSelectionList); + if (selectedItem) + resultList.removeAll(selectedItem); + } + break; + case InvertSelection: { + if (selectedItem + && !m_oldSelectionList.contains(selectedItem)) + { + resultList.append(selectedItem); + } + } + } + + m_editorView->setSelectedItems(resultList); +} + +void LiveSingleSelectionManipulator::select(SelectionType selectionType, bool selectOnlyContentItems) +{ + QDeclarativeViewInspectorPrivate *inspectorPrivate = + QDeclarativeViewInspectorPrivate::get(m_editorView); + QList itemList = inspectorPrivate->selectableItems(m_beginPoint); + select(selectionType, itemList, selectOnlyContentItems); +} + + +bool LiveSingleSelectionManipulator::isActive() const +{ + return m_isActive; +} + +QPointF LiveSingleSelectionManipulator::beginPoint() const +{ + return m_beginPoint; +} + +QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator_p.h new file mode 100644 index 0000000..40b5fc0 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator_p.h @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef LIVESINGLESELECTIONMANIPULATOR_H +#define LIVESINGLESELECTIONMANIPULATOR_H + +#include +#include + +QT_FORWARD_DECLARE_CLASS(QGraphicsItem) + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QDeclarativeViewInspector; + +class LiveSingleSelectionManipulator +{ +public: + LiveSingleSelectionManipulator(QDeclarativeViewInspector *editorView); + + enum SelectionType { + ReplaceSelection, + AddToSelection, + RemoveFromSelection, + InvertSelection + }; + + void begin(const QPointF& beginPoint); + void update(const QPointF& updatePoint); + void end(const QPointF& updatePoint); + + void select(SelectionType selectionType, const QList &items, + bool selectOnlyContentItems); + void select(SelectionType selectionType, bool selectOnlyContentItems); + + void clear(); + + QPointF beginPoint() const; + + bool isActive() const; + +private: + QList m_oldSelectionList; + QPointF m_beginPoint; + QDeclarativeViewInspector *m_editorView; + bool m_isActive; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // LIVESINGLESELECTIONMANIPULATOR_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar.cpp new file mode 100644 index 0000000..0a72674 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar.cpp @@ -0,0 +1,328 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmltoolbar_p.h" +#include "toolbarcolorbox_p.h" + +#include +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +QmlToolBar::QmlToolBar(QWidget *parent) + : QToolBar(parent) + , m_emitSignals(true) + , m_paused(false) + , m_animationSpeed(1.0f) + , ui(new Ui) +{ + ui->playIcon = QIcon(QLatin1String(":/qml/images/play-24.png")); + ui->pauseIcon = QIcon(QLatin1String(":/qml/images/pause-24.png")); + + ui->designmode = new QAction(QIcon(QLatin1String(":/qml/images/inspectormode-24.png")), + tr("Inspector Mode"), this); + ui->play = new QAction(ui->pauseIcon, tr("Play/Pause Animations"), this); + ui->select = new QAction(QIcon(QLatin1String(":/qml/images/select-24.png")), tr("Select"), this); + ui->selectMarquee = new QAction(QIcon(QLatin1String(":/qml/images/select-marquee-24.png")), + tr("Select (Marquee)"), this); + ui->zoom = new QAction(QIcon(QLatin1String(":/qml/images/zoom-24.png")), tr("Zoom"), this); + ui->colorPicker = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-24.png")), + tr("Color Picker"), this); + ui->toQml = new QAction(QIcon(QLatin1String(":/qml/images/to-qml-24.png")), + tr("Apply Changes to QML Viewer"), this); + ui->fromQml = new QAction(QIcon(QLatin1String(":/qml/images/from-qml-24.png")), + tr("Apply Changes to Document"), this); + ui->designmode->setCheckable(true); + ui->designmode->setChecked(false); + + ui->play->setCheckable(false); + ui->select->setCheckable(true); + ui->selectMarquee->setCheckable(true); + ui->zoom->setCheckable(true); + ui->colorPicker->setCheckable(true); + + setWindowTitle(tr("Tools")); + + addAction(ui->designmode); + addAction(ui->play); + addSeparator(); + + addAction(ui->select); + // disabled because multi selection does not do anything useful without design mode + //addAction(ui->selectMarquee); + addSeparator(); + addAction(ui->zoom); + addAction(ui->colorPicker); + //addAction(ui->fromQml); + + ui->colorBox = new ToolBarColorBox(this); + ui->colorBox->setMinimumSize(24, 24); + ui->colorBox->setMaximumSize(28, 28); + ui->colorBox->setColor(Qt::black); + addWidget(ui->colorBox); + + setWindowFlags(Qt::Tool); + + QMenu *playSpeedMenu = new QMenu(this); + ui->playSpeedMenuActions = new QActionGroup(this); + ui->playSpeedMenuActions->setExclusive(true); + + QAction *speedAction = playSpeedMenu->addAction(tr("1x"), this, SLOT(changeAnimationSpeed())); + speedAction->setCheckable(true); + speedAction->setChecked(true); + speedAction->setData(1.0f); + ui->playSpeedMenuActions->addAction(speedAction); + + speedAction = playSpeedMenu->addAction(tr("0.5x"), this, SLOT(changeAnimationSpeed())); + speedAction->setCheckable(true); + speedAction->setData(2.0f); + ui->playSpeedMenuActions->addAction(speedAction); + + speedAction = playSpeedMenu->addAction(tr("0.25x"), this, SLOT(changeAnimationSpeed())); + speedAction->setCheckable(true); + speedAction->setData(4.0f); + ui->playSpeedMenuActions->addAction(speedAction); + + speedAction = playSpeedMenu->addAction(tr("0.125x"), this, SLOT(changeAnimationSpeed())); + speedAction->setCheckable(true); + speedAction->setData(8.0f); + ui->playSpeedMenuActions->addAction(speedAction); + + speedAction = playSpeedMenu->addAction(tr("0.1x"), this, SLOT(changeAnimationSpeed())); + speedAction->setCheckable(true); + speedAction->setData(10.0f); + ui->playSpeedMenuActions->addAction(speedAction); + + ui->play->setMenu(playSpeedMenu); + + connect(ui->designmode, SIGNAL(toggled(bool)), SLOT(setDesignModeBehaviorOnClick(bool))); + + connect(ui->colorPicker, SIGNAL(triggered()), SLOT(activateColorPickerOnClick())); + + connect(ui->play, SIGNAL(triggered()), SLOT(activatePlayOnClick())); + + connect(ui->zoom, SIGNAL(triggered()), SLOT(activateZoomOnClick())); + connect(ui->colorPicker, SIGNAL(triggered()), SLOT(activateColorPickerOnClick())); + connect(ui->select, SIGNAL(triggered()), SLOT(activateSelectToolOnClick())); + connect(ui->selectMarquee, SIGNAL(triggered()), SLOT(activateMarqueeSelectToolOnClick())); + + connect(ui->toQml, SIGNAL(triggered()), SLOT(activateToQml())); + connect(ui->fromQml, SIGNAL(triggered()), SLOT(activateFromQml())); +} + +QmlToolBar::~QmlToolBar() +{ + delete ui; +} + +void QmlToolBar::activateColorPicker() +{ + m_emitSignals = false; + activateColorPickerOnClick(); + m_emitSignals = true; +} + +void QmlToolBar::activateSelectTool() +{ + m_emitSignals = false; + activateSelectToolOnClick(); + m_emitSignals = true; +} + +void QmlToolBar::activateMarqueeSelectTool() +{ + m_emitSignals = false; + activateMarqueeSelectToolOnClick(); + m_emitSignals = true; +} + +void QmlToolBar::activateZoom() +{ + m_emitSignals = false; + activateZoomOnClick(); + m_emitSignals = true; +} + +void QmlToolBar::setAnimationSpeed(qreal slowDownFactor) +{ + if (m_animationSpeed == slowDownFactor) + return; + + m_emitSignals = false; + m_animationSpeed = slowDownFactor; + + foreach (QAction *action, ui->playSpeedMenuActions->actions()) { + if (action->data().toReal() == slowDownFactor) { + action->setChecked(true); + break; + } + } + + m_emitSignals = true; +} + +void QmlToolBar::setAnimationPaused(bool paused) +{ + if (m_paused == paused) + return; + + m_paused = paused; + updatePlayAction(); +} + +void QmlToolBar::changeAnimationSpeed() +{ + QAction *action = qobject_cast(sender()); + m_animationSpeed = action->data().toReal(); + emit animationSpeedChanged(m_animationSpeed); +} + +void QmlToolBar::setDesignModeBehavior(bool inDesignMode) +{ + m_emitSignals = false; + ui->designmode->setChecked(inDesignMode); + setDesignModeBehaviorOnClick(inDesignMode); + m_emitSignals = true; +} + +void QmlToolBar::setDesignModeBehaviorOnClick(bool checked) +{ + ui->select->setEnabled(checked); + ui->selectMarquee->setEnabled(checked); + ui->zoom->setEnabled(checked); + ui->colorPicker->setEnabled(checked); + ui->toQml->setEnabled(checked); + ui->fromQml->setEnabled(checked); + + if (m_emitSignals) + emit designModeBehaviorChanged(checked); +} + +void QmlToolBar::setColorBoxColor(const QColor &color) +{ + ui->colorBox->setColor(color); +} + +void QmlToolBar::activatePlayOnClick() +{ + m_paused = !m_paused; + emit animationPausedChanged(m_paused); + updatePlayAction(); +} + +void QmlToolBar::updatePlayAction() +{ + ui->play->setIcon(m_paused ? ui->playIcon : ui->pauseIcon); +} + +void QmlToolBar::activateColorPickerOnClick() +{ + ui->zoom->setChecked(false); + ui->select->setChecked(false); + ui->selectMarquee->setChecked(false); + + ui->colorPicker->setChecked(true); + if (m_activeTool != Constants::ColorPickerMode) { + m_activeTool = Constants::ColorPickerMode; + if (m_emitSignals) + emit colorPickerSelected(); + } +} + +void QmlToolBar::activateSelectToolOnClick() +{ + ui->zoom->setChecked(false); + ui->selectMarquee->setChecked(false); + ui->colorPicker->setChecked(false); + + ui->select->setChecked(true); + if (m_activeTool != Constants::SelectionToolMode) { + m_activeTool = Constants::SelectionToolMode; + if (m_emitSignals) + emit selectToolSelected(); + } +} + +void QmlToolBar::activateMarqueeSelectToolOnClick() +{ + ui->zoom->setChecked(false); + ui->select->setChecked(false); + ui->colorPicker->setChecked(false); + + ui->selectMarquee->setChecked(true); + if (m_activeTool != Constants::MarqueeSelectionToolMode) { + m_activeTool = Constants::MarqueeSelectionToolMode; + if (m_emitSignals) + emit marqueeSelectToolSelected(); + } +} + +void QmlToolBar::activateZoomOnClick() +{ + ui->select->setChecked(false); + ui->selectMarquee->setChecked(false); + ui->colorPicker->setChecked(false); + + ui->zoom->setChecked(true); + if (m_activeTool != Constants::ZoomMode) { + m_activeTool = Constants::ZoomMode; + if (m_emitSignals) + emit zoomToolSelected(); + } +} + +void QmlToolBar::activateFromQml() +{ + if (m_emitSignals) + emit applyChangesFromQmlFileSelected(); +} + +void QmlToolBar::activateToQml() +{ + if (m_emitSignals) + emit applyChangesToQmlFileSelected(); +} + +QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar_p.h new file mode 100644 index 0000000..0401804 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar_p.h @@ -0,0 +1,138 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLTOOLBAR_H +#define QMLTOOLBAR_H + +#include +#include + +#include "../qmlinspectorconstants_p.h" + +QT_FORWARD_DECLARE_CLASS(QActionGroup) + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class ToolBarColorBox; + +class QmlToolBar : public QToolBar +{ + Q_OBJECT + +public: + explicit QmlToolBar(QWidget *parent = 0); + ~QmlToolBar(); + +public slots: + void setDesignModeBehavior(bool inDesignMode); + void setColorBoxColor(const QColor &color); + void activateColorPicker(); + void activateSelectTool(); + void activateMarqueeSelectTool(); + void activateZoom(); + + void setAnimationSpeed(qreal slowDownFactor); + void setAnimationPaused(bool paused); + +signals: + void animationSpeedChanged(qreal factor); + void animationPausedChanged(bool paused); + + void designModeBehaviorChanged(bool inDesignMode); + void colorPickerSelected(); + void selectToolSelected(); + void marqueeSelectToolSelected(); + void zoomToolSelected(); + + void applyChangesToQmlFileSelected(); + void applyChangesFromQmlFileSelected(); + +private slots: + void setDesignModeBehaviorOnClick(bool inDesignMode); + void activatePlayOnClick(); + void activateColorPickerOnClick(); + void activateSelectToolOnClick(); + void activateMarqueeSelectToolOnClick(); + void activateZoomOnClick(); + + void activateFromQml(); + void activateToQml(); + + void changeAnimationSpeed(); + + void updatePlayAction(); + +private: + class Ui { + public: + QAction *designmode; + QAction *play; + QAction *select; + QAction *selectMarquee; + QAction *zoom; + QAction *colorPicker; + QAction *toQml; + QAction *fromQml; + QIcon playIcon; + QIcon pauseIcon; + ToolBarColorBox *colorBox; + + QActionGroup *playSpeedMenuActions; + }; + + bool m_emitSignals; + bool m_paused; + qreal m_animationSpeed; + + Constants::DesignTool m_activeTool; + + Ui *ui; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMLTOOLBAR_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem.cpp new file mode 100644 index 0000000..2ed3179 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem.cpp @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "subcomponentmasklayeritem_p.h" + +#include "../qmlinspectorconstants_p.h" +#include "../qdeclarativeviewinspector_p.h" + +#include + +QT_BEGIN_NAMESPACE + +SubcomponentMaskLayerItem::SubcomponentMaskLayerItem(QDeclarativeViewInspector *inspector, + QGraphicsItem *parentItem) : + QGraphicsPolygonItem(parentItem), + m_inspector(inspector), + m_currentItem(0), + m_borderRect(new QGraphicsRectItem(this)) +{ + m_borderRect->setRect(0,0,0,0); + m_borderRect->setPen(QPen(QColor(60, 60, 60), 1)); + m_borderRect->setData(Constants::EditorItemDataKey, QVariant(true)); + + setBrush(QBrush(QColor(160,160,160))); + setPen(Qt::NoPen); +} + +int SubcomponentMaskLayerItem::type() const +{ + return Constants::EditorItemType; +} + +static QRectF resizeRect(const QRectF &newRect, const QRectF &oldRect) +{ + QRectF result = newRect; + if (oldRect.left() < newRect.left()) + result.setLeft(oldRect.left()); + + if (oldRect.top() < newRect.top()) + result.setTop(oldRect.top()); + + if (oldRect.right() > newRect.right()) + result.setRight(oldRect.right()); + + if (oldRect.bottom() > newRect.bottom()) + result.setBottom(oldRect.bottom()); + + return result; +} + +static QPolygonF regionToPolygon(const QRegion ®ion) +{ + QPainterPath path; + foreach (const QRect &rect, region.rects()) + path.addRect(rect); + return path.toFillPolygon(); +} + +void SubcomponentMaskLayerItem::setCurrentItem(QGraphicsItem *item) +{ + QGraphicsItem *prevItem = m_currentItem; + m_currentItem = item; + + if (!m_currentItem) + return; + + QRect viewRect = m_inspector->declarativeView()->rect(); + viewRect = m_inspector->declarativeView()->mapToScene(viewRect).boundingRect().toRect(); + + QRectF itemRect = item->boundingRect() | item->childrenBoundingRect(); + itemRect = item->mapRectToScene(itemRect); + + // if updating the same item as before, resize the rectangle only bigger, not smaller. + if (prevItem == item && prevItem != 0) { + m_itemPolyRect = resizeRect(itemRect, m_itemPolyRect); + } else { + m_itemPolyRect = itemRect; + } + QRectF borderRect = m_itemPolyRect; + borderRect.adjust(-1, -1, 1, 1); + m_borderRect->setRect(borderRect); + + const QRegion externalRegion = QRegion(viewRect).subtracted(m_itemPolyRect.toRect()); + setPolygon(regionToPolygon(externalRegion)); +} + +QGraphicsItem *SubcomponentMaskLayerItem::currentItem() const +{ + return m_currentItem; +} + +QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem_p.h new file mode 100644 index 0000000..07ce881 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem_p.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SUBCOMPONENTMASKLAYERITEM_H +#define SUBCOMPONENTMASKLAYERITEM_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QDeclarativeViewInspector; + +class SubcomponentMaskLayerItem : public QGraphicsPolygonItem +{ +public: + explicit SubcomponentMaskLayerItem(QDeclarativeViewInspector *inspector, + QGraphicsItem *parentItem = 0); + int type() const; + void setCurrentItem(QGraphicsItem *item); + void setBoundingBox(const QRectF &boundingBox); + QGraphicsItem *currentItem() const; + QRectF itemRect() const; + +private: + QDeclarativeViewInspector *m_inspector; + QGraphicsItem *m_currentItem; + QGraphicsRectItem *m_borderRect; + QRectF m_itemPolyRect; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // SUBCOMPONENTMASKLAYERITEM_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox.cpp new file mode 100644 index 0000000..154ddf2 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox.cpp @@ -0,0 +1,134 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "toolbarcolorbox_p.h" + +#include "../qmlinspectorconstants_p.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +ToolBarColorBox::ToolBarColorBox(QWidget *parent) : + QLabel(parent) +{ + m_copyHexColor = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-hicontrast.png")), + tr("Copy Color"), this); + connect(m_copyHexColor, SIGNAL(triggered()), SLOT(copyColorToClipboard())); + setScaledContents(false); +} + +void ToolBarColorBox::setColor(const QColor &color) +{ + m_color = color; + + QPixmap pix = createDragPixmap(width()); + setPixmap(pix); + update(); +} + +void ToolBarColorBox::mousePressEvent(QMouseEvent *event) +{ + m_dragBeginPoint = event->pos(); + m_dragStarted = false; +} + +void ToolBarColorBox::mouseMoveEvent(QMouseEvent *event) +{ + + if (event->buttons() & Qt::LeftButton + && (QPoint(event->pos() - m_dragBeginPoint).manhattanLength() + > Constants::DragStartDistance) + && !m_dragStarted) + { + m_dragStarted = true; + QDrag *drag = new QDrag(this); + QMimeData *mimeData = new QMimeData; + + mimeData->setText(m_color.name()); + drag->setMimeData(mimeData); + drag->setPixmap(createDragPixmap()); + + drag->exec(); + } +} + +QPixmap ToolBarColorBox::createDragPixmap(int size) const +{ + QPixmap pix(size, size); + QPainter p(&pix); + + QColor borderColor1 = QColor(143, 143 ,143); + QColor borderColor2 = QColor(43, 43, 43); + + p.setBrush(QBrush(m_color)); + p.setPen(QPen(QBrush(borderColor2),1)); + + p.fillRect(0, 0, size, size, borderColor1); + p.drawRect(1,1, size - 3, size - 3); + return pix; +} + +void ToolBarColorBox::contextMenuEvent(QContextMenuEvent *ev) +{ + QMenu contextMenu; + contextMenu.addAction(m_copyHexColor); + contextMenu.exec(ev->globalPos()); +} + +void ToolBarColorBox::copyColorToClipboard() +{ + QClipboard *clipboard = QApplication::clipboard(); + clipboard->setText(m_color.name()); +} + +QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox_p.h new file mode 100644 index 0000000..c3e064c --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox_p.h @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef TOOLBARCOLORBOX_H +#define TOOLBARCOLORBOX_H + +#include +#include +#include + +QT_FORWARD_DECLARE_CLASS(QContextMenuEvent) +QT_FORWARD_DECLARE_CLASS(QAction) + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class ToolBarColorBox : public QLabel +{ + Q_OBJECT + +public: + explicit ToolBarColorBox(QWidget *parent = 0); + void setColor(const QColor &color); + +protected: + void contextMenuEvent(QContextMenuEvent *ev); + void mousePressEvent(QMouseEvent *ev); + void mouseMoveEvent(QMouseEvent *ev); +private slots: + void copyColorToClipboard(); + +private: + QPixmap createDragPixmap(int size = 24) const; + +private: + bool m_dragStarted; + QPoint m_dragBeginPoint; + QAction *m_copyHexColor; + QColor m_color; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // TOOLBARCOLORBOX_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.cpp new file mode 100644 index 0000000..969c9d5 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.cpp @@ -0,0 +1,336 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "zoomtool_p.h" + +#include "../qdeclarativeviewinspector_p_p.h" + +#include +#include +#include +#include +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +ZoomTool::ZoomTool(QDeclarativeViewInspector *view) : + AbstractLiveEditTool(view), + m_rubberbandManipulator(), + m_smoothZoomMultiplier(0.05f), + m_currentScale(1.0f) +{ + m_zoomTo100Action = new QAction(tr("Zoom to &100%"), this); + m_zoomInAction = new QAction(tr("Zoom In"), this); + m_zoomOutAction = new QAction(tr("Zoom Out"), this); + m_zoomInAction->setShortcut(QKeySequence(Qt::Key_Plus)); + m_zoomOutAction->setShortcut(QKeySequence(Qt::Key_Minus)); + + + LiveLayerItem *layerItem = QDeclarativeViewInspectorPrivate::get(view)->manipulatorLayer; + QGraphicsObject *layerObject = reinterpret_cast(layerItem); + m_rubberbandManipulator = new LiveRubberBandSelectionManipulator(layerObject, view); + + + connect(m_zoomTo100Action, SIGNAL(triggered()), SLOT(zoomTo100())); + connect(m_zoomInAction, SIGNAL(triggered()), SLOT(zoomIn())); + connect(m_zoomOutAction, SIGNAL(triggered()), SLOT(zoomOut())); +} + +ZoomTool::~ZoomTool() +{ + delete m_rubberbandManipulator; +} + +void ZoomTool::mousePressEvent(QMouseEvent *event) +{ + m_mousePos = event->pos(); + + QPointF scenePos = view()->mapToScene(event->pos()); + + if (event->buttons() & Qt::RightButton) { + QMenu contextMenu; + contextMenu.addAction(m_zoomTo100Action); + contextMenu.addSeparator(); + contextMenu.addAction(m_zoomInAction); + contextMenu.addAction(m_zoomOutAction); + contextMenu.exec(event->globalPos()); + } else if (event->buttons() & Qt::LeftButton) { + m_dragBeginPos = scenePos; + m_dragStarted = false; + } +} + +void ZoomTool::mouseMoveEvent(QMouseEvent *event) +{ + m_mousePos = event->pos(); + + QPointF scenePos = view()->mapToScene(event->pos()); + + if (event->buttons() & Qt::LeftButton + && (QPointF(scenePos - m_dragBeginPos).manhattanLength() + > Constants::DragStartDistance / 3) + && !m_dragStarted) + { + m_dragStarted = true; + m_rubberbandManipulator->begin(m_dragBeginPos); + return; + } + + if (m_dragStarted) + m_rubberbandManipulator->update(scenePos); + +} + +void ZoomTool::mouseReleaseEvent(QMouseEvent *event) +{ + m_mousePos = event->pos(); + QPointF scenePos = view()->mapToScene(event->pos()); + + if (m_dragStarted) { + m_rubberbandManipulator->end(); + + int x1 = qMin(scenePos.x(), m_rubberbandManipulator->beginPoint().x()); + int x2 = qMax(scenePos.x(), m_rubberbandManipulator->beginPoint().x()); + int y1 = qMin(scenePos.y(), m_rubberbandManipulator->beginPoint().y()); + int y2 = qMax(scenePos.y(), m_rubberbandManipulator->beginPoint().y()); + + QPointF scenePosTopLeft = QPoint(x1, y1); + QPointF scenePosBottomRight = QPoint(x2, y2); + + QRectF sceneArea(scenePosTopLeft, scenePosBottomRight); + + m_currentScale = qMin(view()->rect().width() / sceneArea.width(), + view()->rect().height() / sceneArea.height()); + + + QTransform transform; + transform.scale(m_currentScale, m_currentScale); + + view()->setTransform(transform); + view()->setSceneRect(sceneArea); + } else { + Qt::KeyboardModifier modifierKey = Qt::ControlModifier; +#ifdef Q_WS_MAC + modifierKey = Qt::AltModifier; +#endif + if (event->modifiers() & modifierKey) { + zoomOut(); + } else { + zoomIn(); + } + } +} + +void ZoomTool::zoomIn() +{ + m_currentScale = nextZoomScale(ZoomIn); + scaleView(view()->mapToScene(m_mousePos)); +} + +void ZoomTool::zoomOut() +{ + m_currentScale = nextZoomScale(ZoomOut); + scaleView(view()->mapToScene(m_mousePos)); +} + +void ZoomTool::mouseDoubleClickEvent(QMouseEvent *event) +{ + m_mousePos = event->pos(); +} + + +void ZoomTool::hoverMoveEvent(QMouseEvent *event) +{ + m_mousePos = event->pos(); +} + + +void ZoomTool::keyPressEvent(QKeyEvent * /*event*/) +{ +} + +void ZoomTool::wheelEvent(QWheelEvent *event) +{ + if (event->orientation() != Qt::Vertical) + return; + + Qt::KeyboardModifier smoothZoomModifier = Qt::ControlModifier; + if (event->modifiers() & smoothZoomModifier) { + int numDegrees = event->delta() / 8; + m_currentScale += m_smoothZoomMultiplier * (numDegrees / 15.0f); + + scaleView(view()->mapToScene(m_mousePos)); + + } else if (!event->modifiers()) { + if (event->delta() > 0) { + m_currentScale = nextZoomScale(ZoomIn); + } else if (event->delta() < 0) { + m_currentScale = nextZoomScale(ZoomOut); + } + scaleView(view()->mapToScene(m_mousePos)); + } +} + +void ZoomTool::keyReleaseEvent(QKeyEvent *event) +{ + switch (event->key()) { + case Qt::Key_Plus: + zoomIn(); + break; + case Qt::Key_Minus: + zoomOut(); + break; + case Qt::Key_1: + case Qt::Key_2: + case Qt::Key_3: + case Qt::Key_4: + case Qt::Key_5: + case Qt::Key_6: + case Qt::Key_7: + case Qt::Key_8: + case Qt::Key_9: + { + m_currentScale = ((event->key() - Qt::Key_0) * 1.0f); + scaleView(view()->mapToScene(m_mousePos)); // view()->mapToScene(view()->rect().center()) + break; + } + + default: + break; + } + +} + +void ZoomTool::itemsAboutToRemoved(const QList &/*itemList*/) +{ +} + +void ZoomTool::clear() +{ + view()->setCursor(Qt::ArrowCursor); +} + +void ZoomTool::selectedItemsChanged(const QList &/*itemList*/) +{ +} + +void ZoomTool::scaleView(const QPointF ¢erPos) +{ + + QTransform transform; + transform.scale(m_currentScale, m_currentScale); + view()->setTransform(transform); + + QPointF adjustedCenterPos = centerPos; + QSize rectSize(view()->rect().width() / m_currentScale, + view()->rect().height() / m_currentScale); + + QRectF sceneRect; + if (qAbs(m_currentScale - 1.0f) < Constants::ZoomSnapDelta) { + adjustedCenterPos.rx() = rectSize.width() / 2; + adjustedCenterPos.ry() = rectSize.height() / 2; + } + + if (m_currentScale < 1.0f) { + adjustedCenterPos.rx() = rectSize.width() / 2; + adjustedCenterPos.ry() = rectSize.height() / 2; + sceneRect.setRect(view()->rect().width() / 2 -rectSize.width() / 2, + view()->rect().height() / 2 -rectSize.height() / 2, + rectSize.width(), + rectSize.height()); + } else { + sceneRect.setRect(adjustedCenterPos.x() - rectSize.width() / 2, + adjustedCenterPos.y() - rectSize.height() / 2, + rectSize.width(), + rectSize.height()); + } + + view()->setSceneRect(sceneRect); +} + +void ZoomTool::zoomTo100() +{ + m_currentScale = 1.0f; + scaleView(view()->mapToScene(view()->rect().center())); +} + +qreal ZoomTool::nextZoomScale(ZoomDirection direction) const +{ + static QList zoomScales = + QList() + << 0.125f + << 1.0f / 6.0f + << 0.25f + << 1.0f / 3.0f + << 0.5f + << 2.0f / 3.0f + << 1.0f + << 2.0f + << 3.0f + << 4.0f + << 5.0f + << 6.0f + << 7.0f + << 8.0f + << 12.0f + << 16.0f + << 32.0f + << 48.0f; + + if (direction == ZoomIn) { + for (int i = 0; i < zoomScales.length(); ++i) { + if (zoomScales[i] > m_currentScale || i == zoomScales.length() - 1) + return zoomScales[i]; + } + } else { + for (int i = zoomScales.length() - 1; i >= 0; --i) { + if (zoomScales[i] < m_currentScale || i == 0) + return zoomScales[i]; + } + } + + return 1.0f; +} + +QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool_p.h new file mode 100644 index 0000000..14fa4d5 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool_p.h @@ -0,0 +1,113 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef ZOOMTOOL_H +#define ZOOMTOOL_H + +#include "abstractliveedittool_p.h" +#include "liverubberbandselectionmanipulator_p.h" + +QT_FORWARD_DECLARE_CLASS(QAction) + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class ZoomTool : public AbstractLiveEditTool +{ + Q_OBJECT + +public: + enum ZoomDirection { + ZoomIn, + ZoomOut + }; + + explicit ZoomTool(QDeclarativeViewInspector *view); + + virtual ~ZoomTool(); + + void mousePressEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); + void mouseDoubleClickEvent(QMouseEvent *event); + + void hoverMoveEvent(QMouseEvent *event); + void wheelEvent(QWheelEvent *event); + + void keyPressEvent(QKeyEvent *event); + void keyReleaseEvent(QKeyEvent *keyEvent); + void itemsAboutToRemoved(const QList &itemList); + + void clear(); + +protected: + void selectedItemsChanged(const QList &itemList); + +private slots: + void zoomTo100(); + void zoomIn(); + void zoomOut(); + +private: + qreal nextZoomScale(ZoomDirection direction) const; + void scaleView(const QPointF ¢erPos); + +private: + bool m_dragStarted; + QPoint m_mousePos; // in view coords + QPointF m_dragBeginPos; + QAction *m_zoomTo100Action; + QAction *m_zoomInAction; + QAction *m_zoomOutAction; + LiveRubberBandSelectionManipulator *m_rubberbandManipulator; + + qreal m_smoothZoomMultiplier; + qreal m_currentScale; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // ZOOMTOOL_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.cpp b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.cpp new file mode 100644 index 0000000..a266eb9 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.cpp @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qdeclarativeinspectorplugin.h" + +#include "qdeclarativeviewinspector_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QDeclarativeInspectorPlugin::QDeclarativeInspectorPlugin() : + m_inspector(0) +{ +} + +QDeclarativeInspectorPlugin::~QDeclarativeInspectorPlugin() +{ + delete m_inspector; +} + +void QDeclarativeInspectorPlugin::activate() +{ + QDeclarativeInspectorService *service = QDeclarativeInspectorService::instance(); + QList views = service->views(); + if (views.isEmpty()) + return; + + // TODO: Support multiple views + QDeclarativeView *view = service->views().at(0); + m_inspector = new QDeclarativeViewInspector(view, view); +} + +void QDeclarativeInspectorPlugin::deactivate() +{ + delete m_inspector; +} + +Q_EXPORT_PLUGIN2(declarativeinspector, QDeclarativeInspectorPlugin) + +QT_END_NAMESPACE + diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.h b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.h new file mode 100644 index 0000000..3e28643 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEINSPECTORPLUGIN_H +#define QDECLARATIVEINSPECTORPLUGIN_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class QDeclarativeViewInspector; + +class QDeclarativeInspectorPlugin : public QObject, public QDeclarativeInspectorInterface +{ + Q_OBJECT + Q_DISABLE_COPY(QDeclarativeInspectorPlugin) + Q_INTERFACES(QDeclarativeInspectorInterface) + +public: + QDeclarativeInspectorPlugin(); + ~QDeclarativeInspectorPlugin(); + + void activate(); + void deactivate(); + +private: + QPointer m_inspector; +}; + +QT_END_NAMESPACE + +#endif // QDECLARATIVEINSPECTORPLUGIN_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorprotocol.h b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorprotocol.h new file mode 100644 index 0000000..2878bc1 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorprotocol.h @@ -0,0 +1,143 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEINSPECTORPROTOCOL_H +#define QDECLARATIVEINSPECTORPROTOCOL_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class InspectorProtocol : public QObject +{ + Q_OBJECT + Q_ENUMS(Message Tool) + +public: + enum Message { + AnimationSpeedChanged = 0, + AnimationPausedChanged = 19, // highest value + ChangeTool = 1, + ClearComponentCache = 2, + ColorChanged = 3, + CreateObject = 5, + CurrentObjectsChanged = 6, + DestroyObject = 7, + MoveObject = 8, + ObjectIdList = 9, + Reload = 10, + Reloaded = 11, + SetAnimationSpeed = 12, + SetAnimationPaused = 18, + SetCurrentObjects = 14, + SetDesignMode = 15, + ShowAppOnTop = 16, + ToolChanged = 17 + }; + + enum Tool { + ColorPickerTool, + SelectMarqueeTool, + SelectTool, + ZoomTool + }; + + static inline QString toString(Message message) + { + return QLatin1String(staticMetaObject.enumerator(0).valueToKey(message)); + } + + static inline QString toString(Tool tool) + { + return QLatin1String(staticMetaObject.enumerator(1).valueToKey(tool)); + } +}; + +inline QDataStream & operator<< (QDataStream &stream, InspectorProtocol::Message message) +{ + return stream << static_cast(message); +} + +inline QDataStream & operator>> (QDataStream &stream, InspectorProtocol::Message &message) +{ + quint32 i; + stream >> i; + message = static_cast(i); + return stream; +} + +inline QDebug operator<< (QDebug dbg, InspectorProtocol::Message message) +{ + dbg << InspectorProtocol::toString(message); + return dbg; +} + +inline QDataStream & operator<< (QDataStream &stream, InspectorProtocol::Tool tool) +{ + return stream << static_cast(tool); +} + +inline QDataStream & operator>> (QDataStream &stream, InspectorProtocol::Tool &tool) +{ + quint32 i; + stream >> i; + tool = static_cast(i); + return stream; +} + +inline QDebug operator<< (QDebug dbg, InspectorProtocol::Tool tool) +{ + dbg << InspectorProtocol::toString(tool); + return dbg; +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QDECLARATIVEINSPECTORPROTOCOL_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp new file mode 100644 index 0000000..19bfdaa --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp @@ -0,0 +1,1021 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "QtDeclarative/private/qdeclarativeinspectorservice_p.h" +#include "QtDeclarative/private/qdeclarativedebughelper_p.h" + +#include "qdeclarativeviewinspector_p.h" +#include "qdeclarativeviewinspector_p_p.h" +#include "qdeclarativeinspectorprotocol.h" + +#include "editor/liveselectiontool_p.h" +#include "editor/zoomtool_p.h" +#include "editor/colorpickertool_p.h" +#include "editor/livelayeritem_p.h" +#include "editor/boundingrecthighlighter_p.h" +#include "editor/qmltoolbar_p.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static inline void initEditorResource() { Q_INIT_RESOURCE(editor); } + +QT_BEGIN_NAMESPACE + +const char * const KEY_TOOLBOX_GEOMETRY = "toolBox/geometry"; + +const int SceneChangeUpdateInterval = 5000; + + +class ToolBox : public QWidget +{ + Q_OBJECT + +public: + ToolBox(QWidget *parent = 0); + ~ToolBox(); + + QmlToolBar *toolBar() const { return m_toolBar; } + +private: + QSettings m_settings; + QmlToolBar *m_toolBar; +}; + +ToolBox::ToolBox(QWidget *parent) + : QWidget(parent, Qt::Tool) + , m_settings(QLatin1String("Nokia"), QLatin1String("QmlInspector"), this) + , m_toolBar(new QmlToolBar) +{ + setWindowFlags((windowFlags() & ~Qt::WindowCloseButtonHint) | Qt::CustomizeWindowHint); + setWindowTitle(tr("Qt Quick Toolbox")); + + QVBoxLayout *verticalLayout = new QVBoxLayout; + verticalLayout->setMargin(0); + verticalLayout->addWidget(m_toolBar); + setLayout(verticalLayout); + + restoreGeometry(m_settings.value(QLatin1String(KEY_TOOLBOX_GEOMETRY)).toByteArray()); +} + +ToolBox::~ToolBox() +{ + m_settings.setValue(QLatin1String(KEY_TOOLBOX_GEOMETRY), saveGeometry()); +} + + +QDeclarativeViewInspectorPrivate::QDeclarativeViewInspectorPrivate(QDeclarativeViewInspector *q) : + q(q), + designModeBehavior(false), + showAppOnTop(false), + animationPaused(false), + slowDownFactor(1.0f), + toolBox(0) +{ +} + +QDeclarativeViewInspectorPrivate::~QDeclarativeViewInspectorPrivate() +{ +} + +QDeclarativeViewInspector::QDeclarativeViewInspector(QDeclarativeView *view, + QObject *parent) : + QObject(parent), + data(new QDeclarativeViewInspectorPrivate(this)) +{ + initEditorResource(); + + data->view = view; + data->manipulatorLayer = new LiveLayerItem(view->scene()); + data->selectionTool = new LiveSelectionTool(this); + data->zoomTool = new ZoomTool(this); + data->colorPickerTool = new ColorPickerTool(this); + data->boundingRectHighlighter = new BoundingRectHighlighter(this); + data->currentTool = data->selectionTool; + + // to capture ChildRemoved event when viewport changes + data->view->installEventFilter(this); + + data->setViewport(data->view->viewport()); + + data->debugService = QDeclarativeInspectorService::instance(); + connect(data->debugService, SIGNAL(gotMessage(QByteArray)), + this, SLOT(handleMessage(QByteArray))); + + connect(data->view, SIGNAL(statusChanged(QDeclarativeView::Status)), + data.data(), SLOT(_q_onStatusChanged(QDeclarativeView::Status))); + + connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)), + SIGNAL(selectedColorChanged(QColor))); + connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)), + this, SLOT(sendColorChanged(QColor))); + + data->_q_changeToSingleSelectTool(); +} + +QDeclarativeViewInspector::~QDeclarativeViewInspector() +{ +} + +void QDeclarativeViewInspectorPrivate::_q_setToolBoxVisible(bool visible) +{ +#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR) + if (!toolBox && visible) + createToolBox(); + if (toolBox) + toolBox->setVisible(visible); +#else + Q_UNUSED(visible) +#endif +} + +void QDeclarativeViewInspectorPrivate::_q_reloadView() +{ + clearHighlight(); + emit q->reloadRequested(); +} + +void QDeclarativeViewInspectorPrivate::setViewport(QWidget *widget) +{ + if (viewport.data() == widget) + return; + + if (viewport) + viewport.data()->removeEventFilter(q); + + viewport = widget; + if (viewport) { + // make sure we get mouse move events + viewport.data()->setMouseTracking(true); + viewport.data()->installEventFilter(q); + } +} + +void QDeclarativeViewInspectorPrivate::clearEditorItems() +{ + clearHighlight(); + setSelectedItems(QList()); +} + +bool QDeclarativeViewInspector::eventFilter(QObject *obj, QEvent *event) +{ + if (obj == data->view) { + // Event from view + if (event->type() == QEvent::ChildRemoved) { + // Might mean that viewport has changed + if (data->view->viewport() != data->viewport.data()) + data->setViewport(data->view->viewport()); + } + return QObject::eventFilter(obj, event); + } + + // Event from viewport + switch (event->type()) { + case QEvent::Leave: { + if (leaveEvent(event)) + return true; + break; + } + case QEvent::MouseButtonPress: { + if (mousePressEvent(static_cast(event))) + return true; + break; + } + case QEvent::MouseMove: { + if (mouseMoveEvent(static_cast(event))) + return true; + break; + } + case QEvent::MouseButtonRelease: { + if (mouseReleaseEvent(static_cast(event))) + return true; + break; + } + case QEvent::KeyPress: { + if (keyPressEvent(static_cast(event))) + return true; + break; + } + case QEvent::KeyRelease: { + if (keyReleaseEvent(static_cast(event))) + return true; + break; + } + case QEvent::MouseButtonDblClick: { + if (mouseDoubleClickEvent(static_cast(event))) + return true; + break; + } + case QEvent::Wheel: { + if (wheelEvent(static_cast(event))) + return true; + break; + } + default: { + break; + } + } //switch + + // standard event processing + return QObject::eventFilter(obj, event); +} + +bool QDeclarativeViewInspector::leaveEvent(QEvent * /*event*/) +{ + if (!data->designModeBehavior) + return false; + data->clearHighlight(); + return true; +} + +bool QDeclarativeViewInspector::mousePressEvent(QMouseEvent *event) +{ + if (!data->designModeBehavior) + return false; + data->cursorPos = event->pos(); + data->currentTool->mousePressEvent(event); + return true; +} + +bool QDeclarativeViewInspector::mouseMoveEvent(QMouseEvent *event) +{ + if (!data->designModeBehavior) { + data->clearEditorItems(); + return false; + } + data->cursorPos = event->pos(); + + QList selItems = data->selectableItems(event->pos()); + if (!selItems.isEmpty()) { + declarativeView()->setToolTip(data->currentTool->titleForItem(selItems.first())); + } else { + declarativeView()->setToolTip(QString()); + } + if (event->buttons()) { + data->currentTool->mouseMoveEvent(event); + } else { + data->currentTool->hoverMoveEvent(event); + } + return true; +} + +bool QDeclarativeViewInspector::mouseReleaseEvent(QMouseEvent *event) +{ + if (!data->designModeBehavior) + return false; + + data->cursorPos = event->pos(); + data->currentTool->mouseReleaseEvent(event); + return true; +} + +bool QDeclarativeViewInspector::keyPressEvent(QKeyEvent *event) +{ + if (!data->designModeBehavior) + return false; + + data->currentTool->keyPressEvent(event); + return true; +} + +bool QDeclarativeViewInspector::keyReleaseEvent(QKeyEvent *event) +{ + if (!data->designModeBehavior) + return false; + + switch (event->key()) { + case Qt::Key_V: + data->_q_changeToSingleSelectTool(); + break; +// disabled because multiselection does not do anything useful without design mode +// case Qt::Key_M: +// data->_q_changeToMarqueeSelectTool(); +// break; + case Qt::Key_I: + data->_q_changeToColorPickerTool(); + break; + case Qt::Key_Z: + data->_q_changeToZoomTool(); + break; + case Qt::Key_Space: + setAnimationPaused(!data->animationPaused); + break; + default: + break; + } + + data->currentTool->keyReleaseEvent(event); + return true; +} + +void QDeclarativeViewInspectorPrivate::_q_createQmlObject(const QString &qml, QObject *parent, + const QStringList &importList, + const QString &filename) +{ + if (!parent) + return; + + QString imports; + foreach (const QString &s, importList) { + imports += s; + imports += QLatin1Char('\n'); + } + + QDeclarativeContext *parentContext = view->engine()->contextForObject(parent); + QDeclarativeComponent component(view->engine(), q); + QByteArray constructedQml = QString(imports + qml).toLatin1(); + + component.setData(constructedQml, QUrl::fromLocalFile(filename)); + QObject *newObject = component.create(parentContext); + if (newObject) { + newObject->setParent(parent); + QDeclarativeItem *parentItem = qobject_cast(parent); + QDeclarativeItem *newItem = qobject_cast(newObject); + if (parentItem && newItem) + newItem->setParentItem(parentItem); + } +} + +void QDeclarativeViewInspectorPrivate::_q_reparentQmlObject(QObject *object, QObject *newParent) +{ + if (!newParent) + return; + + object->setParent(newParent); + QDeclarativeItem *newParentItem = qobject_cast(newParent); + QDeclarativeItem *item = qobject_cast(object); + if (newParentItem && item) + item->setParentItem(newParentItem); +} + +void QDeclarativeViewInspectorPrivate::_q_clearComponentCache() +{ + view->engine()->clearComponentCache(); +} + +void QDeclarativeViewInspectorPrivate::_q_removeFromSelection(QObject *obj) +{ + QList items = selectedItems(); + if (QGraphicsItem *item = qobject_cast(obj)) + items.removeOne(item); + setSelectedItems(items); +} + +bool QDeclarativeViewInspector::mouseDoubleClickEvent(QMouseEvent * /*event*/) +{ + if (!data->designModeBehavior) + return false; + + return true; +} + +bool QDeclarativeViewInspector::wheelEvent(QWheelEvent *event) +{ + if (!data->designModeBehavior) + return false; + data->currentTool->wheelEvent(event); + return true; +} + +void QDeclarativeViewInspector::setDesignModeBehavior(bool value) +{ + emit designModeBehaviorChanged(value); + + if (data->toolBox) + data->toolBox->toolBar()->setDesignModeBehavior(value); + sendDesignModeBehavior(value); + + data->designModeBehavior = value; + + if (!data->designModeBehavior) + data->clearEditorItems(); +} + +bool QDeclarativeViewInspector::designModeBehavior() +{ + return data->designModeBehavior; +} + +bool QDeclarativeViewInspector::showAppOnTop() const +{ + return data->showAppOnTop; +} + +void QDeclarativeViewInspector::setShowAppOnTop(bool appOnTop) +{ + if (data->view) { + QWidget *window = data->view->window(); + Qt::WindowFlags flags = window->windowFlags(); + if (appOnTop) + flags |= Qt::WindowStaysOnTopHint; + else + flags &= ~Qt::WindowStaysOnTopHint; + + window->setWindowFlags(flags); + window->show(); + } + + data->showAppOnTop = appOnTop; + sendShowAppOnTop(appOnTop); + + emit showAppOnTopChanged(appOnTop); +} + +void QDeclarativeViewInspectorPrivate::changeTool(Constants::DesignTool tool, + Constants::ToolFlags /*flags*/) +{ + switch (tool) { + case Constants::SelectionToolMode: + _q_changeToSingleSelectTool(); + break; + case Constants::NoTool: + default: + currentTool = 0; + break; + } +} + +void QDeclarativeViewInspectorPrivate::setSelectedItemsForTools(const QList &items) +{ + foreach (const QWeakPointer &obj, currentSelection) { + if (QGraphicsItem *item = obj.data()) { + if (!items.contains(item)) { + QObject::disconnect(obj.data(), SIGNAL(destroyed(QObject*)), + this, SLOT(_q_removeFromSelection(QObject*))); + currentSelection.removeOne(obj); + } + } + } + + foreach (QGraphicsItem *item, items) { + if (QGraphicsObject *obj = item->toGraphicsObject()) { + if (!currentSelection.contains(obj)) { + QObject::connect(obj, SIGNAL(destroyed(QObject*)), + this, SLOT(_q_removeFromSelection(QObject*))); + currentSelection.append(obj); + } + } + } + + currentTool->updateSelectedItems(); +} + +void QDeclarativeViewInspectorPrivate::setSelectedItems(const QList &items) +{ + QList > oldList = currentSelection; + setSelectedItemsForTools(items); + if (oldList != currentSelection) { + QList objectList; + foreach (const QWeakPointer &graphicsObject, currentSelection) { + if (graphicsObject) + objectList << graphicsObject.data(); + } + + q->sendCurrentObjects(objectList); + } +} + +QList QDeclarativeViewInspectorPrivate::selectedItems() const +{ + QList selection; + foreach (const QWeakPointer &selectedObject, currentSelection) { + if (selectedObject.data()) + selection << selectedObject.data(); + } + + return selection; +} + +void QDeclarativeViewInspector::setSelectedItems(QList items) +{ + data->setSelectedItems(items); +} + +QList QDeclarativeViewInspector::selectedItems() const +{ + return data->selectedItems(); +} + +QDeclarativeView *QDeclarativeViewInspector::declarativeView() +{ + return data->view; +} + +void QDeclarativeViewInspectorPrivate::clearHighlight() +{ + boundingRectHighlighter->clear(); +} + +void QDeclarativeViewInspectorPrivate::highlight(const QList &items) +{ + if (items.isEmpty()) + return; + + QList objectList; + foreach (QGraphicsItem *item, items) { + QGraphicsItem *child = item; + + if (child) { + QGraphicsObject *childObject = child->toGraphicsObject(); + if (childObject) + objectList << childObject; + } + } + + boundingRectHighlighter->highlight(objectList); +} + +QList QDeclarativeViewInspectorPrivate::selectableItems( + const QPointF &scenePos) const +{ + QList itemlist = view->scene()->items(scenePos); + return filterForSelection(itemlist); +} + +QList QDeclarativeViewInspectorPrivate::selectableItems(const QPoint &pos) const +{ + QList itemlist = view->items(pos); + return filterForSelection(itemlist); +} + +QList QDeclarativeViewInspectorPrivate::selectableItems( + const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const +{ + QList itemlist = view->scene()->items(sceneRect, selectionMode); + return filterForSelection(itemlist); +} + +void QDeclarativeViewInspectorPrivate::_q_changeToSingleSelectTool() +{ + currentToolMode = Constants::SelectionToolMode; + selectionTool->setRubberbandSelectionMode(false); + + changeToSelectTool(); + + emit q->selectToolActivated(); + q->sendCurrentTool(Constants::SelectionToolMode); +} + +void QDeclarativeViewInspectorPrivate::changeToSelectTool() +{ + if (currentTool == selectionTool) + return; + + currentTool->clear(); + currentTool = selectionTool; + currentTool->clear(); + currentTool->updateSelectedItems(); +} + +void QDeclarativeViewInspectorPrivate::_q_changeToMarqueeSelectTool() +{ + changeToSelectTool(); + currentToolMode = Constants::MarqueeSelectionToolMode; + selectionTool->setRubberbandSelectionMode(true); + + emit q->marqueeSelectToolActivated(); + q->sendCurrentTool(Constants::MarqueeSelectionToolMode); +} + +void QDeclarativeViewInspectorPrivate::_q_changeToZoomTool() +{ + currentToolMode = Constants::ZoomMode; + currentTool->clear(); + currentTool = zoomTool; + currentTool->clear(); + + emit q->zoomToolActivated(); + q->sendCurrentTool(Constants::ZoomMode); +} + +void QDeclarativeViewInspectorPrivate::_q_changeToColorPickerTool() +{ + if (currentTool == colorPickerTool) + return; + + currentToolMode = Constants::ColorPickerMode; + currentTool->clear(); + currentTool = colorPickerTool; + currentTool->clear(); + + emit q->colorPickerActivated(); + q->sendCurrentTool(Constants::ColorPickerMode); +} + +void QDeclarativeViewInspector::setAnimationSpeed(qreal slowDownFactor) +{ + Q_ASSERT(slowDownFactor > 0); + if (data->slowDownFactor == slowDownFactor) + return; + + animationSpeedChangeRequested(slowDownFactor); + sendAnimationSpeed(slowDownFactor); +} + +void QDeclarativeViewInspector::setAnimationPaused(bool paused) +{ + if (data->animationPaused == paused) + return; + + animationPausedChangeRequested(paused); + sendAnimationPaused(paused); +} + +void QDeclarativeViewInspector::animationSpeedChangeRequested(qreal factor) +{ + if (data->slowDownFactor != factor) { + data->slowDownFactor = factor; + emit animationSpeedChanged(factor); + } + + const float effectiveFactor = data->animationPaused ? 0 : factor; + QDeclarativeDebugHelper::setAnimationSlowDownFactor(effectiveFactor); +} + +void QDeclarativeViewInspector::animationPausedChangeRequested(bool paused) +{ + if (data->animationPaused != paused) { + data->animationPaused = paused; + emit animationPausedChanged(paused); + } + + const float effectiveFactor = paused ? 0 : data->slowDownFactor; + QDeclarativeDebugHelper::setAnimationSlowDownFactor(effectiveFactor); +} + + +void QDeclarativeViewInspectorPrivate::_q_applyChangesFromClient() +{ +} + + +QList QDeclarativeViewInspectorPrivate::filterForSelection( + QList &itemlist) const +{ + foreach (QGraphicsItem *item, itemlist) { + if (isEditorItem(item)) + itemlist.removeOne(item); + } + + return itemlist; +} + +bool QDeclarativeViewInspectorPrivate::isEditorItem(QGraphicsItem *item) const +{ + return (item->type() == Constants::EditorItemType + || item->type() == Constants::ResizeHandleItemType + || item->data(Constants::EditorItemDataKey).toBool()); +} + +void QDeclarativeViewInspectorPrivate::_q_onStatusChanged(QDeclarativeView::Status status) +{ + if (status == QDeclarativeView::Ready) + q->sendReloaded(); +} + +void QDeclarativeViewInspectorPrivate::_q_onCurrentObjectsChanged(QList objects) +{ + QList items; + QList gfxObjects; + foreach (QObject *obj, objects) { + if (QDeclarativeItem *declarativeItem = qobject_cast(obj)) { + items << declarativeItem; + gfxObjects << declarativeItem; + } + } + if (designModeBehavior) { + setSelectedItemsForTools(items); + clearHighlight(); + highlight(gfxObjects); + } +} + +// adjusts bounding boxes on edges of screen to be visible +QRectF QDeclarativeViewInspector::adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace) +{ + int marginFromEdge = 1; + QRectF boundingRect(boundingRectInSceneSpace); + if (qAbs(boundingRect.left()) - 1 < 2) + boundingRect.setLeft(marginFromEdge); + + QRect rect = data->view->rect(); + + if (boundingRect.right() >= rect.right()) + boundingRect.setRight(rect.right() - marginFromEdge); + + if (qAbs(boundingRect.top()) - 1 < 2) + boundingRect.setTop(marginFromEdge); + + if (boundingRect.bottom() >= rect.bottom()) + boundingRect.setBottom(rect.bottom() - marginFromEdge); + + return boundingRect; +} + +void QDeclarativeViewInspectorPrivate::createToolBox() +{ + toolBox = new ToolBox(q->declarativeView()); + + QmlToolBar *toolBar = toolBox->toolBar(); + + QObject::connect(q, SIGNAL(selectedColorChanged(QColor)), + toolBar, SLOT(setColorBoxColor(QColor))); + + QObject::connect(q, SIGNAL(designModeBehaviorChanged(bool)), + toolBar, SLOT(setDesignModeBehavior(bool))); + + QObject::connect(toolBar, SIGNAL(designModeBehaviorChanged(bool)), + q, SLOT(setDesignModeBehavior(bool))); + QObject::connect(toolBar, SIGNAL(animationSpeedChanged(qreal)), q, SLOT(setAnimationSpeed(qreal))); + QObject::connect(toolBar, SIGNAL(animationPausedChanged(bool)), q, SLOT(setAnimationPaused(bool))); + QObject::connect(toolBar, SIGNAL(colorPickerSelected()), this, SLOT(_q_changeToColorPickerTool())); + QObject::connect(toolBar, SIGNAL(zoomToolSelected()), this, SLOT(_q_changeToZoomTool())); + QObject::connect(toolBar, SIGNAL(selectToolSelected()), this, SLOT(_q_changeToSingleSelectTool())); + QObject::connect(toolBar, SIGNAL(marqueeSelectToolSelected()), + this, SLOT(_q_changeToMarqueeSelectTool())); + + QObject::connect(toolBar, SIGNAL(applyChangesFromQmlFileSelected()), + this, SLOT(_q_applyChangesFromClient())); + + QObject::connect(q, SIGNAL(animationSpeedChanged(qreal)), toolBar, SLOT(setAnimationSpeed(qreal))); + QObject::connect(q, SIGNAL(animationPausedChanged(bool)), toolBar, SLOT(setAnimationPaused(bool))); + + QObject::connect(q, SIGNAL(selectToolActivated()), toolBar, SLOT(activateSelectTool())); + + // disabled features + //connect(d->m_toolBar, SIGNAL(applyChangesToQmlFileSelected()), SLOT(applyChangesToClient())); + //connect(q, SIGNAL(resizeToolActivated()), d->m_toolBar, SLOT(activateSelectTool())); + //connect(q, SIGNAL(moveToolActivated()), d->m_toolBar, SLOT(activateSelectTool())); + + QObject::connect(q, SIGNAL(colorPickerActivated()), toolBar, SLOT(activateColorPicker())); + QObject::connect(q, SIGNAL(zoomToolActivated()), toolBar, SLOT(activateZoom())); + QObject::connect(q, SIGNAL(marqueeSelectToolActivated()), + toolBar, SLOT(activateMarqueeSelectTool())); +} + +void QDeclarativeViewInspector::handleMessage(const QByteArray &message) +{ + QDataStream ds(message); + + InspectorProtocol::Message type; + ds >> type; + + switch (type) { + case InspectorProtocol::SetCurrentObjects: { + int itemCount = 0; + ds >> itemCount; + + QList selectedObjects; + for (int i = 0; i < itemCount; ++i) { + int debugId = -1; + ds >> debugId; + if (QObject *obj = QDeclarativeDebugService::objectForId(debugId)) + selectedObjects << obj; + } + + data->_q_onCurrentObjectsChanged(selectedObjects); + break; + } + case InspectorProtocol::Reload: { + data->_q_reloadView(); + break; + } + case InspectorProtocol::SetAnimationSpeed: { + qreal speed; + ds >> speed; + animationSpeedChangeRequested(speed); + break; + } + case InspectorProtocol::SetAnimationPaused: { + bool paused; + ds >> paused; + animationPausedChangeRequested(paused); + break; + } + case InspectorProtocol::ChangeTool: { + InspectorProtocol::Tool tool; + ds >> tool; + switch (tool) { + case InspectorProtocol::ColorPickerTool: + data->_q_changeToColorPickerTool(); + break; + case InspectorProtocol::SelectTool: + data->_q_changeToSingleSelectTool(); + break; + case InspectorProtocol::SelectMarqueeTool: + data->_q_changeToMarqueeSelectTool(); + break; + case InspectorProtocol::ZoomTool: + data->_q_changeToZoomTool(); + break; + default: + qWarning() << "Warning: Unhandled tool:" << tool; + } + break; + } + case InspectorProtocol::SetDesignMode: { + bool inDesignMode; + ds >> inDesignMode; + setDesignModeBehavior(inDesignMode); + break; + } + case InspectorProtocol::ShowAppOnTop: { + bool showOnTop; + ds >> showOnTop; + setShowAppOnTop(showOnTop); + break; + } + case InspectorProtocol::CreateObject: { + QString qml; + int parentId; + QString filename; + QStringList imports; + ds >> qml >> parentId >> imports >> filename; + data->_q_createQmlObject(qml, QDeclarativeDebugService::objectForId(parentId), + imports, filename); + break; + } + case InspectorProtocol::DestroyObject: { + int debugId; + ds >> debugId; + if (QObject* obj = QDeclarativeDebugService::objectForId(debugId)) + obj->deleteLater(); + break; + } + case InspectorProtocol::MoveObject: { + int debugId, newParent; + ds >> debugId >> newParent; + data->_q_reparentQmlObject(QDeclarativeDebugService::objectForId(debugId), + QDeclarativeDebugService::objectForId(newParent)); + break; + } + case InspectorProtocol::ObjectIdList: { + int itemCount; + ds >> itemCount; + data->stringIdForObjectId.clear(); + for (int i = 0; i < itemCount; ++i) { + int itemDebugId; + QString itemIdString; + ds >> itemDebugId + >> itemIdString; + + data->stringIdForObjectId.insert(itemDebugId, itemIdString); + } + break; + } + case InspectorProtocol::ClearComponentCache: { + data->_q_clearComponentCache(); + break; + } + default: + qWarning() << "Warning: Not handling message:" << type; + } +} + +void QDeclarativeViewInspector::sendDesignModeBehavior(bool inDesignMode) +{ + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + + ds << InspectorProtocol::SetDesignMode + << inDesignMode; + + data->debugService->sendMessage(message); +} + +void QDeclarativeViewInspector::sendCurrentObjects(const QList &objects) +{ + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + + ds << InspectorProtocol::CurrentObjectsChanged + << objects.length(); + + foreach (QObject *object, objects) { + int id = QDeclarativeDebugService::idForObject(object); + ds << id; + } + + data->debugService->sendMessage(message); +} + +void QDeclarativeViewInspector::sendCurrentTool(Constants::DesignTool toolId) +{ + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + + ds << InspectorProtocol::ToolChanged + << toolId; + + data->debugService->sendMessage(message); +} + +void QDeclarativeViewInspector::sendAnimationSpeed(qreal slowDownFactor) +{ + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + + ds << InspectorProtocol::AnimationSpeedChanged + << slowDownFactor; + + data->debugService->sendMessage(message); +} + +void QDeclarativeViewInspector::sendAnimationPaused(bool paused) +{ + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + + ds << InspectorProtocol::AnimationPausedChanged + << paused; + + data->debugService->sendMessage(message); +} + +void QDeclarativeViewInspector::sendReloaded() +{ + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + + ds << InspectorProtocol::Reloaded; + + data->debugService->sendMessage(message); +} + +void QDeclarativeViewInspector::sendShowAppOnTop(bool showAppOnTop) +{ + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + + ds << InspectorProtocol::ShowAppOnTop << showAppOnTop; + + data->debugService->sendMessage(message); +} + +void QDeclarativeViewInspector::sendColorChanged(const QColor &color) +{ + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + + ds << InspectorProtocol::ColorChanged + << color; + + data->debugService->sendMessage(message); +} + +QString QDeclarativeViewInspector::idStringForObject(QObject *obj) const +{ + int id = QDeclarativeDebugService::idForObject(obj); + QString idString = data->stringIdForObjectId.value(id, QString()); + return idString; +} + +QT_END_NAMESPACE + +#include "qdeclarativeviewinspector.moc" diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h new file mode 100644 index 0000000..4efa093 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h @@ -0,0 +1,147 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEVIEWINSPECTOR_P_H +#define QDECLARATIVEVIEWINSPECTOR_P_H + +#include +#include "qmlinspectorconstants_p.h" + +#include +#include + +QT_FORWARD_DECLARE_CLASS(QDeclarativeItem) +QT_FORWARD_DECLARE_CLASS(QMouseEvent) +QT_FORWARD_DECLARE_CLASS(QToolBar) + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QDeclarativeViewInspectorPrivate; + +class QDeclarativeViewInspector : public QObject +{ + Q_OBJECT + +public: + explicit QDeclarativeViewInspector(QDeclarativeView *view, QObject *parent = 0); + ~QDeclarativeViewInspector(); + + void setSelectedItems(QList items); + QList selectedItems() const; + + QDeclarativeView *declarativeView(); + + QRectF adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace); + + bool showAppOnTop() const; + + void sendDesignModeBehavior(bool inDesignMode); + void sendCurrentObjects(const QList &); + void sendAnimationSpeed(qreal slowDownFactor); + void sendAnimationPaused(bool paused); + void sendCurrentTool(Constants::DesignTool toolId); + void sendReloaded(); + void sendShowAppOnTop(bool showAppOnTop); + + QString idStringForObject(QObject *obj) const; + +public Q_SLOTS: + void sendColorChanged(const QColor &color); + + void setDesignModeBehavior(bool value); + bool designModeBehavior(); + + void setShowAppOnTop(bool appOnTop); + + void setAnimationSpeed(qreal factor); + void setAnimationPaused(bool paused); + +Q_SIGNALS: + void designModeBehaviorChanged(bool inDesignMode); + void showAppOnTopChanged(bool showAppOnTop); + void reloadRequested(); + void marqueeSelectToolActivated(); + void selectToolActivated(); + void zoomToolActivated(); + void colorPickerActivated(); + void selectedColorChanged(const QColor &color); + + void animationSpeedChanged(qreal factor); + void animationPausedChanged(bool paused); + +protected: + bool eventFilter(QObject *obj, QEvent *event); + + bool leaveEvent(QEvent *); + bool mousePressEvent(QMouseEvent *event); + bool mouseMoveEvent(QMouseEvent *event); + bool mouseReleaseEvent(QMouseEvent *event); + bool keyPressEvent(QKeyEvent *event); + bool keyReleaseEvent(QKeyEvent *keyEvent); + bool mouseDoubleClickEvent(QMouseEvent *event); + bool wheelEvent(QWheelEvent *event); + + void setSelectedItemsForTools(QList items); + +private slots: + void handleMessage(const QByteArray &message); + + void animationSpeedChangeRequested(qreal factor); + void animationPausedChangeRequested(bool paused); + +private: + Q_DISABLE_COPY(QDeclarativeViewInspector) + + inline QDeclarativeViewInspectorPrivate *d_func() { return data.data(); } + QScopedPointer data; + friend class QDeclarativeViewInspectorPrivate; + friend class AbstractLiveEditTool; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QDECLARATIVEVIEWINSPECTOR_P_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p_p.h b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p_p.h new file mode 100644 index 0000000..11cbe0f --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p_p.h @@ -0,0 +1,152 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEVIEWINSPECTOR_P_P_H +#define QDECLARATIVEVIEWINSPECTOR_P_P_H + +#include "qdeclarativeviewinspector_p.h" + +#include +#include + +#include "QtDeclarative/private/qdeclarativeinspectorservice_p.h" + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QDeclarativeViewInspector; +class LiveSelectionTool; +class ZoomTool; +class ColorPickerTool; +class LiveLayerItem; +class BoundingRectHighlighter; +class ToolBox; +class AbstractLiveEditTool; + +class QDeclarativeViewInspectorPrivate : public QObject +{ + Q_OBJECT +public: + QDeclarativeViewInspectorPrivate(QDeclarativeViewInspector *); + ~QDeclarativeViewInspectorPrivate(); + + QDeclarativeView *view; + QDeclarativeViewInspector *q; + QDeclarativeInspectorService *debugService; + QWeakPointer viewport; + QHash stringIdForObjectId; + + QPointF cursorPos; + QList > currentSelection; + + Constants::DesignTool currentToolMode; + AbstractLiveEditTool *currentTool; + + LiveSelectionTool *selectionTool; + ZoomTool *zoomTool; + ColorPickerTool *colorPickerTool; + LiveLayerItem *manipulatorLayer; + + BoundingRectHighlighter *boundingRectHighlighter; + + bool designModeBehavior; + bool showAppOnTop; + + bool animationPaused; + qreal slowDownFactor; + + ToolBox *toolBox; + + void setViewport(QWidget *widget); + + void clearEditorItems(); + void createToolBox(); + void changeToSelectTool(); + QList filterForSelection(QList &itemlist) const; + + QList selectableItems(const QPoint &pos) const; + QList selectableItems(const QPointF &scenePos) const; + QList selectableItems(const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const; + + void setSelectedItemsForTools(const QList &items); + void setSelectedItems(const QList &items); + QList selectedItems() const; + + void changeTool(Constants::DesignTool tool, + Constants::ToolFlags flags = Constants::NoToolFlags); + + void clearHighlight(); + void highlight(const QList &item); + inline void highlight(QGraphicsObject *item) + { highlight(QList() << item); } + + bool isEditorItem(QGraphicsItem *item) const; + +public slots: + void _q_setToolBoxVisible(bool visible); + + void _q_reloadView(); + void _q_onStatusChanged(QDeclarativeView::Status status); + void _q_onCurrentObjectsChanged(QList objects); + void _q_applyChangesFromClient(); + void _q_createQmlObject(const QString &qml, QObject *parent, + const QStringList &imports, const QString &filename = QString()); + void _q_reparentQmlObject(QObject *, QObject *); + + void _q_changeToSingleSelectTool(); + void _q_changeToMarqueeSelectTool(); + void _q_changeToZoomTool(); + void _q_changeToColorPickerTool(); + void _q_clearComponentCache(); + void _q_removeFromSelection(QObject *); + +public: + static QDeclarativeViewInspectorPrivate *get(QDeclarativeViewInspector *v) { return v->d_func(); } +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QDECLARATIVEVIEWINSPECTOR_P_P_H diff --git a/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro b/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro new file mode 100644 index 0000000..f8d7ee8 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro @@ -0,0 +1,51 @@ +TARGET = qmldbg_inspector +QT += declarative + +include(../../qpluginbase.pri) + +QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/qmltooling +QTDIR_build:REQUIRES += "contains(QT_CONFIG, declarative)" + +SOURCES += \ + qdeclarativeinspectorplugin.cpp \ + qdeclarativeviewinspector.cpp \ + editor/abstractliveedittool.cpp \ + editor/liveselectiontool.cpp \ + editor/livelayeritem.cpp \ + editor/livesingleselectionmanipulator.cpp \ + editor/liverubberbandselectionmanipulator.cpp \ + editor/liveselectionrectangle.cpp \ + editor/liveselectionindicator.cpp \ + editor/boundingrecthighlighter.cpp \ + editor/subcomponentmasklayeritem.cpp \ + editor/zoomtool.cpp \ + editor/colorpickertool.cpp \ + editor/qmltoolbar.cpp \ + editor/toolbarcolorbox.cpp + +HEADERS += \ + qdeclarativeinspectorplugin.h \ + qdeclarativeinspectorprotocol.h \ + qdeclarativeviewinspector_p.h \ + qdeclarativeviewinspector_p_p.h \ + qmlinspectorconstants_p.h \ + editor/abstractliveedittool_p.h \ + editor/liveselectiontool_p.h \ + editor/livelayeritem_p.h \ + editor/livesingleselectionmanipulator_p.h \ + editor/liverubberbandselectionmanipulator_p.h \ + editor/liveselectionrectangle_p.h \ + editor/liveselectionindicator_p.h \ + editor/boundingrecthighlighter_p.h \ + editor/subcomponentmasklayeritem_p.h \ + editor/zoomtool_p.h \ + editor/colorpickertool_p.h \ + editor/qmltoolbar_p.h \ + editor/toolbarcolorbox_p.h + +RESOURCES += editor/editor.qrc + +target.path += $$[QT_INSTALL_PLUGINS]/qmltooling +INSTALLS += target + +symbian:TARGET.UID3=0x20031E90 diff --git a/src/plugins/qmltooling/qmldbg_inspector/qmlinspectorconstants_p.h b/src/plugins/qmltooling/qmldbg_inspector/qmlinspectorconstants_p.h new file mode 100644 index 0000000..40ec325 --- /dev/null +++ b/src/plugins/qmltooling/qmldbg_inspector/qmlinspectorconstants_p.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLINSPECTORCONSTANTS_H +#define QMLINSPECTORCONSTANTS_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +namespace Constants { + +enum DesignTool { + NoTool = 0, + SelectionToolMode = 1, + MarqueeSelectionToolMode = 2, + MoveToolMode = 3, + ResizeToolMode = 4, + ColorPickerMode = 5, + ZoomMode = 6 +}; + +enum ToolFlags { + NoToolFlags = 0, + UseCursorPos = 1 +}; + +static const int DragStartTime = 50; + +static const int DragStartDistance = 20; + +static const double ZoomSnapDelta = 0.04; + +static const int EditorItemDataKey = 1000; + +enum GraphicsItemTypes { + EditorItemType = 0xEAAA, + ResizeHandleItemType = 0xEAEA +}; + + +} // namespace Constants + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMLINSPECTORCONSTANTS_H diff --git a/src/plugins/qmltooling/qmltooling.pro b/src/plugins/qmltooling/qmltooling.pro index 0d60eb1..8220109 100644 --- a/src/plugins/qmltooling/qmltooling.pro +++ b/src/plugins/qmltooling/qmltooling.pro @@ -1,4 +1,4 @@ TEMPLATE = subdirs -SUBDIRS = qmldbg_tcp declarativeobserver +SUBDIRS = qmldbg_tcp qmldbg_inspector symbian:SUBDIRS += qmldbg_ost -- cgit v0.12 From 0b4e028ec294992df01430bdf978982835c7df5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Thu, 26 May 2011 20:23:16 +0200 Subject: DeclarativeObserver: Don't fade in the highlight edge It feels more responsive when the highlight is immediately visible. Change-Id: Ie3dd0693ecc38f33b001c86970b220b45b37fdfc Reviewed-by: Kai Koehne --- .../editor/boundingrecthighlighter.cpp | 61 ++++------------------ .../editor/boundingrecthighlighter_p.h | 7 +-- 2 files changed, 10 insertions(+), 58 deletions(-) diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.cpp index 8e551d2..3f95005 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.cpp +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.cpp @@ -52,10 +52,6 @@ QT_BEGIN_NAMESPACE -const qreal AnimDelta = 0.025f; -const int AnimInterval = 30; -const int AnimFrames = 10; - BoundingBox::BoundingBox(QGraphicsObject *itemToHighlight, QGraphicsItem *parentItem, QObject *parent) : QObject(parent), @@ -93,12 +89,8 @@ int BoundingBoxPolygonItem::type() const BoundingRectHighlighter::BoundingRectHighlighter(QDeclarativeViewInspector *view) : LiveLayerItem(view->declarativeView()->scene()), - m_view(view), - m_animFrame(0) + m_view(view) { - m_animTimer = new QTimer(this); - m_animTimer->setInterval(AnimInterval); - connect(m_animTimer, SIGNAL(timeout()), SLOT(animTimeout())); } BoundingRectHighlighter::~BoundingRectHighlighter() @@ -106,37 +98,17 @@ BoundingRectHighlighter::~BoundingRectHighlighter() } -void BoundingRectHighlighter::animTimeout() -{ - ++m_animFrame; - if (m_animFrame == AnimFrames) { - m_animTimer->stop(); - } - - qreal alpha = m_animFrame / float(AnimFrames); - - foreach (BoundingBox *box, m_boxes) { - box->highlightPolygonEdge->setOpacity(alpha); - } -} - void BoundingRectHighlighter::clear() { - if (m_boxes.length()) { - m_animTimer->stop(); - - foreach (BoundingBox *box, m_boxes) { - freeBoundingBox(box); - } - } + foreach (BoundingBox *box, m_boxes) + freeBoundingBox(box); } BoundingBox *BoundingRectHighlighter::boxFor(QGraphicsObject *item) const { foreach (BoundingBox *box, m_boxes) { - if (box->highlightedObject.data() == item) { + if (box->highlightedObject.data() == item) return box; - } } return 0; } @@ -146,15 +118,11 @@ void BoundingRectHighlighter::highlight(QList items) if (items.isEmpty()) return; - bool animate = false; - QList newBoxes; foreach (QGraphicsObject *itemToHighlight, items) { BoundingBox *box = boxFor(itemToHighlight); - if (!box) { + if (!box) box = createBoundingBox(itemToHighlight); - animate = true; - } newBoxes << box; } @@ -165,7 +133,7 @@ void BoundingRectHighlighter::highlight(QList items) m_boxes << newBoxes; } - highlightAll(animate); + highlightAll(); } void BoundingRectHighlighter::highlight(QGraphicsObject* itemToHighlight) @@ -173,17 +141,14 @@ void BoundingRectHighlighter::highlight(QGraphicsObject* itemToHighlight) if (!itemToHighlight) return; - bool animate = false; - BoundingBox *box = boxFor(itemToHighlight); if (!box) { box = createBoundingBox(itemToHighlight); m_boxes << box; - animate = true; qSort(m_boxes); } - highlightAll(animate); + highlightAll(); } BoundingBox *BoundingRectHighlighter::createBoundingBox(QGraphicsObject *itemToHighlight) @@ -244,7 +209,7 @@ void BoundingRectHighlighter::itemDestroyed(QObject *obj) } } -void BoundingRectHighlighter::highlightAll(bool animate) +void BoundingRectHighlighter::highlightAll() { foreach (BoundingBox *box, m_boxes) { if (box && box->highlightedObject.isNull()) { @@ -262,21 +227,13 @@ void BoundingRectHighlighter::highlightAll(bool animate) box->highlightPolygon->setPolygon(QPolygonF(bboxRect)); box->highlightPolygonEdge->setPolygon(QPolygonF(edgeRect)); - - if (animate) - box->highlightPolygonEdge->setOpacity(0); - } - - if (animate) { - m_animFrame = 0; - m_animTimer->start(); } } void BoundingRectHighlighter::refresh() { if (!m_boxes.isEmpty()) - highlightAll(true); + highlightAll(); } QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter_p.h b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter_p.h index 89a9cf2..e2928f7 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter_p.h +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter_p.h @@ -74,12 +74,11 @@ public: private slots: void refresh(); - void animTimeout(); void itemDestroyed(QObject *); private: BoundingBox *boxFor(QGraphicsObject *item) const; - void highlightAll(bool animate); + void highlightAll(); BoundingBox *createBoundingBox(QGraphicsObject *itemToHighlight); void removeBoundingBox(BoundingBox *box); void freeBoundingBox(BoundingBox *box); @@ -90,10 +89,6 @@ private: QDeclarativeViewInspector *m_view; QList m_boxes; QList m_freeBoxes; - QTimer *m_animTimer; - qreal m_animScale; - int m_animFrame; - }; class BoundingBox : public QObject -- cgit v0.12 From bedf245d3ee7c5760d56bb67e97d6a62a34105e9 Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Mon, 23 May 2011 16:44:29 +0200 Subject: QDeclarative: fixed clean animation lists Change-Id: I9dd8b4fcd3f04193410710981a511b9f69e5dc19 --- src/declarative/util/qdeclarativeanimation.cpp | 10 +++++--- src/declarative/util/qdeclarativetransition.cpp | 30 +++++++++++++++++++++- .../util/qdeclarativetransitionmanager.cpp | 6 ++--- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index efaa7f0..ce21bcd 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -1522,6 +1522,7 @@ void QDeclarativeAnimationGroupPrivate::append_animation(QDeclarativeListPropert QDeclarativeAnimationGroup *q = qobject_cast(list->object); if (q) { a->setGroup(q); + // This is an optimization for the parenting that already occurs via addAnimation QDeclarative_setParent_noEvent(a->qtAnimation(), q->d_func()->ag); q->d_func()->ag->addAnimation(a->qtAnimation()); } @@ -1531,9 +1532,12 @@ void QDeclarativeAnimationGroupPrivate::clear_animation(QDeclarativeListProperty { QDeclarativeAnimationGroup *q = qobject_cast(list->object); if (q) { - for (int i = 0; i < q->d_func()->animations.count(); ++i) - q->d_func()->animations.at(i)->setGroup(0); - q->d_func()->animations.clear(); + while (q->d_func()->animations.count()) { + QDeclarativeAbstractAnimation *firstAnim = q->d_func()->animations.at(0); + QDeclarative_setParent_noEvent(firstAnim->qtAnimation(), 0); + q->d_func()->ag->removeAnimation(firstAnim->qtAnimation()); + firstAnim->setGroup(0); + } } } diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp index 273060b..b63407c 100644 --- a/src/declarative/util/qdeclarativetransition.cpp +++ b/src/declarative/util/qdeclarativetransition.cpp @@ -130,6 +130,9 @@ public: endState->complete(); } static void append_animation(QDeclarativeListProperty *list, QDeclarativeAbstractAnimation *a); + static int animation_count(QDeclarativeListProperty *list); + static QDeclarativeAbstractAnimation* animation_at(QDeclarativeListProperty *list, int pos); + static void clear_animations(QDeclarativeListProperty *list); QList animations; }; @@ -141,6 +144,28 @@ void QDeclarativeTransitionPrivate::append_animation(QDeclarativeListPropertysetDisableUserControl(); } +int QDeclarativeTransitionPrivate::animation_count(QDeclarativeListProperty *list) +{ + QDeclarativeTransition *q = static_cast(list->object); + return q->d_func()->animations.count(); +} + +QDeclarativeAbstractAnimation* QDeclarativeTransitionPrivate::animation_at(QDeclarativeListProperty *list, int pos) +{ + QDeclarativeTransition *q = static_cast(list->object); + return q->d_func()->animations.at(pos); +} + +void QDeclarativeTransitionPrivate::clear_animations(QDeclarativeListProperty *list) +{ + QDeclarativeTransition *q = static_cast(list->object); + while (q->d_func()->animations.count()) { + QDeclarativeAbstractAnimation *firstAnim = q->d_func()->animations.at(0); + q->d_func()->group.removeAnimation(firstAnim->qtAnimation()); + q->d_func()->animations.removeAll(firstAnim); + } +} + void ParallelAnimationWrapper::updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) { QParallelAnimationGroup::updateState(newState, oldState); @@ -309,7 +334,10 @@ void QDeclarativeTransition::setToState(const QString &t) QDeclarativeListProperty QDeclarativeTransition::animations() { Q_D(QDeclarativeTransition); - return QDeclarativeListProperty(this, &d->animations, QDeclarativeTransitionPrivate::append_animation); + return QDeclarativeListProperty(this, &d->animations, QDeclarativeTransitionPrivate::append_animation, + QDeclarativeTransitionPrivate::animation_count, + QDeclarativeTransitionPrivate::animation_at, + QDeclarativeTransitionPrivate::clear_animations); } QT_END_NAMESPACE diff --git a/src/declarative/util/qdeclarativetransitionmanager.cpp b/src/declarative/util/qdeclarativetransitionmanager.cpp index 944b37f..6e96ac9 100644 --- a/src/declarative/util/qdeclarativetransitionmanager.cpp +++ b/src/declarative/util/qdeclarativetransitionmanager.cpp @@ -56,12 +56,12 @@ class QDeclarativeTransitionManagerPrivate { public: QDeclarativeTransitionManagerPrivate() - : state(0), transition(0) {} + : state(0) {} void applyBindings(); typedef QList SimpleActionList; QDeclarativeState *state; - QDeclarativeTransition *transition; + QDeclarativeGuard transition; QDeclarativeStateOperation::ActionList bindingsList; SimpleActionList completeList; }; @@ -253,7 +253,7 @@ void QDeclarativeTransitionManager::cancel() { if (d->transition) { // ### this could potentially trigger a complete in rare circumstances - d->transition->stop(); + d->transition->stop(); d->transition = 0; } -- cgit v0.12 From 4fd3f754104f56c625f7cbcca13fa12b4f633957 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 1 Jun 2011 17:13:51 +1000 Subject: Fixed compile of tst_qscriptextensionplugin on some Windows configurations The debug and release versions of staticplugin are qmake'd with the same destination directory. This causes the generated staticplugin .prl file to always refer to the debug versions of Qt libraries, even if Qt was configured with -release. The .prl mechanism is not useful for this test, so simply disable it to solve the problem. Reviewed-by: ckamm --- tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro b/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro index a003338..65c4e8f 100644 --- a/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro +++ b/tests/auto/qscriptextensionplugin/staticplugin/staticplugin.pro @@ -1,5 +1,6 @@ TEMPLATE = lib CONFIG += static plugin +CONFIG -= create_prl # not needed, and complicates debug/release SOURCES = staticplugin.cpp RESOURCES = staticplugin.qrc QT = core script -- cgit v0.12 From 7602be09663d37f01cfd640a7f1be959ce4317b7 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 1 Jun 2011 10:41:14 +1000 Subject: Fix docs on caching for images loaded by image providers Also add docs for 'source' and 'asynchronous' properties for AnimatedImage. Task-number: QTBUG-19504 Change-Id: Iec72dc7630308a94c37d00c6b008b5949c6fccd4 Reviewed-by: Martin Jones --- .../graphicsitems/qdeclarativeanimatedimage.cpp | 26 ++++++++++++++++++++++ src/declarative/qml/qdeclarativeengine.cpp | 3 --- src/declarative/qml/qdeclarativeimageprovider.cpp | 14 +++++++++++- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp index b7fcbb5..8787a5e 100644 --- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp @@ -87,6 +87,32 @@ QT_BEGIN_NAMESPACE */ /*! + \qmlproperty url AnimatedImage::source + + This property holds the URL that refers to the source image. + + AnimatedImage can handle any image format supported by Qt, loaded from any + URL scheme supported by Qt. + + \sa QDeclarativeImageProvider +*/ + +/*! + \qmlproperty bool AnimatedImage::asynchronous + + Specifies that images on the local filesystem should be loaded + asynchronously in a separate thread. The default value is + false, causing the user interface thread to block while the + image is loaded. Setting \a asynchronous to true is useful where + maintaining a responsive user interface is more desirable + than having images immediately visible. + + Note that this property is only valid for images read from the + local filesystem. Images loaded via a network resource (e.g. HTTP) + are always loaded asynchonously. +*/ + +/*! \qmlproperty bool AnimatedImage::cache \since Quick 1.1 diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index b81f631..e9feff4 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -771,9 +771,6 @@ QNetworkAccessManager *QDeclarativeEngine::networkAccessManager() const All required image providers should be added to the engine before any QML sources files are loaded. - Note that images loaded from a QDeclarativeImageProvider are cached - by QPixmapCache, similar to any image loaded by QML. - \sa removeImageProvider() */ void QDeclarativeEngine::addImageProvider(const QString &providerId, QDeclarativeImageProvider *provider) diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp index 559adf4..fa88c00 100644 --- a/src/declarative/qml/qdeclarativeimageprovider.cpp +++ b/src/declarative/qml/qdeclarativeimageprovider.cpp @@ -136,7 +136,8 @@ public: Image providers that support QImage loading automatically include support for asychronous loading of images. To enable asynchronous loading for an - \l Image source, set \l Image::asynchronous to \c true. When this is enabled, + image source, set the \c asynchronous property to \c true for the relevant + \l Image, \l BorderImage or \l AnimatedImage object. When this is enabled, the image request to the provider is run in a low priority thread, allowing image loading to be executed in the background, and reducing the performance impact on the user interface. @@ -147,6 +148,17 @@ public: \c true, the value is ignored and the image is loaded synchronously. + + \section2 Image caching + + Images returned by a QDeclarativeImageProvider are automatically cached, + similar to any image loaded by the QML engine. When an image with a + "image://" prefix is loaded from cache, requestImage() and requestPixmap() + will not be called for the relevant image provider. If an image should always + be fetched from the image provider, and should not be cached at all, set the + \c cache property to \c false for the relevant \l Image, \l BorderImage or + \l AnimatedImage object. + \sa QDeclarativeEngine::addImageProvider() */ -- cgit v0.12 From c038e3505309bb954123493cb5f96c73e114f3d0 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 8 Jun 2011 11:01:26 +0200 Subject: QDeclarativeDebug: Fix QJSDebugService if launched with ',block' If the debugger is launched in blocking mode the service will be enabled from the start. Reviewed-by: Thorbjorn Lindeijer --- src/declarative/debugger/qjsdebuggeragent.cpp | 13 ++++++++++++- src/declarative/debugger/qjsdebuggeragent_p.h | 2 ++ src/declarative/debugger/qjsdebugservice.cpp | 10 ++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/declarative/debugger/qjsdebuggeragent.cpp b/src/declarative/debugger/qjsdebuggeragent.cpp index 9b76592..dff637b 100644 --- a/src/declarative/debugger/qjsdebuggeragent.cpp +++ b/src/declarative/debugger/qjsdebuggeragent.cpp @@ -56,7 +56,7 @@ class QJSDebuggerAgentPrivate { public: QJSDebuggerAgentPrivate(QJSDebuggerAgent *q) - : q(q), state(NoState) + : q(q), state(NoState), isInitialized(false) {} void continueExec(); @@ -79,6 +79,7 @@ public: QHash fileNameToBreakpoints; QStringList watchExpressions; QSet knownObjectIds; + bool isInitialized; }; namespace { @@ -252,6 +253,14 @@ QJSDebuggerAgent::~QJSDebuggerAgent() delete d; } +/*! + Indicates whether the agent got the list of breakpoints. + */ +bool QJSDebuggerAgent::isInitialized() const +{ + return d->isInitialized; +} + void QJSDebuggerAgent::setBreakpoints(const JSAgentBreakpoints &breakpoints) { d->breakpoints = breakpoints; @@ -259,6 +268,8 @@ void QJSDebuggerAgent::setBreakpoints(const JSAgentBreakpoints &breakpoints) d->fileNameToBreakpoints.clear(); foreach (const JSAgentBreakpointData &bp, breakpoints) d->fileNameToBreakpoints.insertMulti(fileName(QString::fromUtf8(bp.fileUrl)), bp); + + d->isInitialized = true; } void QJSDebuggerAgent::setWatchExpressions(const QStringList &watchExpressions) diff --git a/src/declarative/debugger/qjsdebuggeragent_p.h b/src/declarative/debugger/qjsdebuggeragent_p.h index 5aa3c9c..309588e 100644 --- a/src/declarative/debugger/qjsdebuggeragent_p.h +++ b/src/declarative/debugger/qjsdebuggeragent_p.h @@ -145,6 +145,8 @@ public: QJSDebuggerAgent(QDeclarativeEngine *engine, QObject *parent = 0); ~QJSDebuggerAgent(); + bool isInitialized() const; + void setBreakpoints(const JSAgentBreakpoints &); void setWatchExpressions(const QStringList &); diff --git a/src/declarative/debugger/qjsdebugservice.cpp b/src/declarative/debugger/qjsdebugservice.cpp index 4ce2c90..ad84f65 100644 --- a/src/declarative/debugger/qjsdebugservice.cpp +++ b/src/declarative/debugger/qjsdebugservice.cpp @@ -71,6 +71,16 @@ void QJSDebugService::addEngine(QDeclarativeEngine *engine) Q_ASSERT(!m_engines.contains(engine)); m_engines.append(engine); + + if (status() == Enabled && !m_engines.isEmpty() && !m_agent) { + m_agent = new QJSDebuggerAgent(engine, engine); + connect(m_agent, SIGNAL(stopped(bool,QString)), + this, SLOT(executionStopped(bool,QString))); + + while (!m_agent->isInitialized()) { + waitForMessage(); + } + } } void QJSDebugService::removeEngine(QDeclarativeEngine *engine) -- cgit v0.12 From 809fc41c9b19388a21ee8e23601156579780cda3 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 8 Jun 2011 15:49:33 +0200 Subject: Protect against deleted windows Check that the window is still there before trying to deliver an event to it. Reviewed-by: Samuel --- src/gui/kernel/qapplication_qpa.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/gui/kernel/qapplication_qpa.cpp b/src/gui/kernel/qapplication_qpa.cpp index 98359e4..5787c71 100644 --- a/src/gui/kernel/qapplication_qpa.cpp +++ b/src/gui/kernel/qapplication_qpa.cpp @@ -612,6 +612,9 @@ void QApplication::setMainWidget(QWidget *mainWidget) void QApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent *e) { + if (!e->widget) + return; + // qDebug() << "handleMouseEvent" << tlw << ev.pos() << ev.globalPos() << hex << ev.buttons(); static QWeakPointer implicit_mouse_grabber; @@ -768,6 +771,10 @@ void QApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mouse void QApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::WheelEvent *e) { + + if (!e->widget) + return; + // QPoint localPoint = ev.pos(); QPoint globalPoint = e->globalPos; // bool trustLocalPoint = !!tlw; //is there something the local point can be local to? @@ -842,12 +849,18 @@ void QApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEven void QApplicationPrivate::processEnterEvent(QWindowSystemInterfacePrivate::EnterEvent *e) { + if (!e->enter) + return; + QApplicationPrivate::dispatchEnterLeave(e->enter.data(),0); qt_last_mouse_receiver = e->enter.data(); } void QApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::LeaveEvent *e) { + if (!e->leave) + return; + QApplicationPrivate::dispatchEnterLeave(0,qt_last_mouse_receiver); if (e->leave.data() && !e->leave.data()->isAncestorOf(qt_last_mouse_receiver)) //(???) this should not happen @@ -858,6 +871,9 @@ void QApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::Leave void QApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *e) { + if (!e->activated) + return; + QApplication::setActiveWindow(e->activated.data()); } -- cgit v0.12 From e3b5de8651586cf5484fd8ab217cddf17f0fe01e Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 8 Jun 2011 20:51:07 +0200 Subject: QDeclarativeDebug: Don't hang if started with ',block' argument Fixes regression introduced in a59261454071 Reviewed-by: Christiaan Janssen --- src/declarative/debugger/qpacketprotocol.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/declarative/debugger/qpacketprotocol.cpp b/src/declarative/debugger/qpacketprotocol.cpp index 77c5f44..9caaa79 100644 --- a/src/declarative/debugger/qpacketprotocol.cpp +++ b/src/declarative/debugger/qpacketprotocol.cpp @@ -199,6 +199,7 @@ public Q_SLOTS: inProgressSize = -1; inProgress.clear(); + waitingForPacket = false; emit readyRead(); } else return; -- cgit v0.12 From 78a1f738c21b1dfe799c9deea0ab01360bbde25d Mon Sep 17 00:00:00 2001 From: Sami Lempinen Date: Fri, 10 Jun 2011 10:40:02 +0300 Subject: Disabling DEF files to get around building problems. --- config.profiles/symbian/bld.inf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.profiles/symbian/bld.inf b/config.profiles/symbian/bld.inf index 6ccb11c..91b90c2 100644 --- a/config.profiles/symbian/bld.inf +++ b/config.profiles/symbian/bld.inf @@ -80,5 +80,5 @@ translations/qt_zh_tw_symbian.ts /epoc32/include/platform/qt/translations/qt_zh_ PRJ_EXTENSIONS START EXTENSION qt/qtconfig OPTION QT_ROOT .. -OPTION OPTIONS -opensource -confirm-license -openvg -opengl-es-2 -script -no-scripttools -no-webkit -make make -graphicssystem openvg -phonon -phonon-backend -usedeffiles -dont-process -nomake examples -nomake demos -nomake tools -audio-backend -fpu softvfp+vfpv2 +OPTION OPTIONS -opensource -confirm-license -openvg -opengl-es-2 -script -no-scripttools -no-webkit -make make -graphicssystem openvg -phonon -phonon-backend -no-usedeffiles -dont-process -nomake examples -nomake demos -nomake tools -audio-backend -fpu softvfp+vfpv2 END \ No newline at end of file -- cgit v0.12 From f541c78e1bc5b293466b40e6f10496199a4a5d73 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 9 Jun 2011 10:06:00 +0200 Subject: Fix missing empty lines in Qt HTML when displayed in compliant browsers When QTextDocument exports HTML, it makes an effort to be compatible with its own importer, hence it has to be compatible with the dialect of HTML which Qt has developed over the years. One incorrect interpretation in Qt is that an empty paragraph is interpreted as an empty line. So if you use a QTextDocument to produce HTML for text where an empty line has been added, this empty line will not be visible when the document is viewed in a compliant browser. The fix is to set the height of the empty paragraph to 1em, so that it will match the current pixel size of the font, thus look the same as a


but without altering the structure of the document. Reviewed-by: Gunnar --- src/gui/text/qtextdocument.cpp | 2 +- tests/auto/qtextdocument/tst_qtextdocument.cpp | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index fe3c993..74b1c69 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -2553,7 +2553,7 @@ void QTextHtmlExporter::emitBlockAttributes(const QTextBlock &block) const bool emptyBlock = block.begin().atEnd(); if (emptyBlock) { - html += QLatin1String("-qt-paragraph-type:empty;"); + html += QLatin1String("-qt-paragraph-type:empty; height:1em;"); } emitMargins(QString::number(format.topMargin()), diff --git a/tests/auto/qtextdocument/tst_qtextdocument.cpp b/tests/auto/qtextdocument/tst_qtextdocument.cpp index 1129219..68252ef 100644 --- a/tests/auto/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/qtextdocument/tst_qtextdocument.cpp @@ -182,6 +182,8 @@ private slots: void copiedFontSize(); + void htmlExportImportBlockCount(); + private: void backgroundImage_checkExpectedHtml(const QTextDocument &doc); @@ -1582,7 +1584,7 @@ void tst_QTextDocument::toHtml() expectedOutput.replace("OPENDEFAULTBLOCKSTYLE", "style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"); expectedOutput.replace("DEFAULTBLOCKSTYLE", "style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\""); - expectedOutput.replace("EMPTYBLOCK", "

\n"); + expectedOutput.replace("EMPTYBLOCK", "

\n"); if (expectedOutput.endsWith(QLatin1Char('\n'))) expectedOutput.chop(1); expectedOutput.append(htmlTail); @@ -2760,5 +2762,27 @@ void tst_QTextDocument::copiedFontSize() QCOMPARE(cursorOutput.charFormat().font().pixelSize(), 24); } +void tst_QTextDocument::htmlExportImportBlockCount() +{ + QTextDocument document; + { + QTextCursor cursor(&document); + cursor.insertText("Foo"); + cursor.insertBlock(); + cursor.insertBlock(); + cursor.insertBlock(); + cursor.insertBlock(); + cursor.insertText("Bar"); + } + + QCOMPARE(document.blockCount(), 5); + QString html = document.toHtml(); + + document.clear(); + document.setHtml(html); + + QCOMPARE(document.blockCount(), 5); +} + QTEST_MAIN(tst_QTextDocument) #include "tst_qtextdocument.moc" -- cgit v0.12 From ae9cc6c29521f1b597c3120f638d125892cdd593 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Sat, 4 Jun 2011 14:47:22 +0200 Subject: Allow selecting fonts with irregular style names Fonts like "Helvetica Neue UltraLight" or "Skia Regular Black Condensed" can't be selected in Qt because either they don't report correct numeric values for weight/stretch/etc. or these values are not mapped from QFont enums in a linear way. Thus we provide a shortcut to select these fonts with PostScript name or full name without resorting to family name matching in QFontDatabase (these fonts are not registered in font database anyway). After this, we can simply use: QFont font("Helvetica Neue"); font.setStyleName("UltraLight"); to select these fonts. QCoreTextFontEngineMulti matched like this can be created directly from the CTFontRef instance instead of creating from the font name, making this process faster. The commit also cleaned up the font loading process in Mac font database a bit, moving the code for family matching into a separate function. Add QFontInfo::styleName() and QRawFont::styleName() to access the resolved style name for a font. Task-number: QTBUG-19366 Change-Id: Iad07768c02ed06cc8d6b7395dec554384f410506 Reviewed-on: http://codereview.qt.nokia.com/333 Reviewed-by: Qt Sanity Bot Reviewed-by: Jiang Jiang (cherry picked from commit 97391be5ebddc62545ddb88f92fc2045bfa10711) --- src/gui/text/qfont.cpp | 50 ++++++++++++ src/gui/text/qfont.h | 6 +- src/gui/text/qfont_p.h | 1 + src/gui/text/qfontdatabase_mac.cpp | 142 ++++++++++++++++++++-------------- src/gui/text/qfontdatabase_x11.cpp | 58 ++++++++------ src/gui/text/qfontengine_coretext.mm | 22 +++--- src/gui/text/qfontengine_coretext_p.h | 4 +- src/gui/text/qfontengine_ft.cpp | 2 + src/gui/text/qfontinfo.h | 1 + src/gui/text/qrawfont.cpp | 13 ++++ src/gui/text/qrawfont.h | 1 + tests/auto/qfont/tst_qfont.cpp | 13 ++++ 12 files changed, 217 insertions(+), 96 deletions(-) diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 90dd029..d4c81b9 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -348,6 +348,9 @@ void QFontPrivate::resolve(uint mask, const QFontPrivate *other) if (! (mask & QFont::FamilyResolved)) request.family = other->request.family; + if (! (mask & QFont::StyleNameResolved)) + request.styleName = other->request.styleName; + if (! (mask & QFont::SizeResolved)) { request.pointSize = other->request.pointSize; request.pixelSize = other->request.pixelSize; @@ -897,6 +900,38 @@ void QFont::setFamily(const QString &family) } /*! + \since 4.8 + + Returns the requested font style name, it will be used to match the + font with irregular styles (that can't be normalized in other style + properties). It depends on system font support, thus only works for + Mac OS X and X11 so far. On Windows irregular styles will be added + as separate font families so there is no need for this. + + \sa setFamily() setStyle() +*/ +QString QFont::styleName() const +{ + return d->request.styleName; +} + +/*! + \since 4.8 + + Sets the style name of the font. When set, other style properties + like \a style() and \a weight() will be ignored for font matching. + + \sa styleName() +*/ +void QFont::setStyleName(const QString &styleName) +{ + detach(); + + d->request.styleName = styleName; + resolve_mask |= QFont::StyleNameResolved; +} + +/*! Returns the point size of the font. Returns -1 if the font size was specified in pixels. @@ -2509,6 +2544,21 @@ QString QFontInfo::family() const } /*! + \since 4.8 + + Returns the style name of the matched window system font on + system that supports it. + + \sa QFont::styleName() +*/ +QString QFontInfo::styleName() const +{ + QFontEngine *engine = d->engineForScript(QUnicodeTables::Common); + Q_ASSERT(engine != 0); + return engine->fontDef.styleName; +} + +/*! Returns the point size of the matched window system font. \sa pointSizeF() QFont::pointSize() diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h index 7636ecf..14f290c 100644 --- a/src/gui/text/qfont.h +++ b/src/gui/text/qfont.h @@ -156,7 +156,8 @@ public: LetterSpacingResolved = 0x2000, WordSpacingResolved = 0x4000, HintingPreferenceResolved = 0x8000, - AllPropertiesResolved = 0xffff + StyleNameResolved = 0x10000, + AllPropertiesResolved = 0x1ffff }; QFont(); @@ -168,6 +169,9 @@ public: QString family() const; void setFamily(const QString &); + QString styleName() const; + void setStyleName(const QString &); + int pointSize() const; void setPointSize(int); qreal pointSizeF() const; diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h index d36518e..8eeae6f 100644 --- a/src/gui/text/qfont_p.h +++ b/src/gui/text/qfont_p.h @@ -80,6 +80,7 @@ struct QFontDef } QString family; + QString styleName; #ifdef Q_WS_X11 QString addStyle; diff --git a/src/gui/text/qfontdatabase_mac.cpp b/src/gui/text/qfontdatabase_mac.cpp index 6fdaf06..724dbf6 100644 --- a/src/gui/text/qfontdatabase_mac.cpp +++ b/src/gui/text/qfontdatabase_mac.cpp @@ -249,6 +249,63 @@ static inline float weightToFloat(unsigned int weight) return (weight - 50) / 100.0; } +static QFontEngine *loadFromDatabase(const QFontDef &req, const QFontPrivate *d) +{ +#if defined(QT_MAC_USE_COCOA) + QCFString fontName = NULL; +#else + ATSFontFamilyRef familyRef = 0; + ATSFontRef fontRef = 0; +#endif + + QStringList family_list = familyList(req); + + const char *stylehint = styleHint(req); + if (stylehint) + family_list << QLatin1String(stylehint); + + // add QFont::defaultFamily() to the list, for compatibility with previous versions + family_list << QApplication::font().defaultFamily(); + + QMutexLocker locker(fontDatabaseMutex()); + QFontDatabasePrivate *db = privateDb(); + if (!db->count) + initializeDb(); + for (int i = 0; i < family_list.size(); ++i) { + for (int k = 0; k < db->count; ++k) { + if (db->families[k]->name.compare(family_list.at(i), Qt::CaseInsensitive) == 0) { + QByteArray family_name = db->families[k]->name.toUtf8(); +#if defined(QT_MAC_USE_COCOA) + QCFType ctFont = CTFontCreateWithName(QCFString(db->families[k]->name), 12, NULL); + if (ctFont) { + fontName = CTFontCopyFullName(ctFont); + goto found; + } +#else + familyRef = ATSFontFamilyFindFromName(QCFString(db->families[k]->name), kATSOptionFlagsDefault); + if (familyRef) { + fontRef = ATSFontFindFromName(QCFString(db->families[k]->name), kATSOptionFlagsDefault); + goto found; + } +#endif + } + } + } +found: +#ifdef QT_MAC_USE_COCOA + if (fontName) + return new QCoreTextFontEngineMulti(fontName, req, d->kerning); +#else + if (familyRef) { + QCFString actualName; + if (ATSFontFamilyGetName(familyRef, kATSOptionFlagsDefault, &actualName) == noErr) + req.family = actualName; + return new QFontEngineMacMulti(familyRef, req, fontDef, d->kerning); + } +#endif + return NULL; +} + void QFontDatabase::load(const QFontPrivate *d, int script) { // sanity checks @@ -289,69 +346,38 @@ void QFontDatabase::load(const QFontPrivate *d, int script) return; // the font info and fontdef should already be filled } - //find the font - QStringList family_list = familyList(req); - - const char *stylehint = styleHint(req); - if (stylehint) - family_list << QLatin1String(stylehint); - - // add QFont::defaultFamily() to the list, for compatibility with - // previous versions - family_list << QApplication::font().defaultFamily(); - + QFontEngine *engine = NULL; #if defined(QT_MAC_USE_COCOA) - QCFString fontName = NULL, familyName = NULL; -#else - ATSFontFamilyRef familyRef = 0; - ATSFontRef fontRef = 0; -#endif - - QMutexLocker locker(fontDatabaseMutex()); - QFontDatabasePrivate *db = privateDb(); - if (!db->count) - initializeDb(); - for(int i = 0; i < family_list.size(); ++i) { - for (int k = 0; k < db->count; ++k) { - if (db->families[k]->name.compare(family_list.at(i), Qt::CaseInsensitive) == 0) { - QByteArray family_name = db->families[k]->name.toUtf8(); -#if defined(QT_MAC_USE_COCOA) - QCFType ctFont = CTFontCreateWithName(QCFString(db->families[k]->name), 12, NULL); - if (ctFont) { - fontName = CTFontCopyFullName(ctFont); - familyName = CTFontCopyFamilyName(ctFont); - goto FamilyFound; - } -#else - familyRef = ATSFontFamilyFindFromName(QCFString(db->families[k]->name), kATSOptionFlagsDefault); - if (familyRef) { - fontRef = ATSFontFindFromName(QCFString(db->families[k]->name), kATSOptionFlagsDefault); - goto FamilyFound; - } -#endif + // Shortcut to get the font directly without going through the font database + if (!req.family.isEmpty() && !req.styleName.isEmpty()) { + QCFString expectedFamily = QCFString(req.family); + QCFString expectedStyle = QCFString(req.styleName); + + QCFType attributes = CFDictionaryCreateMutable(NULL, 0, + &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + CFDictionaryAddValue(attributes, kCTFontFamilyNameAttribute, expectedFamily); + CFDictionaryAddValue(attributes, kCTFontStyleNameAttribute, expectedStyle); + + QCFType descriptor = CTFontDescriptorCreateWithAttributes(attributes); + CGAffineTransform transform = qt_transform_from_fontdef(req); + QCFType ctFont = CTFontCreateWithFontDescriptor(descriptor, req.pixelSize, &transform); + if (ctFont) { + QCFString familyName = CTFontCopyFamilyName(ctFont); + // Only accept the font if the family name is exactly the same as we specified + if (CFEqual(expectedFamily, familyName)) { + engine = new QCoreTextFontEngineMulti(ctFont, req, d->kerning); } } } -FamilyFound: - //fill in the engine's font definition - QFontDef fontDef = d->request; //copy.. - if(fontDef.pointSize < 0) - fontDef.pointSize = qt_mac_pointsize(fontDef, d->dpi); - else - fontDef.pixelSize = qt_mac_pixelsize(fontDef, d->dpi); - -#ifdef QT_MAC_USE_COCOA - fontDef.family = familyName; - QFontEngine *engine = new QCoreTextFontEngineMulti(fontName, fontDef, d->kerning); -#else - QCFString actualName; - if (ATSFontFamilyGetName(familyRef, kATSOptionFlagsDefault, &actualName) == noErr) - fontDef.family = actualName; - QFontEngine *engine = new QFontEngineMacMulti(familyRef, fontRef, fontDef, d->kerning); #endif - d->engineData->engine = engine; - engine->ref.ref(); //a ref for the engineData->engine - QFontCache::instance()->insertEngine(key, engine); + if (!engine) + engine = loadFromDatabase(req, d); + + if (engine) { + d->engineData->engine = engine; + engine->ref.ref(); + QFontCache::instance()->insertEngine(key, engine); + } } static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt) diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp index a5fdcb5..754334c 100644 --- a/src/gui/text/qfontdatabase_x11.cpp +++ b/src/gui/text/qfontdatabase_x11.cpp @@ -1452,6 +1452,35 @@ static const char *styleHint(const QFontDef &request) void qt_addPatternProps(FcPattern *pattern, int screen, int script, const QFontDef &request) { + double size_value = qMax(qreal(1.), request.pixelSize); + FcPatternDel(pattern, FC_PIXEL_SIZE); + FcPatternAddDouble(pattern, FC_PIXEL_SIZE, size_value); + + if (X11->display && QX11Info::appDepth(screen) <= 8) { + FcPatternDel(pattern, FC_ANTIALIAS); + // can't do antialiasing on 8bpp + FcPatternAddBool(pattern, FC_ANTIALIAS, false); + } else if (request.styleStrategy & (QFont::PreferAntialias|QFont::NoAntialias)) { + FcPatternDel(pattern, FC_ANTIALIAS); + FcPatternAddBool(pattern, FC_ANTIALIAS, + !(request.styleStrategy & QFont::NoAntialias)); + } + + if (script != QUnicodeTables::Common && *specialLanguages[script] != '\0') { + Q_ASSERT(script < QUnicodeTables::ScriptCount); + FcLangSet *ls = FcLangSetCreate(); + FcLangSetAdd(ls, (const FcChar8*)specialLanguages[script]); + FcPatternDel(pattern, FC_LANG); + FcPatternAddLangSet(pattern, FC_LANG, ls); + FcLangSetDestroy(ls); + } + + if (!request.styleName.isEmpty()) { + QByteArray cs = request.styleName.toUtf8(); + FcPatternAddString(pattern, FC_STYLE, (const FcChar8 *) cs.constData()); + return; + } + int weight_value = FC_WEIGHT_BLACK; if (request.weight == 0) weight_value = FC_WEIGHT_MEDIUM; @@ -1474,34 +1503,11 @@ void qt_addPatternProps(FcPattern *pattern, int screen, int script, const QFontD FcPatternDel(pattern, FC_SLANT); FcPatternAddInteger(pattern, FC_SLANT, slant_value); - double size_value = qMax(qreal(1.), request.pixelSize); - FcPatternDel(pattern, FC_PIXEL_SIZE); - FcPatternAddDouble(pattern, FC_PIXEL_SIZE, size_value); - int stretch = request.stretch; if (!stretch) stretch = 100; FcPatternDel(pattern, FC_WIDTH); FcPatternAddInteger(pattern, FC_WIDTH, stretch); - - if (X11->display && QX11Info::appDepth(screen) <= 8) { - FcPatternDel(pattern, FC_ANTIALIAS); - // can't do antialiasing on 8bpp - FcPatternAddBool(pattern, FC_ANTIALIAS, false); - } else if (request.styleStrategy & (QFont::PreferAntialias|QFont::NoAntialias)) { - FcPatternDel(pattern, FC_ANTIALIAS); - FcPatternAddBool(pattern, FC_ANTIALIAS, - !(request.styleStrategy & QFont::NoAntialias)); - } - - if (script != QUnicodeTables::Common && *specialLanguages[script] != '\0') { - Q_ASSERT(script < QUnicodeTables::ScriptCount); - FcLangSet *ls = FcLangSetCreate(); - FcLangSetAdd(ls, (const FcChar8*)specialLanguages[script]); - FcPatternDel(pattern, FC_LANG); - FcPatternAddLangSet(pattern, FC_LANG, ls); - FcLangSetDestroy(ls); - } } static bool preferScalable(const QFontDef &request) @@ -2049,7 +2055,8 @@ static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt) return; FcPatternDel(pattern, FC_FILE); - FcPatternAddString(pattern, FC_FILE, (const FcChar8 *)fnt->fileName.toUtf8().constData()); + QByteArray cs = fnt->fileName.toUtf8(); + FcPatternAddString(pattern, FC_FILE, (const FcChar8 *) cs.constData()); FcChar8 *fam = 0, *familylang = 0; int i, n = 0; @@ -2135,7 +2142,8 @@ QString QFontDatabase::resolveFontFamilyAlias(const QString &family) if (!pattern) return family; - FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *) family.toUtf8().data()); + QByteArray cs = family.toUtf8(); + FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *) cs.constData()); FcConfigSubstitute(0, pattern, FcMatchPattern); FcDefaultSubstitute(pattern); diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm index 9a83599..64b8682 100644 --- a/src/gui/text/qfontengine_coretext.mm +++ b/src/gui/text/qfontengine_coretext.mm @@ -116,17 +116,11 @@ QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(const QCFString &name, const init(kerning); } -QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(CGFontRef cgFontRef, const QFontDef &fontDef, bool kerning) +QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(CTFontRef ctFontRef, const QFontDef &fontDef, bool kerning) : QFontEngineMulti(0) { this->fontDef = fontDef; - - transform = CGAffineTransformIdentity; - if (fontDef.stretch != 100) { - transform = CGAffineTransformMakeScale(float(fontDef.stretch) / float(100), 1); - } - - ctfont = CTFontCreateWithGraphicsFont(cgFontRef, fontDef.pixelSize, &transform, NULL); + ctfont = (CTFontRef) CFRetain(ctFontRef); init(kerning); } @@ -149,6 +143,9 @@ void QCoreTextFontEngineMulti::init(bool kerning) } QCoreTextFontEngine *fe = new QCoreTextFontEngine(ctfont, fontDef); + fontDef.family = fe->fontDef.family; + fontDef.styleName = fe->fontDef.styleName; + transform = fe->transform; fe->ref.ref(); engines.append(fe); } @@ -405,7 +402,7 @@ void QCoreTextFontEngineMulti::loadEngine(int) extern int qt_antialiasing_threshold; // from qapplication.cpp -static inline CGAffineTransform transformFromFontDef(const QFontDef &fontDef) +CGAffineTransform qt_transform_from_fontdef(const QFontDef &fontDef) { CGAffineTransform transform = CGAffineTransformIdentity; if (fontDef.stretch != 100) @@ -416,7 +413,7 @@ static inline CGAffineTransform transformFromFontDef(const QFontDef &fontDef) QCoreTextFontEngine::QCoreTextFontEngine(CTFontRef font, const QFontDef &def) { fontDef = def; - transform = transformFromFontDef(fontDef); + transform = qt_transform_from_fontdef(fontDef); ctfont = font; CFRetain(ctfont); cgFont = CTFontCopyGraphicsFont(font, NULL); @@ -426,7 +423,7 @@ QCoreTextFontEngine::QCoreTextFontEngine(CTFontRef font, const QFontDef &def) QCoreTextFontEngine::QCoreTextFontEngine(CGFontRef font, const QFontDef &def) { fontDef = def; - transform = transformFromFontDef(fontDef); + transform = qt_transform_from_fontdef(fontDef); cgFont = font; // Keep reference count balanced CFRetain(cgFont); @@ -464,6 +461,9 @@ void QCoreTextFontEngine::init() QCFString family = CTFontCopyFamilyName(ctfont); fontDef.family = family; + QCFString styleName = (CFStringRef) CTFontCopyAttribute(ctfont, kCTFontStyleNameAttribute); + fontDef.styleName = styleName; + synthesisFlags = 0; CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(ctfont); if (traits & kCTFontItalicTrait) diff --git a/src/gui/text/qfontengine_coretext_p.h b/src/gui/text/qfontengine_coretext_p.h index 98d3b50..3ca8a0a 100644 --- a/src/gui/text/qfontengine_coretext_p.h +++ b/src/gui/text/qfontengine_coretext_p.h @@ -113,7 +113,7 @@ class QCoreTextFontEngineMulti : public QFontEngineMulti { public: QCoreTextFontEngineMulti(const QCFString &name, const QFontDef &fontDef, bool kerning); - QCoreTextFontEngineMulti(CGFontRef cgFontRef, const QFontDef &fontDef, bool kerning); + QCoreTextFontEngineMulti(CTFontRef ctFontRef, const QFontDef &fontDef, bool kerning); ~QCoreTextFontEngineMulti(); virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, @@ -141,6 +141,8 @@ private: friend class QFontDialogPrivate; }; +CGAffineTransform qt_transform_from_fontdef(const QFontDef &fontDef); + #endif// !defined(Q_WS_MAC) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) #endif // QFONTENGINE_CORETEXT_P_H diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 39abbd6..9a5d9d6 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -758,6 +758,8 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format, } #endif + fontDef.styleName = QString::fromUtf8(face->style_name); + unlockFace(); fsType = freetype->fsType(); diff --git a/src/gui/text/qfontinfo.h b/src/gui/text/qfontinfo.h index 1238cba..37a724e 100644 --- a/src/gui/text/qfontinfo.h +++ b/src/gui/text/qfontinfo.h @@ -61,6 +61,7 @@ public: QFontInfo &operator=(const QFontInfo &); QString family() const; + QString styleName() const; int pixelSize() const; int pointSize() const; qreal pointSizeF() const; diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp index 843deb0..a6ec86e 100644 --- a/src/gui/text/qrawfont.cpp +++ b/src/gui/text/qrawfont.cpp @@ -396,6 +396,19 @@ QString QRawFont::familyName() const } /*! + Returns the style name of this QRawFont. + + \sa QFont::styleName() +*/ +QString QRawFont::styleName() const +{ + if (!isValid()) + return QString(); + + return d->fontEngine->fontDef.styleName; +} + +/*! Returns the style of this QRawFont. \sa QFont::style() diff --git a/src/gui/text/qrawfont.h b/src/gui/text/qrawfont.h index da56d3d..99e0837 100644 --- a/src/gui/text/qrawfont.h +++ b/src/gui/text/qrawfont.h @@ -84,6 +84,7 @@ public: bool operator==(const QRawFont &other) const; QString familyName() const; + QString styleName() const; QFont::Style style() const; int weight() const; diff --git a/tests/auto/qfont/tst_qfont.cpp b/tests/auto/qfont/tst_qfont.cpp index cfafa78..711ffc0 100644 --- a/tests/auto/qfont/tst_qfont.cpp +++ b/tests/auto/qfont/tst_qfont.cpp @@ -77,6 +77,7 @@ private slots: void insertAndRemoveSubstitutions(); void serializeSpacing(); void lastResortFont(); + void styleName(); }; // Testing get/set functions @@ -612,5 +613,17 @@ void tst_QFont::lastResortFont() QVERIFY(!font.lastResortFont().isEmpty()); } +void tst_QFont::styleName() +{ +#if !defined(Q_WS_MAC) + QSKIP("Only tested on Mac", SkipAll); +#else + QFont font("Helvetica Neue"); + font.setStyleName("UltraLight"); + + QCOMPARE(QFontInfo(font).styleName(), QString("UltraLight")); +#endif +} + QTEST_MAIN(tst_QFont) #include "tst_qfont.moc" -- cgit v0.12 From b9993f684c7ef8c04aa6a0e87af596609957f906 Mon Sep 17 00:00:00 2001 From: aavit Date: Fri, 10 Jun 2011 12:46:52 +0200 Subject: Fix compilation of lrelease on Windows --- tools/linguist/lrelease/lrelease.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/linguist/lrelease/lrelease.pro b/tools/linguist/lrelease/lrelease.pro index e9b3a75..dbe4ab4 100644 --- a/tools/linguist/lrelease/lrelease.pro +++ b/tools/linguist/lrelease/lrelease.pro @@ -10,5 +10,7 @@ include(../shared/formats.pri) include(../shared/proparser.pri) include(../../shared/symbian/epocroot.pri) +win32:LIBS += -ladvapi32 # for registry.cpp in epocroot + target.path=$$[QT_INSTALL_BINS] INSTALLS += target -- cgit v0.12 From 267e7ca0e586eb63c62deac94f8412db962d621d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 10 Jun 2011 17:20:19 +0200 Subject: fix build on windows 7 remove pointless epocroot.pri inclusion --- tools/linguist/lrelease/lrelease.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/linguist/lrelease/lrelease.pro b/tools/linguist/lrelease/lrelease.pro index e9b3a75..28a741d 100644 --- a/tools/linguist/lrelease/lrelease.pro +++ b/tools/linguist/lrelease/lrelease.pro @@ -8,7 +8,6 @@ SOURCES += main.cpp include(../../../src/tools/bootstrap/bootstrap.pri) include(../shared/formats.pri) include(../shared/proparser.pri) -include(../../shared/symbian/epocroot.pri) target.path=$$[QT_INSTALL_BINS] INSTALLS += target -- cgit v0.12 From 8680ced782c5e225b2e15c50c05493a23410b119 Mon Sep 17 00:00:00 2001 From: Bernhard Rosenkraenzer Date: Fri, 10 Jun 2011 18:08:44 +0200 Subject: Fix building the OpenVG graphicssystem on Linux with static libs Without this, building OpenVG would fail because Q_OPENVG_EXPORT wasn't defined at all, causing it to be treated as a variable name Merge-request: 1256 Reviewed-by: Oswald Buddenhagen --- src/corelib/global/qglobal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 1454cb3..32b3e6b 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1423,6 +1423,7 @@ class QDataStream; # define Q_DECLARATIVE_EXPORT # define Q_OPENGL_EXPORT # define Q_MULTIMEDIA_EXPORT +# define Q_OPENVG_EXPORT # define Q_XML_EXPORT # define Q_XMLPATTERNS_EXPORT # define Q_SCRIPT_EXPORT -- cgit v0.12 From 978dd42d80730fea26ba02303bb65904cfdbadb5 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 26 May 2011 13:43:32 +0100 Subject: Enable QTcpServer benchmark on symbian Added required capability to the .pro file Added default connection startup code Removed the QSKIP for IPv6 test Reviewed-by: Markus Goetz --- .../network/socket/qtcpserver/qtcpserver.pro | 2 ++ .../network/socket/qtcpserver/tst_qtcpserver.cpp | 35 +++++++++++++++++++--- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro b/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro index e5b9346..4bdfcb7 100644 --- a/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro +++ b/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro @@ -11,3 +11,5 @@ CONFIG += release # Input SOURCES += tst_qtcpserver.cpp + +symbian:TARGET.CAPABILITY += NetworkServices \ No newline at end of file diff --git a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp index f81853b..9fc5807 100644 --- a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp +++ b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp @@ -54,6 +54,10 @@ #include #include +#include +#include +#include + #include Q_DECLARE_METATYPE(QNetworkProxy) Q_DECLARE_METATYPE(QList) @@ -75,16 +79,42 @@ public: public slots: void initTestCase_data(); void init(); + void initTestCase(); void cleanup(); private slots: void ipv4LoopbackPerformanceTest(); void ipv6LoopbackPerformanceTest(); void ipv4PerformanceTest(); +private: +#ifndef QT_NO_BEARERMANAGEMENT + QNetworkConfigurationManager *netConfMan; + QNetworkConfiguration networkConfiguration; + QSharedPointer networkSession; +#endif }; tst_QTcpServer::tst_QTcpServer() { - Q_SET_DEFAULT_IAP +} + +void tst_QTcpServer::initTestCase() +{ +#ifndef QT_NO_BEARERMANAGEMENT + netConfMan = new QNetworkConfigurationManager(this); + netConfMan->updateConfigurations(); + connect(netConfMan, SIGNAL(updateCompleted()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(10); + networkConfiguration = netConfMan->defaultConfiguration(); + if (networkConfiguration.isValid()) { + networkSession = QSharedPointer(new QNetworkSession(networkConfiguration)); + if (!networkSession->isOpen()) { + networkSession->open(); + QVERIFY(networkSession->waitForOpened(30000)); + } + } else { + QVERIFY(!(netConfMan->capabilities() & QNetworkConfigurationManager::NetworkSessionRequired)); + } +#endif } tst_QTcpServer::~tst_QTcpServer() @@ -179,9 +209,6 @@ void tst_QTcpServer::ipv6LoopbackPerformanceTest() QSKIP("WinCE WM: Not yet supported", SkipAll); #endif -#if defined(Q_OS_SYMBIAN) - QSKIP("Symbian: IPv6 is not yet supported", SkipAll); -#endif QTcpServer server; if (!server.listen(QHostAddress::LocalHostIPv6, 0)) { QVERIFY(server.serverError() == QAbstractSocket::UnsupportedSocketOperationError); -- cgit v0.12 From 9f5809d921f3380c36f482e66184039ec0b0ea93 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 10 Jun 2011 19:23:55 +0100 Subject: Symbian QFileSystemWatcher: fix potential crash An address on the stack was being passed to an asynchronous API. This is changed to use the copy of the data on the heap. Reviewed-by: joao --- src/corelib/io/qfilesystemwatcher_symbian.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qfilesystemwatcher_symbian.cpp b/src/corelib/io/qfilesystemwatcher_symbian.cpp index 6e5e911..63cc4f1 100644 --- a/src/corelib/io/qfilesystemwatcher_symbian.cpp +++ b/src/corelib/io/qfilesystemwatcher_symbian.cpp @@ -62,9 +62,9 @@ QNotifyChangeEvent::QNotifyChangeEvent(RFs &fs, const TDesC &file, failureCount(0) { if (isDir) { - fsSession.NotifyChange(ENotifyEntry, iStatus, file); + fsSession.NotifyChange(ENotifyEntry, iStatus, watchedPath); } else { - fsSession.NotifyChange(ENotifyAll, iStatus, file); + fsSession.NotifyChange(ENotifyAll, iStatus, watchedPath); } CActiveScheduler::Add(this); SetActive(); -- cgit v0.12 From 63729b15d4e08401d383f4d38eee6a290e8ba894 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 26 May 2011 13:56:02 +0100 Subject: Also test http proxy in the QTcpServer benchmark Test the http socket engine: The test server's proxy will connect to the listening socket on the DUT rather than a listening socket on the proxy server as in the SOCKS5 case. Reviewed-by: Markus Goetz --- tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp index 9fc5807..f06c4eb 100644 --- a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp +++ b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp @@ -128,6 +128,7 @@ void tst_QTcpServer::initTestCase_data() QTest::newRow("WithoutProxy") << false << 0; QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy); + QTest::newRow("WithHttpProxy") << true << int(QNetworkProxy::HttpProxy); } void tst_QTcpServer::init() @@ -263,6 +264,11 @@ void tst_QTcpServer::ipv4PerformanceTest() QTcpServer server; QVERIFY(server.listen(probeSocket.localAddress(), 0)); + QFETCH_GLOBAL(int, proxyType); + //For http proxy, only the active connection can be proxied and not the server socket + if (proxyType == QNetworkProxy::HttpProxy) + QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128)); + QTcpSocket clientA; clientA.connectToHost(server.serverAddress(), server.serverPort()); QVERIFY(clientA.waitForConnected(5000)); -- cgit v0.12 From 59f186869c67ab51fccf3aac3153629a1da285b7 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 10 Jun 2011 19:18:03 +0100 Subject: QFileInfoGatherer: call QFileSystemWatcher addPaths from proper thread QFSW isn't thread safe. With removal of the thread inside QFSW, the addPaths and removePaths must be called from the thread the QFSW was created in. Reviewed-by: joao --- src/gui/dialogs/qfileinfogatherer.cpp | 13 +++++++++---- src/gui/dialogs/qfileinfogatherer_p.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp index 315b931..06c9f39 100644 --- a/src/gui/dialogs/qfileinfogatherer.cpp +++ b/src/gui/dialogs/qfileinfogatherer.cpp @@ -170,7 +170,6 @@ void QFileInfoGatherer::updateFile(const QString &filePath) void QFileInfoGatherer::clear() { #ifndef QT_NO_FILESYSTEMWATCHER - QMutexLocker locker(&mutex); watcher->removePaths(watcher->files()); watcher->removePaths(watcher->directories()); #endif @@ -184,11 +183,18 @@ void QFileInfoGatherer::clear() void QFileInfoGatherer::removePath(const QString &path) { #ifndef QT_NO_FILESYSTEMWATCHER - QMutexLocker locker(&mutex); watcher->removePath(path); #endif } +void QFileInfoGatherer::addPath(const QString &path) +{ +#ifndef QT_NO_FILESYSTEMWATCHER + if (!watcher->directories().contains(path)) + watcher->addPath(path); +#endif +} + /* List all files in \a directoryPath @@ -280,10 +286,9 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil { #ifndef QT_NO_FILESYSTEMWATCHER if (files.isEmpty() - && !watcher->directories().contains(path) && !path.isEmpty() && !path.startsWith(QLatin1String("//")) /*don't watch UNC path*/) { - watcher->addPath(path); + QMetaObject::invokeMethod(this, "addPath", Q_ARG(QString, path)); } #endif diff --git a/src/gui/dialogs/qfileinfogatherer_p.h b/src/gui/dialogs/qfileinfogatherer_p.h index 98217c1..bff4f69 100644 --- a/src/gui/dialogs/qfileinfogatherer_p.h +++ b/src/gui/dialogs/qfileinfogatherer_p.h @@ -162,6 +162,7 @@ public: void clear(); void removePath(const QString &path); + Q_INVOKABLE void addPath(const QString& path); QExtendedInformation getInfo(const QFileInfo &info) const; public Q_SLOTS: -- cgit v0.12 From 1b413c8821d127a8541134d7ec5306bf135ff942 Mon Sep 17 00:00:00 2001 From: aavit Date: Tue, 14 Jun 2011 10:37:52 +0200 Subject: Revert "Fix compilation of lrelease on Windows" This reverts commit b9993f684c7ef8c04aa6a0e87af596609957f906. --- tools/linguist/lrelease/lrelease.pro | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/linguist/lrelease/lrelease.pro b/tools/linguist/lrelease/lrelease.pro index 7c416b2..28a741d 100644 --- a/tools/linguist/lrelease/lrelease.pro +++ b/tools/linguist/lrelease/lrelease.pro @@ -9,7 +9,5 @@ include(../../../src/tools/bootstrap/bootstrap.pri) include(../shared/formats.pri) include(../shared/proparser.pri) -win32:LIBS += -ladvapi32 # for registry.cpp in epocroot - target.path=$$[QT_INSTALL_BINS] INSTALLS += target -- cgit v0.12 From bdad106358ae177d1345f5ff85c0e38cfeb5ca90 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 22 Dec 2010 14:42:33 +0100 Subject: Improve toLatin1 x86 SIMD by using a new SSE4.1 instruction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new instruction is PBLENDVB, which creates a result by selecting bytes from one of two registers, depending on whether the mask contains a 1 (0xff) or a zero. The SSE2 code requires three instructions (and, andnot, or). The equivalent Neon instruction is VBSL (bit select). Reviewed-by: Samuel Rødal --- src/corelib/tools/qstring.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 8ad4e70..7cbef98 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -3579,6 +3579,10 @@ static QByteArray toLatin1_helper(const QChar *data, int length) const __m128i signedChunk = _mm_add_epi16(chunk1, signedBitOffset); const __m128i offLimitMask = _mm_cmpgt_epi16(signedChunk, thresholdMask); +#ifdef __SSE4_1__ + chunk1 = _mm_blendv_epi8(chunk1, questionMark, offLimitMask); +#else + // offLimitQuestionMark contains '?' for each 16 bits that was off-limit // the 16 bits that were correct contains zeros const __m128i offLimitQuestionMark = _mm_and_si128(offLimitMask, questionMark); @@ -3589,6 +3593,7 @@ static QByteArray toLatin1_helper(const QChar *data, int length) // merge offLimitQuestionMark and correctBytes to have the result chunk1 = _mm_or_si128(correctBytes, offLimitQuestionMark); +#endif } __m128i chunk2 = _mm_loadu_si128((__m128i*)src); // load @@ -3597,9 +3602,13 @@ static QByteArray toLatin1_helper(const QChar *data, int length) // exactly the same operations as for the previous chunk of data const __m128i signedChunk = _mm_add_epi16(chunk2, signedBitOffset); const __m128i offLimitMask = _mm_cmpgt_epi16(signedChunk, thresholdMask); +#ifdef __SSE4_1__ + chunk2 = _mm_blendv_epi8(chunk2, questionMark, offLimitMask); +#else const __m128i offLimitQuestionMark = _mm_and_si128(offLimitMask, questionMark); const __m128i correctBytes = _mm_andnot_si128(offLimitMask, chunk2); chunk2 = _mm_or_si128(correctBytes, offLimitQuestionMark); +#endif } // pack the two vector to 16 x 8bits elements -- cgit v0.12 From bb3bd601560132df769c32808ae0b36c56d1caab Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 22 Dec 2010 19:52:18 +0100 Subject: Create a function that merges the SSE common code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Samuel Rødal --- src/corelib/tools/qstring.cpp | 73 +++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 7cbef98..0edf291 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -3556,6 +3556,38 @@ bool QString::endsWith(const QChar &c, Qt::CaseSensitivity cs) const Use toLocal8Bit() instead. */ +#if defined(QT_ALWAYS_HAVE_SSE2) +static inline __m128i mergeQuestionMarks(__m128i chunk) +{ + const __m128i questionMark = _mm_set1_epi16('?'); + + // SSE has no compare instruction for unsigned comparison. + // The variables must be shiffted + 0x8000 to be compared + const __m128i signedBitOffset = _mm_set1_epi16(0x8000); + const __m128i thresholdMask = _mm_set1_epi16(0xff + 0x8000); + + const __m128i signedChunk = _mm_add_epi16(chunk, signedBitOffset); + const __m128i offLimitMask = _mm_cmpgt_epi16(signedChunk, thresholdMask); + +# ifdef __SSE4_1__ + // replace the non-Latin 1 characters in the chunk with question marks + chunk = _mm_blendv_epi8(chunk, questionMark, offLimitMask); +# else + // offLimitQuestionMark contains '?' for each 16 bits that was off-limit + // the 16 bits that were correct contains zeros + const __m128i offLimitQuestionMark = _mm_and_si128(offLimitMask, questionMark); + + // correctBytes contains the bytes that were in limit + // the 16 bits that were off limits contains zeros + const __m128i correctBytes = _mm_andnot_si128(offLimitMask, chunk); + + // merge offLimitQuestionMark and correctBytes to have the result + chunk = _mm_or_si128(correctBytes, offLimitQuestionMark); +# endif + return chunk; +} +#endif + static QByteArray toLatin1_helper(const QChar *data, int length) { QByteArray ba; @@ -3566,50 +3598,15 @@ static QByteArray toLatin1_helper(const QChar *data, int length) #if defined(QT_ALWAYS_HAVE_SSE2) if (length >= 16) { const int chunkCount = length >> 4; // divided by 16 - const __m128i questionMark = _mm_set1_epi16('?'); - // SSE has no compare instruction for unsigned comparison. - // The variables must be shiffted + 0x8000 to be compared - const __m128i signedBitOffset = _mm_set1_epi16(0x8000); - const __m128i thresholdMask = _mm_set1_epi16(0xff + 0x8000); + for (int i = 0; i < chunkCount; ++i) { __m128i chunk1 = _mm_loadu_si128((__m128i*)src); // load + chunk1 = mergeQuestionMarks(chunk1); src += 8; - { - // each 16 bit is equal to 0xFF if the source is outside latin 1 (>0xff) - const __m128i signedChunk = _mm_add_epi16(chunk1, signedBitOffset); - const __m128i offLimitMask = _mm_cmpgt_epi16(signedChunk, thresholdMask); - -#ifdef __SSE4_1__ - chunk1 = _mm_blendv_epi8(chunk1, questionMark, offLimitMask); -#else - - // offLimitQuestionMark contains '?' for each 16 bits that was off-limit - // the 16 bits that were correct contains zeros - const __m128i offLimitQuestionMark = _mm_and_si128(offLimitMask, questionMark); - - // correctBytes contains the bytes that were in limit - // the 16 bits that were off limits contains zeros - const __m128i correctBytes = _mm_andnot_si128(offLimitMask, chunk1); - - // merge offLimitQuestionMark and correctBytes to have the result - chunk1 = _mm_or_si128(correctBytes, offLimitQuestionMark); -#endif - } __m128i chunk2 = _mm_loadu_si128((__m128i*)src); // load + chunk2 = mergeQuestionMarks(chunk2); src += 8; - { - // exactly the same operations as for the previous chunk of data - const __m128i signedChunk = _mm_add_epi16(chunk2, signedBitOffset); - const __m128i offLimitMask = _mm_cmpgt_epi16(signedChunk, thresholdMask); -#ifdef __SSE4_1__ - chunk2 = _mm_blendv_epi8(chunk2, questionMark, offLimitMask); -#else - const __m128i offLimitQuestionMark = _mm_and_si128(offLimitMask, questionMark); - const __m128i correctBytes = _mm_andnot_si128(offLimitMask, chunk2); - chunk2 = _mm_or_si128(correctBytes, offLimitQuestionMark); -#endif - } // pack the two vector to 16 x 8bits elements const __m128i result = _mm_packus_epi16(chunk1, chunk2); -- cgit v0.12 From 4746bad937a4abfc413aa56f316fc25115fe0525 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 29 Apr 2011 18:49:11 +0200 Subject: Silence the callgrind warnings in our source code when using gcc 4.6 --- src/testlib/qbenchmarkvalgrind.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/testlib/qbenchmarkvalgrind.cpp b/src/testlib/qbenchmarkvalgrind.cpp index 4b260e8..22c7c37 100644 --- a/src/testlib/qbenchmarkvalgrind.cpp +++ b/src/testlib/qbenchmarkvalgrind.cpp @@ -225,6 +225,12 @@ bool QBenchmarkValgrindUtils::runCallgrindSubProcess(const QStringList &origAppA return finishedOk; } +#if defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) +// the callgrind macros below generate warnings +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#endif + void QBenchmarkCallgrindMeasurer::start() { CALLGRIND_ZERO_STATS; @@ -237,6 +243,11 @@ qint64 QBenchmarkCallgrindMeasurer::checkpoint() return result; } +#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) +// the callgrind macros above generate warnings +# pragma GCC diagnostic pop +#endif + qint64 QBenchmarkCallgrindMeasurer::stop() { return checkpoint(); -- cgit v0.12 From c169eeaf3886955d74b41f150e1035ee93c8c5c4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 16 May 2011 13:21:18 +0200 Subject: Silence the "array out of bounds" warning in GCC 4.6. I can't find anything wrong with this code, so tell GCC simply to shut up. Reviewed-by: Trust Me --- src/opengl/qgl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 2b0c8f8..4e941c6 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -366,6 +366,10 @@ void QGL::setPreferredPaintEngine(QPaintEngine::Type engineType) static inline void transform_point(GLdouble out[4], const GLdouble m[16], const GLdouble in[4]) { +#if defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Warray-bounds" +#endif #define M(row,col) m[col*4+row] out[0] = M(0, 0) * in[0] + M(0, 1) * in[1] + M(0, 2) * in[2] + M(0, 3) * in[3]; @@ -376,6 +380,9 @@ static inline void transform_point(GLdouble out[4], const GLdouble m[16], const out[3] = M(3, 0) * in[0] + M(3, 1) * in[1] + M(3, 2) * in[2] + M(3, 3) * in[3]; #undef M +#if defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) +# pragma GCC diagnostic pop +#endif } static inline GLint qgluProject(GLdouble objx, GLdouble objy, GLdouble objz, -- cgit v0.12 From 524dc28aa9172964622fe1764d1cc97a457b6ed3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 14 Jun 2011 10:41:36 +0200 Subject: Silence a compiler warning about unhandled enum in switch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The value is impossible due to the construct, but the compiler complains nonetheless. So just add a value handled in the switch and a comment letting the reader know that it can't happen. Reviewed-By: Samuel Rødal --- src/gui/painting/qtextureglyphcache.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 4bb4759..fdba9c9 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -308,6 +308,10 @@ QImage QTextureGlyphCache::textureMapForGlyph(glyph_t g, QFixed subPixelPosition format = QFontEngineFT::Format_Mono; imageFormat = QImage::Format_Mono; break; + case Raster_RGBMask: + // impossible condition (see the if-clause above) + // this option is here only to silence a compiler warning + break; }; QFontEngineFT *ft = static_cast (m_current_fontengine); -- cgit v0.12 From 82f32ef0e4e744276a011e30ce99aafa341ea816 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 29 Apr 2011 18:54:16 +0200 Subject: Fix alignment value not handled in ODF We're currently getting this error: src/gui/text/qtextodfwriter.cpp:592:16: error: enumeration value 'AlignBaseline' not handled in switch [-Werror=switch] Solve by making AlignBaseline operate like AlignNormal. Patch suggested by: Thomas Zander Reviewed-By: Thiago Macieira --- src/gui/text/qtextodfwriter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp index 1619c9c..2addc0f 100644 --- a/src/gui/text/qtextodfwriter.cpp +++ b/src/gui/text/qtextodfwriter.cpp @@ -591,6 +591,7 @@ void QTextOdfWriter::writeCharacterFormat(QXmlStreamWriter &writer, QTextCharFor QString value; switch (format.verticalAlignment()) { case QTextCharFormat::AlignMiddle: + case QTextCharFormat::AlignBaseline: case QTextCharFormat::AlignNormal: value = QString::fromLatin1("0%"); break; case QTextCharFormat::AlignSuperScript: value = QString::fromLatin1("super"); break; case QTextCharFormat::AlignSubScript: value = QString::fromLatin1("sub"); break; -- cgit v0.12 From 08d1b0ab26dea5749461a988e6168f9dea6081f3 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 14 Jun 2011 15:41:50 +0100 Subject: Revert "QFileInfoGatherer: call QFileSystemWatcher addPaths from proper thread" This reverts commit 59f186869c67ab51fccf3aac3153629a1da285b7. Introduced a race condition - QFileInfoGatherer needs a more invasive refactor to solve the thread safety problems. --- src/gui/dialogs/qfileinfogatherer.cpp | 13 ++++--------- src/gui/dialogs/qfileinfogatherer_p.h | 1 - 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp index 06c9f39..315b931 100644 --- a/src/gui/dialogs/qfileinfogatherer.cpp +++ b/src/gui/dialogs/qfileinfogatherer.cpp @@ -170,6 +170,7 @@ void QFileInfoGatherer::updateFile(const QString &filePath) void QFileInfoGatherer::clear() { #ifndef QT_NO_FILESYSTEMWATCHER + QMutexLocker locker(&mutex); watcher->removePaths(watcher->files()); watcher->removePaths(watcher->directories()); #endif @@ -183,18 +184,11 @@ void QFileInfoGatherer::clear() void QFileInfoGatherer::removePath(const QString &path) { #ifndef QT_NO_FILESYSTEMWATCHER + QMutexLocker locker(&mutex); watcher->removePath(path); #endif } -void QFileInfoGatherer::addPath(const QString &path) -{ -#ifndef QT_NO_FILESYSTEMWATCHER - if (!watcher->directories().contains(path)) - watcher->addPath(path); -#endif -} - /* List all files in \a directoryPath @@ -286,9 +280,10 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil { #ifndef QT_NO_FILESYSTEMWATCHER if (files.isEmpty() + && !watcher->directories().contains(path) && !path.isEmpty() && !path.startsWith(QLatin1String("//")) /*don't watch UNC path*/) { - QMetaObject::invokeMethod(this, "addPath", Q_ARG(QString, path)); + watcher->addPath(path); } #endif diff --git a/src/gui/dialogs/qfileinfogatherer_p.h b/src/gui/dialogs/qfileinfogatherer_p.h index bff4f69..98217c1 100644 --- a/src/gui/dialogs/qfileinfogatherer_p.h +++ b/src/gui/dialogs/qfileinfogatherer_p.h @@ -162,7 +162,6 @@ public: void clear(); void removePath(const QString &path); - Q_INVOKABLE void addPath(const QString& path); QExtendedInformation getInfo(const QFileInfo &info) const; public Q_SLOTS: -- cgit v0.12 From 49fd95009bc3df7f2da46524245c51dd17ea1907 Mon Sep 17 00:00:00 2001 From: mread Date: Wed, 15 Jun 2011 14:18:08 +0100 Subject: QTBUG-19883 Adding top level TRAP for QThreads on Symbian The native Symbian implementation of QThread in Qt4.8 does not have a top level TRAP, whereas it did in pthreads based implementation in Qt4.7. This causes an incompatibility in the form of a EUSER-CBASE:66 panic for code that attempts to use the cleanup stack without a TRAP of its own. This adds a top level TRAP and std::exception handler to match it and prints out warning information if they ever trigger to provide some diagnostic information which would otherwise be lost. Task-number: QTBUG-19883 Reviewed-by: Laszlo Agocs --- src/corelib/thread/qthread_symbian.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/corelib/thread/qthread_symbian.cpp b/src/corelib/thread/qthread_symbian.cpp index c515ae6..46339a6 100644 --- a/src/corelib/thread/qthread_symbian.cpp +++ b/src/corelib/thread/qthread_symbian.cpp @@ -335,7 +335,15 @@ void *QThreadPrivate::start(void *arg) createEventDispatcher(data); emit thr->started(); - thr->run(); + TRAPD(err, { + try { + thr->run(); + } catch (const std::exception& ex) { + qWarning("QThreadPrivate::start: Thread exited on exception %s", ex.what()); + } + }); + if (err) + qWarning("QThreadPrivate::start: Thread exited on leave %d", err); QThreadPrivate::finish(arg); -- cgit v0.12 From 0cbe134b84f03f6490f6034ddfc0bf69699dd91f Mon Sep 17 00:00:00 2001 From: mread Date: Wed, 15 Jun 2011 14:49:27 +0100 Subject: DEF file updates for Symbian Result of sufficient build, remove_freeze freeze cycles to get Qt urel building cleanly. --- src/s60installs/bwins/QtCoreu.def | 37 +++++ src/s60installs/bwins/QtDeclarativeu.def | 31 ++++ src/s60installs/bwins/QtGuiu.def | 241 ++++++++++++++++--------------- src/s60installs/bwins/QtNetworku.def | 5 + src/s60installs/bwins/QtOpenVGu.def | 1 + src/s60installs/eabi/QtCoreu.def | 8 + src/s60installs/eabi/QtDeclarativeu.def | 58 +++++--- src/s60installs/eabi/QtGuiu.def | 4 + 8 files changed, 248 insertions(+), 137 deletions(-) diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def index f780cc9..58c1c4a 100644 --- a/src/s60installs/bwins/QtCoreu.def +++ b/src/s60installs/bwins/QtCoreu.def @@ -4844,4 +4844,41 @@ EXPORTS ?staticMetaObjectExtraData@QEventTransition@@0UQMetaObjectExtraData@@B @ 4843 NONAME ; struct QMetaObjectExtraData const QEventTransition::staticMetaObjectExtraData ?qt_static_metacall@QEventLoop@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 4844 NONAME ; void QEventLoop::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) ?keys@QProcessEnvironment@@QBE?AVQStringList@@XZ @ 4845 NONAME ; class QStringList QProcessEnvironment::keys(void) const + ?qt_static_metacall@QFutureWatcherBase@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 4846 NONAME ; void QFutureWatcherBase::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) + ?progressValueChanged@QFutureWatcherBase@@IAEXH@Z @ 4847 NONAME ; void QFutureWatcherBase::progressValueChanged(int) + ?qt_metacast@QFutureWatcherBase@@UAEPAXPBD@Z @ 4848 NONAME ; void * QFutureWatcherBase::qt_metacast(char const *) + ?qIsEffectiveTLD@@YA_NABVQString@@@Z @ 4849 NONAME ; bool qIsEffectiveTLD(class QString const &) + ?tr@QFutureWatcherBase@@SA?AVQString@@PBD0@Z @ 4850 NONAME ; class QString QFutureWatcherBase::tr(char const *, char const *) + ?trolltechConf@QCoreApplicationPrivate@@SAPAVQSettings@@XZ @ 4851 NONAME ; class QSettings * QCoreApplicationPrivate::trolltechConf(void) + ?pause@QFutureWatcherBase@@QAEXXZ @ 4852 NONAME ; void QFutureWatcherBase::pause(void) + ?topLevelDomain@QUrl@@QBE?AVQString@@XZ @ 4853 NONAME ; class QString QUrl::topLevelDomain(void) const + ?togglePaused@QFutureWatcherBase@@QAEXXZ @ 4854 NONAME ; void QFutureWatcherBase::togglePaused(void) + ?toRfc4122@QUuid@@QBE?AVQByteArray@@XZ @ 4855 NONAME ; class QByteArray QUuid::toRfc4122(void) const + ?progressRangeChanged@QFutureWatcherBase@@IAEXHH@Z @ 4856 NONAME ; void QFutureWatcherBase::progressRangeChanged(int, int) + ?cancel@QFutureWatcherBase@@QAEXXZ @ 4857 NONAME ; void QFutureWatcherBase::cancel(void) + ?tr@QFutureWatcherBase@@SA?AVQString@@PBD0H@Z @ 4858 NONAME ; class QString QFutureWatcherBase::tr(char const *, char const *, int) + ?toByteArray@QUuid@@QBE?AVQByteArray@@XZ @ 4859 NONAME ; class QByteArray QUuid::toByteArray(void) const + ?runningAnimationCount@QUnifiedTimer@@QAEHXZ @ 4860 NONAME ; int QUnifiedTimer::runningAnimationCount(void) + ?getStaticMetaObject@QFutureWatcherBase@@SAABUQMetaObject@@XZ @ 4861 NONAME ; struct QMetaObject const & QFutureWatcherBase::getStaticMetaObject(void) + ?trUtf8@QFutureWatcherBase@@SA?AVQString@@PBD0H@Z @ 4862 NONAME ; class QString QFutureWatcherBase::trUtf8(char const *, char const *, int) + ?staticMetaObjectExtraData@QFutureWatcherBase@@0UQMetaObjectExtraData@@B @ 4863 NONAME ; struct QMetaObjectExtraData const QFutureWatcherBase::staticMetaObjectExtraData + ?qt_metacall@QFutureWatcherBase@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 4864 NONAME ; int QFutureWatcherBase::qt_metacall(enum QMetaObject::Call, int, void * *) + ?resumed@QFutureWatcherBase@@IAEXXZ @ 4865 NONAME ; void QFutureWatcherBase::resumed(void) + ?setPaused@QFutureWatcherBase@@QAEX_N@Z @ 4866 NONAME ; void QFutureWatcherBase::setPaused(bool) + ?canceled@QFutureWatcherBase@@IAEXXZ @ 4867 NONAME ; void QFutureWatcherBase::canceled(void) + ?progressTextChanged@QFutureWatcherBase@@IAEXABVQString@@@Z @ 4868 NONAME ; void QFutureWatcherBase::progressTextChanged(class QString const &) + ?fromRfc4122@QUuid@@SA?AU1@ABVQByteArray@@@Z @ 4869 NONAME ; struct QUuid QUuid::fromRfc4122(class QByteArray const &) + ?staticMetaObject@QFutureWatcherBase@@2UQMetaObject@@B @ 4870 NONAME ; struct QMetaObject const QFutureWatcherBase::staticMetaObject + ?trUtf8@QFutureWatcherBase@@SA?AVQString@@PBD0@Z @ 4871 NONAME ; class QString QFutureWatcherBase::trUtf8(char const *, char const *) + ?d_func@QFutureWatcherBase@@ABEPBVQFutureWatcherBasePrivate@@XZ @ 4872 NONAME ; class QFutureWatcherBasePrivate const * QFutureWatcherBase::d_func(void) const + ?metaObject@QFutureWatcherBase@@UBEPBUQMetaObject@@XZ @ 4873 NONAME ; struct QMetaObject const * QFutureWatcherBase::metaObject(void) const + ?d_func@QFutureWatcherBase@@AAEPAVQFutureWatcherBasePrivate@@XZ @ 4874 NONAME ; class QFutureWatcherBasePrivate * QFutureWatcherBase::d_func(void) + ?qTopLevelDomain@@YA?AVQString@@ABV1@@Z @ 4875 NONAME ; class QString qTopLevelDomain(class QString const &) + ??0QUuid@@QAE@ABVQByteArray@@@Z @ 4876 NONAME ; QUuid::QUuid(class QByteArray const &) + ?resultReadyAt@QFutureWatcherBase@@IAEXH@Z @ 4877 NONAME ; void QFutureWatcherBase::resultReadyAt(int) + ?paused@QFutureWatcherBase@@IAEXXZ @ 4878 NONAME ; void QFutureWatcherBase::paused(void) + ?finished@QFutureWatcherBase@@IAEXXZ @ 4879 NONAME ; void QFutureWatcherBase::finished(void) + ?resume@QFutureWatcherBase@@QAEXXZ @ 4880 NONAME ; void QFutureWatcherBase::resume(void) + ?resultsReadyAt@QFutureWatcherBase@@IAEXHH@Z @ 4881 NONAME ; void QFutureWatcherBase::resultsReadyAt(int, int) + ?started@QFutureWatcherBase@@IAEXXZ @ 4882 NONAME ; void QFutureWatcherBase::started(void) diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def index 2cfdd22..a976e3f 100644 --- a/src/s60installs/bwins/QtDeclarativeu.def +++ b/src/s60installs/bwins/QtDeclarativeu.def @@ -1923,4 +1923,35 @@ EXPORTS ?staticMetaObjectExtraData@QDeclarativeStateGroup@@0UQMetaObjectExtraData@@B @ 1922 NONAME ; struct QMetaObjectExtraData const QDeclarativeStateGroup::staticMetaObjectExtraData ?staticMetaObjectExtraData@QDeclarativeView@@0UQMetaObjectExtraData@@B @ 1923 NONAME ; struct QMetaObjectExtraData const QDeclarativeView::staticMetaObjectExtraData ?qt_static_metacall@QDeclarativeEngine@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 1924 NONAME ; void QDeclarativeEngine::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) + ?instance@QDeclarativeInspectorService@@SAPAV1@XZ @ 1925 NONAME ; class QDeclarativeInspectorService * QDeclarativeInspectorService::instance(void) + ??_EQDeclarativeInspectorInterface@@UAE@I@Z @ 1926 NONAME ; QDeclarativeInspectorInterface::~QDeclarativeInspectorInterface(unsigned int) + ?qt_static_metacall@QDeclarativeInspectorService@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 1927 NONAME ; void QDeclarativeInspectorService::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) + ?flushCache@QDeclarativePixmap@@SAXXZ @ 1928 NONAME ; void QDeclarativePixmap::flushCache(void) + ??0QDeclarativeDebuggingEnabler@@QAE@XZ @ 1929 NONAME ; QDeclarativeDebuggingEnabler::QDeclarativeDebuggingEnabler(void) + ?addView@QDeclarativeInspectorService@@QAEXPAVQDeclarativeView@@@Z @ 1930 NONAME ; void QDeclarativeInspectorService::addView(class QDeclarativeView *) + ?tr@QDeclarativeInspectorService@@SA?AVQString@@PBD0@Z @ 1931 NONAME ; class QString QDeclarativeInspectorService::tr(char const *, char const *) + ?statusChanged@QDeclarativeInspectorService@@MAEXW4Status@QDeclarativeDebugService@@@Z @ 1932 NONAME ; void QDeclarativeInspectorService::statusChanged(enum QDeclarativeDebugService::Status) + ?waitForReadyRead@QPacketProtocol@@QAE_NH@Z @ 1933 NONAME ; bool QPacketProtocol::waitForReadyRead(int) + ?waitForMessage@QDeclarativeDebugService@@QAE_NXZ @ 1934 NONAME ; bool QDeclarativeDebugService::waitForMessage(void) + ?staticMetaObject@QDeclarativeInspectorService@@2UQMetaObject@@B @ 1935 NONAME ; struct QMetaObject const QDeclarativeInspectorService::staticMetaObject + ?qt_metacast@QDeclarativeInspectorService@@UAEPAXPBD@Z @ 1936 NONAME ; void * QDeclarativeInspectorService::qt_metacast(char const *) + ?waitForMessage@QDeclarativeDebugServer@@QAE_NPAVQDeclarativeDebugService@@@Z @ 1937 NONAME ; bool QDeclarativeDebugServer::waitForMessage(class QDeclarativeDebugService *) + ?sendMessage@QDeclarativeInspectorService@@QAEXABVQByteArray@@@Z @ 1938 NONAME ; void QDeclarativeInspectorService::sendMessage(class QByteArray const &) + ??_EQDeclarativeInspectorService@@UAE@I@Z @ 1939 NONAME ; QDeclarativeInspectorService::~QDeclarativeInspectorService(unsigned int) + ??1QDeclarativeInspectorService@@UAE@XZ @ 1940 NONAME ; QDeclarativeInspectorService::~QDeclarativeInspectorService(void) + ?gotMessage@QDeclarativeInspectorService@@IAEXABVQByteArray@@@Z @ 1941 NONAME ; void QDeclarativeInspectorService::gotMessage(class QByteArray const &) + ?loadInspectorPlugin@QDeclarativeInspectorService@@CAPAVQDeclarativeInspectorInterface@@XZ @ 1942 NONAME ; class QDeclarativeInspectorInterface * QDeclarativeInspectorService::loadInspectorPlugin(void) + ?removeView@QDeclarativeInspectorService@@QAEXPAVQDeclarativeView@@@Z @ 1943 NONAME ; void QDeclarativeInspectorService::removeView(class QDeclarativeView *) + ?trUtf8@QDeclarativeInspectorService@@SA?AVQString@@PBD0@Z @ 1944 NONAME ; class QString QDeclarativeInspectorService::trUtf8(char const *, char const *) + ?metaObject@QDeclarativeInspectorService@@UBEPBUQMetaObject@@XZ @ 1945 NONAME ; struct QMetaObject const * QDeclarativeInspectorService::metaObject(void) const + ?tr@QDeclarativeInspectorService@@SA?AVQString@@PBD0H@Z @ 1946 NONAME ; class QString QDeclarativeInspectorService::tr(char const *, char const *, int) + ?views@QDeclarativeInspectorService@@QBE?AV?$QList@PAVQDeclarativeView@@@@XZ @ 1947 NONAME ; class QList QDeclarativeInspectorService::views(void) const + ??0QDeclarativeInspectorService@@QAE@XZ @ 1948 NONAME ; QDeclarativeInspectorService::QDeclarativeInspectorService(void) + ?getStaticMetaObject@QDeclarativeInspectorService@@SAABUQMetaObject@@XZ @ 1949 NONAME ; struct QMetaObject const & QDeclarativeInspectorService::getStaticMetaObject(void) + ?staticMetaObjectExtraData@QDeclarativeInspectorService@@0UQMetaObjectExtraData@@B @ 1950 NONAME ; struct QMetaObjectExtraData const QDeclarativeInspectorService::staticMetaObjectExtraData + ??0QDeclarativeInspectorInterface@@QAE@XZ @ 1951 NONAME ; QDeclarativeInspectorInterface::QDeclarativeInspectorInterface(void) + ?messageReceived@QDeclarativeInspectorService@@MAEXABVQByteArray@@@Z @ 1952 NONAME ; void QDeclarativeInspectorService::messageReceived(class QByteArray const &) + ?trUtf8@QDeclarativeInspectorService@@SA?AVQString@@PBD0H@Z @ 1953 NONAME ; class QString QDeclarativeInspectorService::trUtf8(char const *, char const *, int) + ??1QDeclarativeInspectorInterface@@UAE@XZ @ 1954 NONAME ; QDeclarativeInspectorInterface::~QDeclarativeInspectorInterface(void) + ?qt_metacall@QDeclarativeInspectorService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1955 NONAME ; int QDeclarativeInspectorService::qt_metacall(enum QMetaObject::Call, int, void * *) diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index f40790b..90bef7b 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -12855,7 +12855,7 @@ EXPORTS ?populate@QTextureGlyphCache@@QAEXPAVQFontEngine@@HPBIPBUQFixedPoint@@@Z @ 12854 NONAME ABSENT ; void QTextureGlyphCache::populate(class QFontEngine *, int, unsigned int const *, struct QFixedPoint const *) ?hasPartialUpdateSupport@QWindowSurface@@UBE_NXZ @ 12855 NONAME ABSENT ; bool QWindowSurface::hasPartialUpdateSupport(void) const ?scroll@QRuntimePixmapData@@UAE_NHHABVQRect@@@Z @ 12856 NONAME ; bool QRuntimePixmapData::scroll(int, int, class QRect const &) - ?qt_draw_glyphs@@YAXPAVQPainter@@PBIPBVQPointF@@H@Z @ 12857 NONAME ; void qt_draw_glyphs(class QPainter *, unsigned int const *, class QPointF const *, int) + ?qt_draw_glyphs@@YAXPAVQPainter@@PBIPBVQPointF@@H@Z @ 12857 NONAME ABSENT ; void qt_draw_glyphs(class QPainter *, unsigned int const *, class QPointF const *, int) ?nativeDisplay@QEgl@@YAHXZ @ 12858 NONAME ; int QEgl::nativeDisplay(void) ?PreDocConstructL@QS60MainApplication@@UAEXXZ @ 12859 NONAME ; void QS60MainApplication::PreDocConstructL(void) ?detach@QStaticText@@AAEXXZ @ 12860 NONAME ; void QStaticText::detach(void) @@ -13201,19 +13201,19 @@ EXPORTS png_write_sig @ 13200 NONAME ?clipEnabledChanged@QBlitterPaintEngine@@UAEXXZ @ 13201 NONAME ; void QBlitterPaintEngine::clipEnabledChanged(void) ?supportsSubPixelPositions@QFontEngine@@UBE_NXZ @ 13202 NONAME ; bool QFontEngine::supportsSubPixelPositions(void) const - ??_EQScrollerProperties@@UAE@I@Z @ 13203 NONAME ; QScrollerProperties::~QScrollerProperties(unsigned int) + ??_EQScrollerProperties@@UAE@I@Z @ 13203 NONAME ABSENT ; QScrollerProperties::~QScrollerProperties(unsigned int) ??_EQFontPrivate@@QAE@I@Z @ 13204 NONAME ABSENT ; QFontPrivate::~QFontPrivate(unsigned int) ??0QMimeSource@@QAE@XZ @ 13205 NONAME ABSENT ; QMimeSource::QMimeSource(void) ??0QStyleFactoryInterface@@QAE@XZ @ 13206 NONAME ABSENT ; QStyleFactoryInterface::QStyleFactoryInterface(void) - ?d_func@QScrollEvent@@AAEPAVQScrollEventPrivate@@XZ @ 13207 NONAME ; class QScrollEventPrivate * QScrollEvent::d_func(void) + ?d_func@QScrollEvent@@AAEPAVQScrollEventPrivate@@XZ @ 13207 NONAME ABSENT ; class QScrollEventPrivate * QScrollEvent::d_func(void) ??0QFileOpenEvent@@QAE@ABV0@@Z @ 13208 NONAME ABSENT ; QFileOpenEvent::QFileOpenEvent(class QFileOpenEvent const &) ??4QStyleOptionViewItemV2@@QAEAAV0@ABV0@@Z @ 13209 NONAME ABSENT ; class QStyleOptionViewItemV2 & QStyleOptionViewItemV2::operator=(class QStyleOptionViewItemV2 const &) ?heightForWidth@QTabWidget@@UBEHH@Z @ 13210 NONAME ; int QTabWidget::heightForWidth(int) const - ??1QFlickGesture@@UAE@XZ @ 13211 NONAME ; QFlickGesture::~QFlickGesture(void) + ??1QFlickGesture@@UAE@XZ @ 13211 NONAME ABSENT ; QFlickGesture::~QFlickGesture(void) ??0QRasterWindowSurface@@QAE@PAVQWidget@@_N@Z @ 13212 NONAME ; QRasterWindowSurface::QRasterWindowSurface(class QWidget *, bool) ?brushChanged@QBlitterPaintEngine@@UAEXXZ @ 13213 NONAME ; void QBlitterPaintEngine::brushChanged(void) ?clip@QBlitterPaintEngine@@UAEXABVQRect@@W4ClipOperation@Qt@@@Z @ 13214 NONAME ; void QBlitterPaintEngine::clip(class QRect const &, enum Qt::ClipOperation) - ?detach@QGlyphs@@AAEXXZ @ 13215 NONAME ; void QGlyphs::detach(void) + ?detach@QGlyphs@@AAEXXZ @ 13215 NONAME ABSENT ; void QGlyphs::detach(void) ?trUtf8@QInternalMimeData@@SA?AVQString@@PBD0@Z @ 13216 NONAME ; class QString QInternalMimeData::trUtf8(char const *, char const *) ??0QShowEvent@@QAE@ABV0@@Z @ 13217 NONAME ABSENT ; QShowEvent::QShowEvent(class QShowEvent const &) ??0QMouseEvent@@QAE@ABV0@@Z @ 13218 NONAME ABSENT ; QMouseEvent::QMouseEvent(class QMouseEvent const &) @@ -13221,20 +13221,20 @@ EXPORTS ??0QActionEvent@@QAE@ABV0@@Z @ 13220 NONAME ABSENT ; QActionEvent::QActionEvent(class QActionEvent const &) ??0QTouchEvent@@QAE@ABV0@@Z @ 13221 NONAME ABSENT ; QTouchEvent::QTouchEvent(class QTouchEvent const &) ?capabilities@QBlittable@@QBE?AV?$QFlags@W4Capability@QBlittable@@@@XZ @ 13222 NONAME ; class QFlags QBlittable::capabilities(void) const - ?setContentPosRange@QScrollPrepareEvent@@QAEXABVQRectF@@@Z @ 13223 NONAME ; void QScrollPrepareEvent::setContentPosRange(class QRectF const &) + ?setContentPosRange@QScrollPrepareEvent@@QAEXABVQRectF@@@Z @ 13223 NONAME ABSENT ; void QScrollPrepareEvent::setContentPosRange(class QRectF const &) ??_EQImageData@@QAE@I@Z @ 13224 NONAME ABSENT ; QImageData::~QImageData(unsigned int) ?swap@QBrush@@QAEXAAV1@@Z @ 13225 NONAME ; void QBrush::swap(class QBrush &) - ?trUtf8@QFlickGesture@@SA?AVQString@@PBD0H@Z @ 13226 NONAME ; class QString QFlickGesture::trUtf8(char const *, char const *, int) + ?trUtf8@QFlickGesture@@SA?AVQString@@PBD0H@Z @ 13226 NONAME ABSENT ; class QString QFlickGesture::trUtf8(char const *, char const *, int) ?fontHintingPreference@QTextCharFormat@@QBE?AW4HintingPreference@QFont@@XZ @ 13227 NONAME ; enum QFont::HintingPreference QTextCharFormat::fontHintingPreference(void) const ?swap@QPixmap@@QAEXAAV1@@Z @ 13228 NONAME ; void QPixmap::swap(class QPixmap &) ??0QBlitterPaintEngine@@QAE@PAVQBlittablePixmapData@@@Z @ 13229 NONAME ; QBlitterPaintEngine::QBlitterPaintEngine(class QBlittablePixmapData *) ?numberPrefix@QTextListFormat@@QBE?AVQString@@XZ @ 13230 NONAME ; class QString QTextListFormat::numberPrefix(void) const - ?setSnapPositionsX@QScroller@@QAEXMM@Z @ 13231 NONAME ; void QScroller::setSnapPositionsX(float, float) - ?scroller@QScroller@@SAPBV1@PBVQObject@@@Z @ 13232 NONAME ; class QScroller const * QScroller::scroller(class QObject const *) - ?qt_metacall@QScroller@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13233 NONAME ; int QScroller::qt_metacall(enum QMetaObject::Call, int, void * *) - ?tr@QFlickGesture@@SA?AVQString@@PBD0@Z @ 13234 NONAME ; class QString QFlickGesture::tr(char const *, char const *) + ?setSnapPositionsX@QScroller@@QAEXMM@Z @ 13231 NONAME ABSENT ; void QScroller::setSnapPositionsX(float, float) + ?scroller@QScroller@@SAPBV1@PBVQObject@@@Z @ 13232 NONAME ABSENT ; class QScroller const * QScroller::scroller(class QObject const *) + ?qt_metacall@QScroller@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13233 NONAME ABSENT ; int QScroller::qt_metacall(enum QMetaObject::Call, int, void * *) + ?tr@QFlickGesture@@SA?AVQString@@PBD0@Z @ 13234 NONAME ABSENT ; class QString QFlickGesture::tr(char const *, char const *) ??4QBezier@@QAEAAV0@ABV0@@Z @ 13235 NONAME ABSENT ; class QBezier & QBezier::operator=(class QBezier const &) - ?setScrollerProperties@QScroller@@QAEXABVQScrollerProperties@@@Z @ 13236 NONAME ; void QScroller::setScrollerProperties(class QScrollerProperties const &) + ?setScrollerProperties@QScroller@@QAEXABVQScrollerProperties@@@Z @ 13236 NONAME ABSENT ; void QScroller::setScrollerProperties(class QScrollerProperties const &) ??0QIconEngineV2@@QAE@XZ @ 13237 NONAME ABSENT ; QIconEngineV2::QIconEngineV2(void) ??4iterator@QTextBlock@@QAEAAV01@ABV01@@Z @ 13238 NONAME ABSENT ; class QTextBlock::iterator & QTextBlock::iterator::operator=(class QTextBlock::iterator const &) ??MQItemSelectionRange@@QBE_NABV0@@Z @ 13239 NONAME ; bool QItemSelectionRange::operator<(class QItemSelectionRange const &) const @@ -13243,11 +13243,11 @@ EXPORTS ??0QIconEngineV2@@QAE@ABV0@@Z @ 13242 NONAME ABSENT ; QIconEngineV2::QIconEngineV2(class QIconEngineV2 const &) ?swap@QImage@@QAEXAAV1@@Z @ 13243 NONAME ; void QImage::swap(class QImage &) ??0QIconEngineFactoryInterfaceV2@@QAE@XZ @ 13244 NONAME ABSENT ; QIconEngineFactoryInterfaceV2::QIconEngineFactoryInterfaceV2(void) - ??0QScroller@@AAE@PAVQObject@@@Z @ 13245 NONAME ; QScroller::QScroller(class QObject *) + ??0QScroller@@AAE@PAVQObject@@@Z @ 13245 NONAME ABSENT ; QScroller::QScroller(class QObject *) ?compositionModeChanged@QBlitterPaintEngine@@UAEXXZ @ 13246 NONAME ; void QBlitterPaintEngine::compositionModeChanged(void) - ?contentPosRange@QScrollPrepareEvent@@QBE?AVQRectF@@XZ @ 13247 NONAME ; class QRectF QScrollPrepareEvent::contentPosRange(void) const - ?grabGesture@QScroller@@SA?AW4GestureType@Qt@@PAVQObject@@W4ScrollerGestureType@1@@Z @ 13248 NONAME ; enum Qt::GestureType QScroller::grabGesture(class QObject *, enum QScroller::ScrollerGestureType) - ??_EQFlickGesture@@UAE@I@Z @ 13249 NONAME ; QFlickGesture::~QFlickGesture(unsigned int) + ?contentPosRange@QScrollPrepareEvent@@QBE?AVQRectF@@XZ @ 13247 NONAME ABSENT ; class QRectF QScrollPrepareEvent::contentPosRange(void) const + ?grabGesture@QScroller@@SA?AW4GestureType@Qt@@PAVQObject@@W4ScrollerGestureType@1@@Z @ 13248 NONAME ABSENT ; enum Qt::GestureType QScroller::grabGesture(class QObject *, enum QScroller::ScrollerGestureType) + ??_EQFlickGesture@@UAE@I@Z @ 13249 NONAME ABSENT ; QFlickGesture::~QFlickGesture(unsigned int) ?drawRects@QBlitterPaintEngine@@UAEXPBVQRectF@@H@Z @ 13250 NONAME ; void QBlitterPaintEngine::drawRects(class QRectF const *, int) ??4QTextLine@@QAEAAV0@ABV0@@Z @ 13251 NONAME ABSENT ; class QTextLine & QTextLine::operator=(class QTextLine const &) ??0QToolBarChangeEvent@@QAE@ABV0@@Z @ 13252 NONAME ABSENT ; QToolBarChangeEvent::QToolBarChangeEvent(class QToolBarChangeEvent const &) @@ -13257,40 +13257,40 @@ EXPORTS ??0QIconEngineFactoryInterface@@QAE@XZ @ 13256 NONAME ABSENT ; QIconEngineFactoryInterface::QIconEngineFactoryInterface(void) ?drawTextItem@QBlitterPaintEngine@@UAEXABVQPointF@@ABVQTextItem@@@Z @ 13257 NONAME ; void QBlitterPaintEngine::drawTextItem(class QPointF const &, class QTextItem const &) ??0QPictureFormatInterface@@QAE@XZ @ 13258 NONAME ABSENT ; QPictureFormatInterface::QPictureFormatInterface(void) - ?trUtf8@QFlickGesture@@SA?AVQString@@PBD0@Z @ 13259 NONAME ; class QString QFlickGesture::trUtf8(char const *, char const *) - ?stop@QScroller@@QAEXXZ @ 13260 NONAME ; void QScroller::stop(void) + ?trUtf8@QFlickGesture@@SA?AVQString@@PBD0@Z @ 13259 NONAME ABSENT ; class QString QFlickGesture::trUtf8(char const *, char const *) + ?stop@QScroller@@QAEXXZ @ 13260 NONAME ABSENT ; void QScroller::stop(void) ?retrieveData@QInternalMimeData@@MBE?AVQVariant@@ABVQString@@W4Type@2@@Z @ 13261 NONAME ; class QVariant QInternalMimeData::retrieveData(class QString const &, enum QVariant::Type) const - ??8QGlyphs@@QBE_NABV0@@Z @ 13262 NONAME ; bool QGlyphs::operator==(class QGlyphs const &) const + ??8QGlyphs@@QBE_NABV0@@Z @ 13262 NONAME ABSENT ; bool QGlyphs::operator==(class QGlyphs const &) const ?drawImage@QBlitterPaintEngine@@UAEXABVQRectF@@ABVQImage@@0V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 13263 NONAME ; void QBlitterPaintEngine::drawImage(class QRectF const &, class QImage const &, class QRectF const &, class QFlags) - ?contentPos@QScrollEvent@@QBE?AVQPointF@@XZ @ 13264 NONAME ; class QPointF QScrollEvent::contentPos(void) const + ?contentPos@QScrollEvent@@QBE?AVQPointF@@XZ @ 13264 NONAME ABSENT ; class QPointF QScrollEvent::contentPos(void) const ?mimeTypes@QAbstractProxyModel@@UBE?AVQStringList@@XZ @ 13265 NONAME ; class QStringList QAbstractProxyModel::mimeTypes(void) const ?createState@QBlitterPaintEngine@@UBEPAVQPainterState@@PAV2@@Z @ 13266 NONAME ; class QPainterState * QBlitterPaintEngine::createState(class QPainterState *) const ?removeItem@QGraphicsGridLayout@@QAEXPAVQGraphicsLayoutItem@@@Z @ 13267 NONAME ; void QGraphicsGridLayout::removeItem(class QGraphicsLayoutItem *) ?clipBoundingRect@QPainter@@QBE?AVQRectF@@XZ @ 13268 NONAME ; class QRectF QPainter::clipBoundingRect(void) const ?formats@QInternalMimeData@@UBE?AVQStringList@@XZ @ 13269 NONAME ; class QStringList QInternalMimeData::formats(void) const - ?stateChanged@QScroller@@IAEXW4State@1@@Z @ 13270 NONAME ; void QScroller::stateChanged(enum QScroller::State) + ?stateChanged@QScroller@@IAEXW4State@1@@Z @ 13270 NONAME ABSENT ; void QScroller::stateChanged(enum QScroller::State) ?raster@QBlitterPaintEngine@@ABEPAVQRasterPaintEngine@@XZ @ 13271 NONAME ; class QRasterPaintEngine * QBlitterPaintEngine::raster(void) const ?sort@QAbstractProxyModel@@UAEXHW4SortOrder@Qt@@@Z @ 13272 NONAME ; void QAbstractProxyModel::sort(int, enum Qt::SortOrder) ?d_func@QBlittable@@AAEPAVQBlittablePrivate@@XZ @ 13273 NONAME ; class QBlittablePrivate * QBlittable::d_func(void) - ?setDefaultScrollerProperties@QScrollerProperties@@SAXABV1@@Z @ 13274 NONAME ; void QScrollerProperties::setDefaultScrollerProperties(class QScrollerProperties const &) + ?setDefaultScrollerProperties@QScrollerProperties@@SAXABV1@@Z @ 13274 NONAME ABSENT ; void QScrollerProperties::setDefaultScrollerProperties(class QScrollerProperties const &) ??_EQPolygon@@QAE@I@Z @ 13275 NONAME ABSENT ; QPolygon::~QPolygon(unsigned int) ?type@QBlitterPaintEngine@@UBE?AW4Type@QPaintEngine@@XZ @ 13276 NONAME ; enum QPaintEngine::Type QBlitterPaintEngine::type(void) const - ?qt_metacast@QScroller@@UAEPAXPBD@Z @ 13277 NONAME ; void * QScroller::qt_metacast(char const *) + ?qt_metacast@QScroller@@UAEPAXPBD@Z @ 13277 NONAME ABSENT ; void * QScroller::qt_metacast(char const *) ??_EQImageReader@@QAE@I@Z @ 13278 NONAME ABSENT ; QImageReader::~QImageReader(unsigned int) ?buddy@QAbstractProxyModel@@UBE?AVQModelIndex@@ABV2@@Z @ 13279 NONAME ; class QModelIndex QAbstractProxyModel::buddy(class QModelIndex const &) const - ?tr@QScroller@@SA?AVQString@@PBD0H@Z @ 13280 NONAME ; class QString QScroller::tr(char const *, char const *, int) + ?tr@QScroller@@SA?AVQString@@PBD0H@Z @ 13280 NONAME ABSENT ; class QString QScroller::tr(char const *, char const *, int) ?fill@QImage@@QAEXABVQColor@@@Z @ 13281 NONAME ; void QImage::fill(class QColor const &) - ?scrollMetric@QScrollerProperties@@QBE?AVQVariant@@W4ScrollMetric@1@@Z @ 13282 NONAME ; class QVariant QScrollerProperties::scrollMetric(enum QScrollerProperties::ScrollMetric) const + ?scrollMetric@QScrollerProperties@@QBE?AVQVariant@@W4ScrollMetric@1@@Z @ 13282 NONAME ABSENT ; class QVariant QScrollerProperties::scrollMetric(enum QScrollerProperties::ScrollMetric) const ?fill@QImage@@QAEXW4GlobalColor@Qt@@@Z @ 13283 NONAME ; void QImage::fill(enum Qt::GlobalColor) ??4QStyleOptionGraphicsItem@@QAEAAV0@ABV0@@Z @ 13284 NONAME ABSENT ; class QStyleOptionGraphicsItem & QStyleOptionGraphicsItem::operator=(class QStyleOptionGraphicsItem const &) ?canFetchMore@QAbstractProxyModel@@UBE_NABVQModelIndex@@@Z @ 13285 NONAME ; bool QAbstractProxyModel::canFetchMore(class QModelIndex const &) const ??4QStyleOptionProgressBarV2@@QAEAAV0@ABV0@@Z @ 13286 NONAME ABSENT ; class QStyleOptionProgressBarV2 & QStyleOptionProgressBarV2::operator=(class QStyleOptionProgressBarV2 const &) - ??1QScroller@@EAE@XZ @ 13287 NONAME ; QScroller::~QScroller(void) - ?setFont@QGlyphs@@QAEXABVQFont@@@Z @ 13288 NONAME ; void QGlyphs::setFont(class QFont const &) - ?startPos@QScrollPrepareEvent@@QBE?AVQPointF@@XZ @ 13289 NONAME ; class QPointF QScrollPrepareEvent::startPos(void) const + ??1QScroller@@EAE@XZ @ 13287 NONAME ABSENT ; QScroller::~QScroller(void) + ?setFont@QGlyphs@@QAEXABVQFont@@@Z @ 13288 NONAME ABSENT ; void QGlyphs::setFont(class QFont const &) + ?startPos@QScrollPrepareEvent@@QBE?AVQPointF@@XZ @ 13289 NONAME ABSENT ; class QPointF QScrollPrepareEvent::startPos(void) const ?resize@QBlittablePixmapData@@UAEXHH@Z @ 13290 NONAME ; void QBlittablePixmapData::resize(int, int) ?setTabsClosable@QMdiArea@@QAEX_N@Z @ 13291 NONAME ; void QMdiArea::setTabsClosable(bool) - ?ensureVisible@QScroller@@QAEXABVQRectF@@MM@Z @ 13292 NONAME ; void QScroller::ensureVisible(class QRectF const &, float, float) + ?ensureVisible@QScroller@@QAEXABVQRectF@@MM@Z @ 13292 NONAME ABSENT ; void QScroller::ensureVisible(class QRectF const &, float, float) ?getText@QInputDialog@@SA?AVQString@@PAVQWidget@@ABV2@1W4EchoMode@QLineEdit@@1PA_NV?$QFlags@W4WindowType@Qt@@@@V?$QFlags@W4InputMethodHint@Qt@@@@@Z @ 13293 NONAME ; class QString QInputDialog::getText(class QWidget *, class QString const &, class QString const &, enum QLineEdit::EchoMode, class QString const &, bool *, class QFlags, class QFlags) ?hasWidthForHeight@QSizePolicy@@QBE_NXZ @ 13294 NONAME ; bool QSizePolicy::hasWidthForHeight(void) const ?transformChanged@QBlitterPaintEngine@@UAEXXZ @ 13295 NONAME ; void QBlitterPaintEngine::transformChanged(void) @@ -13302,50 +13302,50 @@ EXPORTS ??0QShortcutEvent@@QAE@ABV0@@Z @ 13301 NONAME ABSENT ; QShortcutEvent::QShortcutEvent(class QShortcutEvent const &) ?setBlittable@QBlittablePixmapData@@QAEXPAVQBlittable@@@Z @ 13302 NONAME ; void QBlittablePixmapData::setBlittable(class QBlittable *) ?opacityChanged@QBlitterPaintEngine@@UAEXXZ @ 13303 NONAME ; void QBlitterPaintEngine::opacityChanged(void) - ?tr@QFlickGesture@@SA?AVQString@@PBD0H@Z @ 13304 NONAME ; class QString QFlickGesture::tr(char const *, char const *, int) + ?tr@QFlickGesture@@SA?AVQString@@PBD0H@Z @ 13304 NONAME ABSENT ; class QString QFlickGesture::tr(char const *, char const *, int) ??_EQTextCursor@@QAE@I@Z @ 13305 NONAME ABSENT ; QTextCursor::~QTextCursor(unsigned int) - ?createExplicitFontWithName@QFontEngine@@IBE?AVQFont@@ABVQString@@@Z @ 13306 NONAME ; class QFont QFontEngine::createExplicitFontWithName(class QString const &) const + ?createExplicitFontWithName@QFontEngine@@IBE?AVQFont@@ABVQString@@@Z @ 13306 NONAME ABSENT ; class QFont QFontEngine::createExplicitFontWithName(class QString const &) const ?setState@QBlitterPaintEngine@@UAEXPAVQPainterState@@@Z @ 13307 NONAME ; void QBlitterPaintEngine::setState(class QPainterState *) ?clip@QBlitterPaintEngine@@UAEXABVQRegion@@W4ClipOperation@Qt@@@Z @ 13308 NONAME ; void QBlitterPaintEngine::clip(class QRegion const &, enum Qt::ClipOperation) ?subPixelPositionForX@QTextureGlyphCache@@QBE?AUQFixed@@U2@@Z @ 13309 NONAME ; struct QFixed QTextureGlyphCache::subPixelPositionForX(struct QFixed) const ?hasAlphaChannel@QBlittablePixmapData@@UBE_NXZ @ 13310 NONAME ; bool QBlittablePixmapData::hasAlphaChannel(void) const - ?setSnapPositionsX@QScroller@@QAEXABV?$QList@M@@@Z @ 13311 NONAME ; void QScroller::setSnapPositionsX(class QList const &) + ?setSnapPositionsX@QScroller@@QAEXABV?$QList@M@@@Z @ 13311 NONAME ABSENT ; void QScroller::setSnapPositionsX(class QList const &) ?numberSuffix@QTextListFormat@@QBE?AVQString@@XZ @ 13312 NONAME ; class QString QTextListFormat::numberSuffix(void) const - ??HQGlyphs@@ABE?AV0@ABV0@@Z @ 13313 NONAME ; class QGlyphs QGlyphs::operator+(class QGlyphs const &) const + ??HQGlyphs@@ABE?AV0@ABV0@@Z @ 13313 NONAME ABSENT ; class QGlyphs QGlyphs::operator+(class QGlyphs const &) const ??0QGradient@@QAE@ABV0@@Z @ 13314 NONAME ABSENT ; QGradient::QGradient(class QGradient const &) ?tabsMovable@QMdiArea@@QBE_NXZ @ 13315 NONAME ; bool QMdiArea::tabsMovable(void) const ??4QInputMethodEvent@@QAEAAV0@ABV0@@Z @ 13316 NONAME ABSENT ; class QInputMethodEvent & QInputMethodEvent::operator=(class QInputMethodEvent const &) - ?contentPos@QScrollPrepareEvent@@QBE?AVQPointF@@XZ @ 13317 NONAME ; class QPointF QScrollPrepareEvent::contentPos(void) const - ?getStaticMetaObject@QScroller@@SAABUQMetaObject@@XZ @ 13318 NONAME ; struct QMetaObject const & QScroller::getStaticMetaObject(void) + ?contentPos@QScrollPrepareEvent@@QBE?AVQPointF@@XZ @ 13317 NONAME ABSENT ; class QPointF QScrollPrepareEvent::contentPos(void) const + ?getStaticMetaObject@QScroller@@SAABUQMetaObject@@XZ @ 13318 NONAME ABSENT ; struct QMetaObject const & QScroller::getStaticMetaObject(void) ?end@QBlitterPaintEngine@@UAE_NXZ @ 13319 NONAME ; bool QBlitterPaintEngine::end(void) - ??1QScrollerProperties@@UAE@XZ @ 13320 NONAME ; QScrollerProperties::~QScrollerProperties(void) - ??0QFlickGesture@@QAE@PAVQObject@@W4MouseButton@Qt@@0@Z @ 13321 NONAME ; QFlickGesture::QFlickGesture(class QObject *, enum Qt::MouseButton, class QObject *) + ??1QScrollerProperties@@UAE@XZ @ 13320 NONAME ABSENT ; QScrollerProperties::~QScrollerProperties(void) + ??0QFlickGesture@@QAE@PAVQObject@@W4MouseButton@Qt@@0@Z @ 13321 NONAME ABSENT ; QFlickGesture::QFlickGesture(class QObject *, enum Qt::MouseButton, class QObject *) ?fill@QBlitterPaintEngine@@UAEXABVQVectorPath@@ABVQBrush@@@Z @ 13322 NONAME ; void QBlitterPaintEngine::fill(class QVectorPath const &, class QBrush const &) ?drawPixmap@QBlitterPaintEngine@@UAEXABVQRectF@@ABVQPixmap@@0@Z @ 13323 NONAME ; void QBlitterPaintEngine::drawPixmap(class QRectF const &, class QPixmap const &, class QRectF const &) ??0QVector2D@@QAE@ABV0@@Z @ 13324 NONAME ABSENT ; QVector2D::QVector2D(class QVector2D const &) - ?setSnapPositionsY@QScroller@@QAEXABV?$QList@M@@@Z @ 13325 NONAME ; void QScroller::setSnapPositionsY(class QList const &) + ?setSnapPositionsY@QScroller@@QAEXABV?$QList@M@@@Z @ 13325 NONAME ABSENT ; void QScroller::setSnapPositionsY(class QList const &) ??4QStyleOptionFocusRect@@QAEAAV0@ABV0@@Z @ 13326 NONAME ABSENT ; class QStyleOptionFocusRect & QStyleOptionFocusRect::operator=(class QStyleOptionFocusRect const &) ??_EQPen@@QAE@I@Z @ 13327 NONAME ABSENT ; QPen::~QPen(unsigned int) ??_EQKeySequence@@QAE@I@Z @ 13328 NONAME ABSENT ; QKeySequence::~QKeySequence(unsigned int) ?tr@QInternalMimeData@@SA?AVQString@@PBD0H@Z @ 13329 NONAME ; class QString QInternalMimeData::tr(char const *, char const *, int) - ?velocity@QScroller@@QBE?AVQPointF@@XZ @ 13330 NONAME ; class QPointF QScroller::velocity(void) const - ?glyphIndexes@QGlyphs@@QBE?AV?$QVector@I@@XZ @ 13331 NONAME ; class QVector QGlyphs::glyphIndexes(void) const + ?velocity@QScroller@@QBE?AVQPointF@@XZ @ 13330 NONAME ABSENT ; class QPointF QScroller::velocity(void) const + ?glyphIndexes@QGlyphs@@QBE?AV?$QVector@I@@XZ @ 13331 NONAME ABSENT ; class QVector QGlyphs::glyphIndexes(void) const ?get@QFontPrivate@@SAPAV1@ABVQFont@@@Z @ 13332 NONAME ; class QFontPrivate * QFontPrivate::get(class QFont const &) - ?setScrollMetric@QScrollerProperties@@QAEXW4ScrollMetric@1@ABVQVariant@@@Z @ 13333 NONAME ; void QScrollerProperties::setScrollMetric(enum QScrollerProperties::ScrollMetric, class QVariant const &) + ?setScrollMetric@QScrollerProperties@@QAEXW4ScrollMetric@1@ABVQVariant@@@Z @ 13333 NONAME ABSENT ; void QScrollerProperties::setScrollMetric(enum QScrollerProperties::ScrollMetric, class QVariant const &) ??4QGradient@@QAEAAV0@ABV0@@Z @ 13334 NONAME ABSENT ; class QGradient & QGradient::operator=(class QGradient const &) - ??0QScrollEvent@@QAE@ABVQPointF@@0W4ScrollState@0@@Z @ 13335 NONAME ; QScrollEvent::QScrollEvent(class QPointF const &, class QPointF const &, enum QScrollEvent::ScrollState) - ?d_func@QFlickGesture@@AAEPAVQFlickGesturePrivate@@XZ @ 13336 NONAME ; class QFlickGesturePrivate * QFlickGesture::d_func(void) - ?scrollState@QScrollEvent@@QBE?AW4ScrollState@1@XZ @ 13337 NONAME ; enum QScrollEvent::ScrollState QScrollEvent::scrollState(void) const + ??0QScrollEvent@@QAE@ABVQPointF@@0W4ScrollState@0@@Z @ 13335 NONAME ABSENT ; QScrollEvent::QScrollEvent(class QPointF const &, class QPointF const &, enum QScrollEvent::ScrollState) + ?d_func@QFlickGesture@@AAEPAVQFlickGesturePrivate@@XZ @ 13336 NONAME ABSENT ; class QFlickGesturePrivate * QFlickGesture::d_func(void) + ?scrollState@QScrollEvent@@QBE?AW4ScrollState@1@XZ @ 13337 NONAME ABSENT ; enum QScrollEvent::ScrollState QScrollEvent::scrollState(void) const ??0QTextTableFormat@@QAE@ABV0@@Z @ 13338 NONAME ABSENT ; QTextTableFormat::QTextTableFormat(class QTextTableFormat const &) ??_EQImagePixmapCleanupHooks@@QAE@I@Z @ 13339 NONAME ABSENT ; QImagePixmapCleanupHooks::~QImagePixmapCleanupHooks(unsigned int) ?fetchMore@QAbstractProxyModel@@UAEXABVQModelIndex@@@Z @ 13340 NONAME ; void QAbstractProxyModel::fetchMore(class QModelIndex const &) - ?glyphs@QTextLine@@ABE?AV?$QList@VQGlyphs@@@@HH@Z @ 13341 NONAME ; class QList QTextLine::glyphs(int, int) const - ?getStaticMetaObject@QFlickGesture@@SAABUQMetaObject@@XZ @ 13342 NONAME ; struct QMetaObject const & QFlickGesture::getStaticMetaObject(void) - ?setViewportSize@QScrollPrepareEvent@@QAEXABVQSizeF@@@Z @ 13343 NONAME ; void QScrollPrepareEvent::setViewportSize(class QSizeF const &) + ?glyphs@QTextLine@@ABE?AV?$QList@VQGlyphs@@@@HH@Z @ 13341 NONAME ABSENT ; class QList QTextLine::glyphs(int, int) const + ?getStaticMetaObject@QFlickGesture@@SAABUQMetaObject@@XZ @ 13342 NONAME ABSENT ; struct QMetaObject const & QFlickGesture::getStaticMetaObject(void) + ?setViewportSize@QScrollPrepareEvent@@QAEXABVQSizeF@@@Z @ 13343 NONAME ABSENT ; void QScrollPrepareEvent::setViewportSize(class QSizeF const &) ??0QStatusTipEvent@@QAE@ABV0@@Z @ 13344 NONAME ABSENT ; QStatusTipEvent::QStatusTipEvent(class QStatusTipEvent const &) ??0Value@QCss@@QAE@ABU01@@Z @ 13345 NONAME ABSENT ; QCss::Value::Value(struct QCss::Value const &) - ?d_func@QScrollPrepareEvent@@AAEPAVQScrollPrepareEventPrivate@@XZ @ 13346 NONAME ; class QScrollPrepareEventPrivate * QScrollPrepareEvent::d_func(void) - ?overshootDistance@QScrollEvent@@QBE?AVQPointF@@XZ @ 13347 NONAME ; class QPointF QScrollEvent::overshootDistance(void) const + ?d_func@QScrollPrepareEvent@@AAEPAVQScrollPrepareEventPrivate@@XZ @ 13346 NONAME ABSENT ; class QScrollPrepareEventPrivate * QScrollPrepareEvent::d_func(void) + ?overshootDistance@QScrollEvent@@QBE?AVQPointF@@XZ @ 13347 NONAME ABSENT ; class QPointF QScrollEvent::overshootDistance(void) const ?resolveFontFamilyAlias@QFontDatabase@@CA?AVQString@@ABV2@@Z @ 13348 NONAME ; class QString QFontDatabase::resolveFontFamilyAlias(class QString const &) ?alphaRGBMapForGlyph@QFontEngine@@UAE?AVQImage@@IUQFixed@@HABVQTransform@@@Z @ 13349 NONAME ; class QImage QFontEngine::alphaRGBMapForGlyph(unsigned int, struct QFixed, int, class QTransform const &) ??4QSizePolicy@@QAEAAV0@ABV0@@Z @ 13350 NONAME ABSENT ; class QSizePolicy & QSizePolicy::operator=(class QSizePolicy const &) @@ -13362,59 +13362,59 @@ EXPORTS ??6@YA?AVQDebug@@V0@PBVQSymbianEvent@@@Z @ 13361 NONAME ; class QDebug operator<<(class QDebug, class QSymbianEvent const *) ??0QSizePolicy@@QAE@ABV0@@Z @ 13362 NONAME ABSENT ; QSizePolicy::QSizePolicy(class QSizePolicy const &) ?ProcessCommandParametersL@QS60MainAppUi@@UAEHW4TApaCommand@@AAV?$TBuf@$0BAA@@@ABVTDesC8@@@Z @ 13363 NONAME ; int QS60MainAppUi::ProcessCommandParametersL(enum TApaCommand, class TBuf<256> &, class TDesC8 const &) - ?scrollerProperties@QScroller@@QBE?AVQScrollerProperties@@XZ @ 13364 NONAME ; class QScrollerProperties QScroller::scrollerProperties(void) const + ?scrollerProperties@QScroller@@QBE?AVQScrollerProperties@@XZ @ 13364 NONAME ABSENT ; class QScrollerProperties QScroller::scrollerProperties(void) const ??_EQBlittablePixmapData@@UAE@I@Z @ 13365 NONAME ; QBlittablePixmapData::~QBlittablePixmapData(unsigned int) ?mimeData@QAbstractProxyModel@@UBEPAVQMimeData@@ABV?$QList@VQModelIndex@@@@@Z @ 13366 NONAME ; class QMimeData * QAbstractProxyModel::mimeData(class QList const &) const ??4QStyleOptionFrameV2@@QAEAAV0@ABV0@@Z @ 13367 NONAME ABSENT ; class QStyleOptionFrameV2 & QStyleOptionFrameV2::operator=(class QStyleOptionFrameV2 const &) - ??_EQScroller@@UAE@I@Z @ 13368 NONAME ; QScroller::~QScroller(unsigned int) - ??1QScrollPrepareEvent@@UAE@XZ @ 13369 NONAME ; QScrollPrepareEvent::~QScrollPrepareEvent(void) + ??_EQScroller@@UAE@I@Z @ 13368 NONAME ABSENT ; QScroller::~QScroller(unsigned int) + ??1QScrollPrepareEvent@@UAE@XZ @ 13369 NONAME ABSENT ; QScrollPrepareEvent::~QScrollPrepareEvent(void) ??4QVector3D@@QAEAAV0@ABV0@@Z @ 13370 NONAME ABSENT ; class QVector3D & QVector3D::operator=(class QVector3D const &) ?setTabsMovable@QMdiArea@@QAEX_N@Z @ 13371 NONAME ; void QMdiArea::setTabsMovable(bool) ?minimumSizeHint@QRadioButton@@UBE?AVQSize@@XZ @ 13372 NONAME ; class QSize QRadioButton::minimumSizeHint(void) const ??4QStyleOptionQ3DockWindow@@QAEAAV0@ABV0@@Z @ 13373 NONAME ABSENT ; class QStyleOptionQ3DockWindow & QStyleOptionQ3DockWindow::operator=(class QStyleOptionQ3DockWindow const &) - ?qt_metacast@QFlickGesture@@UAEPAXPBD@Z @ 13374 NONAME ; void * QFlickGesture::qt_metacast(char const *) + ?qt_metacast@QFlickGesture@@UAEPAXPBD@Z @ 13374 NONAME ABSENT ; void * QFlickGesture::qt_metacast(char const *) ??_EQFont@@QAE@I@Z @ 13375 NONAME ABSENT ; QFont::~QFont(unsigned int) - ?setPositions@QGlyphs@@QAEXABV?$QVector@VQPointF@@@@@Z @ 13376 NONAME ; void QGlyphs::setPositions(class QVector const &) + ?setPositions@QGlyphs@@QAEXABV?$QVector@VQPointF@@@@@Z @ 13376 NONAME ABSENT ; void QGlyphs::setPositions(class QVector const &) ??4QStyleOptionDockWidget@@QAEAAV0@ABV0@@Z @ 13377 NONAME ABSENT ; class QStyleOptionDockWidget & QStyleOptionDockWidget::operator=(class QStyleOptionDockWidget const &) ??0QPainterState@@QAE@ABV0@@Z @ 13378 NONAME ABSENT ; QPainterState::QPainterState(class QPainterState const &) ??4QStyleOptionFrame@@QAEAAV0@ABV0@@Z @ 13379 NONAME ABSENT ; class QStyleOptionFrame & QStyleOptionFrame::operator=(class QStyleOptionFrame const &) ?drawRects@QBlitterPaintEngine@@UAEXPBVQRect@@H@Z @ 13380 NONAME ; void QBlitterPaintEngine::drawRects(class QRect const *, int) ?fillInPendingGlyphs@QTextureGlyphCache@@QAEXXZ @ 13381 NONAME ; void QTextureGlyphCache::fillInPendingGlyphs(void) - ?metaObject@QFlickGesture@@UBEPBUQMetaObject@@XZ @ 13382 NONAME ; struct QMetaObject const * QFlickGesture::metaObject(void) const + ?metaObject@QFlickGesture@@UBEPBUQMetaObject@@XZ @ 13382 NONAME ABSENT ; struct QMetaObject const * QFlickGesture::metaObject(void) const ?renderHintsChanged@QBlitterPaintEngine@@UAEXXZ @ 13383 NONAME ; void QBlitterPaintEngine::renderHintsChanged(void) ?supportedDropActions@QAbstractProxyModel@@UBE?AV?$QFlags@W4DropAction@Qt@@@@XZ @ 13384 NONAME ; class QFlags QAbstractProxyModel::supportedDropActions(void) const ?fillRect@QBlitterPaintEngine@@UAEXABVQRectF@@ABVQBrush@@@Z @ 13385 NONAME ; void QBlitterPaintEngine::fillRect(class QRectF const &, class QBrush const &) - ?setGlyphIndexes@QGlyphs@@QAEXABV?$QVector@I@@@Z @ 13386 NONAME ; void QGlyphs::setGlyphIndexes(class QVector const &) + ?setGlyphIndexes@QGlyphs@@QAEXABV?$QVector@I@@@Z @ 13386 NONAME ABSENT ; void QGlyphs::setGlyphIndexes(class QVector const &) ?alphaMapBoundingBox@QFontEngine@@UAE?AUglyph_metrics_t@@IABVQTransform@@W4GlyphFormat@1@@Z @ 13387 NONAME ABSENT ; struct glyph_metrics_t QFontEngine::alphaMapBoundingBox(unsigned int, class QTransform const &, enum QFontEngine::GlyphFormat) - ?resendPrepareEvent@QScroller@@QAEXXZ @ 13388 NONAME ; void QScroller::resendPrepareEvent(void) + ?resendPrepareEvent@QScroller@@QAEXXZ @ 13388 NONAME ABSENT ; void QScroller::resendPrepareEvent(void) ??4QTextLength@@QAEAAV0@ABV0@@Z @ 13389 NONAME ABSENT ; class QTextLength & QTextLength::operator=(class QTextLength const &) ??0QHelpEvent@@QAE@ABV0@@Z @ 13390 NONAME ABSENT ; QHelpEvent::QHelpEvent(class QHelpEvent const &) ??0QContextMenuEvent@@QAE@ABV0@@Z @ 13391 NONAME ABSENT ; QContextMenuEvent::QContextMenuEvent(class QContextMenuEvent const &) ?d_func@QBlittable@@ABEPBVQBlittablePrivate@@XZ @ 13392 NONAME ; class QBlittablePrivate const * QBlittable::d_func(void) const ?state@QBlitterPaintEngine@@QBEPBVQPainterState@@XZ @ 13393 NONAME ; class QPainterState const * QBlitterPaintEngine::state(void) const - ??0QScrollPrepareEvent@@QAE@ABVQPointF@@@Z @ 13394 NONAME ; QScrollPrepareEvent::QScrollPrepareEvent(class QPointF const &) + ??0QScrollPrepareEvent@@QAE@ABVQPointF@@@Z @ 13394 NONAME ABSENT ; QScrollPrepareEvent::QScrollPrepareEvent(class QPointF const &) ??0QWhatsThisClickedEvent@@QAE@ABV0@@Z @ 13395 NONAME ABSENT ; QWhatsThisClickedEvent::QWhatsThisClickedEvent(class QWhatsThisClickedEvent const &) ??4QStyleOptionTab@@QAEAAV0@ABV0@@Z @ 13396 NONAME ABSENT ; class QStyleOptionTab & QStyleOptionTab::operator=(class QStyleOptionTab const &) ??0QTabletEvent@@QAE@ABV0@@Z @ 13397 NONAME ABSENT ; QTabletEvent::QTabletEvent(class QTabletEvent const &) - ?scrollTo@QScroller@@QAEXABVQPointF@@H@Z @ 13398 NONAME ; void QScroller::scrollTo(class QPointF const &, int) - ?ungrabGesture@QScroller@@SAXPAVQObject@@@Z @ 13399 NONAME ; void QScroller::ungrabGesture(class QObject *) + ?scrollTo@QScroller@@QAEXABVQPointF@@H@Z @ 13398 NONAME ABSENT ; void QScroller::scrollTo(class QPointF const &, int) + ?ungrabGesture@QScroller@@SAXPAVQObject@@@Z @ 13399 NONAME ABSENT ; void QScroller::ungrabGesture(class QObject *) ??4QItemSelectionRange@@QAEAAV0@ABV0@@Z @ 13400 NONAME ABSENT ; class QItemSelectionRange & QItemSelectionRange::operator=(class QItemSelectionRange const &) - ?clear@QGlyphs@@QAEXXZ @ 13401 NONAME ; void QGlyphs::clear(void) + ?clear@QGlyphs@@QAEXXZ @ 13401 NONAME ABSENT ; void QGlyphs::clear(void) ??_EQStyleOptionViewItemV4@@QAE@I@Z @ 13402 NONAME ABSENT ; QStyleOptionViewItemV4::~QStyleOptionViewItemV4(unsigned int) ??1QBlittablePixmapData@@UAE@XZ @ 13403 NONAME ; QBlittablePixmapData::~QBlittablePixmapData(void) ?formatsHelper@QInternalMimeData@@SA?AVQStringList@@PBVQMimeData@@@Z @ 13404 NONAME ; class QStringList QInternalMimeData::formatsHelper(class QMimeData const *) ?qt_metacast@QInternalMimeData@@UAEPAXPBD@Z @ 13405 NONAME ; void * QInternalMimeData::qt_metacast(char const *) - ?font@QGlyphs@@QBE?AVQFont@@XZ @ 13406 NONAME ; class QFont QGlyphs::font(void) const + ?font@QGlyphs@@QBE?AVQFont@@XZ @ 13406 NONAME ABSENT ; class QFont QGlyphs::font(void) const ?paintEngine@QBlittablePixmapData@@UBEPAVQPaintEngine@@XZ @ 13407 NONAME ; class QPaintEngine * QBlittablePixmapData::paintEngine(void) const - ?unsetDefaultScrollerProperties@QScrollerProperties@@SAXXZ @ 13408 NONAME ; void QScrollerProperties::unsetDefaultScrollerProperties(void) + ?unsetDefaultScrollerProperties@QScrollerProperties@@SAXXZ @ 13408 NONAME ABSENT ; void QScrollerProperties::unsetDefaultScrollerProperties(void) ?hasChildren@QAbstractProxyModel@@UBE_NABVQModelIndex@@@Z @ 13409 NONAME ; bool QAbstractProxyModel::hasChildren(class QModelIndex const &) const ?swap@QPen@@QAEXAAV1@@Z @ 13410 NONAME ; void QPen::swap(class QPen &) ?span@QAbstractProxyModel@@UBE?AVQSize@@ABVQModelIndex@@@Z @ 13411 NONAME ; class QSize QAbstractProxyModel::span(class QModelIndex const &) const ??4QEglProperties@@QAEAAV0@ABV0@@Z @ 13412 NONAME ABSENT ; class QEglProperties & QEglProperties::operator=(class QEglProperties const &) ??0QHoverEvent@@QAE@ABV0@@Z @ 13413 NONAME ABSENT ; QHoverEvent::QHoverEvent(class QHoverEvent const &) ??0QPaintEngineState@@QAE@XZ @ 13414 NONAME ABSENT ; QPaintEngineState::QPaintEngineState(void) - ?setSnapPositionsY@QScroller@@QAEXMM@Z @ 13415 NONAME ; void QScroller::setSnapPositionsY(float, float) - ?d_func@QScrollPrepareEvent@@ABEPBVQScrollPrepareEventPrivate@@XZ @ 13416 NONAME ; class QScrollPrepareEventPrivate const * QScrollPrepareEvent::d_func(void) const + ?setSnapPositionsY@QScroller@@QAEXMM@Z @ 13415 NONAME ABSENT ; void QScroller::setSnapPositionsY(float, float) + ?d_func@QScrollPrepareEvent@@ABEPBVQScrollPrepareEventPrivate@@XZ @ 13416 NONAME ABSENT ; class QScrollPrepareEventPrivate const * QScrollPrepareEvent::d_func(void) const ?textureMapForGlyph@QTextureGlyphCache@@QBE?AVQImage@@IUQFixed@@@Z @ 13417 NONAME ; class QImage QTextureGlyphCache::textureMapForGlyph(unsigned int, struct QFixed) const ??0QKeyEvent@@QAE@ABV0@@Z @ 13418 NONAME ABSENT ; QKeyEvent::QKeyEvent(class QKeyEvent const &) ??0QIconEngine@@QAE@ABV0@@Z @ 13419 NONAME ABSENT ; QIconEngine::QIconEngine(class QIconEngine const &) @@ -13422,13 +13422,13 @@ EXPORTS ?qt_metacall@QInternalMimeData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13421 NONAME ; int QInternalMimeData::qt_metacall(enum QMetaObject::Call, int, void * *) ?lineHeightType@QTextBlockFormat@@QBEHXZ @ 13422 NONAME ; int QTextBlockFormat::lineHeightType(void) const ?hintingPreference@QFont@@QBE?AW4HintingPreference@1@XZ @ 13423 NONAME ; enum QFont::HintingPreference QFont::hintingPreference(void) const - ??0QGlyphs@@QAE@XZ @ 13424 NONAME ; QGlyphs::QGlyphs(void) + ??0QGlyphs@@QAE@XZ @ 13424 NONAME ABSENT ; QGlyphs::QGlyphs(void) ?trUtf8@QInternalMimeData@@SA?AVQString@@PBD0H@Z @ 13425 NONAME ; class QString QInternalMimeData::trUtf8(char const *, char const *, int) ??0QImageIOHandlerFactoryInterface@@QAE@XZ @ 13426 NONAME ABSENT ; QImageIOHandlerFactoryInterface::QImageIOHandlerFactoryInterface(void) ??_EQRegion@@QAE@I@Z @ 13427 NONAME ABSENT ; QRegion::~QRegion(unsigned int) ?begin@QBlitterPaintEngine@@UAE_NPAVQPaintDevice@@@Z @ 13428 NONAME ; bool QBlitterPaintEngine::begin(class QPaintDevice *) ?inFontUcs4@QFontMetricsF@@QBE_NI@Z @ 13429 NONAME ; bool QFontMetricsF::inFontUcs4(unsigned int) const - ?viewportSize@QScrollPrepareEvent@@QBE?AVQSizeF@@XZ @ 13430 NONAME ; class QSizeF QScrollPrepareEvent::viewportSize(void) const + ?viewportSize@QScrollPrepareEvent@@QBE?AVQSizeF@@XZ @ 13430 NONAME ABSENT ; class QSizeF QScrollPrepareEvent::viewportSize(void) const ?markRasterOverlay@QBlittablePixmapData@@QAEXABVQRectF@@@Z @ 13431 NONAME ; void QBlittablePixmapData::markRasterOverlay(class QRectF const &) ?d_func@QBlitterPaintEngine@@AAEPAVQBlitterPaintEnginePrivate@@XZ @ 13432 NONAME ; class QBlitterPaintEnginePrivate * QBlitterPaintEngine::d_func(void) ?setNumberPrefix@QTextListFormat@@QAEXABVQString@@@Z @ 13433 NONAME ; void QTextListFormat::setNumberPrefix(class QString const &) @@ -13440,66 +13440,66 @@ EXPORTS ?qGamma_correct_back_to_linear_cs@@YAXPAVQImage@@@Z @ 13439 NONAME ; void qGamma_correct_back_to_linear_cs(class QImage *) ??0QBitmap@@QAE@ABV0@@Z @ 13440 NONAME ABSENT ; QBitmap::QBitmap(class QBitmap const &) ?clip@QBlitterPaintEngine@@UAEXABVQVectorPath@@W4ClipOperation@Qt@@@Z @ 13441 NONAME ; void QBlitterPaintEngine::clip(class QVectorPath const &, enum Qt::ClipOperation) - ??1QScrollEvent@@UAE@XZ @ 13442 NONAME ; QScrollEvent::~QScrollEvent(void) - ?state@QScroller@@QBE?AW4State@1@XZ @ 13443 NONAME ; enum QScroller::State QScroller::state(void) const - ?positions@QGlyphs@@QBE?AV?$QVector@VQPointF@@@@XZ @ 13444 NONAME ; class QVector QGlyphs::positions(void) const - ?tr@QScroller@@SA?AVQString@@PBD0@Z @ 13445 NONAME ; class QString QScroller::tr(char const *, char const *) + ??1QScrollEvent@@UAE@XZ @ 13442 NONAME ABSENT ; QScrollEvent::~QScrollEvent(void) + ?state@QScroller@@QBE?AW4State@1@XZ @ 13443 NONAME ABSENT ; enum QScroller::State QScroller::state(void) const + ?positions@QGlyphs@@QBE?AV?$QVector@VQPointF@@@@XZ @ 13444 NONAME ABSENT ; class QVector QGlyphs::positions(void) const + ?tr@QScroller@@SA?AVQString@@PBD0@Z @ 13445 NONAME ABSENT ; class QString QScroller::tr(char const *, char const *) ?canReadData@QInternalMimeData@@SA_NABVQString@@@Z @ 13446 NONAME ; bool QInternalMimeData::canReadData(class QString const &) - ?glyphs@QTextLayout@@QBE?AV?$QList@VQGlyphs@@@@XZ @ 13447 NONAME ; class QList QTextLayout::glyphs(void) const + ?glyphs@QTextLayout@@QBE?AV?$QList@VQGlyphs@@@@XZ @ 13447 NONAME ABSENT ; class QList QTextLayout::glyphs(void) const ?leadingSpaceWidth@QTextEngine@@QAE?AUQFixed@@ABUQScriptLine@@@Z @ 13448 NONAME ; struct QFixed QTextEngine::leadingSpaceWidth(struct QScriptLine const &) ??_EQTextFormat@@QAE@I@Z @ 13449 NONAME ABSENT ; QTextFormat::~QTextFormat(unsigned int) ??4QStyleOptionTabWidgetFrame@@QAEAAV0@ABV0@@Z @ 13450 NONAME ABSENT ; class QStyleOptionTabWidgetFrame & QStyleOptionTabWidgetFrame::operator=(class QStyleOptionTabWidgetFrame const &) - ?trUtf8@QScroller@@SA?AVQString@@PBD0H@Z @ 13451 NONAME ; class QString QScroller::trUtf8(char const *, char const *, int) - ?d_func@QFlickGesture@@ABEPBVQFlickGesturePrivate@@XZ @ 13452 NONAME ; class QFlickGesturePrivate const * QFlickGesture::d_func(void) const + ?trUtf8@QScroller@@SA?AVQString@@PBD0H@Z @ 13451 NONAME ABSENT ; class QString QScroller::trUtf8(char const *, char const *, int) + ?d_func@QFlickGesture@@ABEPBVQFlickGesturePrivate@@XZ @ 13452 NONAME ABSENT ; class QFlickGesturePrivate const * QFlickGesture::d_func(void) const ??4QMouseEvent@@QAEAAV0@ABV0@@Z @ 13453 NONAME ABSENT ; class QMouseEvent & QMouseEvent::operator=(class QMouseEvent const &) ??_EQPainter@@QAE@I@Z @ 13454 NONAME ABSENT ; QPainter::~QPainter(unsigned int) ??4QStyleOptionTabBarBaseV2@@QAEAAV0@ABV0@@Z @ 13455 NONAME ABSENT ; class QStyleOptionTabBarBaseV2 & QStyleOptionTabBarBaseV2::operator=(class QStyleOptionTabBarBaseV2 const &) ??4QInputEvent@@QAEAAV0@ABV0@@Z @ 13456 NONAME ABSENT ; class QInputEvent & QInputEvent::operator=(class QInputEvent const &) - ?hasScroller@QScroller@@SA_NPAVQObject@@@Z @ 13457 NONAME ; bool QScroller::hasScroller(class QObject *) + ?hasScroller@QScroller@@SA_NPAVQObject@@@Z @ 13457 NONAME ABSENT ; bool QScroller::hasScroller(class QObject *) ?alphaMapForGlyph@QFontEngine@@UAE?AVQImage@@IUQFixed@@ABVQTransform@@@Z @ 13458 NONAME ; class QImage QFontEngine::alphaMapForGlyph(unsigned int, struct QFixed, class QTransform const &) ??_EQPainterPath@@QAE@I@Z @ 13459 NONAME ABSENT ; QPainterPath::~QPainterPath(unsigned int) ??_EQGlyphs@@QAE@I@Z @ 13460 NONAME ABSENT ; QGlyphs::~QGlyphs(unsigned int) ?fromImage@QBlittablePixmapData@@UAEXABVQImage@@V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 13461 NONAME ; void QBlittablePixmapData::fromImage(class QImage const &, class QFlags) ??0QInternalMimeData@@QAE@XZ @ 13462 NONAME ; QInternalMimeData::QInternalMimeData(void) - ??_EQScrollEvent@@UAE@I@Z @ 13463 NONAME ; QScrollEvent::~QScrollEvent(unsigned int) + ??_EQScrollEvent@@UAE@I@Z @ 13463 NONAME ABSENT ; QScrollEvent::~QScrollEvent(unsigned int) ?features@QRasterWindowSurface@@UBE?AV?$QFlags@W4WindowSurfaceFeature@QWindowSurface@@@@XZ @ 13464 NONAME ; class QFlags QRasterWindowSurface::features(void) const - ??4QGlyphs@@QAEAAV0@ABV0@@Z @ 13465 NONAME ; class QGlyphs & QGlyphs::operator=(class QGlyphs const &) + ??4QGlyphs@@QAEAAV0@ABV0@@Z @ 13465 NONAME ABSENT ; class QGlyphs & QGlyphs::operator=(class QGlyphs const &) ??4QQuaternion@@QAEAAV0@ABV0@@Z @ 13466 NONAME ABSENT ; class QQuaternion & QQuaternion::operator=(class QQuaternion const &) ??4Symbol@QCss@@QAEAAU01@ABU01@@Z @ 13467 NONAME ABSENT ; struct QCss::Symbol & QCss::Symbol::operator=(struct QCss::Symbol const &) ??0QBlittable@@QAE@ABVQSize@@V?$QFlags@W4Capability@QBlittable@@@@@Z @ 13468 NONAME ; QBlittable::QBlittable(class QSize const &, class QFlags) ??0QIconDragEvent@@QAE@ABV0@@Z @ 13469 NONAME ABSENT ; QIconDragEvent::QIconDragEvent(class QIconDragEvent const &) - ?scroller@QScroller@@SAPAV1@PAVQObject@@@Z @ 13470 NONAME ; class QScroller * QScroller::scroller(class QObject *) - ??4QScrollerProperties@@QAEAAV0@ABV0@@Z @ 13471 NONAME ; class QScrollerProperties & QScrollerProperties::operator=(class QScrollerProperties const &) - ?d_func@QScroller@@AAEPAVQScrollerPrivate@@XZ @ 13472 NONAME ; class QScrollerPrivate * QScroller::d_func(void) - ?scrollerPropertiesChanged@QScroller@@IAEXABVQScrollerProperties@@@Z @ 13473 NONAME ; void QScroller::scrollerPropertiesChanged(class QScrollerProperties const &) + ?scroller@QScroller@@SAPAV1@PAVQObject@@@Z @ 13470 NONAME ABSENT ; class QScroller * QScroller::scroller(class QObject *) + ??4QScrollerProperties@@QAEAAV0@ABV0@@Z @ 13471 NONAME ABSENT ; class QScrollerProperties & QScrollerProperties::operator=(class QScrollerProperties const &) + ?d_func@QScroller@@AAEPAVQScrollerPrivate@@XZ @ 13472 NONAME ABSENT ; class QScrollerPrivate * QScroller::d_func(void) + ?scrollerPropertiesChanged@QScroller@@IAEXABVQScrollerProperties@@@Z @ 13473 NONAME ABSENT ; void QScroller::scrollerPropertiesChanged(class QScrollerProperties const &) ?markRasterOverlay@QBlittablePixmapData@@QAEXPBVQRect@@H@Z @ 13474 NONAME ; void QBlittablePixmapData::markRasterOverlay(class QRect const *, int) ?tabsClosable@QMdiArea@@QBE_NXZ @ 13475 NONAME ; bool QMdiArea::tabsClosable(void) const - ?canStartScrollingAt@QAbstractScrollAreaPrivate@@QAE_NABVQPoint@@@Z @ 13476 NONAME ; bool QAbstractScrollAreaPrivate::canStartScrollingAt(class QPoint const &) - ??0QScrollerProperties@@QAE@XZ @ 13477 NONAME ; QScrollerProperties::QScrollerProperties(void) + ?canStartScrollingAt@QAbstractScrollAreaPrivate@@QAE_NABVQPoint@@@Z @ 13476 NONAME ABSENT ; bool QAbstractScrollAreaPrivate::canStartScrollingAt(class QPoint const &) + ??0QScrollerProperties@@QAE@XZ @ 13477 NONAME ABSENT ; QScrollerProperties::QScrollerProperties(void) ?setLineHeight@QTextBlockFormat@@QAEXMH@Z @ 13478 NONAME ; void QTextBlockFormat::setLineHeight(float, int) ?calculateSubPixelPositionCount@QTextureGlyphCache@@IBEHI@Z @ 13479 NONAME ; int QTextureGlyphCache::calculateSubPixelPositionCount(unsigned int) const ??0QTextImageFormat@@QAE@ABV0@@Z @ 13480 NONAME ABSENT ; QTextImageFormat::QTextImageFormat(class QTextImageFormat const &) ??0QMoveEvent@@QAE@ABV0@@Z @ 13481 NONAME ABSENT ; QMoveEvent::QMoveEvent(class QMoveEvent const &) - ?glyphs@QTextFragment@@QBE?AV?$QList@VQGlyphs@@@@XZ @ 13482 NONAME ; class QList QTextFragment::glyphs(void) const + ?glyphs@QTextFragment@@QBE?AV?$QList@VQGlyphs@@@@XZ @ 13482 NONAME ABSENT ; class QList QTextFragment::glyphs(void) const ??0QInputContextFactoryInterface@@QAE@XZ @ 13483 NONAME ABSENT ; QInputContextFactoryInterface::QInputContextFactoryInterface(void) ??0QTextFrameFormat@@QAE@ABV0@@Z @ 13484 NONAME ABSENT ; QTextFrameFormat::QTextFrameFormat(class QTextFrameFormat const &) - ?resetInternalData@QAbstractProxyModel@@IAEXXZ @ 13485 NONAME ; void QAbstractProxyModel::resetInternalData(void) + ?resetInternalData@QAbstractProxyModel@@IAEXXZ @ 13485 NONAME ABSENT ; void QAbstractProxyModel::resetInternalData(void) ??0Symbol@QCss@@QAE@ABU01@@Z @ 13486 NONAME ABSENT ; QCss::Symbol::Symbol(struct QCss::Symbol const &) ?features@QWindowSurface@@UBE?AV?$QFlags@W4WindowSurfaceFeature@QWindowSurface@@@@XZ @ 13487 NONAME ; class QFlags QWindowSurface::features(void) const ?markRasterOverlay@QBlittablePixmapData@@QAEXABVQVectorPath@@@Z @ 13488 NONAME ; void QBlittablePixmapData::markRasterOverlay(class QVectorPath const &) ??4QStyleOptionFrameV3@@QAEAAV0@ABV0@@Z @ 13489 NONAME ABSENT ; class QStyleOptionFrameV3 & QStyleOptionFrameV3::operator=(class QStyleOptionFrameV3 const &) - ?scrollTo@QScroller@@QAEXABVQPointF@@@Z @ 13490 NONAME ; void QScroller::scrollTo(class QPointF const &) + ?scrollTo@QScroller@@QAEXABVQPointF@@@Z @ 13490 NONAME ABSENT ; void QScroller::scrollTo(class QPointF const &) ??0QGraphicsSystem@@QAE@XZ @ 13491 NONAME ABSENT ; QGraphicsSystem::QGraphicsSystem(void) ??4QStyleOptionViewItem@@QAEAAV0@ABV0@@Z @ 13492 NONAME ABSENT ; class QStyleOptionViewItem & QStyleOptionViewItem::operator=(class QStyleOptionViewItem const &) ??4QStyleOptionProgressBar@@QAEAAV0@ABV0@@Z @ 13493 NONAME ABSENT ; class QStyleOptionProgressBar & QStyleOptionProgressBar::operator=(class QStyleOptionProgressBar const &) ?clip@QBlitterPaintEngine@@QAEPBVQClipData@@XZ @ 13494 NONAME ; class QClipData const * QBlitterPaintEngine::clip(void) - ?d_func@QScroller@@ABEPBVQScrollerPrivate@@XZ @ 13495 NONAME ; class QScrollerPrivate const * QScroller::d_func(void) const + ?d_func@QScroller@@ABEPBVQScrollerPrivate@@XZ @ 13495 NONAME ABSENT ; class QScrollerPrivate const * QScroller::d_func(void) const ?setNumberSuffix@QTextListFormat@@QAEXABVQString@@@Z @ 13496 NONAME ; void QTextListFormat::setNumberSuffix(class QString const &) ?swap@QPicture@@QAEXAAV1@@Z @ 13497 NONAME ; void QPicture::swap(class QPicture &) ?swap@QPainterPath@@QAEXAAV1@@Z @ 13498 NONAME ; void QPainterPath::swap(class QPainterPath &) ??4QStyleOptionRubberBand@@QAEAAV0@ABV0@@Z @ 13499 NONAME ABSENT ; class QStyleOptionRubberBand & QStyleOptionRubberBand::operator=(class QStyleOptionRubberBand const &) ?minimumSizeHint@QCheckBox@@UBE?AVQSize@@XZ @ 13500 NONAME ; class QSize QCheckBox::minimumSizeHint(void) const - ?createExplicitFont@QFontEngine@@UBE?AVQFont@@XZ @ 13501 NONAME ; class QFont QFontEngine::createExplicitFont(void) const + ?createExplicitFont@QFontEngine@@UBE?AVQFont@@XZ @ 13501 NONAME ABSENT ; class QFont QFontEngine::createExplicitFont(void) const ?alphaMapForGlyph@QFontEngine@@UAE?AVQImage@@IUQFixed@@@Z @ 13502 NONAME ; class QImage QFontEngine::alphaMapForGlyph(unsigned int, struct QFixed) ?fillTexture@QImageTextureGlyphCache@@UAEXABUCoord@QTextureGlyphCache@@IUQFixed@@@Z @ 13503 NONAME ; void QImageTextureGlyphCache::fillTexture(struct QTextureGlyphCache::Coord const &, unsigned int, struct QFixed) ?swap@QIcon@@QAEXAAV1@@Z @ 13504 NONAME ; void QIcon::swap(class QIcon &) @@ -13510,44 +13510,44 @@ EXPORTS ?openFile@QFileOpenEvent@@QBE_NAAVQFile@@V?$QFlags@W4OpenModeFlag@QIODevice@@@@@Z @ 13509 NONAME ; bool QFileOpenEvent::openFile(class QFile &, class QFlags) const ??_EQBrush@@QAE@I@Z @ 13510 NONAME ABSENT ; QBrush::~QBrush(unsigned int) ??0QApplicationPrivate@@QAE@AAHPAPADW4Type@QApplication@@H@Z @ 13511 NONAME ; QApplicationPrivate::QApplicationPrivate(int &, char * *, enum QApplication::Type, int) - ?handleInput@QScroller@@QAE_NW4Input@1@ABVQPointF@@_J@Z @ 13512 NONAME ; bool QScroller::handleInput(enum QScroller::Input, class QPointF const &, long long) - ??8QScrollerProperties@@QBE_NABV0@@Z @ 13513 NONAME ; bool QScrollerProperties::operator==(class QScrollerProperties const &) const + ?handleInput@QScroller@@QAE_NW4Input@1@ABVQPointF@@_J@Z @ 13512 NONAME ABSENT ; bool QScroller::handleInput(enum QScroller::Input, class QPointF const &, long long) + ??8QScrollerProperties@@QBE_NABV0@@Z @ 13513 NONAME ABSENT ; bool QScrollerProperties::operator==(class QScrollerProperties const &) const ?inFontUcs4@QFontMetrics@@QBE_NI@Z @ 13514 NONAME ; bool QFontMetrics::inFontUcs4(unsigned int) const ??_EQTableWidgetSelectionRange@@QAE@I@Z @ 13515 NONAME ABSENT ; QTableWidgetSelectionRange::~QTableWidgetSelectionRange(unsigned int) ??4QStyleOptionTabBarBase@@QAEAAV0@ABV0@@Z @ 13516 NONAME ABSENT ; class QStyleOptionTabBarBase & QStyleOptionTabBarBase::operator=(class QStyleOptionTabBarBase const &) ??0QTextObjectInterface@@QAE@XZ @ 13517 NONAME ABSENT ; QTextObjectInterface::QTextObjectInterface(void) ?unlock@QBlittable@@QAEXXZ @ 13518 NONAME ; void QBlittable::unlock(void) - ?metaObject@QScroller@@UBEPBUQMetaObject@@XZ @ 13519 NONAME ; struct QMetaObject const * QScroller::metaObject(void) const - ?d_func@QScrollEvent@@ABEPBVQScrollEventPrivate@@XZ @ 13520 NONAME ; class QScrollEventPrivate const * QScrollEvent::d_func(void) const + ?metaObject@QScroller@@UBEPBUQMetaObject@@XZ @ 13519 NONAME ABSENT ; struct QMetaObject const * QScroller::metaObject(void) const + ?d_func@QScrollEvent@@ABEPBVQScrollEventPrivate@@XZ @ 13520 NONAME ABSENT ; class QScrollEventPrivate const * QScrollEvent::d_func(void) const ?swap@QRegion@@QAEXAAV1@@Z @ 13521 NONAME ; void QRegion::swap(class QRegion &) ??0QHideEvent@@QAE@ABV0@@Z @ 13522 NONAME ABSENT ; QHideEvent::QHideEvent(class QHideEvent const &) - ?ensureVisible@QScroller@@QAEXABVQRectF@@MMH@Z @ 13523 NONAME ; void QScroller::ensureVisible(class QRectF const &, float, float, int) - ?qt_metacall@QFlickGesture@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13524 NONAME ; int QFlickGesture::qt_metacall(enum QMetaObject::Call, int, void * *) + ?ensureVisible@QScroller@@QAEXABVQRectF@@MMH@Z @ 13523 NONAME ABSENT ; void QScroller::ensureVisible(class QRectF const &, float, float, int) + ?qt_metacall@QFlickGesture@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13524 NONAME ABSENT ; int QFlickGesture::qt_metacall(enum QMetaObject::Call, int, void * *) ?setItemData@QAbstractProxyModel@@UAE_NABVQModelIndex@@ABV?$QMap@HVQVariant@@@@@Z @ 13525 NONAME ; bool QAbstractProxyModel::setItemData(class QModelIndex const &, class QMap const &) ?getStaticMetaObject@QInternalMimeData@@SAABUQMetaObject@@XZ @ 13526 NONAME ; struct QMetaObject const & QInternalMimeData::getStaticMetaObject(void) ?swap@QPolygonF@@QAEXAAV1@@Z @ 13527 NONAME ; void QPolygonF::swap(class QPolygonF &) ?swap@QPolygon@@QAEXAAV1@@Z @ 13528 NONAME ; void QPolygon::swap(class QPolygon &) - ??_EQScrollPrepareEvent@@UAE@I@Z @ 13529 NONAME ; QScrollPrepareEvent::~QScrollPrepareEvent(unsigned int) + ??_EQScrollPrepareEvent@@UAE@I@Z @ 13529 NONAME ABSENT ; QScrollPrepareEvent::~QScrollPrepareEvent(unsigned int) ?d_func@QBlitterPaintEngine@@ABEPBVQBlitterPaintEnginePrivate@@XZ @ 13530 NONAME ; class QBlitterPaintEnginePrivate const * QBlitterPaintEngine::d_func(void) const - ?pixelPerMeter@QScroller@@QBE?AVQPointF@@XZ @ 13531 NONAME ; class QPointF QScroller::pixelPerMeter(void) const - ?target@QScroller@@QBEPAVQObject@@XZ @ 13532 NONAME ; class QObject * QScroller::target(void) const + ?pixelPerMeter@QScroller@@QBE?AVQPointF@@XZ @ 13531 NONAME ABSENT ; class QPointF QScroller::pixelPerMeter(void) const + ?target@QScroller@@QBEPAVQObject@@XZ @ 13532 NONAME ABSENT ; class QObject * QScroller::target(void) const ?swap@QKeySequence@@QAEXAAV1@@Z @ 13533 NONAME ; void QKeySequence::swap(class QKeySequence &) - ??1QGlyphs@@QAE@XZ @ 13534 NONAME ; QGlyphs::~QGlyphs(void) + ??1QGlyphs@@QAE@XZ @ 13534 NONAME ABSENT ; QGlyphs::~QGlyphs(void) ?lineHeight@QTextBlockFormat@@QBEMXZ @ 13535 NONAME ; float QTextBlockFormat::lineHeight(void) const ?stroke@QBlitterPaintEngine@@UAEXABVQVectorPath@@ABVQPen@@@Z @ 13536 NONAME ; void QBlitterPaintEngine::stroke(class QVectorPath const &, class QPen const &) ?tr@QInternalMimeData@@SA?AVQString@@PBD0@Z @ 13537 NONAME ; class QString QInternalMimeData::tr(char const *, char const *) - ??9QGlyphs@@QBE_NABV0@@Z @ 13538 NONAME ; bool QGlyphs::operator!=(class QGlyphs const &) const + ??9QGlyphs@@QBE_NABV0@@Z @ 13538 NONAME ABSENT ; bool QGlyphs::operator!=(class QGlyphs const &) const ??1QBlittable@@UAE@XZ @ 13539 NONAME ; QBlittable::~QBlittable(void) ??_EQBlitterPaintEngine@@UAE@I@Z @ 13540 NONAME ; QBlitterPaintEngine::~QBlitterPaintEngine(unsigned int) ??0QCloseEvent@@QAE@ABV0@@Z @ 13541 NONAME ABSENT ; QCloseEvent::QCloseEvent(class QCloseEvent const &) - ?grabbedGesture@QScroller@@SA?AW4GestureType@Qt@@PAVQObject@@@Z @ 13542 NONAME ; enum Qt::GestureType QScroller::grabbedGesture(class QObject *) + ?grabbedGesture@QScroller@@SA?AW4GestureType@Qt@@PAVQObject@@@Z @ 13542 NONAME ABSENT ; enum Qt::GestureType QScroller::grabbedGesture(class QObject *) ?buffer@QBlittablePixmapData@@UAEPAVQImage@@XZ @ 13543 NONAME ; class QImage * QBlittablePixmapData::buffer(void) ??0QTextFrameLayoutData@@QAE@XZ @ 13544 NONAME ABSENT ; QTextFrameLayoutData::QTextFrameLayoutData(void) - ?staticMetaObject@QFlickGesture@@2UQMetaObject@@B @ 13545 NONAME ; struct QMetaObject const QFlickGesture::staticMetaObject - ?finalPosition@QScroller@@QBE?AVQPointF@@XZ @ 13546 NONAME ; class QPointF QScroller::finalPosition(void) const + ?staticMetaObject@QFlickGesture@@2UQMetaObject@@B @ 13545 NONAME ABSENT ; struct QMetaObject const QFlickGesture::staticMetaObject + ?finalPosition@QScroller@@QBE?AVQPointF@@XZ @ 13546 NONAME ABSENT ; class QPointF QScroller::finalPosition(void) const ??4QStyleOptionTabWidgetFrameV2@@QAEAAV0@ABV0@@Z @ 13547 NONAME ABSENT ; class QStyleOptionTabWidgetFrameV2 & QStyleOptionTabWidgetFrameV2::operator=(class QStyleOptionTabWidgetFrameV2 const &) ?drawStaticTextItem@QBlitterPaintEngine@@UAEXPAVQStaticTextItem@@@Z @ 13548 NONAME ; void QBlitterPaintEngine::drawStaticTextItem(class QStaticTextItem *) - ??0QGlyphs@@QAE@ABV0@@Z @ 13549 NONAME ; QGlyphs::QGlyphs(class QGlyphs const &) + ??0QGlyphs@@QAE@ABV0@@Z @ 13549 NONAME ABSENT ; QGlyphs::QGlyphs(class QGlyphs const &) ?lock@QBlittable@@QAEPAVQImage@@XZ @ 13550 NONAME ; class QImage * QBlittable::lock(void) ?setFontHintingPreference@QTextCharFormat@@QAEXW4HintingPreference@QFont@@@Z @ 13551 NONAME ; void QTextCharFormat::setFontHintingPreference(enum QFont::HintingPreference) ??4QStyleOptionTabV2@@QAEAAV0@ABV0@@Z @ 13552 NONAME ABSENT ; class QStyleOptionTabV2 & QStyleOptionTabV2::operator=(class QStyleOptionTabV2 const &) @@ -13557,10 +13557,10 @@ EXPORTS ??0QFocusEvent@@QAE@ABV0@@Z @ 13556 NONAME ABSENT ; QFocusEvent::QFocusEvent(class QFocusEvent const &) ??4QStyleOptionQ3ListViewItem@@QAEAAV0@ABV0@@Z @ 13557 NONAME ABSENT ; class QStyleOptionQ3ListViewItem & QStyleOptionQ3ListViewItem::operator=(class QStyleOptionQ3ListViewItem const &) ?markRasterOverlay@QBlittablePixmapData@@QAEXABVQPointF@@ABVQTextItem@@@Z @ 13558 NONAME ; void QBlittablePixmapData::markRasterOverlay(class QPointF const &, class QTextItem const &) - ?trUtf8@QScroller@@SA?AVQString@@PBD0@Z @ 13559 NONAME ; class QString QScroller::trUtf8(char const *, char const *) + ?trUtf8@QScroller@@SA?AVQString@@PBD0@Z @ 13559 NONAME ABSENT ; class QString QScroller::trUtf8(char const *, char const *) ??_EQIcon@@QAE@I@Z @ 13560 NONAME ABSENT ; QIcon::~QIcon(unsigned int) - ??YQGlyphs@@AAEAAV0@ABV0@@Z @ 13561 NONAME ; class QGlyphs & QGlyphs::operator+=(class QGlyphs const &) - ??9QScrollerProperties@@QBE_NABV0@@Z @ 13562 NONAME ; bool QScrollerProperties::operator!=(class QScrollerProperties const &) const + ??YQGlyphs@@AAEAAV0@ABV0@@Z @ 13561 NONAME ABSENT ; class QGlyphs & QGlyphs::operator+=(class QGlyphs const &) + ??9QScrollerProperties@@QBE_NABV0@@Z @ 13562 NONAME ABSENT ; bool QScrollerProperties::operator!=(class QScrollerProperties const &) const ??0QTextListFormat@@QAE@ABV0@@Z @ 13563 NONAME ABSENT ; QTextListFormat::QTextListFormat(class QTextListFormat const &) ?drawEllipse@QBlitterPaintEngine@@UAEXABVQRectF@@@Z @ 13564 NONAME ; void QBlitterPaintEngine::drawEllipse(class QRectF const &) ??0QGuiPlatformPluginInterface@@QAE@XZ @ 13565 NONAME ABSENT ; QGuiPlatformPluginInterface::QGuiPlatformPluginInterface(void) @@ -13568,14 +13568,14 @@ EXPORTS ??0QWheelEvent@@QAE@ABV0@@Z @ 13567 NONAME ABSENT ; QWheelEvent::QWheelEvent(class QWheelEvent const &) ?blittable@QBlittablePixmapData@@QBEPAVQBlittable@@XZ @ 13568 NONAME ; class QBlittable * QBlittablePixmapData::blittable(void) const ?resizeCache@QTextureGlyphCache@@QAEXHH@Z @ 13569 NONAME ; void QTextureGlyphCache::resizeCache(int, int) - ??0QScrollerProperties@@QAE@ABV0@@Z @ 13570 NONAME ; QScrollerProperties::QScrollerProperties(class QScrollerProperties const &) + ??0QScrollerProperties@@QAE@ABV0@@Z @ 13570 NONAME ABSENT ; QScrollerProperties::QScrollerProperties(class QScrollerProperties const &) ??0QWindowStateChangeEvent@@QAE@ABV0@@Z @ 13571 NONAME ABSENT ; QWindowStateChangeEvent::QWindowStateChangeEvent(class QWindowStateChangeEvent const &) ?metaObject@QInternalMimeData@@UBEPBUQMetaObject@@XZ @ 13572 NONAME ; struct QMetaObject const * QInternalMimeData::metaObject(void) const - ?setContentPos@QScrollPrepareEvent@@QAEXABVQPointF@@@Z @ 13573 NONAME ; void QScrollPrepareEvent::setContentPos(class QPointF const &) + ?setContentPos@QScrollPrepareEvent@@QAEXABVQPointF@@@Z @ 13573 NONAME ABSENT ; void QScrollPrepareEvent::setContentPos(class QPointF const &) ??_EQTextEngine@@QAE@I@Z @ 13574 NONAME ABSENT ; QTextEngine::~QTextEngine(unsigned int) ??4QStyleOptionTitleBar@@QAEAAV0@ABV0@@Z @ 13575 NONAME ABSENT ; class QStyleOptionTitleBar & QStyleOptionTitleBar::operator=(class QStyleOptionTitleBar const &) ??4Value@QCss@@QAEAAU01@ABU01@@Z @ 13576 NONAME ABSENT ; struct QCss::Value & QCss::Value::operator=(struct QCss::Value const &) - ?staticMetaObject@QScroller@@2UQMetaObject@@B @ 13577 NONAME ; struct QMetaObject const QScroller::staticMetaObject + ?staticMetaObject@QScroller@@2UQMetaObject@@B @ 13577 NONAME ABSENT ; struct QMetaObject const QScroller::staticMetaObject ?hasFormatHelper@QInternalMimeData@@SA_NABVQString@@PBVQMimeData@@@Z @ 13578 NONAME ; bool QInternalMimeData::hasFormatHelper(class QString const &, class QMimeData const *) ?state@QBlitterPaintEngine@@QAEPAVQPainterState@@XZ @ 13579 NONAME ; class QPainterState * QBlitterPaintEngine::state(void) ?penChanged@QBlitterPaintEngine@@UAEXXZ @ 13580 NONAME ; void QBlitterPaintEngine::penChanged(void) @@ -13589,8 +13589,8 @@ EXPORTS ??0QItemSelection@@QAE@ABV0@@Z @ 13588 NONAME ABSENT ; QItemSelection::QItemSelection(class QItemSelection const &) ?qt_addBitmapToPath@@YAXMMPBEHHHPAVQPainterPath@@@Z @ 13589 NONAME ; void qt_addBitmapToPath(float, float, unsigned char const *, int, int, int, class QPainterPath *) ?staticMetaObject@QInternalMimeData@@2UQMetaObject@@B @ 13590 NONAME ; struct QMetaObject const QInternalMimeData::staticMetaObject - ?activeScrollers@QScroller@@SA?AV?$QList@PAVQScroller@@@@XZ @ 13591 NONAME ; class QList QScroller::activeScrollers(void) - ?drawGlyphs@QPainter@@QAEXABVQPointF@@ABVQGlyphs@@@Z @ 13592 NONAME ; void QPainter::drawGlyphs(class QPointF const &, class QGlyphs const &) + ?activeScrollers@QScroller@@SA?AV?$QList@PAVQScroller@@@@XZ @ 13591 NONAME ABSENT ; class QList QScroller::activeScrollers(void) + ?drawGlyphs@QPainter@@QAEXABVQPointF@@ABVQGlyphs@@@Z @ 13592 NONAME ABSENT ; void QPainter::drawGlyphs(class QPointF const &, class QGlyphs const &) ??4QTextFrameFormat@@QAEAAV0@ABV0@@Z @ 13593 NONAME ABSENT ; class QTextFrameFormat & QTextFrameFormat::operator=(class QTextFrameFormat const &) ?staticMetaObjectExtraData@QStylePlugin@@0UQMetaObjectExtraData@@B @ 13594 NONAME ; struct QMetaObjectExtraData const QStylePlugin::staticMetaObjectExtraData ?staticMetaObjectExtraData@QToolBar@@0UQMetaObjectExtraData@@B @ 13595 NONAME ; struct QMetaObjectExtraData const QToolBar::staticMetaObjectExtraData @@ -13616,7 +13616,7 @@ EXPORTS ?addFile@QZipWriter@@QAEXABVQString@@PAVQIODevice@@@Z @ 13615 NONAME ; void QZipWriter::addFile(class QString const &, class QIODevice *) ?staticMetaObjectExtraData@QDateEdit@@0UQMetaObjectExtraData@@B @ 13616 NONAME ; struct QMetaObjectExtraData const QDateEdit::staticMetaObjectExtraData ?qt_static_metacall@QGuiPlatformPlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13617 NONAME ; void QGuiPlatformPlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) - ?qt_static_metacall@QFlickGesture@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13618 NONAME ; void QFlickGesture::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) + ?qt_static_metacall@QFlickGesture@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13618 NONAME ABSENT ; void QFlickGesture::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) ?staticMetaObjectExtraData@QStyledItemDelegate@@0UQMetaObjectExtraData@@B @ 13619 NONAME ; struct QMetaObjectExtraData const QStyledItemDelegate::staticMetaObjectExtraData ?qt_static_metacall@QWizard@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13620 NONAME ; void QWizard::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) ?qt_static_metacall@QTextControl@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13621 NONAME ; void QTextControl::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) @@ -13661,7 +13661,7 @@ EXPORTS ?staticMetaObjectExtraData@QGraphicsProxyWidget@@0UQMetaObjectExtraData@@B @ 13660 NONAME ; struct QMetaObjectExtraData const QGraphicsProxyWidget::staticMetaObjectExtraData ?qt_static_metacall@QPictureFormatPlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13661 NONAME ; void QPictureFormatPlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) ?qt_static_metacall@QFileDialog@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13662 NONAME ; void QFileDialog::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) - ?staticMetaObjectExtraData@QFlickGesture@@0UQMetaObjectExtraData@@B @ 13663 NONAME ; struct QMetaObjectExtraData const QFlickGesture::staticMetaObjectExtraData + ?staticMetaObjectExtraData@QFlickGesture@@0UQMetaObjectExtraData@@B @ 13663 NONAME ABSENT ; struct QMetaObjectExtraData const QFlickGesture::staticMetaObjectExtraData ?staticMetaObjectExtraData@QWizard@@0UQMetaObjectExtraData@@B @ 13664 NONAME ; struct QMetaObjectExtraData const QWizard::staticMetaObjectExtraData ?qt_static_metacall@QS60Style@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13665 NONAME ; void QS60Style::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) ?qt_static_metacall@QTapGesture@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13666 NONAME ; void QTapGesture::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) @@ -13746,7 +13746,7 @@ EXPORTS ?qt_static_metacall@QHeaderView@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13745 NONAME ; void QHeaderView::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) ?exists@QZipWriter@@QBE_NXZ @ 13746 NONAME ; bool QZipWriter::exists(void) const ?qt_static_metacall@QSyntaxHighlighter@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13747 NONAME ; void QSyntaxHighlighter::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) - ?staticMetaObjectExtraData@QScroller@@0UQMetaObjectExtraData@@B @ 13748 NONAME ; struct QMetaObjectExtraData const QScroller::staticMetaObjectExtraData + ?staticMetaObjectExtraData@QScroller@@0UQMetaObjectExtraData@@B @ 13748 NONAME ABSENT ; struct QMetaObjectExtraData const QScroller::staticMetaObjectExtraData ?qt_static_metacall@QTextFrame@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13749 NONAME ; void QTextFrame::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) ?qt_static_metacall@QDirModel@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13750 NONAME ; void QDirModel::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) ?staticMetaObjectExtraData@QScrollBar@@0UQMetaObjectExtraData@@B @ 13751 NONAME ; struct QMetaObjectExtraData const QScrollBar::staticMetaObjectExtraData @@ -13882,7 +13882,7 @@ EXPORTS ?qt_static_metacall@QGraphicsEffectSource@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13881 NONAME ; void QGraphicsEffectSource::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) ?addSymLink@QZipWriter@@QAEXABVQString@@0@Z @ 13882 NONAME ; void QZipWriter::addSymLink(class QString const &, class QString const &) ?staticMetaObjectExtraData@QGraphicsEffectSource@@0UQMetaObjectExtraData@@B @ 13883 NONAME ; struct QMetaObjectExtraData const QGraphicsEffectSource::staticMetaObjectExtraData - ?qt_static_metacall@QScroller@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13884 NONAME ; void QScroller::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) + ?qt_static_metacall@QScroller@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13884 NONAME ABSENT ; void QScroller::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) ?staticMetaObjectExtraData@QStyle@@0UQMetaObjectExtraData@@B @ 13885 NONAME ; struct QMetaObjectExtraData const QStyle::staticMetaObjectExtraData ?staticMetaObjectExtraData@QTabWidget@@0UQMetaObjectExtraData@@B @ 13886 NONAME ; struct QMetaObjectExtraData const QTabWidget::staticMetaObjectExtraData ?staticMetaObjectExtraData@QPixmapFilter@@0UQMetaObjectExtraData@@B @ 13887 NONAME ; struct QMetaObjectExtraData const QPixmapFilter::staticMetaObjectExtraData @@ -14033,8 +14033,13 @@ EXPORTS ?platformExtension@QGraphicsSystem@@UAEPAVQGraphicsSystemEx@@XZ @ 14032 NONAME ; class QGraphicsSystemEx * QGraphicsSystem::platformExtension(void) ?releaseAllGpuResources@QSymbianGraphicsSystemEx@@UAEXXZ @ 14033 NONAME ; void QSymbianGraphicsSystemEx::releaseAllGpuResources(void) ?cursorMoveStyle@QLineControl@@QBE?AW4CursorMoveStyle@Qt@@XZ @ 14034 NONAME ; enum Qt::CursorMoveStyle QLineControl::cursorMoveStyle(void) const - ?hasBCM2727@QSymbianGraphicsSystemEx@@UAE_NXZ @ 14035 NONAME ; bool QSymbianGraphicsSystemEx::hasBCM2727(void) - ?hasStaticContentsSupport@QWindowSurface@@QBE_NXZ @ 14036 NONAME ; bool QWindowSurface::hasStaticContentsSupport(void) const - ?hasPartialUpdateSupport@QWindowSurface@@QBE_NXZ @ 14037 NONAME ; bool QWindowSurface::hasPartialUpdateSupport(void) const + ?hasBCM2727@QSymbianGraphicsSystemEx@@UAE_NXZ @ 14035 NONAME ABSENT ; bool QSymbianGraphicsSystemEx::hasBCM2727(void) + ?hasStaticContentsSupport@QWindowSurface@@QBE_NXZ @ 14036 NONAME ABSENT ; bool QWindowSurface::hasStaticContentsSupport(void) const + ?hasPartialUpdateSupport@QWindowSurface@@QBE_NXZ @ 14037 NONAME ABSENT ; bool QWindowSurface::hasPartialUpdateSupport(void) const ??0QSymbianGraphicsSystemEx@@QAE@XZ @ 14038 NONAME ABSENT ; QSymbianGraphicsSystemEx::QSymbianGraphicsSystemEx(void) ?hasBCM2727@QSymbianGraphicsSystemEx@@SA_NXZ @ 14039 NONAME ; bool QSymbianGraphicsSystemEx::hasBCM2727(void) + ?getClusterLength@QTextEngine@@AAEHPAGPBUHB_CharAttributes@@HHHPAH@Z @ 14040 NONAME ; int QTextEngine::getClusterLength(unsigned short *, struct HB_CharAttributes const *, int, int, int, int *) + ?positionInLigature@QTextEngine@@QAEHPBUQScriptItem@@HUQFixed@@1H_N@Z @ 14041 NONAME ; int QTextEngine::positionInLigature(struct QScriptItem const *, int, struct QFixed, struct QFixed, int, bool) + ?supportsTransformations@QPaintEngineEx@@UBE_NMABVQTransform@@@Z @ 14042 NONAME ; bool QPaintEngineEx::supportsTransformations(float, class QTransform const &) const + ?drawStaticTextItem@QPaintEngineEx@@UAEXPAVQStaticTextItem@@@Z @ 14043 NONAME ; void QPaintEngineEx::drawStaticTextItem(class QStaticTextItem *) + diff --git a/src/s60installs/bwins/QtNetworku.def b/src/s60installs/bwins/QtNetworku.def index 49538ef..5bc8403 100644 --- a/src/s60installs/bwins/QtNetworku.def +++ b/src/s60installs/bwins/QtNetworku.def @@ -1237,4 +1237,9 @@ EXPORTS ?qt_static_metacall@QBearerEnginePlugin@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 1236 NONAME ; void QBearerEnginePlugin::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) ?staticMetaObjectExtraData@QNetworkConfigurationManager@@0UQMetaObjectExtraData@@B @ 1237 NONAME ; struct QMetaObjectExtraData const QNetworkConfigurationManager::staticMetaObjectExtraData ?qt_static_metacall@QTcpSocket@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 1238 NONAME ; void QTcpSocket::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) + ??0QNetworkProxyQuery@@QAE@ABVQNetworkConfiguration@@ABVQUrl@@W4QueryType@0@@Z @ 1239 NONAME ; QNetworkProxyQuery::QNetworkProxyQuery(class QNetworkConfiguration const &, class QUrl const &, enum QNetworkProxyQuery::QueryType) + ??0QNetworkProxyQuery@@QAE@ABVQNetworkConfiguration@@ABVQString@@H1W4QueryType@0@@Z @ 1240 NONAME ; QNetworkProxyQuery::QNetworkProxyQuery(class QNetworkConfiguration const &, class QString const &, int, class QString const &, enum QNetworkProxyQuery::QueryType) + ?networkConfiguration@QNetworkProxyQuery@@QBE?AVQNetworkConfiguration@@XZ @ 1241 NONAME ; class QNetworkConfiguration QNetworkProxyQuery::networkConfiguration(void) const + ?setNetworkConfiguration@QNetworkProxyQuery@@QAEXABVQNetworkConfiguration@@@Z @ 1242 NONAME ; void QNetworkProxyQuery::setNetworkConfiguration(class QNetworkConfiguration const &) + ??0QNetworkProxyQuery@@QAE@ABVQNetworkConfiguration@@GABVQString@@W4QueryType@0@@Z @ 1243 NONAME ; QNetworkProxyQuery::QNetworkProxyQuery(class QNetworkConfiguration const &, unsigned short, class QString const &, enum QNetworkProxyQuery::QueryType) diff --git a/src/s60installs/bwins/QtOpenVGu.def b/src/s60installs/bwins/QtOpenVGu.def index c9fc813..eb4c7bc 100644 --- a/src/s60installs/bwins/QtOpenVGu.def +++ b/src/s60installs/bwins/QtOpenVGu.def @@ -185,4 +185,5 @@ EXPORTS ?releaseNativeImageHandle@QVGPixmapData@@QAEXXZ @ 184 NONAME ; void QVGPixmapData::releaseNativeImageHandle(void) ?forceToImage@QVGPixmapData@@IAEX_N@Z @ 185 NONAME ; void QVGPixmapData::forceToImage(bool) ?features@QVGWindowSurface@@UBE?AV?$QFlags@W4WindowSurfaceFeature@QWindowSurface@@@@XZ @ 186 NONAME ; class QFlags QVGWindowSurface::features(void) const + ?supportsTransformations@QVGPaintEngine@@UBE_NMABVQTransform@@@Z @ 187 NONAME ; bool QVGPaintEngine::supportsTransformations(float, class QTransform const &) const diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def index d6b2e93..c754d91 100644 --- a/src/s60installs/eabi/QtCoreu.def +++ b/src/s60installs/eabi/QtCoreu.def @@ -4154,4 +4154,12 @@ EXPORTS _ZTVN12QtConcurrent16ThreadEngineBaseE @ 4153 NONAME _ZTVN12QtConcurrent18UnhandledExceptionE @ 4154 NONAME _ZTVN12QtConcurrent9ExceptionE @ 4155 NONAME + _Z15qIsEffectiveTLDRK7QString @ 4156 NONAME + _Z15qTopLevelDomainRK7QString @ 4157 NONAME + _ZN5QUuid11fromRfc4122ERK10QByteArray @ 4158 NONAME + _ZN5QUuidC1ERK10QByteArray @ 4159 NONAME + _ZN5QUuidC2ERK10QByteArray @ 4160 NONAME + _ZNK4QUrl14topLevelDomainEv @ 4161 NONAME + _ZNK5QUuid11toByteArrayEv @ 4162 NONAME + _ZNK5QUuid9toRfc4122Ev @ 4163 NONAME diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def index f0b9ea8..b40ac38 100644 --- a/src/s60installs/eabi/QtDeclarativeu.def +++ b/src/s60installs/eabi/QtDeclarativeu.def @@ -1966,25 +1966,45 @@ EXPORTS _ZN15QPacketProtocol16waitForReadyReadEi @ 1965 NONAME _ZN23QDeclarativeDebugServer14waitForMessageEP24QDeclarativeDebugService @ 1966 NONAME _ZN24QDeclarativeDebugService14waitForMessageEv @ 1967 NONAME - _ZN27QDeclarativeObserverService10gotMessageERK10QByteArray @ 1968 NONAME - _ZN27QDeclarativeObserverService10removeViewEP16QDeclarativeView @ 1969 NONAME - _ZN27QDeclarativeObserverService11qt_metacallEN11QMetaObject4CallEiPPv @ 1970 NONAME - _ZN27QDeclarativeObserverService11qt_metacastEPKc @ 1971 NONAME - _ZN27QDeclarativeObserverService11sendMessageERK10QByteArray @ 1972 NONAME - _ZN27QDeclarativeObserverService13statusChangedEN24QDeclarativeDebugService6StatusE @ 1973 NONAME - _ZN27QDeclarativeObserverService15messageReceivedERK10QByteArray @ 1974 NONAME - _ZN27QDeclarativeObserverService16staticMetaObjectE @ 1975 NONAME DATA 16 - _ZN27QDeclarativeObserverService18loadObserverPluginEv @ 1976 NONAME - _ZN27QDeclarativeObserverService18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv @ 1977 NONAME - _ZN27QDeclarativeObserverService19getStaticMetaObjectEv @ 1978 NONAME - _ZN27QDeclarativeObserverService25staticMetaObjectExtraDataE @ 1979 NONAME DATA 8 - _ZN27QDeclarativeObserverService7addViewEP16QDeclarativeView @ 1980 NONAME - _ZN27QDeclarativeObserverService8instanceEv @ 1981 NONAME - _ZN27QDeclarativeObserverServiceC1Ev @ 1982 NONAME - _ZN27QDeclarativeObserverServiceC2Ev @ 1983 NONAME + _ZN27QDeclarativeObserverService10gotMessageERK10QByteArray @ 1968 NONAME ABSENT + _ZN27QDeclarativeObserverService10removeViewEP16QDeclarativeView @ 1969 NONAME ABSENT + _ZN27QDeclarativeObserverService11qt_metacallEN11QMetaObject4CallEiPPv @ 1970 NONAME ABSENT + _ZN27QDeclarativeObserverService11qt_metacastEPKc @ 1971 NONAME ABSENT + _ZN27QDeclarativeObserverService11sendMessageERK10QByteArray @ 1972 NONAME ABSENT + _ZN27QDeclarativeObserverService13statusChangedEN24QDeclarativeDebugService6StatusE @ 1973 NONAME ABSENT + _ZN27QDeclarativeObserverService15messageReceivedERK10QByteArray @ 1974 NONAME ABSENT + _ZN27QDeclarativeObserverService16staticMetaObjectE @ 1975 NONAME DATA 16 ABSENT + _ZN27QDeclarativeObserverService18loadObserverPluginEv @ 1976 NONAME ABSENT + _ZN27QDeclarativeObserverService18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv @ 1977 NONAME ABSENT + _ZN27QDeclarativeObserverService19getStaticMetaObjectEv @ 1978 NONAME ABSENT + _ZN27QDeclarativeObserverService25staticMetaObjectExtraDataE @ 1979 NONAME DATA 8 ABSENT + _ZN27QDeclarativeObserverService7addViewEP16QDeclarativeView @ 1980 NONAME ABSENT + _ZN27QDeclarativeObserverService8instanceEv @ 1981 NONAME ABSENT + _ZN27QDeclarativeObserverServiceC1Ev @ 1982 NONAME ABSENT + _ZN27QDeclarativeObserverServiceC2Ev @ 1983 NONAME ABSENT _ZN28QDeclarativeDebuggingEnablerC1Ev @ 1984 NONAME _ZN28QDeclarativeDebuggingEnablerC2Ev @ 1985 NONAME - _ZNK27QDeclarativeObserverService10metaObjectEv @ 1986 NONAME - _ZTI27QDeclarativeObserverService @ 1987 NONAME - _ZTV27QDeclarativeObserverService @ 1988 NONAME + _ZNK27QDeclarativeObserverService10metaObjectEv @ 1986 NONAME ABSENT + _ZTI27QDeclarativeObserverService @ 1987 NONAME ABSENT + _ZTV27QDeclarativeObserverService @ 1988 NONAME ABSENT + _ZN18QDeclarativePixmap10flushCacheEv @ 1989 NONAME + _ZN28QDeclarativeInspectorService10gotMessageERK10QByteArray @ 1990 NONAME + _ZN28QDeclarativeInspectorService10removeViewEP16QDeclarativeView @ 1991 NONAME + _ZN28QDeclarativeInspectorService11qt_metacallEN11QMetaObject4CallEiPPv @ 1992 NONAME + _ZN28QDeclarativeInspectorService11qt_metacastEPKc @ 1993 NONAME + _ZN28QDeclarativeInspectorService11sendMessageERK10QByteArray @ 1994 NONAME + _ZN28QDeclarativeInspectorService13statusChangedEN24QDeclarativeDebugService6StatusE @ 1995 NONAME + _ZN28QDeclarativeInspectorService15messageReceivedERK10QByteArray @ 1996 NONAME + _ZN28QDeclarativeInspectorService16staticMetaObjectE @ 1997 NONAME DATA 16 + _ZN28QDeclarativeInspectorService18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv @ 1998 NONAME + _ZN28QDeclarativeInspectorService19getStaticMetaObjectEv @ 1999 NONAME + _ZN28QDeclarativeInspectorService19loadInspectorPluginEv @ 2000 NONAME + _ZN28QDeclarativeInspectorService25staticMetaObjectExtraDataE @ 2001 NONAME DATA 8 + _ZN28QDeclarativeInspectorService7addViewEP16QDeclarativeView @ 2002 NONAME + _ZN28QDeclarativeInspectorService8instanceEv @ 2003 NONAME + _ZN28QDeclarativeInspectorServiceC1Ev @ 2004 NONAME + _ZN28QDeclarativeInspectorServiceC2Ev @ 2005 NONAME + _ZNK28QDeclarativeInspectorService10metaObjectEv @ 2006 NONAME + _ZTI28QDeclarativeInspectorService @ 2007 NONAME + _ZTV28QDeclarativeInspectorService @ 2008 NONAME diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def index fb09d5c..4ca71e9 100644 --- a/src/s60installs/eabi/QtGuiu.def +++ b/src/s60installs/eabi/QtGuiu.def @@ -12749,4 +12749,8 @@ EXPORTS _ZTI17QGraphicsSystemEx @ 12748 NONAME _ZTI24QSymbianGraphicsSystemEx @ 12749 NONAME _ZTV24QSymbianGraphicsSystemEx @ 12750 NONAME + _ZN11QTextEngine16getClusterLengthEPtPK17HB_CharAttributesiiiPi @ 12751 NONAME + _ZN11QTextEngine18positionInLigatureEPK11QScriptItemi6QFixedS3_ib @ 12752 NONAME + _ZN14QPaintEngineEx18drawStaticTextItemEP15QStaticTextItem @ 12753 NONAME + _ZNK14QPaintEngineEx23supportsTransformationsEfRK10QTransform @ 12754 NONAME -- cgit v0.12