diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2012-01-16 17:52:29 +0100 |
---|---|---|
committer | João Abecasis <joao.abecasis@nokia.com> | 2012-01-16 17:53:41 +0100 |
commit | 5b250d497fd798c476765b22a2906e1c0ff1e432 (patch) | |
tree | fd4215ca375cc2402e536bf670c2977cf64ae2ef /tests/manual | |
parent | 2c52e9a5c1d6ef6cbf4577430e14027375465c96 (diff) | |
parent | 7a0099183a1c107126bda3b59a47651aac612426 (diff) |
Merge remote-tracking branch 'gerrit/master' into containers
Change-Id: I2d358b912f1055ee6021d13de2f66fd459aaa355
Diffstat (limited to 'tests/manual')
106 files changed, 1023 insertions, 109 deletions
diff --git a/tests/manual/bearerex/bearerex.cpp b/tests/manual/bearerex/bearerex.cpp index c044476a8c..fd75c30438 100644 --- a/tests/manual/bearerex/bearerex.cpp +++ b/tests/manual/bearerex/bearerex.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/bearerex/bearerex.h b/tests/manual/bearerex/bearerex.h index 22c24cb42c..045d310f4a 100644 --- a/tests/manual/bearerex/bearerex.h +++ b/tests/manual/bearerex/bearerex.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/bearerex/datatransferer.cpp b/tests/manual/bearerex/datatransferer.cpp index b170daf489..5184bccde9 100644 --- a/tests/manual/bearerex/datatransferer.cpp +++ b/tests/manual/bearerex/datatransferer.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/bearerex/datatransferer.h b/tests/manual/bearerex/datatransferer.h index 50fc416b19..ddbd89be2a 100644 --- a/tests/manual/bearerex/datatransferer.h +++ b/tests/manual/bearerex/datatransferer.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/bearerex/main.cpp b/tests/manual/bearerex/main.cpp index 9f3e9c68f4..e9bf03395f 100644 --- a/tests/manual/bearerex/main.cpp +++ b/tests/manual/bearerex/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/bearerex/xqlistwidget.cpp b/tests/manual/bearerex/xqlistwidget.cpp index 162545c4e9..b236c41bc6 100644 --- a/tests/manual/bearerex/xqlistwidget.cpp +++ b/tests/manual/bearerex/xqlistwidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/bearerex/xqlistwidget.h b/tests/manual/bearerex/xqlistwidget.h index 0d6d59b877..1715bec3ec 100644 --- a/tests/manual/bearerex/xqlistwidget.h +++ b/tests/manual/bearerex/xqlistwidget.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/cmake/CMakeLists.txt b/tests/manual/cmake/CMakeLists.txt index 1f2bd3e80a..91ead649ec 100644 --- a/tests/manual/cmake/CMakeLists.txt +++ b/tests/manual/cmake/CMakeLists.txt @@ -25,8 +25,10 @@ macro(expect_fail _dir) endif() endmacro() -# Requires a patched cmake for the automoc stuff. Will uncomment when it is released. -# expect_pass(pass1) +if(${CMAKE_VERSION} VERSION_GREATER 2.8.7) + # Requires CMAKE_AUTOMOC function in CMake 2.8.7 + expect_pass(pass1) +endif() expect_pass(pass2) expect_pass(pass3) expect_fail(fail4) diff --git a/tests/manual/cmake/pass1/CMakeLists.txt b/tests/manual/cmake/pass1/CMakeLists.txt index c41a904d79..f11887e545 100644 --- a/tests/manual/cmake/pass1/CMakeLists.txt +++ b/tests/manual/cmake/pass1/CMakeLists.txt @@ -3,23 +3,23 @@ cmake_minimum_required(VERSION 2.8) project(pass1) -# Warning: requires cmake 2.8.7 due for release in December 2011 -# for automatic moc with Qt 5 set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) macro(qt5_use_package _target _package) - # TODO: Handle public/private keywords? - find_package(Qt5${_package} ${ARG1}) + if (NOT Qt5${_package}_FOUND) + find_package(Qt5${_package} ${ARG1}) + endif() if (Qt5${_package}_FOUND) + # TODO: Handle public/private keywords? target_link_libraries(${_target} ${Qt5${_package}_LIBRARIES}) - include_directories(${Qt5${_package}_INCLUDE_DIRS}) + # ### Requires CMake 2.8.8: # set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${Qt5${_package}_INCLUDE_DIRS}) + include_directories(${Qt5${_package}_INCLUDE_DIRS}) set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${Qt5${_package}_COMPILE_DEFINITIONS}) - foreach(_dep ${_Qt5_MODULE_DEPENDENCIES}) - qt5_use_package(${_target} ${_dep} REQUIRED) - endforeach() + else() + message(FATAL_ERROR "NOT FOUND: Qt5${_package}") endif() endmacro() diff --git a/tests/manual/cmake/pass3/CMakeLists.txt b/tests/manual/cmake/pass3/CMakeLists.txt index 8c39b4f4a3..11402e2e18 100644 --- a/tests/manual/cmake/pass3/CMakeLists.txt +++ b/tests/manual/cmake/pass3/CMakeLists.txt @@ -3,11 +3,10 @@ cmake_minimum_required(VERSION 2.8) project(pass3) -find_package(Qt5Core REQUIRED) -find_package(Qt5Gui REQUIRED) +# The module finds its dependencies find_package(Qt5Widgets REQUIRED) -include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}) +include_directories(${Qt5Widgets_INCLUDE_DIRS}) set(CMAKE_INCLUDE_CURRENT_DIR ON) diff --git a/tests/manual/cocoa/qt_on_cocoa/main.mm b/tests/manual/cocoa/qt_on_cocoa/main.mm new file mode 100644 index 0000000000..18b5c78993 --- /dev/null +++ b/tests/manual/cocoa/qt_on_cocoa/main.mm @@ -0,0 +1,213 @@ +/**************************************************************************** +** +** Copyright (C) 2012 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. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtGui> +#include <QtDeclarative> + +#include <QtWidgets/QtWidgets> +#include <private/qwidgetwindow_qpa_p.h> +#include <QtGui/qplatformnativeinterface_qpa.h> + +#include <QtGui/QPixmap> + +#include "window.h" + +#include <Cocoa/Cocoa.h> + + +@interface FilledView : NSView +{ + +} +@end + + +@implementation FilledView + +- (void)drawRect:(NSRect)dirtyRect { + // set any NSColor for filling, say white: + [[NSColor redColor] setFill]; + NSRectFill(dirtyRect); +} + +@end + +@interface QtMacToolbarDelegate : NSObject <NSToolbarDelegate> +{ +@public + NSToolbar *toolbar; +} + +- (id)init; +- (NSToolbarItem *) toolbar: (NSToolbar *)toolbar itemForItemIdentifier: (NSString *) itemIdent willBeInsertedIntoToolbar:(BOOL) willBeInserted; +- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)tb; +- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar; +- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar; +@end + +@implementation QtMacToolbarDelegate + +- (id)init +{ + self = [super init]; + if (self) { + } + return self; +} + +- (void)dealloc +{ + [super dealloc]; +} + +- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)tb +{ + Q_UNUSED(tb); + NSMutableArray *array = [[[NSMutableArray alloc] init] autorelease]; +// [array addObject : NSToolbarPrintItemIdentifier]; +// [array addObject : NSToolbarShowColorsItemIdentifier]; + [array addObject : @"filledView"]; + return array; +} + +- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)tb +{ + Q_UNUSED(tb); + NSMutableArray *array = [[[NSMutableArray alloc] init] autorelease]; +// [array addObject : NSToolbarPrintItemIdentifier]; +// [array addObject : NSToolbarShowColorsItemIdentifier]; + [array addObject : @"filledView"]; + return array; +} + +- (NSArray *)toolbarSelectableItemIdentifiers: (NSToolbar *)tb +{ + Q_UNUSED(tb); + NSMutableArray *array = [[[NSMutableArray alloc] init] autorelease]; + return array; +} + +- (IBAction)itemClicked:(id)sender +{ + +} + +- (NSToolbarItem *) toolbar: (NSToolbar *)tb itemForItemIdentifier: (NSString *) itemIdentifier willBeInsertedIntoToolbar:(BOOL) willBeInserted +{ + Q_UNUSED(tb); + Q_UNUSED(willBeInserted); + //const QString identifier = toQString(itemIdentifier); + //NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdentifier] autorelease]; + //return toolbarItem; + + //NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdentifier] autorelease]; + NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdentifier] autorelease]; + FilledView *theView = [[FilledView alloc] init]; + [toolbarItem setView : theView]; + [toolbarItem setMinSize : NSMakeSize(400, 40)]; + [toolbarItem setMaxSize : NSMakeSize(4000, 40)]; + return toolbarItem; +} +@end + +@interface WindowAndViewAndQtCreator : NSObject {} +- (void)createWindowAndViewAndQt; +@end + +@implementation WindowAndViewAndQtCreator +- (void)createWindowAndViewAndQt { + + // Create the window + NSRect frame = NSMakeRect(500, 500, 500, 500); + NSWindow* window = [[NSWindow alloc] initWithContentRect:frame + styleMask:NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask + backing:NSBackingStoreBuffered + defer:NO]; + + NSString *title = @"This the NSWindow window"; + [window setTitle:title]; + + [window setBackgroundColor:[NSColor blueColor]]; + + // Create a tool bar, set Qt delegate + NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier : @"foobartoolbar"]; + QtMacToolbarDelegate *delegate = [[QtMacToolbarDelegate alloc] init]; + [toolbar setDelegate : delegate]; + [window setToolbar : toolbar]; + + // Create the QWindow, don't show it. + Window *qtWindow = new Window(); + qtWindow->create(); + + //QSGView *qtWindow = new QSGView(); + //qtWindow->setSource(QUrl::fromLocalFile("/Users/msorvig/code/qt5/qtdeclarative/examples/declarative/samegame/samegame.qml")); + // qtWindow->setWindowFlags(Qt::WindowType(13)); // 13: NativeEmbeddedWindow + + // Get the nsview from the QWindow, set it as the content view + // on the NSWindow created above. + QPlatformNativeInterface *platformNativeInterface = QGuiApplication::platformNativeInterface(); + NSView *qtView = (NSView *)platformNativeInterface->nativeResourceForWindow("nsview", qtWindow); + [window setContentView:qtView]; + [window makeKeyAndOrderFront:NSApp]; +} +@end + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + + // fake NSApplicationMain() implementation follows: + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + [NSApplication sharedApplication]; + + // schedule call to create the UI. + WindowAndViewAndQtCreator *windowAndViewAndQtCreator= [WindowAndViewAndQtCreator alloc]; + [NSTimer scheduledTimerWithTimeInterval:0 target:windowAndViewAndQtCreator selector:@selector(createWindowAndViewAndQt) userInfo:nil repeats:NO]; + + [(NSApplication *)NSApp run]; + [NSApp release]; + [pool release]; + exit(0); + return 0; +} + + + diff --git a/tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro b/tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro new file mode 100644 index 0000000000..d5399b543a --- /dev/null +++ b/tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro @@ -0,0 +1,12 @@ +TEMPLATE = app + +OBJECTIVE_SOURCES += main.mm +HEADERS += window.h +SOURCES += window.cpp +LIBS += -framework Cocoa + +QMAKE_INFO_PLIST = Info_mac.plist +OTHER_FILES = Info_mac.plist +QT += gui widgets widgets-private gui-private core-private + +QT += declarative diff --git a/tests/manual/cocoa/qt_on_cocoa/window.cpp b/tests/manual/cocoa/qt_on_cocoa/window.cpp new file mode 100644 index 0000000000..5d24ceb51f --- /dev/null +++ b/tests/manual/cocoa/qt_on_cocoa/window.cpp @@ -0,0 +1,203 @@ +/**************************************************************************** +** +** Copyright (C) 2012 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. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "window.h" + +#include <private/qguiapplication_p.h> + +#include <QBackingStore> +#include <QPainter> +#include <QtGui> + +static int colorIndexId = 0; + +QColor colorTable[] = +{ + QColor("#f09f8f"), + QColor("#a2bff2"), + QColor("#c0ef8f") +}; + +Window::Window(QScreen *screen) + : QWindow(screen) + , m_backgroundColorIndex(colorIndexId++) +{ + initialize(); +} + +Window::Window(QWindow *parent) + : QWindow(parent) + , m_backgroundColorIndex(colorIndexId++) +{ + initialize(); +} + +void Window::initialize() +{ + if (parent()) + setGeometry(QRect(160, 120, 320, 240)); + else { + setGeometry(QRect(10, 10, 640, 480)); + + setSizeIncrement(QSize(10, 10)); + setBaseSize(QSize(640, 480)); + setMinimumSize(QSize(240, 160)); + setMaximumSize(QSize(800, 600)); + } + + create(); + m_backingStore = new QBackingStore(this); + + m_image = QImage(geometry().size(), QImage::Format_RGB32); + m_image.fill(colorTable[m_backgroundColorIndex % (sizeof(colorTable) / sizeof(colorTable[0]))].rgba()); + + m_lastPos = QPoint(-1, -1); + m_renderTimer = 0; +} + +void Window::mousePressEvent(QMouseEvent *event) +{ + m_lastPos = event->pos(); +} + +void Window::mouseMoveEvent(QMouseEvent *event) +{ + if (m_lastPos != QPoint(-1, -1)) { + QPainter p(&m_image); + p.setRenderHint(QPainter::Antialiasing); + p.drawLine(m_lastPos, event->pos()); + m_lastPos = event->pos(); + } + + scheduleRender(); +} + +void Window::mouseReleaseEvent(QMouseEvent *event) +{ + if (m_lastPos != QPoint(-1, -1)) { + QPainter p(&m_image); + p.setRenderHint(QPainter::Antialiasing); + p.drawLine(m_lastPos, event->pos()); + m_lastPos = QPoint(-1, -1); + } + + scheduleRender(); +} + +void Window::exposeEvent(QExposeEvent *) +{ + scheduleRender(); +} + +void Window::resizeEvent(QResizeEvent *) +{ + QImage old = m_image; + + //qDebug() << "Window::resizeEvent" << width << height; + + int width = qMax(geometry().width(), old.width()); + int height = qMax(geometry().height(), old.height()); + + if (width > old.width() || height > old.height()) { + m_image = QImage(width, height, QImage::Format_RGB32); + m_image.fill(colorTable[(m_backgroundColorIndex) % (sizeof(colorTable) / sizeof(colorTable[0]))].rgba()); + + QPainter p(&m_image); + p.drawImage(0, 0, old); + } + + render(); +} + +void Window::keyPressEvent(QKeyEvent *event) +{ + switch (event->key()) { + case Qt::Key_Backspace: + m_text.chop(1); + break; + case Qt::Key_Enter: + case Qt::Key_Return: + m_text.append('\n'); + break; + default: + m_text.append(event->text()); + break; + } + scheduleRender(); +} + +void Window::scheduleRender() +{ + if (!m_renderTimer) + m_renderTimer = startTimer(1); +} + +void Window::timerEvent(QTimerEvent *) +{ + render(); + killTimer(m_renderTimer); + m_renderTimer = 0; +} + +void Window::render() +{ + QRect rect(QPoint(), geometry().size()); + + m_backingStore->resize(rect.size()); + + m_backingStore->beginPaint(rect); + + QPaintDevice *device = m_backingStore->paintDevice(); + + QPainter p(device); + p.drawImage(0, 0, m_image); + + QFont font; + font.setPixelSize(32); + + p.setFont(font); + p.drawText(rect, 0, m_text); + + m_backingStore->endPaint(); + m_backingStore->flush(rect); +} + + diff --git a/tests/manual/cocoa/qt_on_cocoa/window.h b/tests/manual/cocoa/qt_on_cocoa/window.h new file mode 100644 index 0000000000..2fa2784427 --- /dev/null +++ b/tests/manual/cocoa/qt_on_cocoa/window.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2012 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. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QWindow> +#include <QImage> + +class Window : public QWindow +{ +public: + Window(QWindow *parent = 0); + Window(QScreen *screen); + +protected: + void mousePressEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + + void keyPressEvent(QKeyEvent *); + + void exposeEvent(QExposeEvent *); + void resizeEvent(QResizeEvent *); + + void timerEvent(QTimerEvent *); + +private: + void render(); + void scheduleRender(); + void initialize(); + + QString m_text; + QImage m_image; + QPoint m_lastPos; + int m_backgroundColorIndex; + QBackingStore *m_backingStore; + int m_renderTimer; +}; diff --git a/tests/manual/gestures/graphicsview/gestures.cpp b/tests/manual/gestures/graphicsview/gestures.cpp index e576f14871..4dde0f5cb7 100644 --- a/tests/manual/gestures/graphicsview/gestures.cpp +++ b/tests/manual/gestures/graphicsview/gestures.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/gestures/graphicsview/gestures.h b/tests/manual/gestures/graphicsview/gestures.h index 8f96eccf99..8104da640d 100644 --- a/tests/manual/gestures/graphicsview/gestures.h +++ b/tests/manual/gestures/graphicsview/gestures.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/gestures/graphicsview/imageitem.cpp b/tests/manual/gestures/graphicsview/imageitem.cpp index 73d56129d0..03e9946cf4 100644 --- a/tests/manual/gestures/graphicsview/imageitem.cpp +++ b/tests/manual/gestures/graphicsview/imageitem.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/gestures/graphicsview/imageitem.h b/tests/manual/gestures/graphicsview/imageitem.h index cdc1d8823e..d789a3e914 100644 --- a/tests/manual/gestures/graphicsview/imageitem.h +++ b/tests/manual/gestures/graphicsview/imageitem.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/gestures/graphicsview/main.cpp b/tests/manual/gestures/graphicsview/main.cpp index 952b495b76..f46d7139d8 100644 --- a/tests/manual/gestures/graphicsview/main.cpp +++ b/tests/manual/gestures/graphicsview/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp b/tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp index 44b6794d87..778ba78a10 100644 --- a/tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp +++ b/tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/gestures/graphicsview/mousepangesturerecognizer.h b/tests/manual/gestures/graphicsview/mousepangesturerecognizer.h index e815a2d6a8..0e2684a285 100644 --- a/tests/manual/gestures/graphicsview/mousepangesturerecognizer.h +++ b/tests/manual/gestures/graphicsview/mousepangesturerecognizer.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/gestures/scrollarea/main.cpp b/tests/manual/gestures/scrollarea/main.cpp index 7b2924c079..ec5176600e 100644 --- a/tests/manual/gestures/scrollarea/main.cpp +++ b/tests/manual/gestures/scrollarea/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/gestures/scrollarea/mousepangesturerecognizer.cpp b/tests/manual/gestures/scrollarea/mousepangesturerecognizer.cpp index c9c5d41c08..8231fe0e74 100644 --- a/tests/manual/gestures/scrollarea/mousepangesturerecognizer.cpp +++ b/tests/manual/gestures/scrollarea/mousepangesturerecognizer.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/gestures/scrollarea/mousepangesturerecognizer.h b/tests/manual/gestures/scrollarea/mousepangesturerecognizer.h index e815a2d6a8..0e2684a285 100644 --- a/tests/manual/gestures/scrollarea/mousepangesturerecognizer.h +++ b/tests/manual/gestures/scrollarea/mousepangesturerecognizer.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/inputmethodhints/inputmethodhints.cpp b/tests/manual/inputmethodhints/inputmethodhints.cpp index f302c36c43..1754a3cd26 100644 --- a/tests/manual/inputmethodhints/inputmethodhints.cpp +++ b/tests/manual/inputmethodhints/inputmethodhints.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/inputmethodhints/inputmethodhints.h b/tests/manual/inputmethodhints/inputmethodhints.h index 839d5386af..6e2d934204 100644 --- a/tests/manual/inputmethodhints/inputmethodhints.h +++ b/tests/manual/inputmethodhints/inputmethodhints.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/inputmethodhints/main.cpp b/tests/manual/inputmethodhints/main.cpp index f0807dec6f..a276cde1f2 100644 --- a/tests/manual/inputmethodhints/main.cpp +++ b/tests/manual/inputmethodhints/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/keypadnavigation/main.cpp b/tests/manual/keypadnavigation/main.cpp index f8debafe56..2edc67a426 100644 --- a/tests/manual/keypadnavigation/main.cpp +++ b/tests/manual/keypadnavigation/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/lance/interactivewidget.cpp b/tests/manual/lance/interactivewidget.cpp index f7bc67ea0b..fb480b1d0b 100644 --- a/tests/manual/lance/interactivewidget.cpp +++ b/tests/manual/lance/interactivewidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/lance/interactivewidget.h b/tests/manual/lance/interactivewidget.h index f5e91c87dc..ac46a0ec36 100644 --- a/tests/manual/lance/interactivewidget.h +++ b/tests/manual/lance/interactivewidget.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/lance/main.cpp b/tests/manual/lance/main.cpp index f63ac7a367..7ff8b1cf36 100644 --- a/tests/manual/lance/main.cpp +++ b/tests/manual/lance/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/lance/widgets.h b/tests/manual/lance/widgets.h index 033067d846..28ed34f653 100644 --- a/tests/manual/lance/widgets.h +++ b/tests/manual/lance/widgets.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/mkspecs/test.sh b/tests/manual/mkspecs/test.sh index 84f5b93852..d384df2098 100755 --- a/tests/manual/mkspecs/test.sh +++ b/tests/manual/mkspecs/test.sh @@ -1,7 +1,7 @@ #!/bin/bash ############################################################################# ## -## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +## Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## Contact: Nokia Corporation (qt-info@nokia.com) ## diff --git a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp index 77589d350e..06e211738e 100644 --- a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp +++ b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/network_stresstest/minihttpserver.cpp b/tests/manual/network_stresstest/minihttpserver.cpp index 8318f93b5b..d024fe0f06 100644 --- a/tests/manual/network_stresstest/minihttpserver.cpp +++ b/tests/manual/network_stresstest/minihttpserver.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/network_stresstest/minihttpserver.h b/tests/manual/network_stresstest/minihttpserver.h index 0499c3b404..a622159ce6 100644 --- a/tests/manual/network_stresstest/minihttpserver.h +++ b/tests/manual/network_stresstest/minihttpserver.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/network_stresstest/tst_network_stresstest.cpp b/tests/manual/network_stresstest/tst_network_stresstest.cpp index 8337118bbf..debae981ab 100644 --- a/tests/manual/network_stresstest/tst_network_stresstest.cpp +++ b/tests/manual/network_stresstest/tst_network_stresstest.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qcursor/allcursors/main.cpp b/tests/manual/qcursor/allcursors/main.cpp index c074f4c141..1b0d9a55bd 100644 --- a/tests/manual/qcursor/allcursors/main.cpp +++ b/tests/manual/qcursor/allcursors/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qcursor/allcursors/mainwindow.cpp b/tests/manual/qcursor/allcursors/mainwindow.cpp index 855229f3dc..8807f6f1d0 100644 --- a/tests/manual/qcursor/allcursors/mainwindow.cpp +++ b/tests/manual/qcursor/allcursors/mainwindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qcursor/allcursors/mainwindow.h b/tests/manual/qcursor/allcursors/mainwindow.h index df314ef3e6..d9dc3bcb78 100644 --- a/tests/manual/qcursor/allcursors/mainwindow.h +++ b/tests/manual/qcursor/allcursors/mainwindow.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qcursor/grab_override/main.cpp b/tests/manual/qcursor/grab_override/main.cpp index c074f4c141..1b0d9a55bd 100644 --- a/tests/manual/qcursor/grab_override/main.cpp +++ b/tests/manual/qcursor/grab_override/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qcursor/grab_override/mainwindow.cpp b/tests/manual/qcursor/grab_override/mainwindow.cpp index f1082d4d03..d6c671a642 100644 --- a/tests/manual/qcursor/grab_override/mainwindow.cpp +++ b/tests/manual/qcursor/grab_override/mainwindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qcursor/grab_override/mainwindow.h b/tests/manual/qcursor/grab_override/mainwindow.h index 5c565a3cc6..e5a2042bb0 100644 --- a/tests/manual/qcursor/grab_override/mainwindow.h +++ b/tests/manual/qcursor/grab_override/mainwindow.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qdesktopwidget/main.cpp b/tests/manual/qdesktopwidget/main.cpp index f42098f344..4982bd8321 100644 --- a/tests/manual/qdesktopwidget/main.cpp +++ b/tests/manual/qdesktopwidget/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qgraphicsitemgroup/customitem.cpp b/tests/manual/qgraphicsitemgroup/customitem.cpp index 25b99b3d1c..2fb14d638a 100644 --- a/tests/manual/qgraphicsitemgroup/customitem.cpp +++ b/tests/manual/qgraphicsitemgroup/customitem.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qgraphicsitemgroup/customitem.h b/tests/manual/qgraphicsitemgroup/customitem.h index e7ac8c2b45..c8416cf952 100644 --- a/tests/manual/qgraphicsitemgroup/customitem.h +++ b/tests/manual/qgraphicsitemgroup/customitem.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qgraphicsitemgroup/main.cpp b/tests/manual/qgraphicsitemgroup/main.cpp index 5c12a0cc51..c3310637b9 100644 --- a/tests/manual/qgraphicsitemgroup/main.cpp +++ b/tests/manual/qgraphicsitemgroup/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qgraphicsitemgroup/widget.cpp b/tests/manual/qgraphicsitemgroup/widget.cpp index 2788369517..1ff9e41c6a 100644 --- a/tests/manual/qgraphicsitemgroup/widget.cpp +++ b/tests/manual/qgraphicsitemgroup/widget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qgraphicsitemgroup/widget.h b/tests/manual/qgraphicsitemgroup/widget.h index 78468afa50..4e0489722f 100644 --- a/tests/manual/qgraphicsitemgroup/widget.h +++ b/tests/manual/qgraphicsitemgroup/widget.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qgraphicslayout/flicker/main.cpp b/tests/manual/qgraphicslayout/flicker/main.cpp index c0fac45142..db9e53e302 100644 --- a/tests/manual/qgraphicslayout/flicker/main.cpp +++ b/tests/manual/qgraphicslayout/flicker/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qgraphicslayout/flicker/window.cpp b/tests/manual/qgraphicslayout/flicker/window.cpp index 63dfa380d7..01a1182013 100644 --- a/tests/manual/qgraphicslayout/flicker/window.cpp +++ b/tests/manual/qgraphicslayout/flicker/window.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qgraphicslayout/flicker/window.h b/tests/manual/qgraphicslayout/flicker/window.h index 26a8f2ab5e..872a7469d8 100644 --- a/tests/manual/qgraphicslayout/flicker/window.h +++ b/tests/manual/qgraphicslayout/flicker/window.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qhttpnetworkconnection/main.cpp b/tests/manual/qhttpnetworkconnection/main.cpp index 502efcab9a..9998577997 100644 --- a/tests/manual/qhttpnetworkconnection/main.cpp +++ b/tests/manual/qhttpnetworkconnection/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qimagereader/main.cpp b/tests/manual/qimagereader/main.cpp index 90f3a3ec51..bc1772bbcc 100644 --- a/tests/manual/qimagereader/main.cpp +++ b/tests/manual/qimagereader/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/calendar.cpp b/tests/manual/qlocale/calendar.cpp index bd4756e998..8fadf68ea7 100644 --- a/tests/manual/qlocale/calendar.cpp +++ b/tests/manual/qlocale/calendar.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/calendar.h b/tests/manual/qlocale/calendar.h index b5bb3c9268..b03102f68d 100644 --- a/tests/manual/qlocale/calendar.h +++ b/tests/manual/qlocale/calendar.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/currency.cpp b/tests/manual/qlocale/currency.cpp index 4ef157cba8..f5d69de6c2 100644 --- a/tests/manual/qlocale/currency.cpp +++ b/tests/manual/qlocale/currency.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/currency.h b/tests/manual/qlocale/currency.h index 3a1255343c..fbee336da1 100644 --- a/tests/manual/qlocale/currency.h +++ b/tests/manual/qlocale/currency.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/dateformats.cpp b/tests/manual/qlocale/dateformats.cpp index 25b3e7a954..e23a2b8e52 100644 --- a/tests/manual/qlocale/dateformats.cpp +++ b/tests/manual/qlocale/dateformats.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/dateformats.h b/tests/manual/qlocale/dateformats.h index f05ad2a27f..67b2ed4a02 100644 --- a/tests/manual/qlocale/dateformats.h +++ b/tests/manual/qlocale/dateformats.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/info.cpp b/tests/manual/qlocale/info.cpp index a4f6adfce0..2df46a22e3 100644 --- a/tests/manual/qlocale/info.cpp +++ b/tests/manual/qlocale/info.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/info.h b/tests/manual/qlocale/info.h index b23ecf5a47..1fd2b753df 100644 --- a/tests/manual/qlocale/info.h +++ b/tests/manual/qlocale/info.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/languages.cpp b/tests/manual/qlocale/languages.cpp index 18d72d7dd9..189e6976b1 100644 --- a/tests/manual/qlocale/languages.cpp +++ b/tests/manual/qlocale/languages.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/languages.h b/tests/manual/qlocale/languages.h index 18e503f648..b365b7e4e3 100644 --- a/tests/manual/qlocale/languages.h +++ b/tests/manual/qlocale/languages.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/main.cpp b/tests/manual/qlocale/main.cpp index b14a44f7c6..e37113fdc2 100644 --- a/tests/manual/qlocale/main.cpp +++ b/tests/manual/qlocale/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/miscellaneous.cpp b/tests/manual/qlocale/miscellaneous.cpp index 89c80dc65a..fdf4d27f8e 100644 --- a/tests/manual/qlocale/miscellaneous.cpp +++ b/tests/manual/qlocale/miscellaneous.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/miscellaneous.h b/tests/manual/qlocale/miscellaneous.h index 3b635b802f..42e4e4f982 100644 --- a/tests/manual/qlocale/miscellaneous.h +++ b/tests/manual/qlocale/miscellaneous.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/numberformats.cpp b/tests/manual/qlocale/numberformats.cpp index 7b5fce4082..99664f7e73 100644 --- a/tests/manual/qlocale/numberformats.cpp +++ b/tests/manual/qlocale/numberformats.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/numberformats.h b/tests/manual/qlocale/numberformats.h index 4a3ab36506..79dcac0dc9 100644 --- a/tests/manual/qlocale/numberformats.h +++ b/tests/manual/qlocale/numberformats.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/window.cpp b/tests/manual/qlocale/window.cpp index 775023e5df..bb6aea3114 100644 --- a/tests/manual/qlocale/window.cpp +++ b/tests/manual/qlocale/window.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qlocale/window.h b/tests/manual/qlocale/window.h index aee728fd9c..402cdd6259 100644 --- a/tests/manual/qlocale/window.h +++ b/tests/manual/qlocale/window.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qnetworkaccessmanager/qget/qget.cpp b/tests/manual/qnetworkaccessmanager/qget/qget.cpp new file mode 100644 index 0000000000..4e1bc4a71a --- /dev/null +++ b/tests/manual/qnetworkaccessmanager/qget/qget.cpp @@ -0,0 +1,300 @@ +/**************************************************************************** +** +** Copyright (C) 2012 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. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qget.h" + +#include <QSslError> +#include <QNetworkProxy> +#include <QAuthenticator> +#include <QDebug> +#include <QCoreApplication> +#include <QList> +#include <QStringList> +#include <QNetworkConfiguration> +#include <QNetworkConfigurationManager> +#include <QNetworkSession> + +DownloadManager::DownloadManager() +{ + connect(&nam, SIGNAL(finished(QNetworkReply*)), this, SLOT(finished(QNetworkReply*))); + connect(&nam, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)), this, SLOT(authenticationRequired(QNetworkReply*, QAuthenticator*))); + connect(&nam, SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)), this, SLOT(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*))); + connect(&nam, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)), this, SLOT(sslErrors(QNetworkReply*, const QList<QSslError>&))); +} + +DownloadManager::~DownloadManager() +{ + +} + +void DownloadManager::get(const QUrl& url) +{ + //currently multiple downloads are processed in parallel. + //could add an option for serial using the downloads list as a queue + //which would require DownloadItem to hold a request rather than a reply + QNetworkReply* reply = nam.get(QNetworkRequest(url)); + DownloadItem *dl = new DownloadItem(reply, nam); + downloads.append(dl); + connect(dl, SIGNAL(downloadFinished(DownloadItem*)), SLOT(downloadFinished(DownloadItem*))); +} + +void DownloadManager::finished(QNetworkReply* reply) +{ +} + +void DownloadManager::downloadFinished(DownloadItem *item) +{ + downloads.removeOne(item); + item->deleteLater(); + checkForAllDone(); +} + +void DownloadManager::checkForAllDone() +{ + if (downloads.isEmpty()) { + qDebug() << "All Done."; + QCoreApplication::quit(); + } +} + +void DownloadManager::authenticationRequired(QNetworkReply* reply, QAuthenticator* auth) +{ + //provide the credentials exactly once, so that it fails if credentials are incorrect. + if (!httpUser.isEmpty() || !httpPassword.isEmpty()) { + auth->setUser(httpUser); + auth->setPassword(httpPassword); + httpUser.clear(); + httpPassword.clear(); + } +} + +void DownloadManager::proxyAuthenticationRequired(const QNetworkProxy& proxy, QAuthenticator* auth) +{ + //provide the credentials exactly once, so that it fails if credentials are incorrect. + if (!proxyUser.isEmpty() || !proxyPassword.isEmpty()) { + auth->setUser(proxyUser); + auth->setPassword(proxyPassword); + proxyUser.clear(); + proxyPassword.clear(); + } +} + +void DownloadManager::sslErrors(QNetworkReply* reply, const QList<QSslError>& errors) +{ + qDebug() << "sslErrors"; + foreach (const QSslError& error, errors) { + qDebug() << error.errorString(); + qDebug() << error.certificate().toPem(); + } +} + +DownloadItem::DownloadItem(QNetworkReply* r, QNetworkAccessManager& manager) : reply(r), nam(manager) +{ + reply->setParent(this); + connect(reply, SIGNAL(readyRead()), this, SLOT(readyRead())); + connect(reply, SIGNAL(finished()), this, SLOT(finished())); +} + +DownloadItem::~DownloadItem() +{ +} + +void DownloadItem::readyRead() +{ + if (!file.isOpen()) { + qDebug() << reply->header(QNetworkRequest::ContentTypeHeader) << reply->header(QNetworkRequest::ContentLengthHeader); + QString path = reply->url().path(); + path = path.mid(path.lastIndexOf('/') + 1); + if (path.isEmpty()) + path = QLatin1String("index.html"); + file.setFileName(path); + for (int i=1;i<1000;i++) { + if (!file.exists() && file.open(QIODevice::WriteOnly | QIODevice::Truncate)) + break; + file.setFileName(QString(QLatin1String("%1.%2")).arg(path).arg(i)); + } + if (!file.isOpen()) { + qDebug() << "couldn't open output file"; + reply->abort(); + return; + } + qDebug() << reply->url() << " -> " << file.fileName(); + } + file.write(reply->readAll()); +} + +void DownloadItem::finished() +{ + if (reply->attribute(QNetworkRequest::RedirectionTargetAttribute).isValid()) { + QUrl url = reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl(); + url = reply->url().resolved(url); + qDebug() << reply->url() << "redirected to " << url; + if (redirects.contains(url)) { + qDebug() << "redirect loop detected"; + } else if (redirects.count() > 10) { + qDebug() << "too many redirects"; + } else { + //follow redirect + if (file.isOpen()) { + if (!file.seek(0) || !file.resize(0)) { + file.close(); + file.remove(); + } + } + reply->deleteLater(); + reply = nam.get(QNetworkRequest(url)); + reply->setParent(this); + connect(reply, SIGNAL(readyRead()), this, SLOT(readyRead())); + connect(reply, SIGNAL(finished()), this, SLOT(finished())); + redirects.append(url); + return; + } + } + if (file.isOpen()) { + file.write(reply->readAll()); + file.close(); + } + qDebug() << "finished " << reply->url() << " with http status: " << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + if (reply->error() != QNetworkReply::NoError) + qDebug() << "and error: " << reply->error() << reply->errorString(); + emit downloadFinished(this); +} + +void printShortUsage() +{ + qDebug() << QCoreApplication::applicationName() << " [options] [list of urls]" << endl + << "Get one or more urls using QNetworkAccessManager" << endl + << "--help to display detailed usage" << endl; +} + +void printUsage() +{ + qDebug() << QCoreApplication::applicationName() << " [options] [list of urls]" << endl + << "Get one or more urls using QNetworkAccessManager" << endl + << "Options:" + << "--help This message" << endl + << "--http-user=<username> Set username to use for http 401 challenges" << endl + << "--http-password=<password> Set password to use for http 401 challenges" << endl + << "--proxy-user=<username> Set username to use for proxy authentication" << endl + << "--proxy-password=<password> Set password to use for proxy authentication" << endl + << "--proxy=on Use system proxy (default)" << endl + << "--proxy=off Don't use system proxy" << endl + << "--proxy=<host:port>[,type] Use specified proxy" << endl + << " ,http HTTP proxy (default)" << endl + << " ,socks SOCKS5 proxy" << endl + << " ,ftp FTP proxy" << endl + << " ,httpcaching HTTP caching proxy (no CONNECT method)" << endl; +} + +int main(int argc, char *argv[]) +{ + QCoreApplication app(argc, argv); + if (argc < 2) { + printShortUsage(); + return EXIT_FAILURE; + } + + //use system proxy (by default) + QNetworkProxyFactory::setUseSystemConfiguration(true); + + DownloadManager dl; + //arguments match wget where possible + foreach (QString str, app.arguments().mid(1)) { + if (str == "--help") + printUsage(); + else if (str.startsWith("--http-user=")) + dl.setHttpUser(str.mid(12)); + else if (str.startsWith("--http-passwd=")) + dl.setHttpPassword(str.mid(14)); + else if (str.startsWith("--proxy-user=")) + dl.setProxyUser(str.mid(13)); + else if (str.startsWith("--proxy-passwd=")) + dl.setProxyPassword(str.mid(15)); + else if (str == "--proxy=off") + QNetworkProxyFactory::setUseSystemConfiguration(false); + else if (str == "--proxy=on") + QNetworkProxyFactory::setUseSystemConfiguration(true); + else if (str.startsWith("--proxy=")) { + //parse "--proxy=host:port[,type]" + QNetworkProxy proxy; + str = str.mid(8); + int sep = str.indexOf(':'); + proxy.setHostName(str.left(sep)); + str = str.mid(sep + 1); + sep = str.indexOf(','); + QString port; + if (sep < 0) { + port = str; + proxy.setType(QNetworkProxy::HttpProxy); + } else { + port = str.left(sep); + str = str.mid(sep + 1); + if (str == "socks") + proxy.setType(QNetworkProxy::Socks5Proxy); + else if (str == "ftp") + proxy.setType(QNetworkProxy::FtpCachingProxy); + else if (str == "httpcaching") + proxy.setType(QNetworkProxy::HttpCachingProxy); + else if (str == "http") + proxy.setType(QNetworkProxy::HttpProxy); + else { + qDebug() << "unknown proxy type"; + return EXIT_FAILURE; + } + } + bool ok; + quint16 p = port.toUShort(&ok); + if (!ok) { + qDebug() << "couldn't parse proxy"; + return EXIT_FAILURE; + } + proxy.setPort(p); + qDebug() << "proxy:" << proxy.hostName() << proxy.port() << proxy.type(); + dl.setProxy(proxy); + } + else if (str.startsWith("-")) + qDebug() << "unsupported option" << str; + else + dl.get(QUrl::fromUserInput(str)); + } + QMetaObject::invokeMethod(&dl, "checkForAllDone", Qt::QueuedConnection); + return app.exec(); +} diff --git a/tests/manual/qnetworkaccessmanager/qget/qget.h b/tests/manual/qnetworkaccessmanager/qget/qget.h new file mode 100644 index 0000000000..f66e3cd923 --- /dev/null +++ b/tests/manual/qnetworkaccessmanager/qget/qget.h @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2012 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. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef QGET_H +#define QGET_H + +#include <QNetworkAccessManager> +#include <QNetworkRequest> +#include <QNetworkReply> +#include <QFile> + +class DownloadItem : public QObject +{ + Q_OBJECT +public: + DownloadItem(QNetworkReply* r, QNetworkAccessManager& nam); + ~DownloadItem(); + + QNetworkReply* networkReply() { return reply; } + +signals: + void downloadFinished(DownloadItem *self); +private slots: + void readyRead(); + void finished(); +private: + QNetworkAccessManager& nam; + QNetworkReply* reply; + QFile file; + QList<QUrl> redirects; +}; + +class DownloadManager : public QObject +{ + Q_OBJECT +public: + DownloadManager(); + ~DownloadManager(); + void get(const QUrl& url); + void setProxy(const QNetworkProxy& proxy) { nam.setProxy(proxy); } + void setHttpUser(const QString& user) { httpUser = user; } + void setHttpPassword(const QString& password) { httpPassword = password; } + void setProxyUser(const QString& user) { proxyUser = user; } + void setProxyPassword(const QString& password) { proxyPassword = password; } + +public slots: + void checkForAllDone(); + +private slots: + void finished(QNetworkReply* reply); + void authenticationRequired(QNetworkReply* reply, QAuthenticator* authenticator); + void proxyAuthenticationRequired(const QNetworkProxy& proxy, QAuthenticator* authenticator); + void sslErrors(QNetworkReply* reply, const QList<QSslError>& errors); + void downloadFinished(DownloadItem *item); +private: + QNetworkAccessManager nam; + QList<DownloadItem*> downloads; + QString httpUser; + QString httpPassword; + QString proxyUser; + QString proxyPassword; +}; + +#endif // QGET_H diff --git a/tests/manual/qnetworkaccessmanager/qget/qget.pro b/tests/manual/qnetworkaccessmanager/qget/qget.pro new file mode 100644 index 0000000000..80af8a556f --- /dev/null +++ b/tests/manual/qnetworkaccessmanager/qget/qget.pro @@ -0,0 +1,10 @@ +TEMPLATE = app +QT = core network +CONFIG += console + +# Input +SOURCES += qget.cpp +HEADERS += qget.h + +symbian: TARGET.CAPABILITY += ReadUserData NetworkServices + diff --git a/tests/manual/qnetworkreply/main.cpp b/tests/manual/qnetworkreply/main.cpp index 8033251d06..bade33712e 100644 --- a/tests/manual/qnetworkreply/main.cpp +++ b/tests/manual/qnetworkreply/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qssloptions/main.cpp b/tests/manual/qssloptions/main.cpp index 21b5dab1d4..0b7b6b57bc 100644 --- a/tests/manual/qssloptions/main.cpp +++ b/tests/manual/qssloptions/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qtabletevent/device_information/main.cpp b/tests/manual/qtabletevent/device_information/main.cpp index 92e7ea4cd8..a8f42ab0a7 100644 --- a/tests/manual/qtabletevent/device_information/main.cpp +++ b/tests/manual/qtabletevent/device_information/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qtabletevent/device_information/tabletwidget.cpp b/tests/manual/qtabletevent/device_information/tabletwidget.cpp index 8b1eaab8e3..33b9fb9b0a 100644 --- a/tests/manual/qtabletevent/device_information/tabletwidget.cpp +++ b/tests/manual/qtabletevent/device_information/tabletwidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qtabletevent/device_information/tabletwidget.h b/tests/manual/qtabletevent/device_information/tabletwidget.h index 0e93c41752..e1a9860f28 100644 --- a/tests/manual/qtabletevent/device_information/tabletwidget.h +++ b/tests/manual/qtabletevent/device_information/tabletwidget.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qtabletevent/event_compression/main.cpp b/tests/manual/qtabletevent/event_compression/main.cpp index 324dc17b52..d05f5cc55e 100644 --- a/tests/manual/qtabletevent/event_compression/main.cpp +++ b/tests/manual/qtabletevent/event_compression/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qtabletevent/event_compression/mousestatwidget.cpp b/tests/manual/qtabletevent/event_compression/mousestatwidget.cpp index d04563fac4..d43bc50820 100644 --- a/tests/manual/qtabletevent/event_compression/mousestatwidget.cpp +++ b/tests/manual/qtabletevent/event_compression/mousestatwidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qtabletevent/event_compression/mousestatwidget.h b/tests/manual/qtabletevent/event_compression/mousestatwidget.h index 623f39f814..1a71ca44a4 100644 --- a/tests/manual/qtabletevent/event_compression/mousestatwidget.h +++ b/tests/manual/qtabletevent/event_compression/mousestatwidget.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qtabletevent/regular_widgets/main.cpp b/tests/manual/qtabletevent/regular_widgets/main.cpp index 5d589c2cd9..1ecef826ee 100644 --- a/tests/manual/qtabletevent/regular_widgets/main.cpp +++ b/tests/manual/qtabletevent/regular_widgets/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qtbug-8933/main.cpp b/tests/manual/qtbug-8933/main.cpp index 5c12a0cc51..c3310637b9 100644 --- a/tests/manual/qtbug-8933/main.cpp +++ b/tests/manual/qtbug-8933/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qtbug-8933/widget.cpp b/tests/manual/qtbug-8933/widget.cpp index be0a02d05a..6a87857f91 100644 --- a/tests/manual/qtbug-8933/widget.cpp +++ b/tests/manual/qtbug-8933/widget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qtbug-8933/widget.h b/tests/manual/qtbug-8933/widget.h index 5cee97e834..949cd2d11b 100644 --- a/tests/manual/qtbug-8933/widget.h +++ b/tests/manual/qtbug-8933/widget.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qtouchevent/main.cpp b/tests/manual/qtouchevent/main.cpp index 105f4a0302..6d5fbca6a6 100644 --- a/tests/manual/qtouchevent/main.cpp +++ b/tests/manual/qtouchevent/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qtouchevent/touchwidget.cpp b/tests/manual/qtouchevent/touchwidget.cpp index 2dedc8bfac..c26ab50f14 100644 --- a/tests/manual/qtouchevent/touchwidget.cpp +++ b/tests/manual/qtouchevent/touchwidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qtouchevent/touchwidget.h b/tests/manual/qtouchevent/touchwidget.h index e3005eccba..61ad0f9a68 100644 --- a/tests/manual/qtouchevent/touchwidget.h +++ b/tests/manual/qtouchevent/touchwidget.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/qwidget_zorder/main.cpp b/tests/manual/qwidget_zorder/main.cpp index 5bbe3793a1..11e94bada3 100644 --- a/tests/manual/qwidget_zorder/main.cpp +++ b/tests/manual/qwidget_zorder/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/repaint/mainwindow/main.cpp b/tests/manual/repaint/mainwindow/main.cpp index 2cebecca45..5f1020aec6 100644 --- a/tests/manual/repaint/mainwindow/main.cpp +++ b/tests/manual/repaint/mainwindow/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/repaint/scrollarea/main.cpp b/tests/manual/repaint/scrollarea/main.cpp index e64304d2c0..e16866c4d6 100644 --- a/tests/manual/repaint/scrollarea/main.cpp +++ b/tests/manual/repaint/scrollarea/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/repaint/shared/shared.h b/tests/manual/repaint/shared/shared.h index f6a658688a..6cac04ee39 100644 --- a/tests/manual/repaint/shared/shared.h +++ b/tests/manual/repaint/shared/shared.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/repaint/splitter/main.cpp b/tests/manual/repaint/splitter/main.cpp index 8fe1cd2569..a5c329ed82 100644 --- a/tests/manual/repaint/splitter/main.cpp +++ b/tests/manual/repaint/splitter/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/repaint/tableview/main.cpp b/tests/manual/repaint/tableview/main.cpp index 6b88e4c9e4..25ccf5364e 100644 --- a/tests/manual/repaint/tableview/main.cpp +++ b/tests/manual/repaint/tableview/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/repaint/task141091/main.cpp b/tests/manual/repaint/task141091/main.cpp index 5f753f1af1..ac30142ef4 100644 --- a/tests/manual/repaint/task141091/main.cpp +++ b/tests/manual/repaint/task141091/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/repaint/toplevel/main.cpp b/tests/manual/repaint/toplevel/main.cpp index 3a5e813fe8..b5409a2fec 100644 --- a/tests/manual/repaint/toplevel/main.cpp +++ b/tests/manual/repaint/toplevel/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/repaint/widget/main.cpp b/tests/manual/repaint/widget/main.cpp index 300f0df1a4..1564bd2909 100644 --- a/tests/manual/repaint/widget/main.cpp +++ b/tests/manual/repaint/widget/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/socketengine/main.cpp b/tests/manual/socketengine/main.cpp index 115a187385..c81e323df5 100644 --- a/tests/manual/socketengine/main.cpp +++ b/tests/manual/socketengine/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/textrendering/glyphshaping/main.cpp b/tests/manual/textrendering/glyphshaping/main.cpp index a02373f1c8..e3d061dd85 100644 --- a/tests/manual/textrendering/glyphshaping/main.cpp +++ b/tests/manual/textrendering/glyphshaping/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/textrendering/textperformance/main.cpp b/tests/manual/textrendering/textperformance/main.cpp index 654aecde4a..e4907e5ee1 100644 --- a/tests/manual/textrendering/textperformance/main.cpp +++ b/tests/manual/textrendering/textperformance/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/windowflags/controllerwindow.cpp b/tests/manual/windowflags/controllerwindow.cpp index 2694bb861d..f22ec5ec87 100644 --- a/tests/manual/windowflags/controllerwindow.cpp +++ b/tests/manual/windowflags/controllerwindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/windowflags/controllerwindow.h b/tests/manual/windowflags/controllerwindow.h index 2ec91168ee..84c39c9d2b 100644 --- a/tests/manual/windowflags/controllerwindow.h +++ b/tests/manual/windowflags/controllerwindow.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/windowflags/main.cpp b/tests/manual/windowflags/main.cpp index 6bd72b99f6..18d212b88c 100644 --- a/tests/manual/windowflags/main.cpp +++ b/tests/manual/windowflags/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/windowflags/previewwindow.cpp b/tests/manual/windowflags/previewwindow.cpp index 24583220b8..a3e6b49546 100644 --- a/tests/manual/windowflags/previewwindow.cpp +++ b/tests/manual/windowflags/previewwindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/manual/windowflags/previewwindow.h b/tests/manual/windowflags/previewwindow.h index b58f589fc7..91e68ea6b5 100644 --- a/tests/manual/windowflags/previewwindow.h +++ b/tests/manual/windowflags/previewwindow.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** |