summaryrefslogtreecommitdiffstats
path: root/tests/arthur/lance
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-08-13 07:24:47 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-08-13 08:27:51 (GMT)
commit13cbcc0ddca0fdd5be9ede09052d31785c1e4d55 (patch)
treeb647be5699145ccae1545096aba5c495d96f8eb5 /tests/arthur/lance
parent081078137a6fbc85d6be1437f6afc1d60e4f75f9 (diff)
parentde088b5a7f7b57e568399334667b14bfc9e7b893 (diff)
downloadQt-13cbcc0ddca0fdd5be9ede09052d31785c1e4d55.zip
Qt-13cbcc0ddca0fdd5be9ede09052d31785c1e4d55.tar.gz
Qt-13cbcc0ddca0fdd5be9ede09052d31785c1e4d55.tar.bz2
Merge commit 'qt/master'
Conflicts: examples/opengl/samplebuffers/glwidget.cpp src/corelib/io/qfsfileengine_unix.cpp src/corelib/kernel/qobject.cpp src/corelib/tools/qsharedpointer.cpp src/gui/gui.pro tests/auto/qhttp/tst_qhttp.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp
Diffstat (limited to 'tests/arthur/lance')
-rw-r--r--tests/arthur/lance/interactivewidget.cpp2
-rw-r--r--tests/arthur/lance/interactivewidget.h2
-rw-r--r--tests/arthur/lance/main.cpp4
-rw-r--r--tests/arthur/lance/widgets.h41
4 files changed, 26 insertions, 23 deletions
diff --git a/tests/arthur/lance/interactivewidget.cpp b/tests/arthur/lance/interactivewidget.cpp
index 0c2c7a6..d41a584 100644
--- a/tests/arthur/lance/interactivewidget.cpp
+++ b/tests/arthur/lance/interactivewidget.cpp
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
+** contact the sales department at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/tests/arthur/lance/interactivewidget.h b/tests/arthur/lance/interactivewidget.h
index 2bf0ea2..a0f6156 100644
--- a/tests/arthur/lance/interactivewidget.h
+++ b/tests/arthur/lance/interactivewidget.h
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
+** contact the sales department at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/tests/arthur/lance/main.cpp b/tests/arthur/lance/main.cpp
index b199cd5..8bf10eb 100644
--- a/tests/arthur/lance/main.cpp
+++ b/tests/arthur/lance/main.cpp
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
+** contact the sales department at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -270,7 +270,7 @@ int main(int argc, char **argv)
QString format = QString(argv[++i]).toLower();
imageFormat = QImage::Format_Invalid;
- static const unsigned int formatCount =
+ static const int formatCount =
sizeof(imageFormats) / sizeof(imageFormats[0]);
for (int ff = 0; ff < formatCount; ++ff) {
if (QLatin1String(imageFormats[ff].name) == format) {
diff --git a/tests/arthur/lance/widgets.h b/tests/arthur/lance/widgets.h
index 7247608..600b1eb 100644
--- a/tests/arthur/lance/widgets.h
+++ b/tests/arthur/lance/widgets.h
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
+** contact the sales department at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -56,6 +56,9 @@
#include <QFileDialog>
#include <QTextStream>
#include <QPaintEngine>
+#include <QSignalMapper>
+#include <QAction>
+
#include <private/qwindowsurface_p.h>
@@ -96,8 +99,8 @@ public:
OnScreenWidget(const QString &file, QWidget *parent = 0)
: T(parent),
- m_view_mode(RenderView),
- m_filename(file)
+ m_filename(file),
+ m_view_mode(RenderView)
{
QSettings settings("Trolltech", "lance");
for (int i=0; i<10; ++i) {
@@ -117,36 +120,36 @@ public:
}
if (m_baseline.isNull()) {
- setWindowTitle("Rendering: '" + file + "'. No baseline available");
+ T::setWindowTitle("Rendering: '" + file + "'. No baseline available");
} else {
- setWindowTitle("Rendering: '" + file + "'. Shortcuts: 1=render, 2=baseline, 3=difference");
+ T::setWindowTitle("Rendering: '" + file + "'. Shortcuts: 1=render, 2=baseline, 3=difference");
StupidWorkaround *workaround = new StupidWorkaround(this, &m_view_mode);
QSignalMapper *mapper = new QSignalMapper(this);
- connect(mapper, SIGNAL(mapped(int)), workaround, SLOT(setViewMode(int)));
- connect(mapper, SIGNAL(mapped(QString)), this, SLOT(setWindowTitle(QString)));
+ T::connect(mapper, SIGNAL(mapped(int)), workaround, SLOT(setViewMode(int)));
+ T::connect(mapper, SIGNAL(mapped(QString)), this, SLOT(setWindowTitle(QString)));
QAction *renderViewAction = new QAction("Render View", this);
renderViewAction->setShortcut(Qt::Key_1);
- connect(renderViewAction, SIGNAL(triggered()), mapper, SLOT(map()));
+ T::connect(renderViewAction, SIGNAL(triggered()), mapper, SLOT(map()));
mapper->setMapping(renderViewAction, RenderView);
mapper->setMapping(renderViewAction, "Render View: " + file);
- addAction(renderViewAction);
+ T::addAction(renderViewAction);
QAction *baselineAction = new QAction("Baseline", this);
baselineAction->setShortcut(Qt::Key_2);
- connect(baselineAction, SIGNAL(triggered()), mapper, SLOT(map()));
+ T::connect(baselineAction, SIGNAL(triggered()), mapper, SLOT(map()));
mapper->setMapping(baselineAction, BaselineView);
mapper->setMapping(baselineAction, "Baseline View: " + file);
- addAction(baselineAction);
+ T::addAction(baselineAction);
QAction *differenceAction = new QAction("Differenfe View", this);
differenceAction->setShortcut(Qt::Key_3);
- connect(differenceAction, SIGNAL(triggered()), mapper, SLOT(map()));
+ T::connect(differenceAction, SIGNAL(triggered()), mapper, SLOT(map()));
mapper->setMapping(differenceAction, DifferenceView);
mapper->setMapping(differenceAction, "Difference View" + file);
- addAction(differenceAction);
+ T::addAction(differenceAction);
}
@@ -178,7 +181,7 @@ public:
}
}
- void OnScreenWidget<T>::paintRenderView()
+ void paintRenderView()
{
QPainter pt;
QPaintDevice *dev = this;
@@ -233,7 +236,7 @@ public:
}
if (m_render_view.isNull()) {
- m_render_view = window()->windowSurface()->grabWidget(this);
+ m_render_view = T::window()->windowSurface()->grabWidget(this);
m_render_view.save("renderView.png");
}
}
@@ -242,7 +245,7 @@ public:
QPainter p(this);
if (m_baseline.isNull()) {
- p.drawText(rect(), Qt::AlignCenter,
+ p.drawText(T::rect(), Qt::AlignCenter,
"No baseline found\n"
"file '" + m_baseline_name + "' does not exist...");
return;
@@ -258,7 +261,7 @@ public:
QPixmap generateDifference()
{
- QImage img(size(), QImage::Format_RGB32);
+ QImage img(T::size(), QImage::Format_RGB32);
img.fill(0);
QPainter p(&img);
@@ -275,13 +278,13 @@ public:
void paintDifferenceView() {
QPainter p(this);
if (m_baseline.isNull()) {
- p.drawText(rect(), Qt::AlignCenter,
+ p.drawText(T::rect(), Qt::AlignCenter,
"No baseline found\n"
"file '" + m_baseline_name + "' does not exist...");
return;
}
- p.fillRect(rect(), Qt::black);
+ p.fillRect(T::rect(), Qt::black);
p.drawPixmap(0, 0, generateDifference());
}