summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2009-10-22 01:51:59 (GMT)
committerBea Lam <bea.lam@nokia.com>2009-10-22 01:51:59 (GMT)
commitd0f965f1bde20babbb0574007f9cf8439b955a9b (patch)
tree75dacd788f0bbfc727bc2a1e4dafcc62c7ee1834
parent0cf015f746f42fa5c4a5bbb98df07eed8c0ec30a (diff)
downloadQt-d0f965f1bde20babbb0574007f9cf8439b955a9b.zip
Qt-d0f965f1bde20babbb0574007f9cf8439b955a9b.tar.gz
Qt-d0f965f1bde20babbb0574007f9cf8439b955a9b.tar.bz2
Allow canvas sizehint to be configurable and fix signal-slot
connections in engine.cpp
-rw-r--r--tools/qmldebugger/canvasframerate.cpp18
-rw-r--r--tools/qmldebugger/canvasframerate.h4
-rw-r--r--tools/qmldebugger/engine.cpp4
-rw-r--r--tools/qmldebugger/objecttree.cpp1
-rw-r--r--tools/qmldebugger/qmldebugger.cpp1
5 files changed, 20 insertions, 8 deletions
diff --git a/tools/qmldebugger/canvasframerate.cpp b/tools/qmldebugger/canvasframerate.cpp
index 0d23050..7c5d089 100644
--- a/tools/qmldebugger/canvasframerate.cpp
+++ b/tools/qmldebugger/canvasframerate.cpp
@@ -32,7 +32,6 @@ public slots:
protected:
virtual void paintEvent(QPaintEvent *);
- virtual QSize sizeHint() const;
private slots:
void scrollbarChanged(int);
@@ -57,6 +56,8 @@ private:
QLineGraph::QLineGraph(QWidget *parent)
: QWidget(parent), sb(Qt::Horizontal, this), position(-1), samplesPerWidth(99), resolutionForHeight(50), ignoreScroll(false)
{
+ setMinimumHeight(180);
+
sb.setMaximum(0);
sb.setMinimum(0);
sb.setSingleStep(1);
@@ -68,11 +69,6 @@ QLineGraph::QLineGraph(QWidget *parent)
QObject::connect(&sb, SIGNAL(valueChanged(int)), this, SLOT(scrollbarChanged(int)));
}
-QSize QLineGraph::sizeHint() const
-{
- return QSize(800, 600);
-}
-
void QLineGraph::scrollbarChanged(int v)
{
if(ignoreScroll)
@@ -291,6 +287,16 @@ CanvasFrameRate::CanvasFrameRate(QmlDebugConnection *client, QWidget *parent)
newTab();
}
+void CanvasFrameRate::setSizeHint(const QSize &size)
+{
+ m_sizeHint = size;
+}
+
+QSize CanvasFrameRate::sizeHint() const
+{
+ return m_sizeHint;
+}
+
void CanvasFrameRate::newTab()
{
if (m_tabs->count()) {
diff --git a/tools/qmldebugger/canvasframerate.h b/tools/qmldebugger/canvasframerate.h
index cef267d..aa275aa 100644
--- a/tools/qmldebugger/canvasframerate.h
+++ b/tools/qmldebugger/canvasframerate.h
@@ -14,6 +14,9 @@ class CanvasFrameRate : public QWidget
public:
CanvasFrameRate(QmlDebugConnection *, QWidget *parent = 0);
+ void setSizeHint(const QSize &);
+ virtual QSize sizeHint() const;
+
private slots:
void newTab();
void stateChanged(int);
@@ -22,6 +25,7 @@ private:
QTabWidget *m_tabs;
QSpinBox *m_spin;
QObject *m_plugin;
+ QSize m_sizeHint;
};
QT_END_NAMESPACE
diff --git a/tools/qmldebugger/engine.cpp b/tools/qmldebugger/engine.cpp
index fac10f3..3cf5165 100644
--- a/tools/qmldebugger/engine.cpp
+++ b/tools/qmldebugger/engine.cpp
@@ -71,7 +71,7 @@ EnginePane::EnginePane(QmlDebugConnection *conn, QWidget *parent)
WatchTableHeaderView *header = new WatchTableHeaderView(m_watchTableModel);
m_watchTableView->setHorizontalHeader(header);
- connect(m_objTree, SIGNAL(objectSelected(QmlDebugObjectReference)),
+ connect(m_objTree, SIGNAL(currentObjectChanged(QmlDebugObjectReference)),
m_propertiesView, SLOT(reload(QmlDebugObjectReference)));
connect(m_objTree, SIGNAL(expressionWatchRequested(QmlDebugObjectReference,QString)),
m_watchTableModel, SLOT(expressionWatchRequested(QmlDebugObjectReference,QString)));
@@ -83,7 +83,7 @@ EnginePane::EnginePane(QmlDebugConnection *conn, QWidget *parent)
m_propertiesView, SLOT(watchCreated(QmlDebugWatch*)));
connect(m_watchTableView, SIGNAL(objectActivated(int)),
- m_objTree, SLOT(selectObject(int)));
+ m_objTree, SLOT(setCurrentObject(int)));
m_tabs = new QTabWidget(this);
m_tabs->addTab(m_propertiesView, tr("Properties"));
diff --git a/tools/qmldebugger/objecttree.cpp b/tools/qmldebugger/objecttree.cpp
index 0b92ceb..1254ae7 100644
--- a/tools/qmldebugger/objecttree.cpp
+++ b/tools/qmldebugger/objecttree.cpp
@@ -18,6 +18,7 @@ ObjectTree::ObjectTree(QmlEngineDebug *client, QWidget *parent)
m_query(0)
{
setHeaderHidden(true);
+ setMinimumWidth(250);
connect(this, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
this, SLOT(currentItemChanged(QTreeWidgetItem *)));
diff --git a/tools/qmldebugger/qmldebugger.cpp b/tools/qmldebugger/qmldebugger.cpp
index e0a76b6..2828026 100644
--- a/tools/qmldebugger/qmldebugger.cpp
+++ b/tools/qmldebugger/qmldebugger.cpp
@@ -46,6 +46,7 @@ QmlDebugger::QmlDebugger(QWidget *parent)
layout->addWidget(m_tabs);
CanvasFrameRate *cfr = new CanvasFrameRate(&client, this);
+ cfr->setSizeHint(QSize(800, 600));
m_tabs->addTab(cfr, tr("Frame Rate"));
m_enginePane = new EnginePane(&client, this);