summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-09-30 07:25:29 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-09-30 07:25:29 (GMT)
commit78ff58e9dd073dd4182d6ddcb2667ce6dece018e (patch)
treeaf8acfa2f00fb95ac5a715751192f4261ac715de
parent20961991aa3a29e5c3bff1758bbcb5ca85232944 (diff)
parent05ba4a88e3c3237be6e936c780e9fbfec6883b6d (diff)
downloadQt-78ff58e9dd073dd4182d6ddcb2667ce6dece018e.zip
Qt-78ff58e9dd073dd4182d6ddcb2667ce6dece018e.tar.gz
Qt-78ff58e9dd073dd4182d6ddcb2667ce6dece018e.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r--demos/declarative/flickr/flickr-mobile.qml17
-rw-r--r--demos/declarative/flickr/mobile/GridDelegate.qml4
-rw-r--r--demos/declarative/flickr/mobile/ImageDetails.qml5
-rw-r--r--tools/qmldebugger/engine.cpp17
-rw-r--r--tools/qmldebugger/engine.h4
-rw-r--r--tools/qmldebugger/main.cpp9
-rw-r--r--tools/qmldebugger/watchtablemodel.cpp8
-rw-r--r--tools/qmldebugger/watchtablemodel.h2
8 files changed, 52 insertions, 14 deletions
diff --git a/demos/declarative/flickr/flickr-mobile.qml b/demos/declarative/flickr/flickr-mobile.qml
index 9d2a3fb..32f3e37 100644
--- a/demos/declarative/flickr/flickr-mobile.qml
+++ b/demos/declarative/flickr/flickr-mobile.qml
@@ -53,13 +53,26 @@ Item {
onButton2Clicked: if (Screen.inListView == true) Screen.inListView = false; else Screen.inListView = true
}
+ Connection {
+ sender: ImageDetails; signal: "closed()"
+ script: {
+ if (Background.state == "DetailedView") {
+ Background.state = '';
+ ImageDetails.photoUrl = "";
+ }
+ }
+ }
+
states: State {
name: "DetailedView"
PropertyChanges { target: Views; x: -parent.width }
PropertyChanges { target: ToolBar; button1Label: "More..." }
- PropertyChanges { target: ToolBar; onButton1Clicked: { } }
+ PropertyChanges {
+ target: ToolBar
+ onButton1Clicked: if (ImageDetails.state=='') ImageDetails.state='Back'; else ImageDetails.state=''
+ }
PropertyChanges { target: ToolBar; button2Label: "Back" }
- PropertyChanges { target: ToolBar; onButton2Clicked: { } }
+ PropertyChanges { target: ToolBar; onButton2Clicked: ImageDetails.closed() }
}
transitions: Transition {
diff --git a/demos/declarative/flickr/mobile/GridDelegate.qml b/demos/declarative/flickr/mobile/GridDelegate.qml
index 890e020..19369b2 100644
--- a/demos/declarative/flickr/mobile/GridDelegate.qml
+++ b/demos/declarative/flickr/mobile/GridDelegate.qml
@@ -44,8 +44,8 @@
PropertyChanges { target: ScaleMe; scale: 1 }
},
State {
- name: "Details"; extend: "Show"
- //PropertyChanges { target: ImageDetails; z: 2 }
+ name: "Details"
+ PropertyChanges { target: ScaleMe; scale: 1 }
ParentChange { target: Wrapper; parent: ImageDetails.frontContainer }
PropertyChanges { target: Wrapper; x: 20; y: 60; z: 1000 }
PropertyChanges { target: Background; state: "DetailedView" }
diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml
index 617fe40..c55ab50 100644
--- a/demos/declarative/flickr/mobile/ImageDetails.qml
+++ b/demos/declarative/flickr/mobile/ImageDetails.qml
@@ -32,11 +32,6 @@ Flipable {
color: "black"; opacity: 0.4
}
- Connection {
- sender: ToolBar; signal: "button1Clicked()"
- script: if (Container.state=='') Container.state='Back'; else Container.state=''
- }
-
Column {
spacing: 10
anchors {
diff --git a/tools/qmldebugger/engine.cpp b/tools/qmldebugger/engine.cpp
index fedae6b..321f5e0 100644
--- a/tools/qmldebugger/engine.cpp
+++ b/tools/qmldebugger/engine.cpp
@@ -180,8 +180,9 @@ EnginePane::EnginePane(QmlDebugConnection *client, QWidget *parent)
QObject::connect(m_engineView->root(), SIGNAL(engineClicked(int)),
this, SLOT(engineSelected(int)));
QObject::connect(m_engineView->root(), SIGNAL(refreshEngines()),
- this, SLOT(queryEngines()));
+ this, SLOT(refreshEngines()));
+ m_engineView->setVisible(false);
layout->addWidget(m_engineView);
QSplitter *splitter = new QSplitter;
@@ -421,11 +422,16 @@ void EnginePane::buildTree(const QmlDebugObjectReference &obj, QTreeWidgetItem *
buildTree(obj.children().at(ii), item);
}
-void EnginePane::queryEngines()
+void EnginePane::refreshEngines()
{
if (m_engines)
return;
+ QList<QmlDebugWatch *> watches = m_watchTableModel->watches();
+ for (int i=0; i<watches.count(); i++)
+ m_client.removeWatch(watches[i]);
+ qDeleteAll(watches);
+
m_engines = m_client.queryAvailableEngines(this);
if (!m_engines->isWaiting())
enginesChanged();
@@ -442,11 +448,18 @@ void EnginePane::enginesChanged()
QList<QmlDebugEngineReference> engines = m_engines->engines();
delete m_engines; m_engines = 0;
+ if (engines.isEmpty())
+ qWarning("qmldebugger: no engines found!");
+
for (int ii = 0; ii < engines.count(); ++ii)
m_engineItems << new DebuggerEngineItem(engines.at(ii).name(),
engines.at(ii).debugId());
m_engineView->rootContext()->setContextProperty("engines", qVariantFromValue(&m_engineItems));
+
+ m_engineView->setVisible(m_engineItems.count() > 1);
+ if (m_engineItems.count() == 1)
+ engineSelected(qobject_cast<DebuggerEngineItem*>(m_engineItems.at(0))->engineId());
}
void EnginePane::fetchObject(int id)
diff --git a/tools/qmldebugger/engine.h b/tools/qmldebugger/engine.h
index 62fc6fb..c7707ed 100644
--- a/tools/qmldebugger/engine.h
+++ b/tools/qmldebugger/engine.h
@@ -32,8 +32,10 @@ Q_OBJECT
public:
EnginePane(QmlDebugConnection *, QWidget *parent = 0);
+public slots:
+ void refreshEngines();
+
private slots:
- void queryEngines();
void enginesChanged();
void queryContext(int);
diff --git a/tools/qmldebugger/main.cpp b/tools/qmldebugger/main.cpp
index a37a437..7fabfb7 100644
--- a/tools/qmldebugger/main.cpp
+++ b/tools/qmldebugger/main.cpp
@@ -7,6 +7,7 @@
#include <QtCore/qdebug.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qdatastream.h>
+#include <QtCore/qtimer.h>
#include "canvasframerate.h"
#include "engine.h"
#include <QVBoxLayout>
@@ -35,6 +36,8 @@ private:
QSpinBox *m_port;
QPushButton *m_connectButton;
QPushButton *m_disconnectButton;
+
+ EnginePane *m_enginePane;
};
Shell::Shell(QWidget *parent)
@@ -74,8 +77,8 @@ Shell::Shell(QWidget *parent)
CanvasFrameRate *cfr = new CanvasFrameRate(&client, this);
tabs->addTab(cfr, tr("Frame Rate"));
- EnginePane *ep = new EnginePane(&client, this);
- tabs->addTab(ep, tr("QML Engine"));
+ m_enginePane = new EnginePane(&client, this);
+ tabs->addTab(m_enginePane, tr("QML Engine"));
QObject::connect(&client, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(connectionStateChanged()));
connectionStateChanged();
@@ -104,6 +107,8 @@ void Shell::connectionStateChanged()
m_connectionState->setText(tr("Connected"));
m_connectButton->setEnabled(false);
m_disconnectButton->setEnabled(true);
+
+ QTimer::singleShot(0, m_enginePane, SLOT(refreshEngines()));
break;
case QAbstractSocket::ClosingState:
m_connectionState->setText(tr("Closing"));
diff --git a/tools/qmldebugger/watchtablemodel.cpp b/tools/qmldebugger/watchtablemodel.cpp
index 2fed199..9d3ca1e 100644
--- a/tools/qmldebugger/watchtablemodel.cpp
+++ b/tools/qmldebugger/watchtablemodel.cpp
@@ -87,6 +87,14 @@ QmlDebugWatch *WatchTableModel::findWatch(int objectDebugId, const QString &prop
return 0;
}
+QList<QmlDebugWatch *> WatchTableModel::watches() const
+{
+ QList<QmlDebugWatch *> watches;
+ for (int i=0; i<m_columns.count(); i++)
+ watches << m_columns[i].watch;
+ return watches;
+}
+
int WatchTableModel::rowCount(const QModelIndex &) const
{
return m_values.count();
diff --git a/tools/qmldebugger/watchtablemodel.h b/tools/qmldebugger/watchtablemodel.h
index ee99920..306b9d8 100644
--- a/tools/qmldebugger/watchtablemodel.h
+++ b/tools/qmldebugger/watchtablemodel.h
@@ -22,6 +22,8 @@ public:
QmlDebugWatch *findWatch(int column) const;
QmlDebugWatch *findWatch(int objectDebugId, const QString &property) const;
+ QList<QmlDebugWatch *> watches() const;
+
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;