From 28675642f3445e41434b004c2a1a1d96ec0145a2 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 12 Apr 2012 12:56:20 +0200 Subject: Build manual tests. Add a toplevel manual.pro and other .pro-files to build them and fix the build. Change-Id: Ibc98a27b39dd1304edfa8a6894d62e77ce7ef387 Reviewed-by: Shane Kearns --- tests/manual/lance/interactivewidget.cpp | 2 +- tests/manual/lance/interactivewidget.h | 2 +- tests/manual/lance/lance.pro | 4 ++-- tests/manual/lance/main.cpp | 12 +++++------- tests/manual/lance/widgets.h | 10 +--------- 5 files changed, 10 insertions(+), 20 deletions(-) (limited to 'tests/manual/lance') diff --git a/tests/manual/lance/interactivewidget.cpp b/tests/manual/lance/interactivewidget.cpp index 55e60a8946..0b9d8ee0a4 100644 --- a/tests/manual/lance/interactivewidget.cpp +++ b/tests/manual/lance/interactivewidget.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ #include "interactivewidget.h" -#include +#include InteractiveWidget::InteractiveWidget() { diff --git a/tests/manual/lance/interactivewidget.h b/tests/manual/lance/interactivewidget.h index e9e584512e..879facac42 100644 --- a/tests/manual/lance/interactivewidget.h +++ b/tests/manual/lance/interactivewidget.h @@ -44,7 +44,7 @@ #include "widgets.h" #include "paintcommands.h" -#include +#include #include diff --git a/tests/manual/lance/lance.pro b/tests/manual/lance/lance.pro index e24d3f2fa3..4b319369e6 100644 --- a/tests/manual/lance/lance.pro +++ b/tests/manual/lance/lance.pro @@ -1,8 +1,8 @@ -LANCELOT_DIR = $$PWD/../../auto/lancelot +LANCELOT_DIR = $$PWD/../../auto/other/lancelot CONFIG+=console moc TEMPLATE = app INCLUDEPATH += . $$LANCELOT_DIR -QT += core-private gui-private +QT += core-private gui-private widgets printsupport HEADERS += widgets.h \ interactivewidget.h \ diff --git a/tests/manual/lance/main.cpp b/tests/manual/lance/main.cpp index c33cb49be9..e8bb44a221 100644 --- a/tests/manual/lance/main.cpp +++ b/tests/manual/lance/main.cpp @@ -43,7 +43,8 @@ #include "paintcommands.h" #include -#include +#include +#include #include #include @@ -612,14 +613,11 @@ int main(int argc, char **argv) pcmd.setType(type); pcmd.setCheckersBackground(checkers_background); pcmd.setContents(content); - bool ps = type == PsType; QPrinter p(highres ? QPrinter::HighResolution : QPrinter::ScreenResolution); QFileInfo input(files.at(j)); - QString file = QString("%1_%2.%3") - .arg(input.baseName()) - .arg(input.suffix()) - .arg(ps ? "ps" : "pdf"); - p.setOutputFormat(ps ? QPrinter::PdfFormat : QPrinter::PostScriptFormat); + const QString file = input.baseName() + QLatin1Char('_') + + input.suffix() + QStringLiteral(".pdf"); + p.setOutputFormat(QPrinter::PdfFormat); p.setOutputFileName(file); p.setPageSize(QPrinter::A4); QPainter pt(&p); diff --git a/tests/manual/lance/widgets.h b/tests/manual/lance/widgets.h index d8a67a7554..33115ad7b3 100644 --- a/tests/manual/lance/widgets.h +++ b/tests/manual/lance/widgets.h @@ -59,9 +59,6 @@ #include #include - -#include - #include const int CP_RADIUS = 10; @@ -236,12 +233,7 @@ public: } if (m_render_view.isNull()) { - - if (T::window()->windowSurface()) - m_render_view = T::window()->windowSurface()->grabWidget(this); - else - m_render_view = QPixmap::grabWidget(this); - + m_render_view = QPixmap::grabWidget(this); m_render_view.save("renderView.png"); } } -- cgit v1.2.3