From ad20768753905dcec196fe0a8e35fb832c0f3256 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 15 Mar 2010 14:10:36 +0200 Subject: Added close button to Anomaly demo browser Part of QtP delta reduction effort, original task: QTTH-52 Reviewed-by: Janne Anttila --- demos/embedded/anomaly/src/BrowserView.cpp | 1 + demos/embedded/anomaly/src/ControlStrip.cpp | 15 ++++++++++++--- demos/embedded/anomaly/src/ControlStrip.h | 2 ++ demos/embedded/anomaly/src/anomaly.qrc | 1 + demos/embedded/anomaly/src/images/button-close.png | Bin 0 -> 1833 bytes 5 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 demos/embedded/anomaly/src/images/button-close.png diff --git a/demos/embedded/anomaly/src/BrowserView.cpp b/demos/embedded/anomaly/src/BrowserView.cpp index 0945b89..41318ad 100644 --- a/demos/embedded/anomaly/src/BrowserView.cpp +++ b/demos/embedded/anomaly/src/BrowserView.cpp @@ -82,6 +82,7 @@ void BrowserView::initialize() connect(m_controlStrip, SIGNAL(menuClicked()), SIGNAL(menuButtonClicked())); connect(m_controlStrip, SIGNAL(backClicked()), m_webView, SLOT(back())); connect(m_controlStrip, SIGNAL(forwardClicked()), m_webView, SLOT(forward())); + connect(m_controlStrip, SIGNAL(closeClicked()), qApp, SLOT(quit())); QPalette pal = m_webView->palette(); pal.setBrush(QPalette::Base, Qt::white); diff --git a/demos/embedded/anomaly/src/ControlStrip.cpp b/demos/embedded/anomaly/src/ControlStrip.cpp index 265d9a0..dc6d5c2 100644 --- a/demos/embedded/anomaly/src/ControlStrip.cpp +++ b/demos/embedded/anomaly/src/ControlStrip.cpp @@ -50,6 +50,7 @@ ControlStrip::ControlStrip(QWidget *parent) menuPixmap.load(":/images/edit-find.png"); backPixmap.load(":/images/go-previous.png"); forwardPixmap.load(":/images/go-next.png"); + closePixmap.load(":/images/button-close.png"); } QSize ControlStrip::sizeHint() const @@ -74,12 +75,18 @@ void ControlStrip::mousePressEvent(QMouseEvent *event) } if (x > width() - h) { - emit forwardClicked(); + emit closeClicked(); event->accept(); return; } if ((x < width() - 2 * h) && (x > width() - 3 * h)) { + emit forwardClicked(); + event->accept(); + return; + } + + if ((x < width() - 3 * h) && (x > width() - 5 * h)) { emit backClicked(); event->accept(); return; @@ -95,7 +102,9 @@ void ControlStrip::paintEvent(QPaintEvent *event) p.fillRect(event->rect(), QColor(32, 32, 32, 192)); p.setCompositionMode(QPainter::CompositionMode_SourceOver); p.drawPixmap(s, s, menuPixmap); - p.drawPixmap(width() - 3 * h + s, s, backPixmap); - p.drawPixmap(width() - h + s, s, forwardPixmap); + p.drawPixmap(width() - h + s, s, closePixmap); + p.drawPixmap(width() - 3 * h + s, s, forwardPixmap); + p.drawPixmap(width() - 5 * h + s, s, backPixmap); + p.end(); } diff --git a/demos/embedded/anomaly/src/ControlStrip.h b/demos/embedded/anomaly/src/ControlStrip.h index bbaea87..b6003a1 100644 --- a/demos/embedded/anomaly/src/ControlStrip.h +++ b/demos/embedded/anomaly/src/ControlStrip.h @@ -58,6 +58,7 @@ signals: void menuClicked(); void backClicked(); void forwardClicked(); + void closeClicked(); protected: void paintEvent(QPaintEvent *event); @@ -67,6 +68,7 @@ private: QPixmap menuPixmap; QPixmap backPixmap; QPixmap forwardPixmap; + QPixmap closePixmap; }; #endif // CONTROLSTRIP_H diff --git a/demos/embedded/anomaly/src/anomaly.qrc b/demos/embedded/anomaly/src/anomaly.qrc index 601a34e..d8ea630 100644 --- a/demos/embedded/anomaly/src/anomaly.qrc +++ b/demos/embedded/anomaly/src/anomaly.qrc @@ -5,5 +5,6 @@ images/edit-find.png images/list-add.png images/list-remove.png + images/button-close.png diff --git a/demos/embedded/anomaly/src/images/button-close.png b/demos/embedded/anomaly/src/images/button-close.png new file mode 100644 index 0000000..7a7b048 Binary files /dev/null and b/demos/embedded/anomaly/src/images/button-close.png differ -- cgit v0.12 From 9931ceb49685fde68f623ae18d4497273162cf76 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 16 Mar 2010 10:18:05 +0200 Subject: Make sure target path exists in qmake_extra_pre_targetdep.flm Since newer versions of Raptor delete all empty parent directories when cleaning up the files, qmake created moc output directories get also deleted when sbs clean is invoked. Fixed by always creating the extra compiler target directory during build. Task-number: QTBUG-6795 Reviewed-by: Janne Koskinen --- mkspecs/symbian-sbsv2/flm/qt/qmake_extra_pre_targetdep.flm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkspecs/symbian-sbsv2/flm/qt/qmake_extra_pre_targetdep.flm b/mkspecs/symbian-sbsv2/flm/qt/qmake_extra_pre_targetdep.flm index daf33d4..1338515 100644 --- a/mkspecs/symbian-sbsv2/flm/qt/qmake_extra_pre_targetdep.flm +++ b/mkspecs/symbian-sbsv2/flm/qt/qmake_extra_pre_targetdep.flm @@ -10,6 +10,8 @@ SINGLETON:=$(call sanitise,TARGET_$(PREDEP_TARGET)) +$(call makepathfor,$(PREDEP_TARGET)) + define qmake_extra_pre_targetdep EXPORT:: $(PREDEP_TARGET) -- cgit v0.12