summaryrefslogtreecommitdiffstats
path: root/demos/embedded
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-03-18 07:57:42 (GMT)
committeraxis <qt-info@nokia.com>2010-03-18 07:57:42 (GMT)
commitd3cba714adb35098d515f7c4f8e90a4e38527d76 (patch)
tree60018e4f20fc6b58017081b5e9e043d36a7ee3a9 /demos/embedded
parent09c2a804b700ec51f44bda567b806181d00bc161 (diff)
parente483886bcfcf7252af9ac7cc89de15f912bf69da (diff)
downloadQt-d3cba714adb35098d515f7c4f8e90a4e38527d76.zip
Qt-d3cba714adb35098d515f7c4f8e90a4e38527d76.tar.gz
Qt-d3cba714adb35098d515f7c4f8e90a4e38527d76.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-s60
Conflicts: qmake/generators/symbian/symmake_abld.cpp
Diffstat (limited to 'demos/embedded')
-rw-r--r--demos/embedded/anomaly/src/BrowserView.cpp1
-rw-r--r--demos/embedded/anomaly/src/ControlStrip.cpp15
-rw-r--r--demos/embedded/anomaly/src/ControlStrip.h2
-rw-r--r--demos/embedded/anomaly/src/anomaly.qrc1
-rw-r--r--demos/embedded/anomaly/src/images/button-close.pngbin0 -> 1833 bytes
5 files changed, 16 insertions, 3 deletions
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 @@
<file>images/edit-find.png</file>
<file>images/list-add.png</file>
<file>images/list-remove.png</file>
+ <file>images/button-close.png</file>
</qresource>
</RCC>
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
--- /dev/null
+++ b/demos/embedded/anomaly/src/images/button-close.png
Binary files differ