diff options
Diffstat (limited to 'tests/arthur/lance/main.cpp')
-rw-r--r-- | tests/arthur/lance/main.cpp | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/tests/arthur/lance/main.cpp b/tests/arthur/lance/main.cpp index 04941c5..4f0d96d 100644 --- a/tests/arthur/lance/main.cpp +++ b/tests/arthur/lance/main.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. @@ -21,9 +20,10 @@ ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. @@ -66,7 +66,7 @@ extern bool qt_show_painter_debug_output = false; //#define CONSOLE_APPLICATION -static const struct { +static const struct { const char *name; QImage::Format format; } imageFormats[] = { @@ -199,7 +199,6 @@ static void displayCommands() " pixmap_load filename name_in_script\n" " image_load filename name_in_script\n"); } - static InteractiveWidget *interactive_widget = 0; static void runInteractive() @@ -271,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) { @@ -282,7 +281,7 @@ int main(int argc, char **argv) if (imageFormat == QImage::Format_Invalid) { printf("Invalid image format. Available formats are:\n"); - for (int ff = 0; ff < formatCount; ++ff) + for (int ff = 0; ff < formatCount; ++ff) printf("\t%s\n", imageFormats[ff].name); return -1; } @@ -381,7 +380,7 @@ int main(int argc, char **argv) QString script = textFile.readAll(); content = script.split("\n", QString::SkipEmptyParts); } else { - printf("failed to read file: '%s'\n", qPrintable(fileName)); + printf("failed to read file: '%s'\n", qPrintable(fileinfo.absoluteFilePath())); continue; } pcmd.setContents(content); @@ -403,12 +402,10 @@ int main(int argc, char **argv) case WidgetType: { OnScreenWidget<QWidget> *qWidget = - new OnScreenWidget<QWidget>; + new OnScreenWidget<QWidget>(files.at(j)); qWidget->setVerboseMode(verboseMode); qWidget->setType(type); qWidget->setCheckersBackground(checkers_background); - qWidget->m_filename = files.at(j); - qWidget->setWindowTitle(fileinfo.filePath()); qWidget->m_commands = content; qWidget->resize(width, height); qWidget->show(); @@ -418,12 +415,10 @@ int main(int argc, char **argv) case ImageWidgetType: { - OnScreenWidget<QWidget> *qWidget = new OnScreenWidget<QWidget>; + OnScreenWidget<QWidget> *qWidget = new OnScreenWidget<QWidget>(files.at(j)); qWidget->setVerboseMode(verboseMode); qWidget->setType(type); qWidget->setCheckersBackground(checkers_background); - qWidget->m_filename = files.at(j); - qWidget->setWindowTitle(fileinfo.filePath()); qWidget->m_commands = content; qWidget->resize(width, height); qWidget->show(); @@ -452,12 +447,10 @@ int main(int argc, char **argv) } case OpenGLType: { - OnScreenWidget<QGLWidget> *qGLWidget = new OnScreenWidget<QGLWidget>; + OnScreenWidget<QGLWidget> *qGLWidget = new OnScreenWidget<QGLWidget>(files.at(j)); qGLWidget->setVerboseMode(verboseMode); qGLWidget->setType(type); qGLWidget->setCheckersBackground(checkers_background); - qGLWidget->m_filename = files.at(j); - qGLWidget->setWindowTitle(fileinfo.filePath()); qGLWidget->m_commands = content; qGLWidget->resize(width, height); qGLWidget->show(); @@ -587,6 +580,7 @@ int main(int argc, char **argv) case PrinterType: { +#ifndef QT_NO_PRINTER PaintCommands pcmd(QStringList(), 800, 800); pcmd.setVerboseMode(verboseMode); pcmd.setType(type); @@ -614,11 +608,13 @@ int main(int argc, char **argv) } Q_ASSERT(!p.paintingActive()); +#endif break; } case PsType: case PdfType: { +#ifndef QT_NO_PRINTER PaintCommands pcmd(QStringList(), 800, 800); pcmd.setVerboseMode(verboseMode); pcmd.setType(type); @@ -641,6 +637,7 @@ int main(int argc, char **argv) pt.end(); printf("write file: %s\n", qPrintable(file)); +#endif break; } case GrabType: @@ -663,7 +660,6 @@ int main(int argc, char **argv) printf("%s grabbed to %s\n", qPrintable(files.at(j)), qPrintable(filename)); break; } - default: break; } @@ -674,7 +670,6 @@ int main(int argc, char **argv) QObject::connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); app.exec(); } - delete activeWidget; #endif return 0; |