diff options
author | Bill King <bking@trolltech.com> | 2010-02-19 04:42:37 (GMT) |
---|---|---|
committer | Bill King <bking@trolltech.com> | 2010-02-19 04:42:37 (GMT) |
commit | 5162616cbfd16fce37c1f26081cbf83f02fb5831 (patch) | |
tree | 66b8a2a58479d438b5c71f2bff453e5357eaef46 | |
parent | 3598150df228148c49aa5212ee42bd56c3690032 (diff) | |
parent | 52e517b50aafd6cc0bec597abd50d8b3f7e982dd (diff) | |
download | Qt-5162616cbfd16fce37c1f26081cbf83f02fb5831.zip Qt-5162616cbfd16fce37c1f26081cbf83f02fb5831.tar.gz Qt-5162616cbfd16fce37c1f26081cbf83f02fb5831.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-sql-team into 4.6
265 files changed, 2114 insertions, 1043 deletions
diff --git a/configure.exe b/configure.exe Binary files differindex 8913de1..09f4ef2 100644..100755 --- a/configure.exe +++ b/configure.exe diff --git a/demos/composition/composition.cpp b/demos/composition/composition.cpp index e03f3e6..deca5dc 100644 --- a/demos/composition/composition.cpp +++ b/demos/composition/composition.cpp @@ -48,6 +48,8 @@ #include <QMouseEvent> #include <qmath.h> +const int animationInterval = 15; // update every 16 ms = ~60FPS + CompositionWidget::CompositionWidget(QWidget *parent) : QWidget(parent) { @@ -236,6 +238,7 @@ CompositionRenderer::CompositionRenderer(QWidget *parent) : ArthurFrame(parent) { m_animation_enabled = true; + m_animationTimer = startTimer(animationInterval); #ifdef Q_WS_QWS m_image = QPixmap(":res/composition/flower.jpg"); m_image.setAlphaChannel(QPixmap(":res/composition/flower_alpha.jpg")); @@ -264,6 +267,20 @@ QRectF rectangle_around(const QPointF &p, const QSizeF &size = QSize(250, 200)) return rect; } +void CompositionRenderer::setAnimationEnabled(bool enabled) +{ + if (m_animation_enabled == enabled) + return; + m_animation_enabled = enabled; + if (enabled) { + Q_ASSERT(!m_animationTimer); + m_animationTimer = startTimer(animationInterval); + } else { + killTimer(m_animationTimer); + m_animationTimer = 0; + } +} + void CompositionRenderer::updateCirclePos() { if (m_current_object != NoObject) @@ -471,10 +488,6 @@ void CompositionRenderer::paint(QPainter *painter) painter->drawImage(0, 0, m_buffer); #endif } - - if (m_animation_enabled && m_current_object == NoObject) { - updateCirclePos(); - } } void CompositionRenderer::mousePressEvent(QMouseEvent *e) @@ -489,6 +502,10 @@ void CompositionRenderer::mousePressEvent(QMouseEvent *e) } else { m_current_object = NoObject; } + if (m_animation_enabled) { + killTimer(m_animationTimer); + m_animationTimer = 0; + } } void CompositionRenderer::mouseMoveEvent(QMouseEvent *e) @@ -500,7 +517,15 @@ void CompositionRenderer::mouseReleaseEvent(QMouseEvent *) { m_current_object = NoObject; - if (m_animation_enabled) + if (m_animation_enabled) { + Q_ASSERT(!m_animationTimer); + m_animationTimer = startTimer(animationInterval); + } +} + +void CompositionRenderer::timerEvent(QTimerEvent *event) +{ + if (event->timerId() == m_animationTimer) updateCirclePos(); } diff --git a/demos/composition/composition.h b/demos/composition/composition.h index 1123531..f5a9fc3 100644 --- a/demos/composition/composition.h +++ b/demos/composition/composition.h @@ -109,10 +109,6 @@ public: void paint(QPainter *); - void mousePressEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); - void mouseReleaseEvent(QMouseEvent *); - void setCirclePos(const QPointF &pos); QSize sizeHint() const { return QSize(500, 400); } @@ -121,6 +117,12 @@ public: int circleColor() const { return m_circle_hue; } int circleAlpha() const { return m_circle_alpha; } +protected: + void mousePressEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void timerEvent(QTimerEvent *); + public slots: void setClearMode() { m_composition_mode = QPainter::CompositionMode_Clear; update(); } void setSourceMode() { m_composition_mode = QPainter::CompositionMode_Source; update(); } @@ -150,7 +152,7 @@ public slots: void setCircleAlpha(int alpha) { m_circle_alpha = alpha; update(); } void setCircleColor(int hue) { m_circle_hue = hue; update(); } - void setAnimationEnabled(bool enabled) { m_animation_enabled = enabled; update(); } + void setAnimationEnabled(bool enabled); private: void updateCirclePos(); @@ -177,6 +179,7 @@ private: ObjectType m_current_object; bool m_animation_enabled; + int m_animationTimer; #ifdef QT_OPENGL_SUPPORT QGLPixelBuffer *m_pbuffer; diff --git a/dist/changes-4.6.3 b/dist/changes-4.6.3 new file mode 100644 index 0000000..57cc453 --- /dev/null +++ b/dist/changes-4.6.3 @@ -0,0 +1,159 @@ +Qt 4.6.3 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 4.6.0. For more details, +refer to the online documentation included in this distribution. The +documentation is also available online: + + http://qt.nokia.com/doc/4.6 + +The Qt version 4.6 series is binary compatible with the 4.5.x series. +Applications compiled for 4.5 will continue to run with 4.6. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker, the (now obsolete) Task +Tracker, or the Merge Request queue of the public source repository. + +Qt Bug Tracker: http://bugreports.qt.nokia.com +Task Tracker: http://qt.nokia.com/developer/task-tracker +Merge Request: http://qt.gitorious.org + +**************************************************************************** +* General * +**************************************************************************** + +New features +------------ + + - SomeClass, SomeOtherClass + * New classes for foo, bar and baz + +Optimizations +------------- + + - Optimized foo in QSomeClass + * See list of Important Behavior Changes below + + +**************************************************************************** +* Library * +**************************************************************************** + +QtCore +------ + + - foo + * bar + +QtGui +----- + + - foo + * bar + +QtDBus +------ + + - foo + * bar + +QtNetwork +--------- + + - foo + * bar + +QtOpenGL +-------- + + - foo + * bar + +QtScript +-------- + + - foo + * bar + +QtSql +----- + + - foo + * bar + +QtXml +----- + + - foo + * bar + +Qt Plugins +---------- + + - foo + * bar + +Third party components +---------------------- + + - Updated foo to version 2.3.9. + + - Updated bar to the latest version from baz.org. + + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +Qt for Unix (X11 and Mac OS X) +------------------------------ + + - + +Qt for Linux/X11 +---------------- + + - + +Qt for Windows +-------------- + + - + +Qt for Mac OS X +--------------- + + - + +Qt for Embedded Linux +--------------------- + + - + +DirectFB +-------- + + - + +Qt for Windows CE +----------------- + + - + +**************************************************************************** +* Tools * +**************************************************************************** + + - Designer + * foo + + - qdoc3 + * bar + + - Linguist + * baz + +**************************************************************************** +* Important Behavior Changes * +**************************************************************************** + + - + diff --git a/doc/src/objectmodel/signalsandslots.qdoc b/doc/src/objectmodel/signalsandslots.qdoc index 951a396..0f3f618 100644 --- a/doc/src/objectmodel/signalsandslots.qdoc +++ b/doc/src/objectmodel/signalsandslots.qdoc @@ -379,7 +379,7 @@ \section1 Signals And Slots With Default Arguments The signatures of signals and slots may contain arguments, and the - arguments can have defualt values. Consider QObject::destroyed(): + arguments can have default values. Consider QObject::destroyed(): \code void destroyed(QObject* = 0); diff --git a/examples/multimedia/audioinput/audioinput.cpp b/examples/multimedia/audioinput/audioinput.cpp index fbf4dc4..8a97640 100644 --- a/examples/multimedia/audioinput/audioinput.cpp +++ b/examples/multimedia/audioinput/audioinput.cpp @@ -48,16 +48,47 @@ #include <QAudioDeviceInfo> #include <QAudioInput> + +#include <QtCore/qendian.h> + #include "audioinput.h" -#define BUFFER_SIZE 4096 +const QString InputTest::PushModeLabel(tr("Enable push mode")); +const QString InputTest::PullModeLabel(tr("Enable pull mode")); +const QString InputTest::SuspendLabel(tr("Suspend recording")); +const QString InputTest::ResumeLabel(tr("Resume recording")); -AudioInfo::AudioInfo(QObject *parent, QAudioInput *device) - :QIODevice(parent) -{ - input = device; +const int BufferSize = 4096; + +AudioInfo::AudioInfo(const QAudioFormat &format, QObject *parent) + : QIODevice(parent) + , m_format(format) + , m_maxAmplitude(0) + , m_level(0.0) - m_maxValue = 0; +{ + switch (m_format.sampleSize()) { + case 8: + switch (m_format.sampleType()) { + case QAudioFormat::UnSignedInt: + m_maxAmplitude = 255; + break; + case QAudioFormat::SignedInt: + m_maxAmplitude = 127; + break; + } + break; + case 16: + switch (m_format.sampleType()) { + case QAudioFormat::UnSignedInt: + m_maxAmplitude = 65535; + break; + case QAudioFormat::SignedInt: + m_maxAmplitude = 32767; + break; + } + break; + } } AudioInfo::~AudioInfo() @@ -84,48 +115,56 @@ qint64 AudioInfo::readData(char *data, qint64 maxlen) qint64 AudioInfo::writeData(const char *data, qint64 len) { - int samples = len/2; // 2 bytes per sample - int maxAmp = 32768; // max for S16 samples - bool clipping = false; - - m_maxValue = 0; - - qint16 *s = (qint16*)data; - - // sample format is S16LE, only! - - for (int i = 0; i < samples; ++i) { - qint16 sample = *s; - s++; - if (abs(sample) > m_maxValue) m_maxValue = abs(sample); + if (m_maxAmplitude) { + Q_ASSERT(m_format.sampleSize() % 8 == 0); + const int channelBytes = m_format.sampleSize() / 8; + const int sampleBytes = m_format.channels() * channelBytes; + Q_ASSERT(len % sampleBytes == 0); + const int numSamples = len / sampleBytes; + + quint16 maxValue = 0; + const unsigned char *ptr = reinterpret_cast<const unsigned char *>(data); + + for (int i = 0; i < numSamples; ++i) { + for(int j = 0; j < m_format.channels(); ++j) { + quint16 value = 0; + + if (m_format.sampleSize() == 8 && m_format.sampleType() == QAudioFormat::UnSignedInt) { + value = *reinterpret_cast<const quint8*>(ptr); + } else if (m_format.sampleSize() == 8 && m_format.sampleType() == QAudioFormat::SignedInt) { + value = qAbs(*reinterpret_cast<const qint8*>(ptr)); + } else if (m_format.sampleSize() == 16 && m_format.sampleType() == QAudioFormat::UnSignedInt) { + if (m_format.byteOrder() == QAudioFormat::LittleEndian) + value = qFromLittleEndian<quint16>(ptr); + else + value = qFromBigEndian<quint16>(ptr); + } else if (m_format.sampleSize() == 16 && m_format.sampleType() == QAudioFormat::SignedInt) { + if (m_format.byteOrder() == QAudioFormat::LittleEndian) + value = qAbs(qFromLittleEndian<qint16>(ptr)); + else + value = qAbs(qFromBigEndian<qint16>(ptr)); + } + + maxValue = qMax(value, maxValue); + ptr += channelBytes; + } + } + + maxValue = qMin(maxValue, m_maxAmplitude); + m_level = qreal(maxValue) / m_maxAmplitude; } - // check for clipping - if (m_maxValue >= (maxAmp - 1)) - clipping = true; - - float value = ((float)m_maxValue/(float)maxAmp); - if (clipping) - m_maxValue = 100; - else - m_maxValue = (int)(value*100); emit update(); - return len; } -int AudioInfo::LinearMax() -{ - return m_maxValue; -} - RenderArea::RenderArea(QWidget *parent) : QWidget(parent) { setBackgroundRole(QPalette::Base); setAutoFillBackground(true); - level = 0; + m_level = 0; setMinimumHeight(30); setMinimumWidth(200); } @@ -139,12 +178,12 @@ void RenderArea::paintEvent(QPaintEvent * /* event */) painter.viewport().top()+10, painter.viewport().right()-20, painter.viewport().bottom()-20)); - if (level == 0) + if (m_level == 0.0) return; painter.setPen(Qt::red); - int pos = ((painter.viewport().right()-20)-(painter.viewport().left()+11))*level/100; + int pos = ((painter.viewport().right()-20)-(painter.viewport().left()+11))*m_level; for (int i = 0; i < 10; ++i) { int x1 = painter.viewport().left()+11; int y1 = painter.viewport().top()+10+i; @@ -157,156 +196,174 @@ void RenderArea::paintEvent(QPaintEvent * /* event */) } } -void RenderArea::setLevel(int value) +void RenderArea::setLevel(qreal value) { - level = value; + m_level = value; repaint(); } InputTest::InputTest() + : m_canvas(0) + , m_modeButton(0) + , m_suspendResumeButton(0) + , m_deviceBox(0) + , m_audioInfo(0) + , m_audioInput(0) + , m_input(0) + , m_pullMode(false) + , m_buffer(BufferSize, 0) { - QWidget *window = new QWidget; - QVBoxLayout* layout = new QVBoxLayout; + initializeWindow(); + initializeAudio(); +} + +InputTest::~InputTest() {} + +void InputTest::initializeWindow() +{ + QScopedPointer<QWidget> window(new QWidget); + QScopedPointer<QVBoxLayout> layout(new QVBoxLayout); - canvas = new RenderArea; - layout->addWidget(canvas); + m_canvas = new RenderArea(this); + layout->addWidget(m_canvas); - deviceBox = new QComboBox(this); + m_deviceBox = new QComboBox(this); QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::availableDevices(QAudio::AudioInput); for(int i = 0; i < devices.size(); ++i) - deviceBox->addItem(devices.at(i).deviceName(), qVariantFromValue(devices.at(i))); + m_deviceBox->addItem(devices.at(i).deviceName(), qVariantFromValue(devices.at(i))); - connect(deviceBox, SIGNAL(activated(int)), SLOT(deviceChanged(int))); - layout->addWidget(deviceBox); + connect(m_deviceBox, SIGNAL(activated(int)), SLOT(deviceChanged(int))); + layout->addWidget(m_deviceBox); - button = new QPushButton(this); - button->setText(tr("Click for Push Mode")); - connect(button, SIGNAL(clicked()), SLOT(toggleMode())); - layout->addWidget(button); + m_modeButton = new QPushButton(this); + m_modeButton->setText(PushModeLabel); + connect(m_modeButton, SIGNAL(clicked()), SLOT(toggleMode())); + layout->addWidget(m_modeButton); - button2 = new QPushButton(this); - button2->setText(tr("Click To Suspend")); - connect(button2, SIGNAL(clicked()), SLOT(toggleSuspend())); - layout->addWidget(button2); + m_suspendResumeButton = new QPushButton(this); + m_suspendResumeButton->setText(SuspendLabel); + connect(m_suspendResumeButton, SIGNAL(clicked()), SLOT(toggleSuspend())); + layout->addWidget(m_suspendResumeButton); - window->setLayout(layout); - setCentralWidget(window); - window->show(); + window->setLayout(layout.data()); + layout.take(); // ownership transferred - buffer = new char[BUFFER_SIZE]; + setCentralWidget(window.data()); + QWidget *const windowPtr = window.take(); // ownership transferred + windowPtr->show(); +} - pullMode = true; +void InputTest::initializeAudio() +{ + m_pullMode = true; - format.setFrequency(8000); - format.setChannels(1); - format.setSampleSize(16); - format.setSampleType(QAudioFormat::SignedInt); - format.setByteOrder(QAudioFormat::LittleEndian); - format.setCodec("audio/pcm"); + m_format.setFrequency(8000); + m_format.setChannels(1); + m_format.setSampleSize(16); + m_format.setSampleType(QAudioFormat::SignedInt); + m_format.setByteOrder(QAudioFormat::LittleEndian); + m_format.setCodec("audio/pcm"); QAudioDeviceInfo info(QAudioDeviceInfo::defaultInputDevice()); - if (!info.isFormatSupported(format)) { - qWarning()<<"default format not supported try to use nearest"; - format = info.nearestFormat(format); + if (!info.isFormatSupported(m_format)) { + qWarning() << "Default format not supported - trying to use nearest"; + m_format = info.nearestFormat(m_format); } - if(format.sampleSize() != 16) { - qWarning()<<"audio device doesn't support 16 bit samples, example cannot run"; - audioInput = 0; - button->setDisabled(true); - button2->setDisabled(true); - return; - } + m_audioInfo = new AudioInfo(m_format, this); + connect(m_audioInfo, SIGNAL(update()), SLOT(refreshDisplay())); - audioInput = new QAudioInput(format,this); - connect(audioInput, SIGNAL(notify()), SLOT(status())); - connect(audioInput, SIGNAL(stateChanged(QAudio::State)), SLOT(state(QAudio::State))); - audioinfo = new AudioInfo(this,audioInput); - connect(audioinfo, SIGNAL(update()), SLOT(refreshDisplay())); - audioinfo->start(); - audioInput->start(audioinfo); + createAudioInput(); } -InputTest::~InputTest() {} +void InputTest::createAudioInput() +{ -void InputTest::status() + m_audioInput = new QAudioInput(m_device, m_format, this); + connect(m_audioInput, SIGNAL(notify()), SLOT(notified())); + connect(m_audioInput, SIGNAL(stateChanged(QAudio::State)), SLOT(stateChanged(QAudio::State))); + m_audioInfo->start(); + m_audioInput->start(m_audioInfo); +} + +void InputTest::notified() { - qWarning()<<"bytesReady = "<<audioInput->bytesReady()<<" bytes, elapsedUSecs = "<<audioInput->elapsedUSecs()<<", processedUSecs = "<<audioInput->processedUSecs(); + qWarning() << "bytesReady = " << m_audioInput->bytesReady() + << ", " << "elapsedUSecs = " <<m_audioInput->elapsedUSecs() + << ", " << "processedUSecs = "<<m_audioInput->processedUSecs(); } void InputTest::readMore() { - if(!audioInput) + if(!m_audioInput) return; - qint64 len = audioInput->bytesReady(); + qint64 len = m_audioInput->bytesReady(); if(len > 4096) len = 4096; - qint64 l = input->read(buffer,len); + qint64 l = m_input->read(m_buffer.data(), len); if(l > 0) { - audioinfo->write(buffer,l); + m_audioInfo->write(m_buffer.constData(), l); } } void InputTest::toggleMode() { // Change bewteen pull and push modes - audioInput->stop(); + m_audioInput->stop(); - if (pullMode) { - button->setText(tr("Click for Pull Mode")); - input = audioInput->start(); - connect(input, SIGNAL(readyRead()), SLOT(readMore())); - pullMode = false; + if (m_pullMode) { + m_modeButton->setText(PullModeLabel); + m_input = m_audioInput->start(); + connect(m_input, SIGNAL(readyRead()), SLOT(readMore())); + m_pullMode = false; } else { - button->setText(tr("Click for Push Mode")); - pullMode = true; - audioInput->start(audioinfo); + m_modeButton->setText(PushModeLabel); + m_pullMode = true; + m_audioInput->start(m_audioInfo); } + + m_suspendResumeButton->setText(SuspendLabel); } void InputTest::toggleSuspend() { // toggle suspend/resume - if(audioInput->state() == QAudio::SuspendedState) { + if(m_audioInput->state() == QAudio::SuspendedState) { qWarning() << "status: Suspended, resume()"; - audioInput->resume(); - button2->setText("Click To Suspend"); - } else if (audioInput->state() == QAudio::ActiveState) { + m_audioInput->resume(); + m_suspendResumeButton->setText(SuspendLabel); + } else if (m_audioInput->state() == QAudio::ActiveState) { qWarning() << "status: Active, suspend()"; - audioInput->suspend(); - button2->setText("Click To Resume"); - } else if (audioInput->state() == QAudio::StoppedState) { + m_audioInput->suspend(); + m_suspendResumeButton->setText(ResumeLabel); + } else if (m_audioInput->state() == QAudio::StoppedState) { qWarning() << "status: Stopped, resume()"; - audioInput->resume(); - button2->setText("Click To Suspend"); - } else if (audioInput->state() == QAudio::IdleState) { + m_audioInput->resume(); + m_suspendResumeButton->setText(SuspendLabel); + } else if (m_audioInput->state() == QAudio::IdleState) { qWarning() << "status: IdleState"; } } -void InputTest::state(QAudio::State state) +void InputTest::stateChanged(QAudio::State state) { - qWarning() << " state=" << state; + qWarning() << "state = " << state; } void InputTest::refreshDisplay() { - canvas->setLevel(audioinfo->LinearMax()); - canvas->repaint(); + m_canvas->setLevel(m_audioInfo->level()); + m_canvas->repaint(); } -void InputTest::deviceChanged(int idx) +void InputTest::deviceChanged(int index) { - audioinfo->stop(); - audioInput->stop(); - audioInput->disconnect(this); - delete audioInput; - - device = deviceBox->itemData(idx).value<QAudioDeviceInfo>(); - audioInput = new QAudioInput(device, format, this); - connect(audioInput, SIGNAL(notify()), SLOT(status())); - connect(audioInput, SIGNAL(stateChanged(QAudio::State)), SLOT(state(QAudio::State))); - audioinfo->start(); - audioInput->start(audioinfo); + m_audioInfo->stop(); + m_audioInput->stop(); + m_audioInput->disconnect(this); + delete m_audioInput; + + m_device = m_deviceBox->itemData(index).value<QAudioDeviceInfo>(); + createAudioInput(); } diff --git a/examples/multimedia/audioinput/audioinput.h b/examples/multimedia/audioinput/audioinput.h index abe2be1..f87c682 100644 --- a/examples/multimedia/audioinput/audioinput.h +++ b/examples/multimedia/audioinput/audioinput.h @@ -45,6 +45,7 @@ #include <QMainWindow> #include <QPushButton> #include <QComboBox> +#include <QByteArray> #include <qaudioinput.h> @@ -52,21 +53,21 @@ class AudioInfo : public QIODevice { Q_OBJECT public: - AudioInfo(QObject *parent, QAudioInput *device); + AudioInfo(const QAudioFormat &format, QObject *parent); ~AudioInfo(); void start(); void stop(); - int LinearMax(); + qreal level() const { return m_level; } qint64 readData(char *data, qint64 maxlen); qint64 writeData(const char *data, qint64 len); - QAudioInput *input; - private: - int m_maxValue; + const QAudioFormat m_format; + quint16 m_maxAmplitude; + qreal m_level; // 0.0 <= m_level <= 1.0 signals: void update(); @@ -80,14 +81,14 @@ class RenderArea : public QWidget public: RenderArea(QWidget *parent = 0); - void setLevel(int value); + void setLevel(qreal value); protected: void paintEvent(QPaintEvent *event); private: - int level; - QPixmap pixmap; + qreal m_level; + QPixmap m_pixmap; }; class InputTest : public QMainWindow @@ -97,29 +98,38 @@ public: InputTest(); ~InputTest(); +private: + void initializeWindow(); + void initializeAudio(); + void createAudioInput(); + private slots: void refreshDisplay(); - void status(); + void notified(); void readMore(); void toggleMode(); void toggleSuspend(); - void state(QAudio::State s); - void deviceChanged(int idx); + void stateChanged(QAudio::State state); + void deviceChanged(int index); private: - AudioInfo *audioinfo; - QAudioDeviceInfo device; - QAudioFormat format; - QAudioInput *audioInput; - QIODevice *input; - RenderArea *canvas; - - bool pullMode; - - QPushButton *button; - QPushButton *button2; - QComboBox *deviceBox; - - char *buffer; + // Owned by layout + RenderArea *m_canvas; + QPushButton *m_modeButton; + QPushButton *m_suspendResumeButton; + QComboBox *m_deviceBox; + + AudioInfo *m_audioInfo; + QAudioDeviceInfo m_device; + QAudioFormat m_format; + QAudioInput *m_audioInput; + QIODevice *m_input; + bool m_pullMode; + QByteArray m_buffer; + + static const QString PushModeLabel; + static const QString PullModeLabel; + static const QString SuspendLabel; + static const QString ResumeLabel; }; diff --git a/examples/multimedia/audiooutput/audiooutput.cpp b/examples/multimedia/audiooutput/audiooutput.cpp index b44accd..4866d36 100644 --- a/examples/multimedia/audiooutput/audiooutput.cpp +++ b/examples/multimedia/audiooutput/audiooutput.cpp @@ -44,30 +44,34 @@ #include <QAudioOutput> #include <QAudioDeviceInfo> +#include <QtCore/qmath.h> +#include <QtCore/qendian.h> #include "audiooutput.h" -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif +const QString AudioTest::PushModeLabel(tr("Enable push mode")); +const QString AudioTest::PullModeLabel(tr("Enable pull mode")); +const QString AudioTest::SuspendLabel(tr("Suspend playback")); +const QString AudioTest::ResumeLabel(tr("Resume playback")); -#define SECONDS 1 -#define FREQ 600 -#define SYSTEM_FREQ 44100 +const int DurationSeconds = 1; +const int ToneFrequencyHz = 600; +const int DataFrequencyHz = 44100; +const int BufferSize = 32768; -Generator::Generator(QObject *parent) - :QIODevice( parent ) + +Generator::Generator(const QAudioFormat &format, + qint64 durationUs, + int frequency, + QObject *parent) + : QIODevice(parent) + , m_pos(0) { - finished = false; - buffer = new char[SECONDS*SYSTEM_FREQ*4+1000]; - t=buffer; - len=fillData(t,FREQ,SECONDS); /* mono FREQHz sine */ - pos = 0; - total = len; + generateData(format, durationUs, frequency); } Generator::~Generator() { - delete [] buffer; + } void Generator::start() @@ -77,47 +81,65 @@ void Generator::start() void Generator::stop() { + m_pos = 0; close(); } -int Generator::putShort(char *t, unsigned int value) +void Generator::generateData(const QAudioFormat &format, qint64 durationUs, int frequency) { - *(unsigned char *)(t++)=value&255; - *(unsigned char *)(t)=(value/256)&255; - return 2; -} - -int Generator::fillData(char *start, int frequency, int seconds) -{ - int i, len=0; - int value; - for(i=0; i<seconds*SYSTEM_FREQ; i++) { - value=(int)(32767.0*sin(2.0*M_PI*((double)(i))*(double)(frequency)/SYSTEM_FREQ)); - putShort(start, value); - start += 4; - len+=2; + const int channelBytes = format.sampleSize() / 8; + const int sampleBytes = format.channels() * channelBytes; + + qint64 length = (format.frequency() * format.channels() * (format.sampleSize() / 8)) + * durationUs / 100000; + + Q_ASSERT(length % sampleBytes == 0); + Q_UNUSED(sampleBytes) // suppress warning in release builds + + m_buffer.resize(length); + unsigned char *ptr = reinterpret_cast<unsigned char *>(m_buffer.data()); + int sampleIndex = 0; + + while (length) { + const qreal x = qSin(2 * M_PI * frequency * qreal(sampleIndex % format.frequency()) / format.frequency()); + for (int i=0; i<format.channels(); ++i) { + if (format.sampleSize() == 8 && format.sampleType() == QAudioFormat::UnSignedInt) { + const quint8 value = static_cast<quint8>((1.0 + x) / 2 * 255); + *reinterpret_cast<quint8*>(ptr) = value; + } else if (format.sampleSize() == 8 && format.sampleType() == QAudioFormat::SignedInt) { + const qint8 value = static_cast<qint8>(x * 127); + *reinterpret_cast<quint8*>(ptr) = value; + } else if (format.sampleSize() == 16 && format.sampleType() == QAudioFormat::UnSignedInt) { + quint16 value = static_cast<quint16>((1.0 + x) / 2 * 65535); + if (format.byteOrder() == QAudioFormat::LittleEndian) + qToLittleEndian<quint16>(value, ptr); + else + qToBigEndian<quint16>(value, ptr); + } else if (format.sampleSize() == 16 && format.sampleType() == QAudioFormat::SignedInt) { + qint16 value = static_cast<qint16>(x * 32767); + if (format.byteOrder() == QAudioFormat::LittleEndian) + qToLittleEndian<qint16>(value, ptr); + else + qToBigEndian<qint16>(value, ptr); + } + + ptr += channelBytes; + length -= channelBytes; + } + ++sampleIndex; } - return len; } -qint64 Generator::readData(char *data, qint64 maxlen) +qint64 Generator::readData(char *data, qint64 len) { - int len = maxlen; - if (len > 16384) - len = 16384; - - if (len < (SECONDS*SYSTEM_FREQ*2)-pos) { - // Normal - memcpy(data,t+pos,len); - pos+=len; - return len; - } else { - // Whats left and reset to start - qint64 left = (SECONDS*SYSTEM_FREQ*2)-pos; - memcpy(data,t+pos,left); - pos=0; - return left; + qint64 total = 0; + while (len - total) { + const qint64 chunk = qMin((m_buffer.size() - m_pos), len - total); + memcpy(data, m_buffer.constData() + m_pos, chunk); + m_pos = (m_pos + chunk) % m_buffer.size(); + total += chunk; } + return total; } qint64 Generator::writeData(const char *data, qint64 len) @@ -128,158 +150,165 @@ qint64 Generator::writeData(const char *data, qint64 len) return 0; } -AudioTest::AudioTest() +qint64 Generator::bytesAvailable() const { - QWidget *window = new QWidget; - QVBoxLayout* layout = new QVBoxLayout; - - deviceBox = new QComboBox(this); - foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) - deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo)); - connect(deviceBox,SIGNAL(activated(int)),SLOT(deviceChanged(int))); - layout->addWidget(deviceBox); - - button = new QPushButton(this); - button->setText(tr("Click for Push Mode")); - connect(button,SIGNAL(clicked()),SLOT(toggle())); - layout->addWidget(button); - - button2 = new QPushButton(this); - button2->setText(tr("Click To Suspend")); - connect(button2,SIGNAL(clicked()),SLOT(togglePlay())); - layout->addWidget(button2); - - window->setLayout(layout); - setCentralWidget(window); - window->show(); + return m_buffer.size() + QIODevice::bytesAvailable(); +} - buffer = new char[BUFFER_SIZE]; +AudioTest::AudioTest() + : m_pullTimer(new QTimer(this)) + , m_modeButton(0) + , m_suspendResumeButton(0) + , m_deviceBox(0) + , m_generator(0) + , m_audioOutput(0) + , m_output(0) + , m_buffer(BufferSize, 0) +{ + initializeWindow(); + initializeAudio(); +} - gen = new Generator(this); +void AudioTest::initializeWindow() +{ + QScopedPointer<QWidget> window(new QWidget); + QScopedPointer<QVBoxLayout> layout(new QVBoxLayout); - pullMode = true; + m_deviceBox = new QComboBox(this); + foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) + m_deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo)); + connect(m_deviceBox,SIGNAL(activated(int)),SLOT(deviceChanged(int))); + layout->addWidget(m_deviceBox); + + m_modeButton = new QPushButton(this); + m_modeButton->setText(PushModeLabel); + connect(m_modeButton, SIGNAL(clicked()), SLOT(toggleMode())); + layout->addWidget(m_modeButton); + + m_suspendResumeButton = new QPushButton(this); + m_suspendResumeButton->setText(SuspendLabel); + connect(m_suspendResumeButton, SIGNAL(clicked()), SLOT(toggleSuspendResume())); + layout->addWidget(m_suspendResumeButton); + + window->setLayout(layout.data()); + layout.take(); // ownership transferred + + setCentralWidget(window.data()); + QWidget *const windowPtr = window.take(); // ownership transferred + windowPtr->show(); +} - timer = new QTimer(this); - connect(timer,SIGNAL(timeout()),SLOT(writeMore())); +void AudioTest::initializeAudio() +{ + connect(m_pullTimer, SIGNAL(timeout()), SLOT(pullTimerExpired())); - gen->start(); + m_pullMode = true; - settings.setFrequency(SYSTEM_FREQ); - settings.setChannels(1); - settings.setSampleSize(16); - settings.setCodec("audio/pcm"); - settings.setByteOrder(QAudioFormat::LittleEndian); - settings.setSampleType(QAudioFormat::SignedInt); + m_format.setFrequency(DataFrequencyHz); + m_format.setChannels(1); + m_format.setSampleSize(16); + m_format.setCodec("audio/pcm"); + m_format.setByteOrder(QAudioFormat::LittleEndian); + m_format.setSampleType(QAudioFormat::SignedInt); QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice()); - if (!info.isFormatSupported(settings)) { - qWarning()<<"default format not supported try to use nearest"; - settings = info.nearestFormat(settings); + if (!info.isFormatSupported(m_format)) { + qWarning() << "Default format not supported - trying to use nearest"; + m_format = info.nearestFormat(m_format); } - if(settings.sampleSize() != 16) { - qWarning()<<"audio device doesn't support 16 bit samples, example cannot run"; - button->setDisabled(true); - button2->setDisabled(true); - audioOutput = 0; - return; - } + m_generator = new Generator(m_format, DurationSeconds*1000000, ToneFrequencyHz, this); - audioOutput = new QAudioOutput(settings,this); - connect(audioOutput,SIGNAL(notify()),SLOT(status())); - connect(audioOutput,SIGNAL(stateChanged(QAudio::State)),SLOT(state(QAudio::State))); + createAudioOutput(); +} - audioOutput->start(gen); +void AudioTest::createAudioOutput() +{ + delete m_audioOutput; + m_audioOutput = 0; + m_audioOutput = new QAudioOutput(m_format, this); + connect(m_audioOutput, SIGNAL(notify()), SLOT(notified())); + connect(m_audioOutput, SIGNAL(stateChanged(QAudio::State)), SLOT(stateChanged(QAudio::State))); + m_generator->start(); + m_audioOutput->start(m_generator); } AudioTest::~AudioTest() { - delete [] buffer; + } -void AudioTest::deviceChanged(int idx) +void AudioTest::deviceChanged(int index) { - timer->stop(); - gen->stop(); - audioOutput->stop(); - audioOutput->disconnect(this); - delete audioOutput; - - device = deviceBox->itemData(idx).value<QAudioDeviceInfo>(); - audioOutput = new QAudioOutput(device,settings,this); - connect(audioOutput,SIGNAL(notify()),SLOT(status())); - connect(audioOutput,SIGNAL(stateChanged(QAudio::State)),SLOT(state(QAudio::State))); - gen->start(); - audioOutput->start(gen); + m_pullTimer->stop(); + m_generator->stop(); + m_audioOutput->stop(); + m_audioOutput->disconnect(this); + m_device = m_deviceBox->itemData(index).value<QAudioDeviceInfo>(); + createAudioOutput(); } -void AudioTest::status() +void AudioTest::notified() { - qWarning() << "byteFree = " << audioOutput->bytesFree() << " bytes, elapsedUSecs = " << audioOutput->elapsedUSecs() << ", processedUSecs = " << audioOutput->processedUSecs(); + qWarning() << "bytesFree = " << m_audioOutput->bytesFree() + << ", " << "elapsedUSecs = " << m_audioOutput->elapsedUSecs() + << ", " << "processedUSecs = " << m_audioOutput->processedUSecs(); } -void AudioTest::writeMore() +void AudioTest::pullTimerExpired() { - if (!audioOutput) - return; - - if (audioOutput->state() == QAudio::StoppedState) - return; - - int l; - int out; - - int chunks = audioOutput->bytesFree()/audioOutput->periodSize(); - while(chunks) { - l = gen->read(buffer,audioOutput->periodSize()); - if (l > 0) - out = output->write(buffer,l); - if (l != audioOutput->periodSize()) - break; - chunks--; + if (m_audioOutput && m_audioOutput->state() != QAudio::StoppedState) { + int chunks = m_audioOutput->bytesFree()/m_audioOutput->periodSize(); + while (chunks) { + const qint64 len = m_generator->read(m_buffer.data(), m_audioOutput->periodSize()); + if (len) + m_output->write(m_buffer.data(), len); + if (len != m_audioOutput->periodSize()) + break; + --chunks; + } } } -void AudioTest::toggle() +void AudioTest::toggleMode() { - // Change between pull and push modes - - timer->stop(); - audioOutput->stop(); - - if (pullMode) { - button->setText("Click for Pull Mode"); - output = audioOutput->start(); - pullMode = false; - timer->start(20); + m_pullTimer->stop(); + m_audioOutput->stop(); + + if (m_pullMode) { + m_modeButton->setText(PullModeLabel); + m_output = m_audioOutput->start(); + m_pullMode = false; + m_pullTimer->start(20); } else { - button->setText("Click for Push Mode"); - pullMode = true; - audioOutput->start(gen); + m_modeButton->setText(PushModeLabel); + m_pullMode = true; + m_audioOutput->start(m_generator); } + + m_suspendResumeButton->setText(SuspendLabel); } -void AudioTest::togglePlay() +void AudioTest::toggleSuspendResume() { - // toggle suspend/resume - if (audioOutput->state() == QAudio::SuspendedState) { + if (m_audioOutput->state() == QAudio::SuspendedState) { qWarning() << "status: Suspended, resume()"; - audioOutput->resume(); - button2->setText("Click To Suspend"); - } else if (audioOutput->state() == QAudio::ActiveState) { + m_audioOutput->resume(); + m_suspendResumeButton->setText(SuspendLabel); + } else if (m_audioOutput->state() == QAudio::ActiveState) { qWarning() << "status: Active, suspend()"; - audioOutput->suspend(); - button2->setText("Click To Resume"); - } else if (audioOutput->state() == QAudio::StoppedState) { + m_audioOutput->suspend(); + m_suspendResumeButton->setText(ResumeLabel); + } else if (m_audioOutput->state() == QAudio::StoppedState) { qWarning() << "status: Stopped, resume()"; - audioOutput->resume(); - button2->setText("Click To Suspend"); - } else if (audioOutput->state() == QAudio::IdleState) { + m_audioOutput->resume(); + m_suspendResumeButton->setText(SuspendLabel); + } else if (m_audioOutput->state() == QAudio::IdleState) { qWarning() << "status: IdleState"; } } -void AudioTest::state(QAudio::State state) +void AudioTest::stateChanged(QAudio::State state) { - qWarning() << " state=" << state; + qWarning() << "state = " << state; } diff --git a/examples/multimedia/audiooutput/audiooutput.h b/examples/multimedia/audiooutput/audiooutput.h index 372cf78..889482b 100644 --- a/examples/multimedia/audiooutput/audiooutput.h +++ b/examples/multimedia/audiooutput/audiooutput.h @@ -41,14 +41,13 @@ #include <math.h> -#define BUFFER_SIZE 32768 - #include <QObject> #include <QMainWindow> #include <QIODevice> #include <QTimer> #include <QPushButton> #include <QComboBox> +#include <QByteArray> #include <QAudioOutput> @@ -56,26 +55,22 @@ class Generator : public QIODevice { Q_OBJECT public: - Generator(QObject *parent); + Generator(const QAudioFormat &format, qint64 durationUs, int frequency, QObject *parent); ~Generator(); void start(); void stop(); - char *t; - int len; - int pos; - int total; - char *buffer; - bool finished; - int chunk_size; - qint64 readData(char *data, qint64 maxlen); qint64 writeData(const char *data, qint64 len); + qint64 bytesAvailable() const; private: - int putShort(char *t, unsigned int value); - int fillData(char *start, int frequency, int seconds); + void generateData(const QAudioFormat &format, qint64 durationUs, int frequency); + +private: + qint64 m_pos; + QByteArray m_buffer; }; class AudioTest : public QMainWindow @@ -85,26 +80,39 @@ public: AudioTest(); ~AudioTest(); - QAudioDeviceInfo device; - Generator* gen; - QAudioOutput* audioOutput; - QIODevice* output; - QTimer* timer; - QAudioFormat settings; +private: + void initializeWindow(); + void initializeAudio(); + void createAudioOutput(); + +private: + QTimer* m_pullTimer; + + // Owned by layout + QPushButton* m_modeButton; + QPushButton* m_suspendResumeButton; + QComboBox* m_deviceBox; + + QAudioDeviceInfo m_device; + Generator* m_generator; + QAudioOutput* m_audioOutput; + QIODevice* m_output; // not owned + QAudioFormat m_format; - bool pullMode; - char* buffer; + bool m_pullMode; + QByteArray m_buffer; - QPushButton* button; - QPushButton* button2; - QComboBox* deviceBox; + static const QString PushModeLabel; + static const QString PullModeLabel; + static const QString SuspendLabel; + static const QString ResumeLabel; private slots: - void status(); - void writeMore(); - void toggle(); - void togglePlay(); - void state(QAudio::State s); - void deviceChanged(int idx); + void notified(); + void pullTimerExpired(); + void toggleMode(); + void toggleSuspendResume(); + void stateChanged(QAudio::State state); + void deviceChanged(int index); }; diff --git a/header.BSD b/header.BSD new file mode 100644 index 0000000..3c0d604 --- /dev/null +++ b/header.BSD @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + diff --git a/header.LGPL b/header.LGPL new file mode 100644 index 0000000..4fbd874 --- /dev/null +++ b/header.LGPL @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + diff --git a/header.LGPL-ONLY b/header.LGPL-ONLY new file mode 100644 index 0000000..59b4c04 --- /dev/null +++ b/header.LGPL-ONLY @@ -0,0 +1,22 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL-ONLY$ +** 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 6113746..7b2ee91 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -75,15 +75,7 @@ QMAKE_LIBS_COMPAT = QMAKE_LIBS_QT_ENTRY = -llibcrt0.lib QMAKE_LIBS_S60 = -lavkon -!isEmpty(QMAKE_SH) { - QMAKE_COPY = cp - QMAKE_COPY_DIR = cp -r - QMAKE_MOVE = mv - QMAKE_DEL_FILE = rm -f - QMAKE_MKDIR = mkdir - QMAKE_DEL_DIR = rmdir - QMAKE_CHK_DIR_EXISTS = test -d -} else { +contains(QMAKE_HOST.os,Windows) { QMAKE_COPY = copy /y QMAKE_COPY_DIR = xcopy /s /q /y /i QMAKE_MOVE = move @@ -91,6 +83,14 @@ QMAKE_LIBS_S60 = -lavkon QMAKE_MKDIR = mkdir QMAKE_DEL_DIR = rmdir QMAKE_CHK_DIR_EXISTS = if not exist +} else { + QMAKE_COPY = cp + QMAKE_COPY_DIR = cp -r + QMAKE_MOVE = mv + QMAKE_DEL_FILE = rm -f + QMAKE_MKDIR = mkdir + QMAKE_DEL_DIR = rmdir + QMAKE_CHK_DIR_EXISTS = test -d } QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index 61988d3..2055f81 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -1348,7 +1348,7 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy removeSpecialCharacters(bldinfDefine); t << "#ifndef " << bldinfDefine << endl; - t << "\t#include \"" << QDir::toNativeSeparators(bldinfFilename) << "\"" << endl; + t << "\t#include \"" << bldinfFilename << "\"" << endl; t << "#endif // " << bldinfDefine << endl; } diff --git a/src/corelib/arch/qatomic_symbian.h b/src/corelib/arch/qatomic_symbian.h index f1d332f..fa4e4a9 100644 --- a/src/corelib/arch/qatomic_symbian.h +++ b/src/corelib/arch/qatomic_symbian.h @@ -42,7 +42,7 @@ #ifndef QATOMIC_SYMBIAN_H #define QATOMIC_SYMBIAN_H -#include <qglobal.h> +#include <QtCore/qglobal.h> #include <e32std.h> QT_BEGIN_HEADER diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h index a099dd9..169fe82 100644 --- a/src/corelib/codecs/qtextcodec.h +++ b/src/corelib/codecs/qtextcodec.h @@ -170,8 +170,10 @@ private: friend class QXmlStreamWriter; friend class QXmlStreamWriterPrivate; +#if defined(Q_OS_MAC32) || defined(Q_OS_AIX) friend class QCoreXmlStreamWriter; friend class QCoreXmlStreamWriterPrivate; +#endif }; class Q_CORE_EXPORT QTextDecoder { diff --git a/src/corelib/concurrent/qfuture.h b/src/corelib/concurrent/qfuture.h index e402335..02ae40a 100644 --- a/src/corelib/concurrent/qfuture.h +++ b/src/corelib/concurrent/qfuture.h @@ -111,7 +111,7 @@ public: { public: typedef std::bidirectional_iterator_tag iterator_category; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef T value_type; typedef const T *pointer; typedef const T &reference; diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 9a15bf1..efee610 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -35,4 +35,20 @@ symbian: { # Workaroud for problems with paging this dll MMP_RULES -= PAGED MMP_RULES *= UNPAGED + + # Partial upgrade SIS file + vendorinfo = \ + "&EN" \ + "; Localised Vendor name" \ + "%{\"Nokia, Qt\"}" \ + " " \ + "; Unique Vendor name" \ + ":\"Nokia, Qt\"" \ + " " + pu_header = "; Partial upgrade package for testing QtCore changes without reinstalling everything" \ + "$${LITERAL_HASH}{\"Qt corelib\"}, (0x2001E61C), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU" + partial_upgrade.pkg_prerules = pu_header vendorinfo + partial_upgrade.sources = qtcore.dll + partial_upgrade.path = c:/sys/bin + DEPLOYMENT = partial_upgrade $$DEPLOYMENT } diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index 82d3b79..f27ecc1 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -156,6 +156,13 @@ QT_BEGIN_NAMESPACE data, followed by the data. Note that any encoding/decoding of the data (apart from the length quint32) must be done by you. + \section1 Reading and writing Qt collection classes + + The Qt collection classes can also be serialized to a QDataStream. + These include QList, QLinkedList, QVector, QSet, QHash, and QMap. + These classes have have stream operators declared as non-member of + the class. + \target Serializing Qt Classes \section1 Reading and writing other Qt classes. diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp index f088ded..731406f 100644 --- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp +++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp @@ -260,12 +260,22 @@ void QKqueueFileSystemWatcherEngine::run() DEBUG() << "QKqueueFileSystemWatcherEngine: processing kevent" << kev.ident << kev.filter; if (fd == kqpipe[0]) { - char c; - if (read(kqpipe[0], &c, 1) != 1) { + // read all pending data from the pipe + QByteArray ba; + ba.resize(kev.data); + if (read(kqpipe[0], ba.data(), ba.size()) != ba.size()) { perror("QKqueueFileSystemWatcherEngine: error reading from pipe"); return; } - switch (c) { + // read the command from the buffer (but break and return on 'q') + char cmd = 0; + for (int i = 0; i < ba.size(); ++i) { + cmd = ba.constData()[i]; + if (cmd == 'q') + break; + } + // handle the command + switch (cmd) { case 'q': DEBUG() << "QKqueueFileSystemWatcherEngine: thread received 'q', exiting..."; return; @@ -273,7 +283,7 @@ void QKqueueFileSystemWatcherEngine::run() DEBUG() << "QKqueueFileSystemWatcherEngine: thread received '@', continuing..."; break; default: - DEBUG() << "QKqueueFileSystemWatcherEngine: thread received unknow message" << c; + DEBUG() << "QKqueueFileSystemWatcherEngine: thread received unknow message" << cmd; break; } } else { diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index bec0075..139075f 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -1484,7 +1484,7 @@ QAbstractFileEngine::FileFlags QFSFileEnginePrivate::getPermissions() const { //### what to do with permissions if we don't use NTFS // for now just add all permissions and what about exe missions ?? - // also qt_ntfs_permission_lookup is now not set by defualt ... should it ? + // also qt_ntfs_permission_lookup is now not set by default ... should it ? ret |= QAbstractFileEngine::ReadOtherPerm | QAbstractFileEngine::ReadGroupPerm | QAbstractFileEngine::ReadOwnerPerm | QAbstractFileEngine::ReadUserPerm | QAbstractFileEngine::WriteUserPerm | QAbstractFileEngine::WriteOwnerPerm diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index cbc87f3..93becc8 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -68,6 +68,14 @@ extern uint qGlobalPostedEventsCount(); # define QS_RAWINPUT 0x0400 #endif +#ifndef WM_TOUCH +# define WM_TOUCH 0x0240 +#endif +#ifndef WM_GESTURE +# define WM_GESTURE 0x0119 +# define WM_GESTURENOTIFY 0x011A +#endif + enum { WM_QT_SOCKETNOTIFIER = WM_USER, WM_QT_SENDPOSTEDEVENTS = WM_USER + 1, @@ -714,6 +722,9 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags) && msg.message <= WM_MOUSELAST) || msg.message == WM_MOUSEWHEEL || msg.message == WM_MOUSEHWHEEL + || msg.message == WM_TOUCH + || msg.message == WM_GESTURE + || msg.message == WM_GESTURENOTIFY || msg.message == WM_CLOSE)) { // queue user input events for later processing haveMessage = false; diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h index 1f7fdb2..f767962 100644 --- a/src/corelib/tools/qcontiguouscache.h +++ b/src/corelib/tools/qcontiguouscache.h @@ -97,7 +97,7 @@ public: typedef const value_type* const_pointer; typedef value_type& reference; typedef const value_type& const_reference; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef int size_type; explicit QContiguousCache(int capacity = 0); @@ -221,22 +221,29 @@ void QContiguousCache<T>::setCapacity(int asize) x.d->alloc = asize; x.d->count = qMin(d->count, asize); x.d->offset = d->offset + d->count - x.d->count; - x.d->start = x.d->offset % x.d->alloc; - T *dest = x.p->array + (x.d->start + x.d->count-1) % x.d->alloc; - T *src = p->array + (d->start + d->count-1) % d->alloc; + if(asize) + x.d->start = x.d->offset % x.d->alloc; + else + x.d->start = 0; + int oldcount = x.d->count; - while (oldcount--) { - if (QTypeInfo<T>::isComplex) { - new (dest) T(*src); - } else { - *dest = *src; + if(oldcount) + { + T *dest = x.p->array + (x.d->start + x.d->count-1) % x.d->alloc; + T *src = p->array + (d->start + d->count-1) % d->alloc; + while (oldcount--) { + if (QTypeInfo<T>::isComplex) { + new (dest) T(*src); + } else { + *dest = *src; + } + if (dest == x.p->array) + dest = x.p->array + x.d->alloc; + dest--; + if (src == p->array) + src = p->array + d->alloc; + src--; } - if (dest == x.p->array) - dest = x.p->array + x.d->alloc; - dest--; - if (src == p->array) - src = p->array + d->alloc; - src--; } /* free old */ free(p); diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 5e93523..05eae42 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -329,7 +329,7 @@ public: public: typedef std::bidirectional_iterator_tag iterator_category; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef T value_type; typedef T *pointer; typedef T &reference; @@ -394,7 +394,7 @@ public: public: typedef std::bidirectional_iterator_tag iterator_category; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef T value_type; typedef const T *pointer; typedef const T &reference; @@ -478,7 +478,7 @@ public: // STL compatibility typedef T mapped_type; typedef Key key_type; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef int size_type; inline bool empty() const { return isEmpty(); } diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h index f6de966..bfcf24f 100644 --- a/src/corelib/tools/qlinkedlist.h +++ b/src/corelib/tools/qlinkedlist.h @@ -113,7 +113,7 @@ public: { public: typedef std::bidirectional_iterator_tag iterator_category; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef T value_type; typedef T *pointer; typedef T &reference; @@ -146,7 +146,7 @@ public: { public: typedef std::bidirectional_iterator_tag iterator_category; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef T value_type; typedef const T *pointer; typedef const T &reference; @@ -212,7 +212,7 @@ public: typedef const value_type *const_pointer; typedef value_type &reference; typedef const value_type &const_reference; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; #ifndef QT_NO_STL static inline QLinkedList<T> fromStdList(const std::list<T> &list) diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 120442d..a549f2f 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -112,7 +112,7 @@ class QList public: inline QList() : d(&QListData::shared_null) { d->ref.ref(); } inline QList(const QList<T> &l) : d(l.d) { d->ref.ref(); if (!d->sharable) detach_helper(); } - ~QList(); + ~QList(); // ### Qt5: make this destructor virtual QList<T> &operator=(const QList<T> &l); bool operator==(const QList<T> &l) const; inline bool operator!=(const QList<T> &l) const { return !(*this == l); } @@ -163,7 +163,7 @@ public: public: Node *i; typedef std::random_access_iterator_tag iterator_category; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef T value_type; typedef T *pointer; typedef T &reference; @@ -210,7 +210,7 @@ public: public: Node *i; typedef std::random_access_iterator_tag iterator_category; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef T value_type; typedef const T *pointer; typedef const T &reference; @@ -289,7 +289,7 @@ public: typedef const value_type *const_pointer; typedef value_type &reference; typedef const value_type &const_reference; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; #ifdef QT3_SUPPORT inline QT3_SUPPORT iterator remove(iterator pos) { return erase(pos); } diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index e71064c..4679812 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -213,7 +213,7 @@ public: public: typedef std::bidirectional_iterator_tag iterator_category; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef T value_type; typedef T *pointer; typedef T &reference; @@ -281,7 +281,7 @@ public: public: typedef std::bidirectional_iterator_tag iterator_category; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef T value_type; typedef const T *pointer; typedef const T &reference; @@ -384,7 +384,7 @@ public: // STL compatibility typedef Key key_type; typedef T mapped_type; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef int size_type; inline bool empty() const { return isEmpty(); } diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h index 6525880..b266deb 100644 --- a/src/corelib/tools/qset.h +++ b/src/corelib/tools/qset.h @@ -97,7 +97,7 @@ public: public: typedef std::bidirectional_iterator_tag iterator_category; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef T value_type; typedef const T *pointer; typedef const T &reference; @@ -132,7 +132,7 @@ public: public: typedef std::bidirectional_iterator_tag iterator_category; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef T value_type; typedef const T *pointer; typedef const T &reference; @@ -188,11 +188,10 @@ public: typedef const value_type *const_pointer; typedef value_type &reference; typedef const value_type &const_reference; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef int size_type; inline bool empty() const { return isEmpty(); } - // comfort inline QSet<T> &operator<<(const T &value) { insert(value); return *this; } inline QSet<T> &operator|=(const QSet<T> &other) { unite(other); return *this; } diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 8fbfcda..964b279 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -132,7 +132,7 @@ namespace QtSharedPointer { typedef const value_type *const_pointer; typedef value_type &reference; typedef const value_type &const_reference; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; inline T *data() const { return value; } inline bool isNull() const { return !data(); } @@ -541,7 +541,7 @@ public: typedef const value_type *const_pointer; typedef value_type &reference; typedef const value_type &const_reference; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; inline bool isNull() const { return d == 0 || d->strongref == 0 || value == 0; } #ifndef Q_CC_NOKIAX86 diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 90b7442..ac7c795 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -163,7 +163,7 @@ public: public: T *i; typedef std::random_access_iterator_tag iterator_category; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef T value_type; typedef T *pointer; typedef T &reference; @@ -196,7 +196,7 @@ public: public: T *i; typedef std::random_access_iterator_tag iterator_category; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef T value_type; typedef const T *pointer; typedef const T &reference; @@ -260,7 +260,7 @@ public: typedef const value_type* const_pointer; typedef value_type& reference; typedef const value_type& const_reference; - typedef ptrdiff_t difference_type; + typedef qptrdiff difference_type; typedef iterator Iterator; typedef const_iterator ConstIterator; typedef int size_type; diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 44abf7b..6cb4924 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -1937,7 +1937,7 @@ int QDBusConnectionPrivate::sendWithReplyAsync(const QDBusMessage &message, QObj QDBusPendingCallPrivate *pcall = sendWithReplyAsync(message, timeout); Q_ASSERT(pcall); - // has it already finished (dispatched locally)? + // has it already finished with success (dispatched locally)? if (pcall->replyMessage.type() == QDBusMessage::ReplyMessage) { pcall->setReplyCallback(receiver, returnMethod); processFinishedCall(pcall); @@ -1945,33 +1945,24 @@ int QDBusConnectionPrivate::sendWithReplyAsync(const QDBusMessage &message, QObj return 1; } + // either it hasn't finished or it has finished with error + if (errorMethod) { + pcall->watcherHelper = new QDBusPendingCallWatcherHelper; + connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), receiver, errorMethod, + Qt::QueuedConnection); + pcall->watcherHelper->moveToThread(thread()); + } + // has it already finished and is an error reply message? if (pcall->replyMessage.type() == QDBusMessage::ErrorMessage) { - if (errorMethod) { - pcall->watcherHelper = new QDBusPendingCallWatcherHelper; - connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), receiver, errorMethod); - pcall->watcherHelper->moveToThread(thread()); - } processFinishedCall(pcall); delete pcall; return 1; } - // has it already finished with error? - if (pcall->replyMessage.type() != QDBusMessage::InvalidMessage) { - delete pcall; - return 0; - } - pcall->autoDelete = true; pcall->ref.ref(); - pcall->setReplyCallback(receiver, returnMethod); - if (errorMethod) { - pcall->watcherHelper = new QDBusPendingCallWatcherHelper; - connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), receiver, errorMethod); - pcall->watcherHelper->moveToThread(thread()); - } return 1; } diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 7d1d03d..ce4ce6a 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -726,7 +726,8 @@ void QGraphicsColorizeEffect::draw(QPainter *painter) elements. The level of detail can be modified using the setBlurRadius() function. Use setBlurHints() to choose the blur hints. - By default, the blur radius is 5 pixels. + By default, the blur radius is 5 pixels. The blur radius is specified in + device coordinates. \img graphicseffect-blur.png @@ -781,6 +782,9 @@ QGraphicsBlurEffect::~QGraphicsBlurEffect() radius results in a more blurred appearance. By default, the blur radius is 5 pixels. + + The radius is given in device coordinates, meaning it is + unaffected by scale. */ qreal QGraphicsBlurEffect::blurRadius() const { @@ -884,7 +888,8 @@ void QGraphicsBlurEffect::draw(QPainter *painter) By default, the drop shadow is a semi-transparent dark gray (QColor(63, 63, 63, 180)) shadow, blurred with a radius of 1 at an offset - of 8 pixels towards the lower right. + of 8 pixels towards the lower right. The drop shadow offset is specified + in device coordinates. \img graphicseffect-drop-shadow.png @@ -913,6 +918,9 @@ QGraphicsDropShadowEffect::~QGraphicsDropShadowEffect() By default, the offset is 8 pixels towards the lower right. + The offset is given in device coordinates, which means it is + unaffected by scale. + \sa xOffset(), yOffset(), blurRadius(), color() */ QPointF QGraphicsDropShadowEffect::offset() const diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp index 4d447cb..0ed95ea 100644 --- a/src/gui/egl/qegl.cpp +++ b/src/gui/egl/qegl.cpp @@ -101,7 +101,7 @@ bool QEglContext::chooseConfig // If we want the best pixel format, then return the first // matching configuration. if (match == QEgl::BestPixelFormat) { - eglChooseConfig(dpy, props.properties(), &cfg, 1, &matching); + eglChooseConfig(display(), props.properties(), &cfg, 1, &matching); if (matching < 1) continue; return true; @@ -111,13 +111,13 @@ bool QEglContext::chooseConfig // first that matches the pixel format we wanted. EGLint size = matching; EGLConfig *configs = new EGLConfig [size]; - eglChooseConfig(dpy, props.properties(), configs, size, &matching); + eglChooseConfig(display(), props.properties(), configs, size, &matching); for (EGLint index = 0; index < size; ++index) { EGLint red, green, blue, alpha; - eglGetConfigAttrib(dpy, configs[index], EGL_RED_SIZE, &red); - eglGetConfigAttrib(dpy, configs[index], EGL_GREEN_SIZE, &green); - eglGetConfigAttrib(dpy, configs[index], EGL_BLUE_SIZE, &blue); - eglGetConfigAttrib(dpy, configs[index], EGL_ALPHA_SIZE, &alpha); + eglGetConfigAttrib(display(), configs[index], EGL_RED_SIZE, &red); + eglGetConfigAttrib(display(), configs[index], EGL_GREEN_SIZE, &green); + eglGetConfigAttrib(display(), configs[index], EGL_BLUE_SIZE, &blue); + eglGetConfigAttrib(display(), configs[index], EGL_ALPHA_SIZE, &alpha); if (red == props.value(EGL_RED_SIZE) && green == props.value(EGL_GREEN_SIZE) && blue == props.value(EGL_BLUE_SIZE) && @@ -181,7 +181,7 @@ bool QEglContext::createContext(QEglContext *shareContext, const QEglProperties } } if (ctx == EGL_NO_CONTEXT) { - ctx = eglCreateContext(dpy, cfg, 0, contextProps.properties()); + ctx = eglCreateContext(display(), cfg, 0, contextProps.properties()); if (ctx == EGL_NO_CONTEXT) { qWarning() << "QEglContext::createContext(): Unable to create EGL context:" << errorString(eglGetError()); return false; @@ -197,7 +197,7 @@ void QEglContext::destroySurface(EGLSurface surface) if (surface != EGL_NO_SURFACE) { if (surface == currentSurface) doneCurrent(); - eglDestroySurface(dpy, surface); + eglDestroySurface(display(), surface); } } @@ -205,8 +205,7 @@ void QEglContext::destroySurface(EGLSurface surface) void QEglContext::destroyContext() { if (ctx != EGL_NO_CONTEXT && ownsContext) - eglDestroyContext(dpy, ctx); - dpy = EGL_NO_DISPLAY; + eglDestroyContext(display(), ctx); ctx = EGL_NO_CONTEXT; cfg = 0; } @@ -343,7 +342,7 @@ QEglProperties QEglContext::configProperties(EGLConfig cfg) const QEglProperties props; for (int name = 0x3020; name <= 0x304F; ++name) { EGLint value; - if (name != EGL_NONE && eglGetConfigAttrib(dpy, cfg, name, &value)) + if (name != EGL_NONE && eglGetConfigAttrib(display(), cfg, name, &value)) props.setValue(name, value); } eglGetError(); // Clear the error state. @@ -417,7 +416,7 @@ void QEglContext::dumpAllConfigs() if (!eglGetConfigs(display(), 0, 0, &count) || count < 1) return; EGLConfig *configs = new EGLConfig [count]; - eglGetConfigs(dpy, configs, count, &count); + eglGetConfigs(display(), configs, count, &count); for (EGLint index = 0; index < count; ++index) { props = configProperties(configs[index]); qWarning() << props.toString(); diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 3cdf8ce..2f208b7 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -357,19 +357,22 @@ default, child items are stacked on top of the parent item. But setting this flag, the child will be stacked behind it. This flag is useful for drop shadow effects and for decoration objects that follow the parent - item's geometry without drawing on top of it. + item's geometry without drawing on top of it. This flag was introduced + in Qt 4.5. \value ItemUsesExtendedStyleOption The item makes use of either - \l{QStyleOptionGraphicsItem::}{exposedRect} or - \l{QStyleOptionGraphicsItem::}{matrix} in QStyleOptionGraphicsItem. By default, - the \l{QStyleOptionGraphicsItem::}{exposedRect} is initialized to the item's - boundingRect() and the \l{QStyleOptionGraphicsItem::}{matrix} is untransformed. - You can enable this flag for the style options to be set up with more - fine-grained values. - Note that QStyleOptionGraphicsItem::levelOfDetail is unaffected by this flag + \l{QStyleOptionGraphicsItem::} {exposedRect} or + \l{QStyleOptionGraphicsItem::} {matrix} in + QStyleOptionGraphicsItem. By default, the + \l{QStyleOptionGraphicsItem::} {exposedRect} is initialized to the + item's boundingRect() and the + \l{QStyleOptionGraphicsItem::}{matrix} is untransformed. You can + enable this flag for the style options to be set up with more + fine-grained values. Note that + QStyleOptionGraphicsItem::levelOfDetail is unaffected by this flag and always initialized to 1. Use - QStyleOptionGraphicsItem::levelOfDetailFromTransform() if you need a higher - value. + QStyleOptionGraphicsItem::levelOfDetailFromTransform() if you need + a higher value. This flag was introduced in Qt 4.6. \value ItemHasNoContents The item does not paint anything (i.e., calling paint() on the item has no effect). You should set this flag on items that @@ -387,9 +390,10 @@ used for Asian languages. This flag was introduced in Qt 4.6. - \value ItemNegativeZStacksBehindParent The item automatically stacks behind - it's parent if it's z-value is negative. This flag enables setZValue() to - toggle ItemStacksBehindParent. + \value ItemNegativeZStacksBehindParent The item automatically + stacks behind it's parent if it's z-value is negative. This flag + enables setZValue() to toggle ItemStacksBehindParent. This flag + was introduced in Qt 4.6. \value ItemIsPanel The item is a panel. A panel provides activation and contained focus handling. Only one panel can be active at a time (see diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 66707fc..4472272 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5132,6 +5132,8 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool } /*! + \obsolete + Paints the given \a items using the provided \a painter, after the background has been drawn, and before the foreground has been drawn. All painting is done in \e scene coordinates. Before @@ -5154,7 +5156,7 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool \snippet doc/src/snippets/graphicssceneadditemsnippet.cpp 0 - \obsolete Since Qt 4.6, this function is not called anymore unless + Since Qt 4.6, this function is not called anymore unless the QGraphicsView::IndirectPainting flag is given as an Optimization flag. @@ -5710,8 +5712,15 @@ void QGraphicsScenePrivate::touchEventHandler(QTouchEvent *sceneTouchEvent) item->d_ptr->acceptedTouchBeginEvent = true; bool res = sendTouchBeginEvent(item, &touchEvent) && touchEvent.isAccepted(); - if (!res) + if (!res) { + // forget about these touch points, we didn't handle them + for (int i = 0; i < touchEvent.touchPoints().count(); ++i) { + const QTouchEvent::TouchPoint &touchPoint = touchEvent.touchPoints().at(i); + itemForTouchPointId.remove(touchPoint.id()); + sceneCurrentTouchPoints.remove(touchPoint.id()); + } ignoreSceneTouchEvent = false; + } break; } default: @@ -5902,13 +5911,21 @@ void QGraphicsScenePrivate::getGestureTargets(const QSet<QGesture *> &gestures, QList<QGraphicsItem *> items = itemsAtPosition(screenPos, QPointF(), viewport); QList<QGraphicsObject *> result; for (int j = 0; j < items.size(); ++j) { - QGraphicsObject *item = items.at(j)->toGraphicsObject(); - if (!item) - continue; - QGraphicsItemPrivate *d = item->QGraphicsItem::d_func(); - if (d->gestureContext.contains(gestureType)) { - result.append(item); + QGraphicsItem *item = items.at(j); + + // Check if the item is blocked by a modal panel and use it as + // a target instead of this item. + (void) item->isBlockedByModalPanel(&item); + + if (QGraphicsObject *itemobj = item->toGraphicsObject()) { + QGraphicsItemPrivate *d = item->d_func(); + if (d->gestureContext.contains(gestureType)) { + result.append(itemobj); + } } + // Don't propagate through panels. + if (item->isPanel()) + break; } DEBUG() << "QGraphicsScenePrivate::getGestureTargets:" << gesture << result; diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 96b9373..06b7438 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -3609,6 +3609,8 @@ void QGraphicsView::drawForeground(QPainter *painter, const QRectF &rect) } /*! + \obsolete + Draws the items \a items in the scene using \a painter, after the background and before the foreground are drawn. \a numItems is the number of items in \a items and options in \a options. \a options is a list of @@ -3617,7 +3619,7 @@ void QGraphicsView::drawForeground(QPainter *painter, const QRectF &rect) The default implementation calls the scene's drawItems() function. - \obsolete Since Qt 4.6, this function is not called anymore unless + Since Qt 4.6, this function is not called anymore unless the QGraphicsView::IndirectPainting flag is given as an Optimization flag. diff --git a/src/gui/gui.pro b/src/gui/gui.pro index 8ad3bac..d46f3b4 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -51,8 +51,27 @@ contains(DEFINES,QT_EVAL):include($$QT_SOURCE_TREE/src/corelib/eval.pri) QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist DEFINES += Q_INTERNAL_QAPP_SRC -symbian:TARGET.UID3=0x2001B2DD +symbian: { + TARGET.UID3=0x2001B2DD + + # ro-section in gui can exceed default allocated space, so move rw-section a little further + QMAKE_LFLAGS.ARMCC += --rw-base 0x800000 + QMAKE_LFLAGS.GCCE += -Tdata 0xC00000 + + # Partial upgrade SIS file + vendorinfo = \ + "&EN" \ + "; Localised Vendor name" \ + "%{\"Nokia, Qt\"}" \ + " " \ + "; Unique Vendor name" \ + ":\"Nokia, Qt\"" \ + " " + pu_header = "; Partial upgrade package for testing QtGui changes without reinstalling everything" \ + "$${LITERAL_HASH}{\"Qt gui\"}, (0x2001E61C), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU" + partial_upgrade.pkg_prerules = pu_header vendorinfo + partial_upgrade.sources = qtgui.dll + partial_upgrade.path = c:/sys/bin + DEPLOYMENT = partial_upgrade $$DEPLOYMENT +} -# ro-section in gui can exceed default allocated space, so more rw-section little further -symbian-sbsv2: QMAKE_LFLAGS.ARMCC += --rw-base 0x800000 -symbian: QMAKE_LFLAGS.GCCE += -Tdata 0xC00000 diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index cbd9a8a..adf3ce3 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -1540,6 +1540,11 @@ bool QAbstractItemView::event(QEvent *event) case QEvent::FontChange: d->doDelayedItemsLayout(); // the size of the items will change break; +#ifdef QT_SOFTKEYS_ENABLED + case QEvent::LanguageChange: + d->doneSoftKey->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::DoneSoftKey)); + break; +#endif default: break; } diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm index c7c7caf..df09185 100644 --- a/src/gui/kernel/qeventdispatcher_mac.mm +++ b/src/gui/kernel/qeventdispatcher_mac.mm @@ -492,6 +492,14 @@ static bool IsMouseOrKeyEvent( NSEvent* event ) case NSOtherMouseDown: case NSOtherMouseUp: case NSOtherMouseDragged: +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + case NSEventTypeGesture: // touch events + case NSEventTypeMagnify: + case NSEventTypeSwipe: + case NSEventTypeRotate: + case NSEventTypeBeginGesture: + case NSEventTypeEndGesture: +#endif result = true; break; diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 6d108b0..7412b06 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -55,24 +55,24 @@ QT_BEGIN_NAMESPACE QSoftKeyManager *QSoftKeyManagerPrivate::self = 0; -const char *QSoftKeyManager::standardSoftKeyText(StandardSoftKey standardKey) +QString QSoftKeyManager::standardSoftKeyText(StandardSoftKey standardKey) { - const char *softKeyText = 0; + QString softKeyText; switch (standardKey) { case OkSoftKey: - softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Ok"); + softKeyText = QSoftKeyManager::tr("Ok"); break; case SelectSoftKey: - softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Select"); + softKeyText = QSoftKeyManager::tr("Select"); break; case DoneSoftKey: - softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Done"); + softKeyText = QSoftKeyManager::tr("Done"); break; case MenuSoftKey: - softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Options"); + softKeyText = QSoftKeyManager::tr("Options"); break; case CancelSoftKey: - softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Cancel"); + softKeyText = QSoftKeyManager::tr("Cancel"); break; default: break; @@ -100,8 +100,7 @@ QSoftKeyManager::QSoftKeyManager() : QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *actionWidget) { - const char* text = standardSoftKeyText(standardKey); - QAction *action = new QAction(QSoftKeyManager::tr(text), actionWidget); + QAction *action = new QAction(standardSoftKeyText(standardKey), actionWidget); QAction::SoftKeyRole softKeyRole = QAction::NoSoftKey; switch (standardKey) { case MenuSoftKey: // FALL-THROUGH diff --git a/src/gui/kernel/qsoftkeymanager_p.h b/src/gui/kernel/qsoftkeymanager_p.h index ce902fe..a6fe17e 100644 --- a/src/gui/kernel/qsoftkeymanager_p.h +++ b/src/gui/kernel/qsoftkeymanager_p.h @@ -87,6 +87,7 @@ public: static QAction *createAction(StandardSoftKey standardKey, QWidget *actionWidget); static QAction *createKeyedAction(StandardSoftKey standardKey, Qt::Key key, QWidget *actionWidget); + static QString standardSoftKeyText(StandardSoftKey standardKey); protected: bool event(QEvent *e); @@ -94,7 +95,6 @@ protected: private: QSoftKeyManager(); static QSoftKeyManager *instance(); - static const char *standardSoftKeyText(StandardSoftKey standardKey); bool appendSoftkeys(const QWidget &source, int level); QWidget *softkeySource(QWidget *previousSource, bool& recursiveMerging); bool handleUpdateSoftKeys(); diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 7a3da20..070491d 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -8092,20 +8092,43 @@ void qInitDrawhelperAsm() qDrawHelper[QImage::Format_ARGB32_Premultiplied].blendColor = qt_blend_color_argb_sse3dnow; } #endif // 3DNOW - extern void qt_blend_rgb32_on_rgb32_sse(uchar *destPixels, int dbpl, - const uchar *srcPixels, int sbpl, - int w, int h, - int const_alpha); - extern void qt_blend_argb32_on_argb32_sse(uchar *destPixels, int dbpl, - const uchar *srcPixels, int sbpl, - int w, int h, - int const_alpha); - qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse; - qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse; - qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse; - qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse; - } + +#ifdef QT_HAVE_SSE2 + if (features & SSE2) { + extern void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha); + extern void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha); + + + qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2; + qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2; + qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2; + qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2; + } else +#endif + { + extern void qt_blend_rgb32_on_rgb32_sse(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha); + extern void qt_blend_argb32_on_argb32_sse(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha); + + + qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse; + qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse; + qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse; + qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse; + } +} #endif // SSE #ifdef QT_HAVE_IWMMXT diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp index dd6fa1b..6ac64d3 100644 --- a/src/gui/painting/qdrawhelper_sse2.cpp +++ b/src/gui/painting/qdrawhelper_sse2.cpp @@ -57,6 +57,217 @@ QT_BEGIN_NAMESPACE +/* + * Multiply the components of pixelVector by alphaChannel + * Each 32bits components of alphaChannel must be in the form 0x00AA00AA + * colorMask must have 0x00ff00ff on each 32 bits component + * half must have the value 128 (0x80) for each 32 bits compnent + */ +#define BYTE_MUL_SSE2(result, pixelVector, alphaChannel, colorMask, half) \ +{ \ + /* 1. separate the colors in 2 vectors so each color is on 16 bits \ + (in order to be multiplied by the alpha \ + each 32 bit of dstVectorAG are in the form 0x00AA00GG \ + each 32 bit of dstVectorRB are in the form 0x00RR00BB */\ + __m128i pixelVectorAG = _mm_srli_epi16(pixelVector, 8); \ + __m128i pixelVectorRB = _mm_and_si128(pixelVector, colorMask); \ + \ + /* 2. multiply the vectors by the alpha channel */\ + pixelVectorAG = _mm_mullo_epi16(pixelVectorAG, alphaChannel); \ + pixelVectorRB = _mm_mullo_epi16(pixelVectorRB, alphaChannel); \ + \ + /* 3. devide by 255, that's the tricky part. \ + we do it like for BYTE_MUL(), with bit shift: X/255 ~= (X + X/256 + rounding)/256 */ \ + /** so first (X + X/256 + rounding) */\ + pixelVectorRB = _mm_add_epi16(pixelVectorRB, _mm_srli_epi16(pixelVectorRB, 8)); \ + pixelVectorRB = _mm_add_epi16(pixelVectorRB, half); \ + pixelVectorAG = _mm_add_epi16(pixelVectorAG, _mm_srli_epi16(pixelVectorAG, 8)); \ + pixelVectorAG = _mm_add_epi16(pixelVectorAG, half); \ + \ + /** second devide by 256 */\ + pixelVectorRB = _mm_srli_epi16(pixelVectorRB, 8); \ + /** for AG, we could >> 8 to divide followed by << 8 to put the \ + bytes in the correct position. By masking instead, we execute \ + only one instruction */\ + pixelVectorAG = _mm_andnot_si128(colorMask, pixelVectorAG); \ + \ + /* 4. combine the 2 pairs of colors */ \ + result = _mm_or_si128(pixelVectorAG, pixelVectorRB); \ +} + +/* + * Each 32bits components of alphaChannel must be in the form 0x00AA00AA + * oneMinusAlphaChannel must be 255 - alpha for each 32 bits component + * colorMask must have 0x00ff00ff on each 32 bits component + * half must have the value 128 (0x80) for each 32 bits compnent + */ +#define INTERPOLATE_PIXEL_255_SSE2(result, srcVector, dstVector, alphaChannel, oneMinusAlphaChannel, colorMask, half) { \ + /* interpolate AG */\ + __m128i srcVectorAG = _mm_srli_epi16(srcVector, 8); \ + __m128i dstVectorAG = _mm_srli_epi16(dstVector, 8); \ + __m128i srcVectorAGalpha = _mm_mullo_epi16(srcVectorAG, alphaChannel); \ + __m128i dstVectorAGoneMinusAlphalpha = _mm_mullo_epi16(dstVectorAG, oneMinusAlphaChannel); \ + __m128i finalAG = _mm_add_epi16(srcVectorAGalpha, dstVectorAGoneMinusAlphalpha); \ + finalAG = _mm_add_epi16(finalAG, _mm_srli_epi16(finalAG, 8)); \ + finalAG = _mm_add_epi16(finalAG, half); \ + finalAG = _mm_andnot_si128(colorMask, finalAG); \ + \ + /* interpolate RB */\ + __m128i srcVectorRB = _mm_and_si128(srcVector, colorMask); \ + __m128i dstVectorRB = _mm_and_si128(dstVector, colorMask); \ + __m128i srcVectorRBalpha = _mm_mullo_epi16(srcVectorRB, alphaChannel); \ + __m128i dstVectorRBoneMinusAlphalpha = _mm_mullo_epi16(dstVectorRB, oneMinusAlphaChannel); \ + __m128i finalRB = _mm_add_epi16(srcVectorRBalpha, dstVectorRBoneMinusAlphalpha); \ + finalRB = _mm_add_epi16(finalRB, _mm_srli_epi16(finalRB, 8)); \ + finalRB = _mm_add_epi16(finalRB, half); \ + finalRB = _mm_srli_epi16(finalRB, 8); \ + \ + /* combine */\ + result = _mm_or_si128(finalAG, finalRB); \ +} + +void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha) +{ + const quint32 *src = (const quint32 *) srcPixels; + quint32 *dst = (uint *) destPixels; + if (const_alpha == 256) { + const __m128i alphaMask = _mm_set1_epi32(0xff000000); + const __m128i nullVector = _mm_set1_epi32(0); + const __m128i half = _mm_set1_epi16(0x80); + const __m128i one = _mm_set1_epi16(0xff); + const __m128i colorMask = _mm_set1_epi32(0x00ff00ff); + for (int y = 0; y < h; ++y) { + int x = 0; + for (; x < w-3; x += 4) { + const __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]); + const __m128i srcVectorAlpha = _mm_and_si128(srcVector, alphaMask); + if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, alphaMask)) == 0xffff) { + // all opaque + _mm_storeu_si128((__m128i *)&dst[x], srcVector); + } else if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, nullVector)) != 0xffff) { + // not fully transparent + // result = s + d * (1-alpha) + + // extract the alpha channel on 2 x 16 bits + // so we have room for the multiplication + // each 32 bits will be in the form 0x00AA00AA + // with A being the 1 - alpha + __m128i alphaChannel = _mm_srli_epi32(srcVector, 24); + alphaChannel = _mm_or_si128(alphaChannel, _mm_slli_epi32(alphaChannel, 16)); + alphaChannel = _mm_sub_epi16(one, alphaChannel); + + const __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]); + __m128i destMultipliedByOneMinusAlpha; + BYTE_MUL_SSE2(destMultipliedByOneMinusAlpha, dstVector, alphaChannel, colorMask, half); + + // result = s + d * (1-alpha) + const __m128i result = _mm_add_epi8(srcVector, destMultipliedByOneMinusAlpha); + _mm_storeu_si128((__m128i *)&dst[x], result); + } + } + for (; x<w; ++x) { + uint s = src[x]; + if (s >= 0xff000000) + dst[x] = s; + else if (s != 0) + dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); + } + dst = (quint32 *)(((uchar *) dst) + dbpl); + src = (const quint32 *)(((const uchar *) src) + sbpl); + } + } else if (const_alpha != 0) { + // dest = (s + d * sia) * ca + d * cia + // = s * ca + d * (sia * ca + cia) + // = s * ca + d * (1 - sa*ca) + const_alpha = (const_alpha * 255) >> 8; + const __m128i nullVector = _mm_set1_epi32(0); + const __m128i half = _mm_set1_epi16(0x80); + const __m128i one = _mm_set1_epi16(0xff); + const __m128i colorMask = _mm_set1_epi32(0x00ff00ff); + const __m128i constAlphaVector = _mm_set1_epi16(const_alpha); + for (int y = 0; y < h; ++y) { + int x = 0; + for (; x < w-3; x += 4) { + __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]); + if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVector, nullVector)) != 0xffff) { + BYTE_MUL_SSE2(srcVector, srcVector, constAlphaVector, colorMask, half); + + __m128i alphaChannel = _mm_srli_epi32(srcVector, 24); + alphaChannel = _mm_or_si128(alphaChannel, _mm_slli_epi32(alphaChannel, 16)); + alphaChannel = _mm_sub_epi16(one, alphaChannel); + + const __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]); + __m128i destMultipliedByOneMinusAlpha; + BYTE_MUL_SSE2(destMultipliedByOneMinusAlpha, dstVector, alphaChannel, colorMask, half); + + const __m128i result = _mm_add_epi8(srcVector, destMultipliedByOneMinusAlpha); + _mm_storeu_si128((__m128i *)&dst[x], result); + } + } + for (; x<w; ++x) { + quint32 s = src[x]; + if (s != 0) { + s = BYTE_MUL(s, const_alpha); + dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); + } + } + dst = (quint32 *)(((uchar *) dst) + dbpl); + src = (const quint32 *)(((const uchar *) src) + sbpl); + } + } +} + +// qblendfunctions.cpp +void qt_blend_rgb32_on_rgb32(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha); + +void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha) +{ + const quint32 *src = (const quint32 *) srcPixels; + quint32 *dst = (uint *) destPixels; + if (const_alpha != 256) { + if (const_alpha != 0) { + const __m128i nullVector = _mm_set1_epi32(0); + const __m128i half = _mm_set1_epi16(0x80); + const __m128i colorMask = _mm_set1_epi32(0x00ff00ff); + + const_alpha = (const_alpha * 255) >> 8; + int one_minus_const_alpha = 255 - const_alpha; + const __m128i constAlphaVector = _mm_set1_epi16(const_alpha); + const __m128i oneMinusConstAlpha = _mm_set1_epi16(one_minus_const_alpha); + for (int y = 0; y < h; ++y) { + int x = 0; + for (; x < w-3; x += 4) { + __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]); + if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVector, nullVector)) != 0xffff) { + const __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]); + __m128i result; + INTERPOLATE_PIXEL_255_SSE2(result, srcVector, dstVector, constAlphaVector, oneMinusConstAlpha, colorMask, half); + _mm_storeu_si128((__m128i *)&dst[x], result); + } + } + for (; x<w; ++x) { + quint32 s = src[x]; + s = BYTE_MUL(s, const_alpha); + dst[x] = INTERPOLATE_PIXEL_255(src[x], const_alpha, dst[x], one_minus_const_alpha); + } + dst = (quint32 *)(((uchar *) dst) + dbpl); + src = (const quint32 *)(((const uchar *) src) + sbpl); + } + } + } else { + qt_blend_rgb32_on_rgb32(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); + } +} + void qt_memfill32_sse2(quint32 *dest, quint32 value, int count) { if (count < 7) { diff --git a/src/gui/painting/qdrawhelper_x86_p.h b/src/gui/painting/qdrawhelper_x86_p.h index 30aadd0..d7282a7 100644 --- a/src/gui/painting/qdrawhelper_x86_p.h +++ b/src/gui/painting/qdrawhelper_x86_p.h @@ -114,6 +114,14 @@ void qt_bitmapblit32_sse2(QRasterBuffer *rasterBuffer, int x, int y, void qt_bitmapblit16_sse2(QRasterBuffer *rasterBuffer, int x, int y, quint32 color, const uchar *src, int width, int height, int stride); +void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha); +void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha); #endif // QT_HAVE_SSE2 #ifdef QT_HAVE_IWMMXT diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index bc56ed0..3c2cc8c 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -100,10 +100,6 @@ #endif #include <limits.h> -#if defined(QT_NO_FPU) || (_MSC_VER >= 1300 && _MSC_VER < 1400) -# define FLOATING_POINT_BUGGY_OR_NO_FPU -#endif - QT_BEGIN_NAMESPACE extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp @@ -3679,9 +3675,6 @@ void QRasterPaintEngine::drawEllipse(const QRectF &rect) if (((qpen_style(s->lastPen) == Qt::SolidLine && s->flags.fast_pen) || (qpen_style(s->lastPen) == Qt::NoPen && !s->flags.antialiased)) && qMax(rect.width(), rect.height()) < QT_RASTER_COORD_LIMIT -#ifdef FLOATING_POINT_BUGGY_OR_NO_FPU - && qMax(rect.width(), rect.height()) < 128 // integer math breakdown -#endif && s->matrix.type() <= QTransform::TxScale) // no shear { ensureBrush(); @@ -6054,15 +6047,9 @@ static void drawEllipse_midpoint_i(const QRect &rect, const QRect &clip, ProcessSpans pen_func, ProcessSpans brush_func, QSpanData *pen_data, QSpanData *brush_data) { -#ifdef FLOATING_POINT_BUGGY_OR_NO_FPU // no fpu, so use fixed point - const QFixed a = QFixed(rect.width()) >> 1; - const QFixed b = QFixed(rect.height()) >> 1; - QFixed d = b*b - (a*a*b) + ((a*a) >> 2); -#else const qreal a = qreal(rect.width()) / 2; const qreal b = qreal(rect.height()) / 2; qreal d = b*b - (a*a*b) + 0.25*a*a; -#endif int x = 0; int y = (rect.height() + 1) / 2; @@ -6085,12 +6072,7 @@ static void drawEllipse_midpoint_i(const QRect &rect, const QRect &clip, pen_func, brush_func, pen_data, brush_data); // region 2 -#ifdef FLOATING_POINT_BUGGY_OR_NO_FPU - d = b*b*(x + (QFixed(1) >> 1))*(x + (QFixed(1) >> 1)) - + a*a*((y - 1)*(y - 1) - b*b); -#else d = b*b*(x + 0.5)*(x + 0.5) + a*a*((y - 1)*(y - 1) - b*b); -#endif const int miny = rect.height() & 0x1; while (y > miny) { if (d < 0) { // select SE diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp index 6cbf3d9..028ec48 100644 --- a/src/gui/painting/qwindowsurface_s60.cpp +++ b/src/gui/painting/qwindowsurface_s60.cpp @@ -149,11 +149,19 @@ void QS60WindowSurface::flush(QWidget *widget, const QRegion ®ion, const QPoi Q_ASSERT(window); QTLWExtra *topExtra = window->d_func()->maybeTopData(); Q_ASSERT(topExtra); + QRect qr = region.boundingRect(); if (!topExtra->inExpose) { topExtra->inExpose = true; // Prevent DrawNow() from calling syncBackingStore() again - TRect tr = qt_QRect2TRect(region.boundingRect()); + TRect tr = qt_QRect2TRect(qr); widget->winId()->DrawNow(tr); topExtra->inExpose = false; + } else { + // This handles the case when syncBackingStore updates content outside of the + // original drawing rectangle. This might happen if there are pending update() + // events at the same time as we get a Draw() from Symbian. + QRect drawRect = qt_TRect2QRect(widget->winId()->DrawableWindow()->GetDrawRect()); + if (!drawRect.contains(qr)) + widget->winId()->DrawDeferred(); } } diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 14e9b95..ea7399f 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -289,6 +289,9 @@ void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter, case SE_Editor: drawFrame(SF_FrameLineEdit, painter, rect, flags | SF_PointNorth); break; + case SE_DropArea: + drawPart(QS60StyleEnums::SP_QgnGrafOrgBgGrid, painter, rect, flags | SF_PointNorth); + break; default: break; } @@ -844,15 +847,18 @@ QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlag result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth)); break; - case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed: case QS60StyleEnums::SP_QsnCpScrollHandleTopPressed: - case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed: case QS60StyleEnums::SP_QsnCpScrollBgBottom: - case QS60StyleEnums::SP_QsnCpScrollBgMiddle: case QS60StyleEnums::SP_QsnCpScrollBgTop: case QS60StyleEnums::SP_QsnCpScrollHandleBottom: - case QS60StyleEnums::SP_QsnCpScrollHandleMiddle: case QS60StyleEnums::SP_QsnCpScrollHandleTop: + case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed: + result.setHeight(pixelMetric(QStyle::PM_ScrollBarExtent)); + result.setWidth(pixelMetric(QStyle::PM_ScrollBarExtent)); + break; + case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed: + case QS60StyleEnums::SP_QsnCpScrollBgMiddle: + case QS60StyleEnums::SP_QsnCpScrollHandleMiddle: result.setHeight(pixelMetric(QStyle::PM_ScrollBarExtent)); result.setWidth(pixelMetric(QStyle::PM_ScrollBarSliderMin)); break; @@ -2271,14 +2277,16 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti QS60StyleEnums::SkinParts skinPart = (option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper; int minDimension = qMin(option->rect.width(), option->rect.height()); - const int resizeValue = minDimension >> 1; - minDimension += resizeValue; // Adjust the icon bigger because of empty space in svg icon. QRect iconRect(option->rect.topLeft(), QSize(minDimension, minDimension)); - int verticalMagic(0); - // magic values for positioning svg icon. - if (option->rect.width() <= option->rect.height()) - verticalMagic = 3; - iconRect.translate(3, verticalMagic - resizeValue); + const int magicTweak = 3; + int resizeValue = minDimension >> 1; + if (!QS60StylePrivate::isTouchSupported()) { + minDimension += resizeValue; // Adjust the icon bigger because of empty space in svg icon. + iconRect.setSize(QSize(minDimension, minDimension)); + const int verticalMagic = (option->rect.width() <= option->rect.height()) ? magicTweak : 0; + resizeValue = verticalMagic - resizeValue; + } + iconRect.translate(magicTweak, resizeValue); QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, flags); } } @@ -2302,7 +2310,12 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti break; case PE_PanelScrollAreaCorner: break; - + case PE_IndicatorItemViewItemDrop: + if (QS60StylePrivate::isTouchSupported()) + QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_DropArea, painter, option->rect, flags); + else + commonStyleDraws = true; + break; // todo: items are below with #ifdefs "just in case". in final version, remove all non-required cases case PE_FrameLineEdit: case PE_IndicatorDockWidgetResizeHandle: @@ -2323,7 +2336,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti #endif //QT_NO_TOOLBAR #ifndef QT_NO_COLUMNVIEW case PE_IndicatorColumnViewArrow: - case PE_IndicatorItemViewItemDrop: #endif //QT_NO_COLUMNVIEW case PE_FrameTabBarBase: // since tabs are in S60 always in navipane, let's use common style for tab base in Qt. default: @@ -2481,6 +2493,9 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w case SH_FormLayoutWrapPolicy: retValue = QFormLayout::WrapLongRows; break; + case SH_ScrollBar_ContextMenu: + retValue = false; + break; default: retValue = QCommonStyle::styleHint(sh, opt, widget, hret); break; diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index eae2291..ea30b81 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -131,6 +131,7 @@ public: SP_QgnGrafBarFrameSideL, SP_QgnGrafBarFrameSideR, SP_QgnGrafBarProgress, + SP_QgnGrafOrgBgGrid, SP_QgnGrafScrollArrowDown, SP_QgnGrafScrollArrowLeft, SP_QgnGrafScrollArrowRight, @@ -428,6 +429,7 @@ public: SE_ScrollBarHandlePressedVertical, SE_ButtonInactive, SE_Editor, + SE_DropArea }; enum SkinFrameElements { diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 872bc2b..d57b187 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -178,6 +178,8 @@ const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { /* SP_QgnGrafBarFrameSideL */ {KAknsIIDQgnGrafBarFrameSideL, EDrawIcon, ES60_All, -1,-1}, /* SP_QgnGrafBarFrameSideR */ {KAknsIIDQgnGrafBarFrameSideR, EDrawIcon, ES60_All, -1,-1}, /* SP_QgnGrafBarProgress */ {KAknsIIDQgnGrafBarProgress, EDrawIcon, ES60_All, -1,-1}, + // No drop area for 3.x non-touch devices + /* SP_QgnGrafOrgBgGrid */ {KAknsIIDNone, EDrawIcon, ES60_3_X, EAknsMajorGeneric ,0x1eba}, //KAknsIIDQgnGrafOrgBgGrid /* SP_QgnGrafScrollArrowDown */ {KAknsIIDQgnGrafScrollArrowDown, EDrawGulIcon, ES60_All, -1,-1}, /* SP_QgnGrafScrollArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawGulIcon, ES60_All, -1,-1}, /* SP_QgnGrafScrollArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawGulIcon, ES60_All, -1,-1}, diff --git a/src/gui/text/qfontdatabase_win.cpp b/src/gui/text/qfontdatabase_win.cpp index 05c8f08..a6ceee1 100644 --- a/src/gui/text/qfontdatabase_win.cpp +++ b/src/gui/text/qfontdatabase_win.cpp @@ -336,8 +336,18 @@ void addFontToDatabase(QString familyName, const QString &scriptName, signature->fsCsb[0], signature->fsCsb[1] }; QList<QFontDatabase::WritingSystem> systems = determineWritingSystemsFromTrueTypeBits(unicodeRange, codePageRange); - for (int i = 0; i < systems.count(); ++i) - family->writingSystems[systems.at(i)] = QtFontFamily::Supported; + + for (int i = 0; i < systems.count(); ++i) { + QFontDatabase::WritingSystem writingSystem = systems.at(i); + + // ### Hack to work around problem with Thai text on Windows 7. Segoe UI contains + // the symbol for Baht, and Windows thus reports that it supports the Thai script. + // Since it's the default UI font on this platform, most widgets will be unable to + // display Thai text by default. As a temporary work around, we special case Segoe UI + // and remove the Thai script from its list of supported writing systems. + if (writingSystem != QFontDatabase::Thai || familyName != QLatin1String("Segoe UI")) + family->writingSystems[writingSystem] = QtFontFamily::Supported; + } } else if (!family->writingSystemCheck) { //qDebug("family='%s' script=%s", family->name.latin1(), script.latin1()); if (scriptName == QLatin1String("Western") diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 72f32dc..585db70 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -607,7 +607,13 @@ void QComboBoxPrivateContainer::changeEvent(QEvent *e) view->setMouseTracking(combo->style()->styleHint(QStyle::SH_ComboBox_ListMouseTracking, &opt, combo) || combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, combo)); setFrameStyle(combo->style()->styleHint(QStyle::SH_ComboBox_PopupFrameStyle, &opt, combo)); +#ifdef QT_SOFTKEYS_ENABLED + } else if (e->type() == QEvent::LanguageChange) { + selectAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::SelectSoftKey)); + cancelAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::CancelSoftKey)); +#endif } + QWidget::changeEvent(e); } diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp index d754800..0c39f42 100644 --- a/src/gui/widgets/qdockarealayout.cpp +++ b/src/gui/widgets/qdockarealayout.cpp @@ -2635,7 +2635,7 @@ void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list, QSize bottom_max = docks[QInternal::BottomDock].maximumSize(); bottom_hint = bottom_hint.boundedTo(bottom_max).expandedTo(bottom_min); - fallbackToSizeHints = !have_central; + fallbackToSizeHints = false; if (_ver_struct_list != 0) { QVector<QLayoutStruct> &ver_struct_list = *_ver_struct_list; diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 269cd12..e7c4f45 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -1426,6 +1426,11 @@ bool QMainWindow::event(QEvent *event) } break; #endif +#ifdef QT_SOFTKEYS_ENABLED + case QEvent::LanguageChange: + d->menuBarAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::MenuSoftKey)); + break; +#endif default: break; } diff --git a/src/gui/widgets/qmainwindowlayout.cpp b/src/gui/widgets/qmainwindowlayout.cpp index fc75c92..593e391 100644 --- a/src/gui/widgets/qmainwindowlayout.cpp +++ b/src/gui/widgets/qmainwindowlayout.cpp @@ -1772,6 +1772,7 @@ void QMainWindowLayout::setCentralWidget(QWidget *widget) if (savedState.isValid()) { #ifndef QT_NO_DOCKWIDGET savedState.dockAreaLayout.centralWidgetItem = layoutState.dockAreaLayout.centralWidgetItem; + savedState.dockAreaLayout.fallbackToSizeHints = true; #else savedState.centralWidgetItem = layoutState.centralWidgetItem; #endif diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 8ce7cc0..42b7406 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -117,7 +117,7 @@ public: if (parentWidget->parentWidget()) parentWidget = parentWidget->parentWidget(); setParent(parentWidget, Qt::Window | Qt::Tool); - setAttribute(Qt::WA_DeleteOnClose, true); + setAttribute(Qt::WA_DeleteOnClose, true); setAttribute(Qt::WA_X11NetWmWindowTypeMenu, true); setWindowTitle(p->windowTitle()); setEnabled(p->isEnabled()); @@ -1226,7 +1226,7 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action) else if (action->isSeparator()) option->menuItemType = QStyleOptionMenuItem::Separator; else if (d->defaultAction == action) - option->menuItemType = QStyleOptionMenuItem::DefaultItem; + option->menuItemType = QStyleOptionMenuItem::DefaultItem; else option->menuItemType = QStyleOptionMenuItem::Normal; if (action->isIconVisibleInMenu()) @@ -1719,7 +1719,14 @@ bool QMenu::isEmpty() const void QMenu::clear() { QList<QAction*> acts = actions(); + for(int i = 0; i < acts.size(); i++) { +#ifdef QT_SOFTKEYS_ENABLED + Q_D(QMenu); + // Lets not touch to our internal softkey actions + if(acts[i] == d->selectAction || acts[i] == d->cancelAction) + continue; +#endif removeAction(acts[i]); if (acts[i]->parent() == this && acts[i]->d_func()->widgets.isEmpty()) delete acts[i]; @@ -2408,6 +2415,13 @@ QMenu::event(QEvent *e) } return true; #endif +#ifdef QT_SOFTKEYS_ENABLED + case QEvent::LanguageChange: { + d->selectAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::SelectSoftKey)); + d->cancelAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::CancelSoftKey)); + } + break; +#endif default: break; } @@ -2919,7 +2933,7 @@ void QMenu::actionEvent(QActionEvent *e) #endif if (isVisible()) { d->updateActionRects(); - resize(sizeHint()); + resize(sizeHint()); update(); } } diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index b0e632a..2a3036b 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -283,20 +283,17 @@ void QHttpNetworkConnectionChannel::_q_receiveReply() // connection might be closed to signal the end of data if (socketState == QAbstractSocket::UnconnectedState) { - if (!socket->bytesAvailable()) { + if (socket->bytesAvailable() <= 0) { if (reply && reply->d_func()->state == QHttpNetworkReplyPrivate::ReadingDataState) { + // finish this reply. this case happens when the server did not send a content length reply->d_func()->state = QHttpNetworkReplyPrivate::AllDoneState; allDone(); } else { - // try to reconnect/resend before sending an error. - if (reconnectAttempts-- > 0) { - closeAndResendCurrentRequest(); - } else if (reply) { - reply->d_func()->errorString = connection->d_func()->errorDetail(QNetworkReply::RemoteHostClosedError, socket); - emit reply->finishedWithError(QNetworkReply::RemoteHostClosedError, reply->d_func()->errorString); - QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); - } + handleUnexpectedEOF(); + return; } + } else { + // socket not connected but still bytes for reading.. just continue in this function } } @@ -311,18 +308,10 @@ void QHttpNetworkConnectionChannel::_q_receiveReply() } case QHttpNetworkReplyPrivate::ReadingStatusState: { qint64 statusBytes = reply->d_func()->readStatus(socket); - if (statusBytes == -1 && reconnectAttempts <= 0) { - // too many errors reading/receiving/parsing the status, close the socket and emit error - close(); - reply->d_func()->errorString = connection->d_func()->errorDetail(QNetworkReply::ProtocolFailure, socket); - emit reply->finishedWithError(QNetworkReply::ProtocolFailure, reply->d_func()->errorString); - QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); - break; - } else if (statusBytes == -1) { - reconnectAttempts--; - reply->d_func()->clear(); - closeAndResendCurrentRequest(); - break; + if (statusBytes == -1) { + // connection broke while reading status. also handled if later _q_disconnected is called + handleUnexpectedEOF(); + return; } bytes += statusBytes; lastStatus = reply->d_func()->statusCode; @@ -330,7 +319,13 @@ void QHttpNetworkConnectionChannel::_q_receiveReply() } case QHttpNetworkReplyPrivate::ReadingHeaderState: { QHttpNetworkReplyPrivate *replyPrivate = reply->d_func(); - bytes += replyPrivate->readHeader(socket); + qint64 headerBytes = replyPrivate->readHeader(socket); + if (headerBytes == -1) { + // connection broke while reading headers. also handled if later _q_disconnected is called + handleUnexpectedEOF(); + return; + } + bytes += headerBytes; if (replyPrivate->state == QHttpNetworkReplyPrivate::ReadingDataState) { if (replyPrivate->isGzipped() && replyPrivate->autoDecompress) { // remove the Content-Length from header @@ -430,6 +425,23 @@ void QHttpNetworkConnectionChannel::_q_receiveReply() } } +// called when unexpectedly reading a -1 or when data is expected but socket is closed +void QHttpNetworkConnectionChannel::handleUnexpectedEOF() +{ + if (reconnectAttempts <= 0) { + // too many errors reading/receiving/parsing the status, close the socket and emit error + requeueCurrentlyPipelinedRequests(); + close(); + reply->d_func()->errorString = connection->d_func()->errorDetail(QNetworkReply::RemoteHostClosedError, socket); + emit reply->finishedWithError(QNetworkReply::RemoteHostClosedError, reply->d_func()->errorString); + QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); + } else { + reconnectAttempts--; + reply->d_func()->clear(); + closeAndResendCurrentRequest(); + } +} + bool QHttpNetworkConnectionChannel::ensureConnection() { QAbstractSocket::SocketState socketState = socket->state(); @@ -799,9 +811,10 @@ void QHttpNetworkConnectionChannel::_q_disconnected() { // read the available data before closing if (isSocketWaiting() || isSocketReading()) { - state = QHttpNetworkConnectionChannel::ReadingState; - if (reply) + if (reply) { + state = QHttpNetworkConnectionChannel::ReadingState; _q_receiveReply(); + } } else if (state == QHttpNetworkConnectionChannel::IdleState && resendCurrent) { // re-sending request because the socket was in ClosingState QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h index 75ab50d..5032d2b 100644 --- a/src/network/access/qhttpnetworkconnectionchannel_p.h +++ b/src/network/access/qhttpnetworkconnectionchannel_p.h @@ -157,6 +157,7 @@ public: void requeueCurrentlyPipelinedRequests(); void detectPipeliningSupport(); + void handleUnexpectedEOF(); void closeAndResendCurrentRequest(); void eatWhitespace(); diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index 61a95fe..af971a7 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -976,7 +976,7 @@ QNetworkCacheMetaData QNetworkAccessHttpBackend::fetchCacheMetaData(const QNetwo // of writes to disk when using a QNetworkDiskCache (i.e. don't // write to disk when only the date changes). // However, without the date we cannot calculate the age of the page - // anymore. Consider a proper fix of that problem for 4.6.1. + // anymore. //if (header == "date") //continue; diff --git a/src/network/socket/qlocalsocket_p.h b/src/network/socket/qlocalsocket_p.h index 081697b..0f1c23c 100644 --- a/src/network/socket/qlocalsocket_p.h +++ b/src/network/socket/qlocalsocket_p.h @@ -128,10 +128,8 @@ public: void _q_stateChanged(QAbstractSocket::SocketState newState); void _q_error(QAbstractSocket::SocketError newError); #elif defined(Q_OS_WIN) - ~QLocalSocketPrivate() { - CloseHandle(overlapped.hEvent); - } - + ~QLocalSocketPrivate(); + void destroyPipeHandles(); void setErrorString(const QString &function); void _q_notified(); void _q_canWrite(); diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp index 1f94df6..3283bf2 100644 --- a/src/network/socket/qlocalsocket_win.cpp +++ b/src/network/socket/qlocalsocket_win.cpp @@ -110,6 +110,20 @@ QLocalSocketPrivate::QLocalSocketPrivate() : QIODevicePrivate(), { } +QLocalSocketPrivate::~QLocalSocketPrivate() +{ + destroyPipeHandles(); + CloseHandle(overlapped.hEvent); +} + +void QLocalSocketPrivate::destroyPipeHandles() +{ + if (handle != INVALID_HANDLE_VALUE) { + DisconnectNamedPipe(handle); + CloseHandle(handle); + } +} + void QLocalSocket::connectToServer(const QString &name, OpenMode openMode) { Q_D(QLocalSocket); @@ -388,8 +402,7 @@ void QLocalSocket::close() d->readSequenceStarted = false; d->pendingReadyRead = false; d->pipeClosed = false; - DisconnectNamedPipe(d->handle); - CloseHandle(d->handle); + d->destroyPipeHandles(); d->handle = INVALID_HANDLE_VALUE; ResetEvent(d->overlapped.hEvent); d->state = UnconnectedState; @@ -524,7 +537,10 @@ bool QLocalSocket::waitForDisconnected(int msecs) bool QLocalSocket::isValid() const { Q_D(const QLocalSocket); - return (d->handle != INVALID_HANDLE_VALUE); + if (d->handle == INVALID_HANDLE_VALUE) + return false; + + return PeekNamedPipe(d->handle, NULL, 0, NULL, NULL, NULL); } bool QLocalSocket::waitForReadyRead(int msecs) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index a44ae06..5eff8a8 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1306,11 +1306,23 @@ static bool qInvokeTestMethod(const char *slotName, const char *data=0) const int dataCount = table.dataCount(); QTestResult::setSkipCurrentTest(false); + // Data tag requested but none available? + if (data && !dataCount) { + // Let empty data tag through. + if (!*data) + data = 0; + else { + printf("Unknown testdata for function %s: '%s'\n", slotName, data); + printf("Function has no testdata.\n"); + return false; + } + } + /* For each entry in the data table, do: */ do { if (!data || !qstrcmp(data, table.testData(curDataIndex)->dataTag())) { foundFunction = true; - QTestDataSetter s(table.isEmpty() ? static_cast<QTestData *>(0) + QTestDataSetter s(curDataIndex >= dataCount ? static_cast<QTestData *>(0) : table.testData(curDataIndex)); qInvokeTestMethodDataEntry(slot); diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 022b19a..af9832c 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -445,17 +445,16 @@ SUBDIRS += \ qplugin \ qpluginloader \ qscrollbar \ - qsharedmemory \ qsidebar \ qsizegrip \ qsqldriver \ - qsystemsemaphore \ qtconcurrentfilter \ qtconcurrentiteratekernel \ qtconcurrentmap \ qtconcurrentrun \ qtconcurrentthreadengine \ qthreadpool \ + qtipc \ qtokenautomaton \ qtouchevent \ qwidget_window \ @@ -519,15 +518,16 @@ SUBDIRS += checkxmlfiles \ xmlpatternsdiagnosticsts \ xmlpatternsschema \ xmlpatternsschemats \ + xmlpatternssdk \ xmlpatternsvalidator \ xmlpatternsview \ xmlpatternsxqts \ xmlpatternsxslts -xmlpatternsdiagnosticsts.depends = xmlpatternsxqts -xmlpatternsview.depends = xmlpatternsxqts -xmlpatternsxslts.depends = xmlpatternsxqts -xmlpatternsschemats.depends = xmlpatternsxqts +xmlpatternsdiagnosticsts.depends = xmlpatternssdk +xmlpatternsview.depends = xmlpatternssdk +xmlpatternsxslts.depends = xmlpatternssdk +xmlpatternsschemats.depends = xmlpatternssdk } unix:!embedded:contains(QT_CONFIG, dbus):SUBDIRS += \ diff --git a/tests/auto/compilerwarnings/compilerwarnings.qrc b/tests/auto/compilerwarnings/compilerwarnings.qrc index 40fa8f1..3fa313c 100644 --- a/tests/auto/compilerwarnings/compilerwarnings.qrc +++ b/tests/auto/compilerwarnings/compilerwarnings.qrc @@ -1,5 +1,5 @@ <!DOCTYPE RCC><RCC version="1.0"> <qresource> - <file>test.cpp</file> + <file>test_cpp.txt</file> </qresource> </RCC> diff --git a/tests/auto/compilerwarnings/test.cpp b/tests/auto/compilerwarnings/test_cpp.txt index 62b35eb..62b35eb 100644 --- a/tests/auto/compilerwarnings/test.cpp +++ b/tests/auto/compilerwarnings/test_cpp.txt diff --git a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp index 27624e9..f910a18 100644 --- a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp +++ b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp @@ -148,7 +148,7 @@ void tst_CompilerWarnings::warnings() if (tmpSourceFile.isEmpty()) { tmpQSourceFile.open(QIODevice::ReadWrite | QIODevice::Truncate); tmpSourceFile = tmpQSourceFile.fileName(); - QFile cppSource(":/test.cpp"); + QFile cppSource(":/test_cpp.txt"); bool openResult = cppSource.open(QIODevice::ReadOnly); if (openResult) { @@ -158,7 +158,7 @@ void tst_CompilerWarnings::warnings() } } tmpQSourceFile.close(); - QVERIFY2(openResult, "Need resource temporary \"test.cpp\""); + QVERIFY2(openResult, "Need resource temporary \"test_cpp.txt\""); QStringList args; QString compilerName; diff --git a/tests/auto/gestures/tst_gestures.cpp b/tests/auto/gestures/tst_gestures.cpp index 952136b..986227d 100644 --- a/tests/auto/gestures/tst_gestures.cpp +++ b/tests/auto/gestures/tst_gestures.cpp @@ -333,6 +333,8 @@ private slots: void unregisterRecognizer(); void autoCancelGestures(); void autoCancelGestures2(); + void panelPropagation(); + void panelStacksBehindParent(); }; tst_Gestures::tst_Gestures() @@ -1457,9 +1459,7 @@ void tst_Gestures::autoCancelGestures2() event.serial = CustomGesture::SerialStartedThreshold; event.hasHotSpot = true; event.hotSpot = mapToGlobal(QPointF(5, 5), child, &view); - // qDebug() << event.hotSpot; scene.sendEvent(child, &event); - //QEventLoop().exec(); QCOMPARE(parent->events.all.count(), 1); QCOMPARE(child->events.started.count(), 1); QCOMPARE(child->events.canceled.count(), 1); @@ -1471,5 +1471,172 @@ void tst_Gestures::autoCancelGestures2() QCOMPARE(parent->events.all.count(), 2); } +void tst_Gestures::panelPropagation() +{ + QGraphicsScene scene; + QGraphicsView view(&scene); + view.setWindowFlags(Qt::X11BypassWindowManagerHint); + + GestureItem *item0 = new GestureItem("item0"); + scene.addItem(item0); + item0->setPos(0, 0); + item0->size = QRectF(0, 0, 200, 200); + item0->grabGesture(CustomGesture::GestureType); + item0->setZValue(1); + + GestureItem *item1 = new GestureItem("item1"); + item1->grabGesture(CustomGesture::GestureType); + scene.addItem(item1); + item1->setPos(10, 10); + item1->size = QRectF(0, 0, 180, 180); + item1->setZValue(2); + + GestureItem *item1_child1 = new GestureItem("item1_child1[panel]"); + item1_child1->setFlags(QGraphicsItem::ItemIsPanel); + item1_child1->setParentItem(item1); + item1_child1->grabGesture(CustomGesture::GestureType); + item1_child1->setPos(10, 10); + item1_child1->size = QRectF(0, 0, 160, 160); + item1_child1->setZValue(5); + + GestureItem *item1_child1_child1 = new GestureItem("item1_child1_child1"); + item1_child1_child1->setParentItem(item1_child1); + item1_child1_child1->grabGesture(CustomGesture::GestureType); + item1_child1_child1->setPos(10, 10); + item1_child1_child1->size = QRectF(0, 0, 140, 140); + item1_child1_child1->setZValue(10); + + view.show(); + QTest::qWaitForWindowShown(&view); + view.ensureVisible(scene.sceneRect()); + + view.viewport()->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren); + + static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1; + static const int TotalCustomEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialMaybeThreshold + 1; + + CustomEvent event; + event.hotSpot = mapToGlobal(QPointF(5, 5), item1_child1_child1, &view); + event.hasHotSpot = true; + sendCustomGesture(&event, item0, &scene); + + QCOMPARE(item0->customEventsReceived, TotalCustomEventsCount); + QCOMPARE(item1_child1_child1->gestureEventsReceived, TotalGestureEventsCount); + QCOMPARE(item1_child1_child1->gestureOverrideEventsReceived, 1); + QCOMPARE(item1_child1->gestureOverrideEventsReceived, 1); + QCOMPARE(item1->gestureEventsReceived, 0); + QCOMPARE(item1->gestureOverrideEventsReceived, 0); + QCOMPARE(item0->gestureEventsReceived, 0); + QCOMPARE(item0->gestureOverrideEventsReceived, 0); + + item0->reset(); item1->reset(); item1_child1->reset(); item1_child1_child1->reset(); + + event.hotSpot = mapToGlobal(QPointF(5, 5), item1, &view); + event.hasHotSpot = true; + sendCustomGesture(&event, item1, &scene); + + QCOMPARE(item1_child1_child1->gestureEventsReceived, 0); + QCOMPARE(item1_child1_child1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1_child1->gestureEventsReceived, 0); + QCOMPARE(item1_child1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1->gestureEventsReceived, TotalGestureEventsCount); + QCOMPARE(item1->gestureOverrideEventsReceived, 1); + QCOMPARE(item0->gestureEventsReceived, 0); + QCOMPARE(item0->gestureOverrideEventsReceived, 1); + + item0->reset(); item1->reset(); item1_child1->reset(); item1_child1_child1->reset(); + // try with a modal panel + item1_child1->setPanelModality(QGraphicsItem::PanelModal); + + event.hotSpot = mapToGlobal(QPointF(5, 5), item1, &view); + event.hasHotSpot = true; + sendCustomGesture(&event, item1, &scene); + + QCOMPARE(item1_child1_child1->gestureEventsReceived, 0); + QCOMPARE(item1_child1_child1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1_child1->gestureEventsReceived, TotalGestureEventsCount); + QCOMPARE(item1_child1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1->gestureEventsReceived, 0); + QCOMPARE(item1->gestureOverrideEventsReceived, 0); + QCOMPARE(item0->gestureEventsReceived, 0); + QCOMPARE(item0->gestureOverrideEventsReceived, 0); + + item0->reset(); item1->reset(); item1_child1->reset(); item1_child1_child1->reset(); + // try with a modal panel, however set the hotspot to be outside of the + // panel and its parent + item1_child1->setPanelModality(QGraphicsItem::PanelModal); + + event.hotSpot = mapToGlobal(QPointF(5, 5), item0, &view); + event.hasHotSpot = true; + sendCustomGesture(&event, item1, &scene); + + QCOMPARE(item1_child1_child1->gestureEventsReceived, 0); + QCOMPARE(item1_child1_child1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1_child1->gestureEventsReceived, 0); + QCOMPARE(item1_child1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1->gestureEventsReceived, 0); + QCOMPARE(item1->gestureOverrideEventsReceived, 0); + QCOMPARE(item0->gestureEventsReceived, TotalGestureEventsCount); + QCOMPARE(item0->gestureOverrideEventsReceived, 0); + + item0->reset(); item1->reset(); item1_child1->reset(); item1_child1_child1->reset(); + // try with a scene modal panel + item1_child1->setPanelModality(QGraphicsItem::SceneModal); + + event.hotSpot = mapToGlobal(QPointF(5, 5), item0, &view); + event.hasHotSpot = true; + sendCustomGesture(&event, item0, &scene); + + QCOMPARE(item1_child1_child1->gestureEventsReceived, 0); + QCOMPARE(item1_child1_child1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1_child1->gestureEventsReceived, TotalGestureEventsCount); + QCOMPARE(item1_child1->gestureOverrideEventsReceived, 0); + QCOMPARE(item1->gestureEventsReceived, 0); + QCOMPARE(item1->gestureOverrideEventsReceived, 0); + QCOMPARE(item0->gestureEventsReceived, 0); + QCOMPARE(item0->gestureOverrideEventsReceived, 0); +} + +void tst_Gestures::panelStacksBehindParent() +{ + QGraphicsScene scene; + QGraphicsView view(&scene); + view.setWindowFlags(Qt::X11BypassWindowManagerHint); + + GestureItem *item1 = new GestureItem("item1"); + item1->grabGesture(CustomGesture::GestureType); + scene.addItem(item1); + item1->setPos(10, 10); + item1->size = QRectF(0, 0, 180, 180); + item1->setZValue(2); + + GestureItem *panel = new GestureItem("panel"); + panel->setFlags(QGraphicsItem::ItemIsPanel | QGraphicsItem::ItemStacksBehindParent); + panel->setPanelModality(QGraphicsItem::PanelModal); + panel->setParentItem(item1); + panel->grabGesture(CustomGesture::GestureType); + panel->setPos(-10, -10); + panel->size = QRectF(0, 0, 200, 200); + panel->setZValue(5); + + view.show(); + QTest::qWaitForWindowShown(&view); + view.ensureVisible(scene.sceneRect()); + + view.viewport()->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren); + + static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1; + + CustomEvent event; + event.hotSpot = mapToGlobal(QPointF(5, 5), item1, &view); + event.hasHotSpot = true; + sendCustomGesture(&event, item1, &scene); + + QCOMPARE(item1->gestureEventsReceived, 0); + QCOMPARE(item1->gestureOverrideEventsReceived, 0); + QCOMPARE(panel->gestureEventsReceived, TotalGestureEventsCount); + QCOMPARE(panel->gestureOverrideEventsReceived, 0); +} + QTEST_MAIN(tst_Gestures) #include "tst_gestures.moc" diff --git a/tests/auto/maketestselftest/tst_maketestselftest.cpp b/tests/auto/maketestselftest/tst_maketestselftest.cpp index ef92c56..1dde44b 100644 --- a/tests/auto/maketestselftest/tst_maketestselftest.cpp +++ b/tests/auto/maketestselftest/tst_maketestselftest.cpp @@ -92,7 +92,9 @@ void tst_MakeTestSelfTest::auto_dot_pro_data() QStringList subdirs = dir.entryList(QDir::AllDirs|QDir::NoDotAndDotDot); foreach (const QString& subdir, subdirs) { - if (subdir == QString::fromLatin1("tmp")) { + if (subdir == QString::fromLatin1("tmp") + || subdir.startsWith(".")) + { continue; } QTest::newRow(qPrintable(subdir)) << subdir; diff --git a/tests/auto/modeltest/dynamictreemodel.h b/tests/auto/modeltest/dynamictreemodel.h index 3f0d90d..9633755 100644 --- a/tests/auto/modeltest/dynamictreemodel.h +++ b/tests/auto/modeltest/dynamictreemodel.h @@ -48,8 +48,6 @@ #include <QtCore/QList> -template<typename T> class QList; - class DynamicTreeModel : public QAbstractItemModel { Q_OBJECT diff --git a/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp b/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp index 5a23274..f64e815 100644 --- a/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp +++ b/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp @@ -71,6 +71,8 @@ private slots: void contiguousCacheBenchmark(); void setCapacity(); + + void zeroCapacity(); }; QTEST_MAIN(tst_QContiguousCache) @@ -476,4 +478,14 @@ void tst_QContiguousCache::setCapacity() } } +void tst_QContiguousCache::zeroCapacity() +{ + QContiguousCache<int> contiguousCache; + QCOMPARE(contiguousCache.capacity(),0); + contiguousCache.setCapacity(10); + QCOMPARE(contiguousCache.capacity(),10); + contiguousCache.setCapacity(0); + QCOMPARE(contiguousCache.capacity(),0); +} + #include "tst_qcontiguouscache.moc" diff --git a/tests/auto/qdbusconnection/tst_qdbusconnection.cpp b/tests/auto/qdbusconnection/tst_qdbusconnection.cpp index 5e2f3a9..96209b1 100644 --- a/tests/auto/qdbusconnection/tst_qdbusconnection.cpp +++ b/tests/auto/qdbusconnection/tst_qdbusconnection.cpp @@ -80,6 +80,8 @@ class tst_QDBusConnection: public QObject int signalsReceived; public slots: void oneSlot() { ++signalsReceived; } + void exitLoop() { ++signalsReceived; QTestEventLoop::instance().exitLoop(); } + void secondCallWithCallback(); private slots: void noConnection(); @@ -102,6 +104,7 @@ private slots: void multipleInterfacesInQObject(); void slotsWithLessParameters(); + void nestedCallWithCallback(); public: QString serviceName() const { return "com.trolltech.Qt.Autotests.QDBusConnection"; } @@ -618,6 +621,32 @@ void tst_QDBusConnection::slotsWithLessParameters() QCOMPARE(signalsReceived, 1); } +void tst_QDBusConnection::secondCallWithCallback() +{ + qDebug("Hello"); + QDBusConnection con = QDBusConnection::sessionBus(); + QDBusMessage msg = QDBusMessage::createMethodCall(con.baseService(), "/test", QString(), + "test0"); + con.callWithCallback(msg, this, SLOT(exitLoop()), SLOT(secondCallWithCallback())); +} + +void tst_QDBusConnection::nestedCallWithCallback() +{ + TestObject testObject; + QDBusConnection connection = QDBusConnection::sessionBus(); + QVERIFY(connection.registerObject("/test", &testObject, + QDBusConnection::ExportAllContents)); + + QDBusMessage msg = QDBusMessage::createMethodCall(connection.baseService(), "/test", QString(), + "ThisFunctionDoesntExist"); + signalsReceived = 0; + + connection.callWithCallback(msg, this, SLOT(exitLoop()), SLOT(secondCallWithCallback()), 10); + QTestEventLoop::instance().enterLoop(15); + QVERIFY(!QTestEventLoop::instance().timeout()); + QCOMPARE(signalsReceived, 1); +} + QString MyObject::path; QTEST_MAIN(tst_QDBusConnection) diff --git a/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro b/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro index 79bb44c..889aac9 100644 --- a/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro +++ b/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro @@ -1,10 +1,22 @@ -TEMPLATE = subdirs -CONFIG += ordered +load(qttest_p4) +SOURCES += tst_qhelpcontentmodel.cpp -contains(QT_BUILD_PARTS, tools): { - SUBDIRS += ../../../tools/assistant/lib/fulltextsearch \ - ../../../tools/assistant/lib -} +CONFIG += help -SUBDIRS += tst_qhelpcontentmodel.pro +DEFINES += QT_USE_USING_NAMESPACE +!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS +wince*: { + DEFINES += SRCDIR=\\\"./\\\" + QT += network + addFiles.sources = $$PWD/data/*.* + addFiles.path = data + clucene.sources = $$QT_BUILD_TREE/lib/QtCLucene*.dll + + DEPLOYMENT += addFiles + DEPLOYMENT += clucene + + DEPLOYMENT_PLUGIN += qsqlite +} else { + DEFINES += SRCDIR=\\\"$$PWD\\\" +}
\ No newline at end of file diff --git a/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.pro b/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.pro deleted file mode 100644 index 889aac9..0000000 --- a/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.pro +++ /dev/null @@ -1,22 +0,0 @@ -load(qttest_p4) -SOURCES += tst_qhelpcontentmodel.cpp - -CONFIG += help - -DEFINES += QT_USE_USING_NAMESPACE -!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS - -wince*: { - DEFINES += SRCDIR=\\\"./\\\" - QT += network - addFiles.sources = $$PWD/data/*.* - addFiles.path = data - clucene.sources = $$QT_BUILD_TREE/lib/QtCLucene*.dll - - DEPLOYMENT += addFiles - DEPLOYMENT += clucene - - DEPLOYMENT_PLUGIN += qsqlite -} else { - DEFINES += SRCDIR=\\\"$$PWD\\\" -}
\ No newline at end of file diff --git a/tests/auto/qhelpenginecore/qhelpenginecore.pro b/tests/auto/qhelpenginecore/qhelpenginecore.pro index ee9b0c4..27ebd0f 100644 --- a/tests/auto/qhelpenginecore/qhelpenginecore.pro +++ b/tests/auto/qhelpenginecore/qhelpenginecore.pro @@ -1,10 +1,23 @@ -TEMPLATE = subdirs -CONFIG += ordered +load(qttest_p4) +SOURCES += tst_qhelpenginecore.cpp +CONFIG += help +QT += sql -contains(QT_BUILD_PARTS, tools): { - SUBDIRS += ../../../tools/assistant/lib/fulltextsearch \ - ../../../tools/assistant/lib -} -SUBDIRS += tst_qhelpenginecore.pro +DEFINES += QT_USE_USING_NAMESPACE +!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS + +wince*: { + DEFINES += SRCDIR=\\\"./\\\" + QT += network + addFiles.sources = $$PWD/data/*.* + addFiles.path = data + clucene.sources = $$QT_BUILD_TREE/lib/QtCLucene*.dll + DEPLOYMENT += addFiles + DEPLOYMENT += clucene + + DEPLOYMENT_PLUGIN += qsqlite +} else { + DEFINES += SRCDIR=\\\"$$PWD\\\" +} diff --git a/tests/auto/qhelpenginecore/tst_qhelpenginecore.pro b/tests/auto/qhelpenginecore/tst_qhelpenginecore.pro deleted file mode 100644 index 27ebd0f..0000000 --- a/tests/auto/qhelpenginecore/tst_qhelpenginecore.pro +++ /dev/null @@ -1,23 +0,0 @@ -load(qttest_p4) -SOURCES += tst_qhelpenginecore.cpp -CONFIG += help -QT += sql - - -DEFINES += QT_USE_USING_NAMESPACE -!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS - -wince*: { - DEFINES += SRCDIR=\\\"./\\\" - QT += network - addFiles.sources = $$PWD/data/*.* - addFiles.path = data - clucene.sources = $$QT_BUILD_TREE/lib/QtCLucene*.dll - - DEPLOYMENT += addFiles - DEPLOYMENT += clucene - - DEPLOYMENT_PLUGIN += qsqlite -} else { - DEFINES += SRCDIR=\\\"$$PWD\\\" -} diff --git a/tests/auto/qhelpgenerator/qhelpgenerator.pro b/tests/auto/qhelpgenerator/qhelpgenerator.pro index efa1ef5..b4b07dd 100644 --- a/tests/auto/qhelpgenerator/qhelpgenerator.pro +++ b/tests/auto/qhelpgenerator/qhelpgenerator.pro @@ -1,10 +1,9 @@ -TEMPLATE = subdirs -CONFIG += ordered +load(qttest_p4) -contains(QT_BUILD_PARTS, tools): { - SUBDIRS += ../../../tools/assistant/lib/fulltextsearch \ - ../../../tools/assistant/lib -} - -SUBDIRS += tst_qhelpgenerator.pro +SOURCES += tst_qhelpgenerator.cpp +CONFIG += help +QT += sql +DEFINES += SRCDIR=\\\"$$PWD\\\" +DEFINES += QT_USE_USING_NAMESPACE +!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS diff --git a/tests/auto/qhelpgenerator/tst_qhelpgenerator.pro b/tests/auto/qhelpgenerator/tst_qhelpgenerator.pro deleted file mode 100644 index b4b07dd..0000000 --- a/tests/auto/qhelpgenerator/tst_qhelpgenerator.pro +++ /dev/null @@ -1,9 +0,0 @@ -load(qttest_p4) - -SOURCES += tst_qhelpgenerator.cpp -CONFIG += help -QT += sql - -DEFINES += SRCDIR=\\\"$$PWD\\\" -DEFINES += QT_USE_USING_NAMESPACE -!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS diff --git a/tests/auto/qhelpindexmodel/qhelpindexmodel.pro b/tests/auto/qhelpindexmodel/qhelpindexmodel.pro index 1325e09..927c2e1 100644 --- a/tests/auto/qhelpindexmodel/qhelpindexmodel.pro +++ b/tests/auto/qhelpindexmodel/qhelpindexmodel.pro @@ -1,10 +1,9 @@ -TEMPLATE = subdirs -CONFIG += ordered +load(qttest_p4) -contains(QT_BUILD_PARTS, tools): { - SUBDIRS += ../../../tools/assistant/lib/fulltextsearch \ - ../../../tools/assistant/lib -} - -SUBDIRS += tst_qhelpindexmodel.pro +SOURCES += tst_qhelpindexmodel.cpp +CONFIG += help +QT += sql +DEFINES += SRCDIR=\\\"$$PWD\\\" +DEFINES += QT_USE_USING_NAMESPACE +!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS diff --git a/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.pro b/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.pro deleted file mode 100644 index 927c2e1..0000000 --- a/tests/auto/qhelpindexmodel/tst_qhelpindexmodel.pro +++ /dev/null @@ -1,9 +0,0 @@ -load(qttest_p4) - -SOURCES += tst_qhelpindexmodel.cpp -CONFIG += help -QT += sql - -DEFINES += SRCDIR=\\\"$$PWD\\\" -DEFINES += QT_USE_USING_NAMESPACE -!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS diff --git a/tests/auto/qhelpprojectdata/qhelpprojectdata.pro b/tests/auto/qhelpprojectdata/qhelpprojectdata.pro index 9617416..92dc620 100644 --- a/tests/auto/qhelpprojectdata/qhelpprojectdata.pro +++ b/tests/auto/qhelpprojectdata/qhelpprojectdata.pro @@ -1,10 +1,9 @@ -TEMPLATE = subdirs -CONFIG += ordered +load(qttest_p4) -contains(QT_BUILD_PARTS, tools): { - SUBDIRS += ../../../tools/assistant/lib/fulltextsearch \ - ../../../tools/assistant/lib -} +SOURCES += tst_qhelpprojectdata.cpp +CONFIG += help -SUBDIRS += tst_qhelpprojectdata.pro +DEFINES += SRCDIR=\\\"$$PWD\\\" +DEFINES += QT_USE_USING_NAMESPACE +!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS diff --git a/tests/auto/qhelpprojectdata/tst_qhelpprojectdata.pro b/tests/auto/qhelpprojectdata/tst_qhelpprojectdata.pro deleted file mode 100644 index 92dc620..0000000 --- a/tests/auto/qhelpprojectdata/tst_qhelpprojectdata.pro +++ /dev/null @@ -1,9 +0,0 @@ -load(qttest_p4) - -SOURCES += tst_qhelpprojectdata.cpp -CONFIG += help - -DEFINES += SRCDIR=\\\"$$PWD\\\" -DEFINES += QT_USE_USING_NAMESPACE -!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS - diff --git a/tests/auto/qlibrary/lib2/lib2.pro b/tests/auto/qlibrary/lib2/lib2.pro index da30a2d..4654f4d 100644 --- a/tests/auto/qlibrary/lib2/lib2.pro +++ b/tests/auto/qlibrary/lib2/lib2.pro @@ -16,14 +16,19 @@ win32-borland: DEFINES += WIN32_BORLAND !symbian { win32 { - src = $(DESTDIR_TARGET) + # vcproj and Makefile generators refer to target differently + contains(TEMPLATE,vc.*) { + src = $(TargetPath) + } else { + src = $(DESTDIR_TARGET) + } files = mylib.dl2 system.trolltech.test.mylib.dll } else { src = $(DESTDIR)$(TARGET) files = libmylib.so2 system.trolltech.test.mylib.so } for(file, files) { - QMAKE_POST_LINK += $(COPY) $$src ..$$QMAKE_DIR_SEP$$file && + QMAKE_POST_LINK += $$QMAKE_COPY $$src ..$$QMAKE_DIR_SEP$$file && CLEAN_FILES += ../$$file } QMAKE_POST_LINK = $$member(QMAKE_POST_LINK, 0, -2) diff --git a/tests/auto/qlocalsocket/lackey/main.cpp b/tests/auto/qlocalsocket/lackey/main.cpp index 0f1930c..1bba4f8 100644 --- a/tests/auto/qlocalsocket/lackey/main.cpp +++ b/tests/auto/qlocalsocket/lackey/main.cpp @@ -172,8 +172,10 @@ static int _q_ScriptRegisterQObjectMetaType(QScriptEngine *engine, const QScript return qScriptRegisterMetaType<T*>(engine, _q_ScriptValueFromQObject<T>, _q_ScriptValueToQObject<T>, prototype); } +QT_BEGIN_NAMESPACE Q_SCRIPT_DECLARE_QMETAOBJECT(QScriptLocalSocket, QObject*); Q_SCRIPT_DECLARE_QMETAOBJECT(QScriptLocalServer, QObject*); +QT_END_NAMESPACE static void interactive(QScriptEngine &eng) { diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index eec4797..5fecc86 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -2034,6 +2034,11 @@ void tst_QNetworkReply::ioGetFromHttpBrokenServer_data() QTest::newRow("invalid-version+disconnect") << QByteArray("HTTP/123 200 ") << true; QTest::newRow("invalid-version2+disconnect") << QByteArray("HTTP/a.\033 200 ") << true; QTest::newRow("invalid-reply-code+disconnect") << QByteArray("HTTP/1.0 fuu ") << true; + + QTest::newRow("immediate disconnect") << QByteArray("") << true; + QTest::newRow("justHalfStatus+disconnect") << QByteArray("HTTP/1.1") << true; + QTest::newRow("justStatus+disconnect") << QByteArray("HTTP/1.1 200 OK\r\n") << true; + QTest::newRow("justStatusAndHalfHeaders+disconnect") << QByteArray("HTTP/1.1 200 OK\r\nContent-L") << true; } void tst_QNetworkReply::ioGetFromHttpBrokenServer() diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index 104728d..beb83a1 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -1580,10 +1580,8 @@ void tst_QPainter::drawClippedEllipse_data() void tst_QPainter::drawClippedEllipse() { QFETCH(QRect, rect); -#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) if (sizeof(qreal) != sizeof(double)) QSKIP("Test only works for qreal==double", SkipAll); -#endif QImage image(rect.width() + 1, rect.height() + 1, QImage::Format_ARGB32_Premultiplied); QRect expected = QRect(rect.x(), rect.y(), rect.width()+1, rect.height()+1) diff --git a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp index a0f4339..f8951f5 100644 --- a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp +++ b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp @@ -483,7 +483,9 @@ void tst_QPixmapCache::pixmapKey() QVERIFY(!getPrivate(key8)); } +QT_BEGIN_NAMESPACE extern int q_QPixmapCache_keyHashSize(); +QT_END_NAMESPACE void tst_QPixmapCache::noLeak() { diff --git a/tests/auto/qpluginloader/theplugin/plugininterface.h b/tests/auto/qpluginloader/theplugin/plugininterface.h index 0b093db..9b69429 100644 --- a/tests/auto/qpluginloader/theplugin/plugininterface.h +++ b/tests/auto/qpluginloader/theplugin/plugininterface.h @@ -45,7 +45,10 @@ struct PluginInterface { virtual ~PluginInterface() {} virtual QString pluginName() const = 0; }; + +QT_BEGIN_NAMESPACE Q_DECLARE_INTERFACE(PluginInterface, "com.trolltect.autotests.plugininterface/1.0") +QT_END_NAMESPACE #endif // PLUGININTERFACE_H diff --git a/tests/auto/qprocess/tst_qprocess.cpp b/tests/auto/qprocess/tst_qprocess.cpp index ee3bb40..8dae9a0 100644 --- a/tests/auto/qprocess/tst_qprocess.cpp +++ b/tests/auto/qprocess/tst_qprocess.cpp @@ -1652,7 +1652,7 @@ void tst_QProcess::failToStart() QSignalSpy finishedSpy(&process, SIGNAL(finished(int))); QSignalSpy finishedSpy2(&process, SIGNAL(finished(int, QProcess::ExitStatus))); -// Mac OS X and HP-UX have a really low defualt process limit (~100), so spawning +// Mac OS X and HP-UX have a really low default process limit (~100), so spawning // to many processes here will cause test failures later on. #if defined Q_OS_HPUX const int attempts = 15; diff --git a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp index 41df98c..10ff488 100644 --- a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp +++ b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp @@ -688,7 +688,7 @@ tst_Suite::tst_Suite() addExpectedFailure("ecma/TypeConversion/9.3.1-3.js", "- -\"0x80000000\"", willFixInNextReleaseMessage); #endif -#ifdef Q_OS_WIN +#ifdef Q_CC_MSVC addExpectedFailure("ecma_3/Expressions/11.7.3-01.js", "11.7.3 - >>> should evaluate operands in order: order", "QTBUG-8056"); addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.7.3 >>>", "QTBUG-8056"); addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.13.2 >>>=", "QTBUG-8056"); diff --git a/tests/auto/qscriptstring/tst_qscriptstring.cpp b/tests/auto/qscriptstring/tst_qscriptstring.cpp index f336dbe..808b643 100644 --- a/tests/auto/qscriptstring/tst_qscriptstring.cpp +++ b/tests/auto/qscriptstring/tst_qscriptstring.cpp @@ -87,6 +87,8 @@ void tst_QScriptString::test() QScriptString str2 = str; QVERIFY(!str2.isValid()); + + QCOMPARE(str.toArrayIndex(), quint32(0xffffffff)); } for (int x = 0; x < 2; ++x) { @@ -172,6 +174,7 @@ void tst_QScriptString::toArrayIndex_data() QTest::newRow("0a") << QString::fromLatin1("0a") << false << quint32(0xffffffff); QTest::newRow("0x1") << QString::fromLatin1("0x1") << false << quint32(0xffffffff); QTest::newRow("01") << QString::fromLatin1("01") << false << quint32(0xffffffff); + QTest::newRow("101a") << QString::fromLatin1("101a") << false << quint32(0xffffffff); QTest::newRow("4294967294") << QString::fromLatin1("4294967294") << true << quint32(0xfffffffe); QTest::newRow("4294967295") << QString::fromLatin1("4294967295") << false << quint32(0xffffffff); } diff --git a/tests/auto/qsharedmemory/qsharedmemory.pro b/tests/auto/qsharedmemory/qsharedmemory.pro deleted file mode 100644 index 0aad554..0000000 --- a/tests/auto/qsharedmemory/qsharedmemory.pro +++ /dev/null @@ -1,4 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = lackey test qsystemlock - - diff --git a/tests/auto/qsystemsemaphore/files.qrc b/tests/auto/qsystemsemaphore/files.qrc deleted file mode 100644 index 7b344ba..0000000 --- a/tests/auto/qsystemsemaphore/files.qrc +++ /dev/null @@ -1,7 +0,0 @@ -<!DOCTYPE RCC><RCC version="1.0"> -<qresource> - <file alias="systemsemaphore_acquire.js">../qsharedmemory/lackey/scripts/systemsemaphore_acquire.js</file> - <file alias="systemsemaphore_release.js">../qsharedmemory/lackey/scripts/systemsemaphore_release.js</file> - <file alias="systemsemaphore_acquirerelease.js">../qsharedmemory/lackey/scripts/systemsemaphore_acquirerelease.js</file> -</qresource> -</RCC> diff --git a/tests/auto/qsystemsemaphore/qsystemsemaphore.pro b/tests/auto/qsystemsemaphore/qsystemsemaphore.pro deleted file mode 100644 index a3f4a34..0000000 --- a/tests/auto/qsystemsemaphore/qsystemsemaphore.pro +++ /dev/null @@ -1,4 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = ../qsharedmemory/lackey test - - diff --git a/tests/auto/qtextstream/tst_qtextstream.cpp b/tests/auto/qtextstream/tst_qtextstream.cpp index 8ff6bee..9146be2 100644 --- a/tests/auto/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/qtextstream/tst_qtextstream.cpp @@ -4308,10 +4308,15 @@ void tst_QTextStream::int_write_with_locale() // ------------------------------------------------------------------------------ // like QTEST_APPLESS_MAIN, but initialising the locale on Unix +#if defined (Q_OS_UNIX) && !defined (Q_OS_SYMBIAN) +QT_BEGIN_NAMESPACE +extern bool qt_locale_initialized; +QT_END_NAMESPACE +#endif + int main(int argc, char *argv[]) { #if defined (Q_OS_UNIX) && !defined (Q_OS_SYMBIAN) - extern bool qt_locale_initialized; ::setlocale(LC_ALL, ""); qt_locale_initialized = true; #endif diff --git a/tests/auto/qsharedmemory/lackey/lackey.pro b/tests/auto/qtipc/lackey/lackey.pro index d25a50a..3912312 100644 --- a/tests/auto/qsharedmemory/lackey/lackey.pro +++ b/tests/auto/qtipc/lackey/lackey.pro @@ -1,4 +1,4 @@ -include(../src/src.pri) +include(../qsharedmemory/src/src.pri) QT = core script diff --git a/tests/auto/qsharedmemory/lackey/main.cpp b/tests/auto/qtipc/lackey/main.cpp index 5a5bf5e..fef8d22 100644 --- a/tests/auto/qsharedmemory/lackey/main.cpp +++ b/tests/auto/qtipc/lackey/main.cpp @@ -242,9 +242,11 @@ private: QSharedMemory sm; }; +QT_BEGIN_NAMESPACE Q_SCRIPT_DECLARE_QMETAOBJECT(ScriptSharedMemory, QObject*); Q_SCRIPT_DECLARE_QMETAOBJECT(ScriptSystemLock, QObject*); Q_SCRIPT_DECLARE_QMETAOBJECT(ScriptSystemSemaphore, QObject*); +QT_END_NAMESPACE static void interactive(QScriptEngine &eng) { diff --git a/tests/auto/qsharedmemory/lackey/scripts/consumer.js b/tests/auto/qtipc/lackey/scripts/consumer.js index 4d12dca..4d12dca 100644 --- a/tests/auto/qsharedmemory/lackey/scripts/consumer.js +++ b/tests/auto/qtipc/lackey/scripts/consumer.js diff --git a/tests/auto/qsharedmemory/lackey/scripts/producer.js b/tests/auto/qtipc/lackey/scripts/producer.js index e02cd8b..e02cd8b 100644 --- a/tests/auto/qsharedmemory/lackey/scripts/producer.js +++ b/tests/auto/qtipc/lackey/scripts/producer.js diff --git a/tests/auto/qsharedmemory/lackey/scripts/readonly_segfault.js b/tests/auto/qtipc/lackey/scripts/readonly_segfault.js index 3eaf789..3eaf789 100644 --- a/tests/auto/qsharedmemory/lackey/scripts/readonly_segfault.js +++ b/tests/auto/qtipc/lackey/scripts/readonly_segfault.js diff --git a/tests/auto/qsharedmemory/lackey/scripts/systemlock_read.js b/tests/auto/qtipc/lackey/scripts/systemlock_read.js index 1048bc7..1048bc7 100644 --- a/tests/auto/qsharedmemory/lackey/scripts/systemlock_read.js +++ b/tests/auto/qtipc/lackey/scripts/systemlock_read.js diff --git a/tests/auto/qsharedmemory/lackey/scripts/systemlock_readwrite.js b/tests/auto/qtipc/lackey/scripts/systemlock_readwrite.js index fc6367f..fc6367f 100644 --- a/tests/auto/qsharedmemory/lackey/scripts/systemlock_readwrite.js +++ b/tests/auto/qtipc/lackey/scripts/systemlock_readwrite.js diff --git a/tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_acquire.js b/tests/auto/qtipc/lackey/scripts/systemsemaphore_acquire.js index 5cff429..5cff429 100644 --- a/tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_acquire.js +++ b/tests/auto/qtipc/lackey/scripts/systemsemaphore_acquire.js diff --git a/tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_acquirerelease.js b/tests/auto/qtipc/lackey/scripts/systemsemaphore_acquirerelease.js index cedde3f..cedde3f 100644 --- a/tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_acquirerelease.js +++ b/tests/auto/qtipc/lackey/scripts/systemsemaphore_acquirerelease.js diff --git a/tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_release.js b/tests/auto/qtipc/lackey/scripts/systemsemaphore_release.js index c805e0f..c805e0f 100644 --- a/tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_release.js +++ b/tests/auto/qtipc/lackey/scripts/systemsemaphore_release.js diff --git a/tests/auto/qsharedmemory/.gitignore b/tests/auto/qtipc/qsharedmemory/.gitignore index 03ddcf2..03ddcf2 100644 --- a/tests/auto/qsharedmemory/.gitignore +++ b/tests/auto/qtipc/qsharedmemory/.gitignore diff --git a/tests/auto/qtipc/qsharedmemory/qsharedmemory.pro b/tests/auto/qtipc/qsharedmemory/qsharedmemory.pro new file mode 100644 index 0000000..9fef8e4 --- /dev/null +++ b/tests/auto/qtipc/qsharedmemory/qsharedmemory.pro @@ -0,0 +1,4 @@ +TEMPLATE = subdirs +SUBDIRS = test qsystemlock + + diff --git a/tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro b/tests/auto/qtipc/qsharedmemory/qsystemlock/qsystemlock.pro index e232443..e232443 100644 --- a/tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro +++ b/tests/auto/qtipc/qsharedmemory/qsystemlock/qsystemlock.pro diff --git a/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp b/tests/auto/qtipc/qsharedmemory/qsystemlock/tst_qsystemlock.cpp index ea906b7..ea906b7 100644 --- a/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp +++ b/tests/auto/qtipc/qsharedmemory/qsystemlock/tst_qsystemlock.cpp diff --git a/tests/auto/qsharedmemory/src/qsystemlock.cpp b/tests/auto/qtipc/qsharedmemory/src/qsystemlock.cpp index 4ead748..4ead748 100644 --- a/tests/auto/qsharedmemory/src/qsystemlock.cpp +++ b/tests/auto/qtipc/qsharedmemory/src/qsystemlock.cpp diff --git a/tests/auto/qsharedmemory/src/qsystemlock.h b/tests/auto/qtipc/qsharedmemory/src/qsystemlock.h index 7cd6b89..7cd6b89 100644 --- a/tests/auto/qsharedmemory/src/qsystemlock.h +++ b/tests/auto/qtipc/qsharedmemory/src/qsystemlock.h diff --git a/tests/auto/qsharedmemory/src/qsystemlock_p.h b/tests/auto/qtipc/qsharedmemory/src/qsystemlock_p.h index 7995a91..7995a91 100644 --- a/tests/auto/qsharedmemory/src/qsystemlock_p.h +++ b/tests/auto/qtipc/qsharedmemory/src/qsystemlock_p.h diff --git a/tests/auto/qsharedmemory/src/qsystemlock_unix.cpp b/tests/auto/qtipc/qsharedmemory/src/qsystemlock_unix.cpp index 525aa78..525aa78 100644 --- a/tests/auto/qsharedmemory/src/qsystemlock_unix.cpp +++ b/tests/auto/qtipc/qsharedmemory/src/qsystemlock_unix.cpp diff --git a/tests/auto/qsharedmemory/src/qsystemlock_win.cpp b/tests/auto/qtipc/qsharedmemory/src/qsystemlock_win.cpp index ac97100..ac97100 100644 --- a/tests/auto/qsharedmemory/src/qsystemlock_win.cpp +++ b/tests/auto/qtipc/qsharedmemory/src/qsystemlock_win.cpp diff --git a/tests/auto/qsharedmemory/src/src.pri b/tests/auto/qtipc/qsharedmemory/src/src.pri index 5bc9de6..5bc9de6 100644 --- a/tests/auto/qsharedmemory/src/src.pri +++ b/tests/auto/qtipc/qsharedmemory/src/src.pri diff --git a/tests/auto/qsharedmemory/test/test.pro b/tests/auto/qtipc/qsharedmemory/test/test.pro index c9f4fec..40ba8b9 100644 --- a/tests/auto/qsharedmemory/test/test.pro +++ b/tests/auto/qtipc/qsharedmemory/test/test.pro @@ -20,14 +20,14 @@ TARGET = ../tst_qsharedmemory wince*:{ requires(contains(QT_CONFIG,script)) QT += gui script -addFiles.sources = ../lackey/lackey.exe ../lackey/scripts +addFiles.sources = ../../lackey/lackey.exe ../../lackey/scripts addFiles.path = lackey DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\"\\\" }else:symbian*{ requires(contains(QT_CONFIG,script)) QT += gui script -addFiles.sources = ../lackey/scripts +addFiles.sources = ../../lackey/scripts addFiles.path = /data/qsharedmemorytemp/lackey addBin.sources = lackey.exe addBin.path = /sys/bin diff --git a/tests/auto/qsharedmemory/tst_qsharedmemory.cpp b/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp index cea75bf..83f65b0 100644 --- a/tests/auto/qsharedmemory/tst_qsharedmemory.cpp +++ b/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp @@ -51,7 +51,13 @@ #ifdef Q_OS_SYMBIAN #define SRCDIR "c:/data/qsharedmemorytemp/" +#define LACKEYDIR SRCDIR "lackey" +#elif Q_OS_WINCE +#define LACKEYDIR SRCDIR "lackey" +#else +#define LACKEYDIR SRCDIR "../lackey" #endif + Q_DECLARE_METATYPE(QSharedMemory::SharedMemoryError) Q_DECLARE_METATYPE(QSharedMemory::AccessMode) @@ -411,10 +417,10 @@ void tst_QSharedMemory::readOnly() #if defined (Q_OS_SYMBIAN) QSKIP("Readonly shared memory is not supported in symbian", SkipAll); #endif - QString program = "./lackey/lackey"; + QString program = LACKEYDIR "/lackey"; QStringList arguments; rememberKey("readonly_segfault"); - arguments << SRCDIR "lackey/scripts/readonly_segfault.js"; + arguments << LACKEYDIR "/scripts/readonly_segfault.js"; // ### on windows disable the popup somehow QProcess p; @@ -727,28 +733,20 @@ void tst_QSharedMemory::simpleProcessProducerConsumer() rememberKey("market"); -#ifndef Q_OS_WINCE - QStringList arguments = QStringList() << SRCDIR "lackey/scripts/producer.js"; -#else - QStringList arguments = QStringList() << QFileInfo(SRCDIR "lackey/scripts/producer.js").absoluteFilePath(); -#endif + QStringList arguments = QStringList() << LACKEYDIR "/scripts/producer.js"; QProcess producer; producer.setProcessChannelMode(QProcess::ForwardedChannels); - producer.start( "./lackey/lackey", arguments); + producer.start( LACKEYDIR "/lackey", arguments); producer.waitForStarted(); QVERIFY(producer.error() != QProcess::FailedToStart); QList<QProcess*> consumers; unsigned int failedProcesses = 0; for (int i = 0; i < processes; ++i) { -#ifndef Q_OS_WINCE - QStringList arguments = QStringList() << SRCDIR "lackey/scripts/consumer.js"; -#else - QStringList arguments = QStringList() << QFileInfo(SRCDIR "lackey/scripts/consumer.js").absoluteFilePath(); -#endif + QStringList arguments = QStringList() << LACKEYDIR "/scripts/consumer.js"; QProcess *p = new QProcess; p->setProcessChannelMode(QProcess::ForwardedChannels); - p->start("./lackey/lackey", arguments); + p->start(LACKEYDIR "/lackey", arguments); if (p->waitForStarted(2000)) consumers.append(p); diff --git a/tests/auto/qsystemsemaphore/.gitignore b/tests/auto/qtipc/qsystemsemaphore/.gitignore index 2b60bfb..2b60bfb 100644 --- a/tests/auto/qsystemsemaphore/.gitignore +++ b/tests/auto/qtipc/qsystemsemaphore/.gitignore diff --git a/tests/auto/qtipc/qsystemsemaphore/files.qrc b/tests/auto/qtipc/qsystemsemaphore/files.qrc new file mode 100644 index 0000000..6296690 --- /dev/null +++ b/tests/auto/qtipc/qsystemsemaphore/files.qrc @@ -0,0 +1,7 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file alias="systemsemaphore_acquire.js">../lackey/scripts/systemsemaphore_acquire.js</file> + <file alias="systemsemaphore_release.js">../lackey/scripts/systemsemaphore_release.js</file> + <file alias="systemsemaphore_acquirerelease.js">../lackey/scripts/systemsemaphore_acquirerelease.js</file> +</qresource> +</RCC> diff --git a/tests/auto/qsystemsemaphore/test/test.pro b/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro index ed7898c..1f9205e 100644 --- a/tests/auto/qsystemsemaphore/test/test.pro +++ b/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro @@ -1,29 +1,24 @@ CONFIG += qttest_p4 #QT = core -include(../../qsharedmemory/src/src.pri) +include(../qsharedmemory/src/src.pri) win32: CONFIG += console DEFINES += QSHAREDMEMORY_DEBUG DEFINES += QSYSTEMSEMAPHORE_DEBUG -SOURCES += ../tst_qsystemsemaphore.cpp +SOURCES += tst_qsystemsemaphore.cpp TARGET = tst_qsystemsemaphore -DESTDIR = ../ -win32 { - CONFIG(debug, debug|release): DESTDIR = ../debug - else: DESTDIR = ../release -} -RESOURCES += ../files.qrc +RESOURCES += files.qrc wince*: { requires(contains(QT_CONFIG,script)) # this test calls lackey, which then again depends on QtScript. # let's add it here so that it gets deployed easily QT += script -lackey.sources = ../../qsharedmemory/lackey/lackey.exe -lackey.path = ../qsharedmemory/lackey +lackey.sources = ../lackey/lackey.exe +lackey.path = ../lackey DEPLOYMENT += lackey } @@ -34,7 +29,8 @@ requires(contains(QT_CONFIG,script)) # let's add it here so that it gets deployed easily QT += script -lackey.sources = ../../qsharedmemory/lackey/lackey.exe +lackey.sources = ../lackey/lackey.exe lackey.path = /sys/bin DEPLOYMENT += lackey } + diff --git a/tests/auto/qsystemsemaphore/tst_qsystemsemaphore.cpp b/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp index bf4efdc..eb82fd4 100644 --- a/tests/auto/qsystemsemaphore/tst_qsystemsemaphore.cpp +++ b/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp @@ -46,7 +46,7 @@ //TESTED_FILES= #define EXISTING_SHARE "existing" -#define LACKYLOC "../qsharedmemory/lackey" +#define LACKYLOC "../lackey" #define LACKYWAITTIME 10000 class tst_QSystemSemaphore : public QObject diff --git a/tests/auto/qtipc/qtipc.pro b/tests/auto/qtipc/qtipc.pro new file mode 100644 index 0000000..60037d2 --- /dev/null +++ b/tests/auto/qtipc/qtipc.pro @@ -0,0 +1,6 @@ +TEMPLATE=subdirs +SUBDIRS=\ + lackey \ + qsharedmemory \ + qsystemsemaphore \ + diff --git a/tests/auto/qtouchevent/tst_qtouchevent.cpp b/tests/auto/qtouchevent/tst_qtouchevent.cpp index 639f8e4..bb80fde 100644 --- a/tests/auto/qtouchevent/tst_qtouchevent.cpp +++ b/tests/auto/qtouchevent/tst_qtouchevent.cpp @@ -193,6 +193,7 @@ private slots: void multiPointRawEventTranslationOnTouchPad(); void deleteInEventHandler(); void deleteInRawEventTranslation(); + void crashInQGraphicsSceneAfterNotHandlingTouchBegin(); }; void tst_QTouchEvent::touchDisabledByDefault() @@ -1303,6 +1304,36 @@ void tst_QTouchEvent::deleteInRawEventTranslation() qt_translateRawTouchEvent(&touchWidget, QTouchEvent::TouchScreen, rawTouchPoints); } +void tst_QTouchEvent::crashInQGraphicsSceneAfterNotHandlingTouchBegin() +{ + QGraphicsRectItem *rect = new QGraphicsRectItem(0, 0, 100, 100); + rect->setAcceptTouchEvents(true); + + QGraphicsRectItem *mainRect = new QGraphicsRectItem(0, 0, 100, 100, rect); + mainRect->setBrush(Qt::lightGray); + + QGraphicsRectItem *button = new QGraphicsRectItem(-20, -20, 40, 40, mainRect); + button->setPos(50, 50); + button->setBrush(Qt::darkGreen); + + QGraphicsView view; + QGraphicsScene scene; + scene.addItem(rect); + scene.setSceneRect(0,0,100,100); + view.setScene(&scene); + + view.show(); + QTest::qWaitForWindowShown(&view); + + QPoint centerPos = view.mapFromScene(rect->boundingRect().center()); + // Touch the button + QTest::touchEvent(view.viewport()).press(0, centerPos); + QTest::touchEvent(view.viewport()).release(0, centerPos); + // Touch outside of the button + QTest::touchEvent(view.viewport()).press(0, view.mapFromScene(QPoint(10, 10))); + QTest::touchEvent(view.viewport()).release(0, view.mapFromScene(QPoint(10, 10))); +} + QTEST_MAIN(tst_QTouchEvent) #include "tst_qtouchevent.moc" diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp index f108f4c..72ce393 100644 --- a/tests/auto/qurl/tst_qurl.cpp +++ b/tests/auto/qurl/tst_qurl.cpp @@ -1832,7 +1832,7 @@ void tst_QUrl::compat_constructor_01_data() QTest::addColumn<QString>("res"); //next we fill it with data - QTest::newRow( "data0" ) << QString("Makefile") << QString("Makefile"); // nolonger add file by defualt + QTest::newRow( "data0" ) << QString("Makefile") << QString("Makefile"); // nolonger add file by default QTest::newRow( "data1" ) << QString("Makefile") << QString("Makefile"); QTest::newRow( "data2" ) << QString("ftp://ftp.qt.nokia.com/qt/INSTALL") << QString("ftp://ftp.qt.nokia.com/qt/INSTALL"); QTest::newRow( "data3" ) << QString("ftp://ftp.qt.nokia.com/qt/INSTALL") << QString("ftp://ftp.qt.nokia.com/qt/INSTALL"); diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp index 21b2fe3..a316dda 100644 --- a/tests/auto/qvariant/tst_qvariant.cpp +++ b/tests/auto/qvariant/tst_qvariant.cpp @@ -3200,7 +3200,10 @@ struct MyPrimitive return x == o.x && y == o.y; } }; + +QT_BEGIN_NAMESPACE Q_DECLARE_TYPEINFO(MyPrimitive, Q_PRIMITIVE_TYPE); +QT_END_NAMESPACE struct MyData { @@ -3239,7 +3242,9 @@ struct MyMovable int MyMovable::count = 0; +QT_BEGIN_NAMESPACE Q_DECLARE_TYPEINFO(MyMovable, Q_MOVABLE_TYPE); +QT_END_NAMESPACE Q_DECLARE_METATYPE(QList<QSize>) Q_DECLARE_METATYPE(MyPrimitive) diff --git a/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P60/ibm60v01.xml b/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P60/ibm60v01.xml index edf9fee..050a340 100644 --- a/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P60/ibm60v01.xml +++ b/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P60/ibm60v01.xml @@ -10,10 +10,10 @@ <!ATTLIST one chapter CDATA #IMPLIED>
<!ATTLIST two chapter CDATA #REQUIRED>
<!ATTLIST three chapter CDATA #FIXED "JavaBeans">
- <!ATTLIST four chapter CDATA 'defualt'>
+ <!ATTLIST four chapter CDATA 'default'>
]>
<Java><one chapter="Introduction"/>
<three chapter="JavaBeans"/>
Positive test
DefaultDecl attributes values IMPLIED, REQUIRED, FIXED and default
-</Java>
\ No newline at end of file +</Java>
diff --git a/tests/auto/xmlpatternsdiagnosticsts/test/test.pro b/tests/auto/xmlpatternsdiagnosticsts/test/test.pro deleted file mode 100644 index acd71e4..0000000 --- a/tests/auto/xmlpatternsdiagnosticsts/test/test.pro +++ /dev/null @@ -1,32 +0,0 @@ -load(qttest_p4) -SOURCES += tst_xmlpatternsdiagnosticsts.cpp \ - ../../qxmlquery/TestFundament.cpp - -include (../../xmlpatterns.pri) - -TARGET = tst_xmlpatternsdiagnosticsts -DESTDIR = .. -win32 { - CONFIG(debug, debug|release): DESTDIR = ../debug - else: DESTDIR = ../release -} - -contains(QT_CONFIG, xmlpatterns) { -HEADERS += ../../xmlpatternsxqts/test/tst_suitetest.h -SOURCES += ../../xmlpatternsxqts/test/tst_suitetest.cpp -LIBS += -l$$XMLPATTERNS_SDK -} - -QT += xml - -INCLUDEPATH += $$(QTSRCDIR)/tests/auto/xmlpatternsxqts/lib/ \ - $$(QTDIR)/include/QtXmlPatterns/private \ - $$(QTSRCDIR)/tests/auto/xmlpatternsxqts/test \ - ../../xmlpatternsxqts/test \ - ../../xmlpatternsxqts/lib - -wince*|symbian { - catalog.sources = ../TestSuite ../Baseline.xml - catalog.path = . - DEPLOYMENT += catalog -} diff --git a/tests/auto/xmlpatternsdiagnosticsts/test/tst_xmlpatternsdiagnosticsts.cpp b/tests/auto/xmlpatternsdiagnosticsts/tst_xmlpatternsdiagnosticsts.cpp index 4a11404..4a11404 100644 --- a/tests/auto/xmlpatternsdiagnosticsts/test/tst_xmlpatternsdiagnosticsts.cpp +++ b/tests/auto/xmlpatternsdiagnosticsts/tst_xmlpatternsdiagnosticsts.cpp diff --git a/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro b/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro index 3d82eaf..981adab 100644 --- a/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro +++ b/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro @@ -1,5 +1,27 @@ -TEMPLATE = subdirs -CONFIG += ordered +load(qttest_p4) +SOURCES += tst_xmlpatternsdiagnosticsts.cpp \ + ../qxmlquery/TestFundament.cpp -SUBDIRS = ../xmlpatternsxqts test -requires(contains(QT_CONFIG,private_tests)) +include (../xmlpatterns.pri) + +TARGET = tst_xmlpatternsdiagnosticsts + +contains(QT_CONFIG, xmlpatterns) { +HEADERS += ../xmlpatternsxqts/tst_suitetest.h +SOURCES += ../xmlpatternsxqts/tst_suitetest.cpp +LIBS += -l$$XMLPATTERNS_SDK +} + +QT += xml + +INCLUDEPATH += $$(QTSRCDIR)/tests/auto/xmlpatternssdk \ + $$(QTDIR)/include/QtXmlPatterns/private \ + $$(QTSRCDIR)/tests/auto/xmlpatternsxqts \ + ../xmlpatternsxqts \ + ../xmlpatternssdk + +wince*|symbian { + catalog.sources = TestSuite Baseline.xml + catalog.path = . + DEPLOYMENT += catalog +} diff --git a/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro b/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro index 0f55078..f36211e 100644 --- a/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro +++ b/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro @@ -5,8 +5,8 @@ SOURCES += tst_xmlpatternsschemats.cpp \ include (../xmlpatterns.pri) contains(QT_CONFIG,xmlpatterns) { -HEADERS += ../xmlpatternsxqts/test/tst_suitetest.h -SOURCES += ../xmlpatternsxqts/test/tst_suitetest.cpp +HEADERS += ../xmlpatternsxqts/tst_suitetest.h +SOURCES += ../xmlpatternsxqts/tst_suitetest.cpp } PATTERNIST_SDK = QtXmlPatternsSDK @@ -20,8 +20,8 @@ LIBS += -l$$PATTERNIST_SDK QT += xml -INCLUDEPATH += $$QT_SOURCE_TREE/tests/auto/xmlpatternsxqts/lib/ \ - $$QT_BUILD_TREE/include/QtXmlPatterns/private \ - $$QT_SOURCE_TREE/tests/auto/xmlpatternsxqts/test \ - ../xmlpatternsxqts/test \ - ../xmlpatternsxqts/lib +INCLUDEPATH += $$QT_SOURCE_TREE/tests/auto/xmlpatternssdk/ \ + $$QT_BUILD_TREE/include/QtXmlPatterns/private \ + $$QT_SOURCE_TREE/tests/auto/xmlpatternsxqts \ + ../xmlpatternsxqts \ + ../xmlpatternssdk diff --git a/tests/auto/xmlpatternsxqts/lib/ASTItem.cpp b/tests/auto/xmlpatternssdk/ASTItem.cpp index 3b4fbdc..3b4fbdc 100644 --- a/tests/auto/xmlpatternsxqts/lib/ASTItem.cpp +++ b/tests/auto/xmlpatternssdk/ASTItem.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/ASTItem.h b/tests/auto/xmlpatternssdk/ASTItem.h index ca3ac8f..ca3ac8f 100644 --- a/tests/auto/xmlpatternsxqts/lib/ASTItem.h +++ b/tests/auto/xmlpatternssdk/ASTItem.h diff --git a/tests/auto/xmlpatternsxqts/lib/DebugExpressionFactory.cpp b/tests/auto/xmlpatternssdk/DebugExpressionFactory.cpp index 1b5121e..1b5121e 100644 --- a/tests/auto/xmlpatternsxqts/lib/DebugExpressionFactory.cpp +++ b/tests/auto/xmlpatternssdk/DebugExpressionFactory.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/DebugExpressionFactory.h b/tests/auto/xmlpatternssdk/DebugExpressionFactory.h index d5e676d..d5e676d 100644 --- a/tests/auto/xmlpatternsxqts/lib/DebugExpressionFactory.h +++ b/tests/auto/xmlpatternssdk/DebugExpressionFactory.h diff --git a/tests/auto/xmlpatternsxqts/lib/ErrorHandler.cpp b/tests/auto/xmlpatternssdk/ErrorHandler.cpp index 3f07737..3f07737 100644 --- a/tests/auto/xmlpatternsxqts/lib/ErrorHandler.cpp +++ b/tests/auto/xmlpatternssdk/ErrorHandler.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/ErrorHandler.h b/tests/auto/xmlpatternssdk/ErrorHandler.h index 25447a9..25447a9 100644 --- a/tests/auto/xmlpatternsxqts/lib/ErrorHandler.h +++ b/tests/auto/xmlpatternssdk/ErrorHandler.h diff --git a/tests/auto/xmlpatternsxqts/lib/ErrorItem.cpp b/tests/auto/xmlpatternssdk/ErrorItem.cpp index 57edc1f..57edc1f 100644 --- a/tests/auto/xmlpatternsxqts/lib/ErrorItem.cpp +++ b/tests/auto/xmlpatternssdk/ErrorItem.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/ErrorItem.h b/tests/auto/xmlpatternssdk/ErrorItem.h index 1d05872..1d05872 100644 --- a/tests/auto/xmlpatternsxqts/lib/ErrorItem.h +++ b/tests/auto/xmlpatternssdk/ErrorItem.h diff --git a/tests/auto/xmlpatternsxqts/lib/ExitCode.h b/tests/auto/xmlpatternssdk/ExitCode.h index e1810b1..e1810b1 100644 --- a/tests/auto/xmlpatternsxqts/lib/ExitCode.h +++ b/tests/auto/xmlpatternssdk/ExitCode.h diff --git a/tests/auto/xmlpatternsxqts/lib/ExpressionInfo.cpp b/tests/auto/xmlpatternssdk/ExpressionInfo.cpp index abbc8b3..abbc8b3 100644 --- a/tests/auto/xmlpatternsxqts/lib/ExpressionInfo.cpp +++ b/tests/auto/xmlpatternssdk/ExpressionInfo.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/ExpressionInfo.h b/tests/auto/xmlpatternssdk/ExpressionInfo.h index 2d9d398..2d9d398 100644 --- a/tests/auto/xmlpatternsxqts/lib/ExpressionInfo.h +++ b/tests/auto/xmlpatternssdk/ExpressionInfo.h diff --git a/tests/auto/xmlpatternsxqts/lib/ExpressionNamer.cpp b/tests/auto/xmlpatternssdk/ExpressionNamer.cpp index 605c754..605c754 100644 --- a/tests/auto/xmlpatternsxqts/lib/ExpressionNamer.cpp +++ b/tests/auto/xmlpatternssdk/ExpressionNamer.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/ExpressionNamer.h b/tests/auto/xmlpatternssdk/ExpressionNamer.h index 129d8d7..129d8d7 100644 --- a/tests/auto/xmlpatternsxqts/lib/ExpressionNamer.h +++ b/tests/auto/xmlpatternssdk/ExpressionNamer.h diff --git a/tests/auto/xmlpatternsxqts/lib/ExternalSourceLoader.cpp b/tests/auto/xmlpatternssdk/ExternalSourceLoader.cpp index a83a100..a83a100 100644 --- a/tests/auto/xmlpatternsxqts/lib/ExternalSourceLoader.cpp +++ b/tests/auto/xmlpatternssdk/ExternalSourceLoader.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/ExternalSourceLoader.h b/tests/auto/xmlpatternssdk/ExternalSourceLoader.h index 2d88222..2d88222 100644 --- a/tests/auto/xmlpatternsxqts/lib/ExternalSourceLoader.h +++ b/tests/auto/xmlpatternssdk/ExternalSourceLoader.h diff --git a/tests/auto/xmlpatternsxqts/lib/Global.cpp b/tests/auto/xmlpatternssdk/Global.cpp index f78e421..f78e421 100644 --- a/tests/auto/xmlpatternsxqts/lib/Global.cpp +++ b/tests/auto/xmlpatternssdk/Global.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/Global.h b/tests/auto/xmlpatternssdk/Global.h index 53c32cb..53c32cb 100644 --- a/tests/auto/xmlpatternsxqts/lib/Global.h +++ b/tests/auto/xmlpatternssdk/Global.h diff --git a/tests/auto/xmlpatternsxqts/lib/ResultThreader.cpp b/tests/auto/xmlpatternssdk/ResultThreader.cpp index 3296854..3296854 100644 --- a/tests/auto/xmlpatternsxqts/lib/ResultThreader.cpp +++ b/tests/auto/xmlpatternssdk/ResultThreader.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/ResultThreader.h b/tests/auto/xmlpatternssdk/ResultThreader.h index 19749f0..19749f0 100644 --- a/tests/auto/xmlpatternsxqts/lib/ResultThreader.h +++ b/tests/auto/xmlpatternssdk/ResultThreader.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestBaseLine.cpp b/tests/auto/xmlpatternssdk/TestBaseLine.cpp index 6a46bcc..6a46bcc 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestBaseLine.cpp +++ b/tests/auto/xmlpatternssdk/TestBaseLine.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestBaseLine.h b/tests/auto/xmlpatternssdk/TestBaseLine.h index e297128..e297128 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestBaseLine.h +++ b/tests/auto/xmlpatternssdk/TestBaseLine.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestCase.cpp b/tests/auto/xmlpatternssdk/TestCase.cpp index 7b424d2..7b424d2 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestCase.cpp +++ b/tests/auto/xmlpatternssdk/TestCase.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestCase.h b/tests/auto/xmlpatternssdk/TestCase.h index 28df5f1..28df5f1 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestCase.h +++ b/tests/auto/xmlpatternssdk/TestCase.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestContainer.cpp b/tests/auto/xmlpatternssdk/TestContainer.cpp index ec6196c..ec6196c 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestContainer.cpp +++ b/tests/auto/xmlpatternssdk/TestContainer.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestContainer.h b/tests/auto/xmlpatternssdk/TestContainer.h index 5b93491..5b93491 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestContainer.h +++ b/tests/auto/xmlpatternssdk/TestContainer.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestGroup.cpp b/tests/auto/xmlpatternssdk/TestGroup.cpp index f2cd2bd..f2cd2bd 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestGroup.cpp +++ b/tests/auto/xmlpatternssdk/TestGroup.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestGroup.h b/tests/auto/xmlpatternssdk/TestGroup.h index 5f4798f..5f4798f 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestGroup.h +++ b/tests/auto/xmlpatternssdk/TestGroup.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestItem.h b/tests/auto/xmlpatternssdk/TestItem.h index 0b3c606..0b3c606 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestItem.h +++ b/tests/auto/xmlpatternssdk/TestItem.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestResult.cpp b/tests/auto/xmlpatternssdk/TestResult.cpp index 2374bc0..2374bc0 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestResult.cpp +++ b/tests/auto/xmlpatternssdk/TestResult.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestResult.h b/tests/auto/xmlpatternssdk/TestResult.h index 6951f90..6951f90 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestResult.h +++ b/tests/auto/xmlpatternssdk/TestResult.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestResultHandler.cpp b/tests/auto/xmlpatternssdk/TestResultHandler.cpp index b87d481..b87d481 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestResultHandler.cpp +++ b/tests/auto/xmlpatternssdk/TestResultHandler.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestResultHandler.h b/tests/auto/xmlpatternssdk/TestResultHandler.h index a786ac4..a786ac4 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestResultHandler.h +++ b/tests/auto/xmlpatternssdk/TestResultHandler.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestSuite.cpp b/tests/auto/xmlpatternssdk/TestSuite.cpp index 2c3e49c..2c3e49c 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestSuite.cpp +++ b/tests/auto/xmlpatternssdk/TestSuite.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestSuite.h b/tests/auto/xmlpatternssdk/TestSuite.h index d14dc62..d14dc62 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestSuite.h +++ b/tests/auto/xmlpatternssdk/TestSuite.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestSuiteHandler.cpp b/tests/auto/xmlpatternssdk/TestSuiteHandler.cpp index 7c687f3..7c687f3 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestSuiteHandler.cpp +++ b/tests/auto/xmlpatternssdk/TestSuiteHandler.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestSuiteHandler.h b/tests/auto/xmlpatternssdk/TestSuiteHandler.h index 76156c0..76156c0 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestSuiteHandler.h +++ b/tests/auto/xmlpatternssdk/TestSuiteHandler.h diff --git a/tests/auto/xmlpatternsxqts/lib/TestSuiteResult.cpp b/tests/auto/xmlpatternssdk/TestSuiteResult.cpp index 4e81859..4e81859 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestSuiteResult.cpp +++ b/tests/auto/xmlpatternssdk/TestSuiteResult.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TestSuiteResult.h b/tests/auto/xmlpatternssdk/TestSuiteResult.h index 491c2b2..491c2b2 100644 --- a/tests/auto/xmlpatternsxqts/lib/TestSuiteResult.h +++ b/tests/auto/xmlpatternssdk/TestSuiteResult.h diff --git a/tests/auto/xmlpatternsxqts/lib/TreeItem.cpp b/tests/auto/xmlpatternssdk/TreeItem.cpp index b34262d..b34262d 100644 --- a/tests/auto/xmlpatternsxqts/lib/TreeItem.cpp +++ b/tests/auto/xmlpatternssdk/TreeItem.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TreeItem.h b/tests/auto/xmlpatternssdk/TreeItem.h index f5e051f..f5e051f 100644 --- a/tests/auto/xmlpatternsxqts/lib/TreeItem.h +++ b/tests/auto/xmlpatternssdk/TreeItem.h diff --git a/tests/auto/xmlpatternsxqts/lib/TreeModel.cpp b/tests/auto/xmlpatternssdk/TreeModel.cpp index e27f8e0..e27f8e0 100644 --- a/tests/auto/xmlpatternsxqts/lib/TreeModel.cpp +++ b/tests/auto/xmlpatternssdk/TreeModel.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/TreeModel.h b/tests/auto/xmlpatternssdk/TreeModel.h index 1d8ea72..1d8ea72 100644 --- a/tests/auto/xmlpatternsxqts/lib/TreeModel.h +++ b/tests/auto/xmlpatternssdk/TreeModel.h diff --git a/tests/auto/xmlpatternsxqts/lib/Worker.cpp b/tests/auto/xmlpatternssdk/Worker.cpp index 0121099..0121099 100644 --- a/tests/auto/xmlpatternsxqts/lib/Worker.cpp +++ b/tests/auto/xmlpatternssdk/Worker.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/Worker.h b/tests/auto/xmlpatternssdk/Worker.h index b3d7ae2..b3d7ae2 100644 --- a/tests/auto/xmlpatternsxqts/lib/Worker.h +++ b/tests/auto/xmlpatternssdk/Worker.h diff --git a/tests/auto/xmlpatternsxqts/lib/XMLWriter.cpp b/tests/auto/xmlpatternssdk/XMLWriter.cpp index 60a5344..60a5344 100644 --- a/tests/auto/xmlpatternsxqts/lib/XMLWriter.cpp +++ b/tests/auto/xmlpatternssdk/XMLWriter.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/XMLWriter.h b/tests/auto/xmlpatternssdk/XMLWriter.h index 2b629bb..2b629bb 100644 --- a/tests/auto/xmlpatternsxqts/lib/XMLWriter.h +++ b/tests/auto/xmlpatternssdk/XMLWriter.h diff --git a/tests/auto/xmlpatternsxqts/lib/XQTSTestCase.cpp b/tests/auto/xmlpatternssdk/XQTSTestCase.cpp index 6a8645b..6a8645b 100644 --- a/tests/auto/xmlpatternsxqts/lib/XQTSTestCase.cpp +++ b/tests/auto/xmlpatternssdk/XQTSTestCase.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/XQTSTestCase.h b/tests/auto/xmlpatternssdk/XQTSTestCase.h index 8872b32..8872b32 100644 --- a/tests/auto/xmlpatternsxqts/lib/XQTSTestCase.h +++ b/tests/auto/xmlpatternssdk/XQTSTestCase.h diff --git a/tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.cpp b/tests/auto/xmlpatternssdk/XSDTSTestCase.cpp index 3cbb681..3cbb681 100644 --- a/tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.cpp +++ b/tests/auto/xmlpatternssdk/XSDTSTestCase.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.h b/tests/auto/xmlpatternssdk/XSDTSTestCase.h index 8cfa143..947687a 100644 --- a/tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.h +++ b/tests/auto/xmlpatternssdk/XSDTSTestCase.h @@ -50,6 +50,7 @@ #include "TestCase.h" QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE namespace QPatternistSDK { @@ -153,6 +154,7 @@ namespace QPatternistSDK }; } +QT_END_NAMESPACE QT_END_HEADER #endif diff --git a/tests/auto/xmlpatternsxqts/lib/XSDTestSuiteHandler.cpp b/tests/auto/xmlpatternssdk/XSDTestSuiteHandler.cpp index a868d19..a868d19 100644 --- a/tests/auto/xmlpatternsxqts/lib/XSDTestSuiteHandler.cpp +++ b/tests/auto/xmlpatternssdk/XSDTestSuiteHandler.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/XSDTestSuiteHandler.h b/tests/auto/xmlpatternssdk/XSDTestSuiteHandler.h index 9179a2d..5493c7d 100644 --- a/tests/auto/xmlpatternsxqts/lib/XSDTestSuiteHandler.h +++ b/tests/auto/xmlpatternssdk/XSDTestSuiteHandler.h @@ -50,6 +50,7 @@ #include "XQTSTestCase.h" QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE namespace QPatternistSDK { @@ -113,6 +114,7 @@ namespace QPatternistSDK }; } +QT_END_NAMESPACE QT_END_HEADER #endif diff --git a/tests/auto/xmlpatternsxqts/lib/XSLTTestSuiteHandler.cpp b/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.cpp index cfc3b2b..cfc3b2b 100644 --- a/tests/auto/xmlpatternsxqts/lib/XSLTTestSuiteHandler.cpp +++ b/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/XSLTTestSuiteHandler.h b/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.h index 8614789..8614789 100644 --- a/tests/auto/xmlpatternsxqts/lib/XSLTTestSuiteHandler.h +++ b/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.h diff --git a/tests/auto/xmlpatternsxqts/lib/docs/XMLIndenterExample.cpp b/tests/auto/xmlpatternssdk/docs/XMLIndenterExample.cpp index 24ee158..24ee158 100644 --- a/tests/auto/xmlpatternsxqts/lib/docs/XMLIndenterExample.cpp +++ b/tests/auto/xmlpatternssdk/docs/XMLIndenterExample.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/docs/XMLIndenterExampleResult.xml b/tests/auto/xmlpatternssdk/docs/XMLIndenterExampleResult.xml index c5e7312..c5e7312 100644 --- a/tests/auto/xmlpatternsxqts/lib/docs/XMLIndenterExampleResult.xml +++ b/tests/auto/xmlpatternssdk/docs/XMLIndenterExampleResult.xml diff --git a/tests/auto/xmlpatternsxqts/lib/docs/XMLWriterExample.cpp b/tests/auto/xmlpatternssdk/docs/XMLWriterExample.cpp index 24ee158..24ee158 100644 --- a/tests/auto/xmlpatternsxqts/lib/docs/XMLWriterExample.cpp +++ b/tests/auto/xmlpatternssdk/docs/XMLWriterExample.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/docs/XMLWriterExampleResult.xml b/tests/auto/xmlpatternssdk/docs/XMLWriterExampleResult.xml index c5e7312..c5e7312 100644 --- a/tests/auto/xmlpatternsxqts/lib/docs/XMLWriterExampleResult.xml +++ b/tests/auto/xmlpatternssdk/docs/XMLWriterExampleResult.xml diff --git a/tests/auto/xmlpatternsxqts/lib/tests/XMLWriterTest.cpp b/tests/auto/xmlpatternssdk/tests/XMLWriterTest.cpp index a10c01a..a10c01a 100644 --- a/tests/auto/xmlpatternsxqts/lib/tests/XMLWriterTest.cpp +++ b/tests/auto/xmlpatternssdk/tests/XMLWriterTest.cpp diff --git a/tests/auto/xmlpatternsxqts/lib/tests/XMLWriterTest.h b/tests/auto/xmlpatternssdk/tests/XMLWriterTest.h index f90aea2..f90aea2 100644 --- a/tests/auto/xmlpatternsxqts/lib/tests/XMLWriterTest.h +++ b/tests/auto/xmlpatternssdk/tests/XMLWriterTest.h diff --git a/tests/auto/xmlpatternsxqts/lib/lib.pro b/tests/auto/xmlpatternssdk/xmlpatternssdk.pro index f5b0a06..6204f01 100644 --- a/tests/auto/xmlpatternsxqts/lib/lib.pro +++ b/tests/auto/xmlpatternssdk/xmlpatternssdk.pro @@ -1,4 +1,4 @@ -include (../../xmlpatterns.pri) +include (../xmlpatterns.pri) TARGET = $$XMLPATTERNS_SDK TEMPLATE = lib diff --git a/tests/auto/xmlpatternsview/test/test.pro b/tests/auto/xmlpatternsview/test/test.pro deleted file mode 100644 index 6adff4d..0000000 --- a/tests/auto/xmlpatternsview/test/test.pro +++ /dev/null @@ -1,17 +0,0 @@ -load(qttest_p4) -SOURCES += tst_xmlpatternsview.cpp - -include (../../xmlpatterns.pri) - -DESTDIR = .. -win32 { - CONFIG(debug, debug|release): DESTDIR = ../debug - else: DESTDIR = ../release -} -TARGET = tst_xmlpatternsview - -wince*: { - viewexe.sources = $$QT_BUILD_TREE/xmlpatternsview.exe - viewexe.path = . - DEPLOYMENT += viewexe -} diff --git a/tests/auto/xmlpatternsview/test/tst_xmlpatternsview.cpp b/tests/auto/xmlpatternsview/tst_xmlpatternsview.cpp index 91dee63..91dee63 100644 --- a/tests/auto/xmlpatternsview/test/tst_xmlpatternsview.cpp +++ b/tests/auto/xmlpatternsview/tst_xmlpatternsview.cpp diff --git a/tests/auto/xmlpatternsview/xmlpatternsview.pro b/tests/auto/xmlpatternsview/xmlpatternsview.pro index 04ee4d0..d93cba3 100644 --- a/tests/auto/xmlpatternsview/xmlpatternsview.pro +++ b/tests/auto/xmlpatternsview/xmlpatternsview.pro @@ -1,9 +1,12 @@ -TEMPLATE = subdirs -CONFIG += ordered +load(qttest_p4) +SOURCES += tst_xmlpatternsview.cpp -SUBDIRS = ../xmlpatternsxqts test +include (../xmlpatterns.pri) -contains(QT_CONFIG,xmlpatterns) { - SUBDIRS += view +TARGET = tst_xmlpatternsview + +wince*: { + viewexe.sources = $$QT_BUILD_TREE/xmlpatternsview.exe + viewexe.path = . + DEPLOYMENT += viewexe } -requires(contains(QT_CONFIG,private_tests)) diff --git a/tests/auto/xmlpatternsxqts/test/test.pro b/tests/auto/xmlpatternsxqts/test/test.pro deleted file mode 100644 index a69838a..0000000 --- a/tests/auto/xmlpatternsxqts/test/test.pro +++ /dev/null @@ -1,26 +0,0 @@ -load(qttest_p4) -SOURCES += tst_xmlpatternsxqts.cpp ../../qxmlquery/TestFundament.cpp tst_suitetest.cpp - -include(../../xmlpatterns.pri) - -contains(QT_CONFIG,xmlpatterns) { - HEADERS += tst_suitetest.h - LIBS += -l$$XMLPATTERNS_SDK -} - -# syncqt doesn't copy headers in tools/ so let's manually ensure -# it works with shadow builds and source builds. -INCLUDEPATH += $$(QTDIR)/include/QtXmlPatterns/private \ - $$(QTSRCDIR)/include/QtXmlPatterns/private \ - $$(QTSRCDIR)/tools/xmlpatterns \ - $$(QTDIR)/tools/xmlpatterns \ - ../lib/ - -CONFIG += testlib -QT += xml -DESTDIR = .. -win32 { - CONFIG(debug, debug|release): DESTDIR = ../debug - else: DESTDIR = ../release -} -TARGET = tst_xmlpatternsxqts diff --git a/tests/auto/xmlpatternsxqts/test/tst_suitetest.cpp b/tests/auto/xmlpatternsxqts/tst_suitetest.cpp index 64120c7..64120c7 100644 --- a/tests/auto/xmlpatternsxqts/test/tst_suitetest.cpp +++ b/tests/auto/xmlpatternsxqts/tst_suitetest.cpp diff --git a/tests/auto/xmlpatternsxqts/test/tst_suitetest.h b/tests/auto/xmlpatternsxqts/tst_suitetest.h index 22e384a..70e56af 100644 --- a/tests/auto/xmlpatternsxqts/test/tst_suitetest.h +++ b/tests/auto/xmlpatternsxqts/tst_suitetest.h @@ -44,7 +44,7 @@ #define Q_tst_SuiteTest #include <QtCore/QObject> -#include "../../qxmlquery/TestFundament.h" +#include "../qxmlquery/TestFundament.h" /*! \class tst_SuiteTest diff --git a/tests/auto/xmlpatternsxqts/test/tst_xmlpatternsxqts.cpp b/tests/auto/xmlpatternsxqts/tst_xmlpatternsxqts.cpp index 890234e..890234e 100644 --- a/tests/auto/xmlpatternsxqts/test/tst_xmlpatternsxqts.cpp +++ b/tests/auto/xmlpatternsxqts/tst_xmlpatternsxqts.cpp diff --git a/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro b/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro index 3f49ccc..e81888a 100644 --- a/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro +++ b/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro @@ -1,13 +1,21 @@ -TEMPLATE = subdirs +load(qttest_p4) +SOURCES += tst_xmlpatternsxqts.cpp ../qxmlquery/TestFundament.cpp tst_suitetest.cpp + +include(../xmlpatterns.pri) + contains(QT_CONFIG,xmlpatterns) { - SUBDIRS += lib - test.depends = lib + HEADERS += tst_suitetest.h + LIBS += -l$$XMLPATTERNS_SDK } -SUBDIRS += test - -# Needed on the win32-g++ setup and on the test machine arsia. -INCLUDEPATH += $$QT_BUILD_TREE/include/QtXmlPatterns/private \ - ../../../include/QtXmlPatterns/private -requires(contains(QT_CONFIG,private_tests)) +# syncqt doesn't copy headers in tools/ so let's manually ensure +# it works with shadow builds and source builds. +INCLUDEPATH += $$(QTDIR)/include/QtXmlPatterns/private \ + $$(QTSRCDIR)/include/QtXmlPatterns/private \ + $$(QTSRCDIR)/tools/xmlpatterns \ + $$(QTDIR)/tools/xmlpatterns \ + ../xmlpatternssdk/ +CONFIG += testlib +QT += xml +TARGET = tst_xmlpatternsxqts diff --git a/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro b/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro index 9b63a52..940cc31 100644 --- a/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro +++ b/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro @@ -5,17 +5,17 @@ SOURCES += tst_xmlpatternsxslts.cpp \ include (../xmlpatterns.pri) contains(QT_CONFIG,xmlpatterns) { -HEADERS += ../xmlpatternsxqts/test/tst_suitetest.h -SOURCES += ../xmlpatternsxqts/test/tst_suitetest.cpp +HEADERS += ../xmlpatternsxqts/tst_suitetest.h +SOURCES += ../xmlpatternsxqts/tst_suitetest.cpp LIBS += -l$$XMLPATTERNS_SDK } QT += xml -INCLUDEPATH += $$(QTSRCDIR)/tests/auto/xmlpatternsxqts/lib/ \ - $$(QTDIR)/include/QtXmlPatterns/private \ - $$(QTSRCDIR)/tests/auto/xmlpatternsxqts/test \ - ../xmlpatternsxqts/test \ - ../xmlpatternsxqts/lib +INCLUDEPATH += $$(QTSRCDIR)/tests/auto/xmlpatternssdk \ + $$(QTDIR)/include/QtXmlPatterns/private \ + $$(QTSRCDIR)/tests/auto/xmlpatternsxqts \ + ../xmlpatternsxqts \ + ../xmlpatternssdk wince*: { testdata.sources = XSLTS Baseline.xml diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/main.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/main.cpp index e84b879..b904f40 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/main.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/main.cpp @@ -43,6 +43,7 @@ #include <QtTest/QtTest> #include <QtGui/qgraphicsview.h> #include <QtGui/qpixmapcache.h> +#include <QtGui/qdesktopwidget.h> #include "mainview.h" #include "dummydatagen.h" @@ -324,8 +325,12 @@ void tst_GraphicsViewBenchmark::initTestCase() #if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) mMainView->showFullScreen(); #else - mMainView->resize(360, 640); - mMainView->show(); + if (QApplication::desktop()->width() < 360 || QApplication::desktop()->height() < 640) { + mMainView->showFullScreen(); + } else { + mMainView->resize(360, 640); + mMainView->show(); + } #endif } @@ -778,8 +783,12 @@ int main(int argc, char *argv[]) #if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) view.showFullScreen(); #else - view.resize(360, 640); - view.show(); + if (QApplication::desktop()->width() < 360 || QApplication::desktop()->height() < 640) { + view.showFullScreen(); + } else { + view.resize(360, 640); + view.show(); + } #endif } returnValue = app.exec(); diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp index acc2533..f866fd7 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h index e67163c..026bd11 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp index 3fc8307..fe03a21 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. @@ -37,7 +38,6 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - #include <QGraphicsLayout> #include "abstractitemview.h" diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h index e68b2ca..2e191a1 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.cpp index 077e0bf..f6d7a6c 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.h index 563d5dc..5e15d52 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp index 8575e24..528bd87 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h index 8775ab0..3649cb0 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.cpp index 2c0983d..e4cef5d 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.h index bb32c08..e69dbfe 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp index b19e0fa..3380ea4 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.h index b2d942d..adea9da 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.cpp index cdfa941..4fadac6 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.h index 8c063ef..8676d92 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.cpp index 77e8b11..0c3eba4 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.h index 5ec622b..a6c0ff1 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.cpp index 8c840dc..e2b6f78 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.h index 44f6e2b..fbe7426 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp index 00f892f..44bbc7f 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h index 3f40609..3828a58 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp index 7d6bf93..f05904e 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.h index 0693d06..d40e34c 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.cpp index 9768b45..38076e9 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h index 5b9f56d..8f90395 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp index ac7bf45..344d7e8 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.h index 4bf11a4..29ea302 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp index e07e30b..b91a84c 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.h index 3add50a..76d8354 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.cpp index 3f3d118..e794622 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.h index afae605..7db47a0 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp index e9e1c27..89e8215 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h index 34c6564..31b69a5 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp index 2b47183..fe10b28 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.h index e52abde..dfa12d6 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp index e6e6022..736b9fe 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h index c300f39..342083f 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp index 07a154b..ad62a9d 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h index b23f120..7591be6 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp index 30499f3..3de39b8 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.h index 521e27e..1f762ec 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.cpp index eb23ca9..f84b90a 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.h index 4db05a5..a155eef 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/resourcemoninterface.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/resourcemoninterface.h index 86b651f..990843a 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/resourcemoninterface.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/resourcemoninterface.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.cpp index 3883d7b..4cf05e5 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.h index 0d7bcd4..3b0ae04 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.cpp index 5b6ffa3..1cdcaf9 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.h index c3d917b..d3c9f35 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h index 32cb650..69c04a0 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.cpp index 7e7f7ca..bffedf7 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.h index 57ad970..d2c0122 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp index 9776ef4..af25628 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.h index 908bada..152cce7 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp index 7bb15e6..106f435 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h index ec3334d..25a0546 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp index 40efe66..4ed8608 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h index 9ec7b73..51db185 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.cpp index 3ba5f9e..75bc320 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.h index 3087ec8..365b1fd 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.cpp index a01dbdd..68ffcd5 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.h index a10a2dd..e2722ed 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.h +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index ac51072..e17cf1c 100644 --- a/tests/benchmarks/gui/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/benchmarks/gui/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -55,6 +55,7 @@ public: virtual ~tst_QGraphicsItem(); public slots: + void initTestCase(); void init(); void cleanup(); @@ -71,7 +72,6 @@ private slots: void scale(); void shear(); void translate(); - void setRotation(); }; tst_QGraphicsItem::tst_QGraphicsItem() @@ -82,8 +82,23 @@ tst_QGraphicsItem::~tst_QGraphicsItem() { } +static inline void processEvents() +{ + QApplication::flush(); + QApplication::processEvents(); + QApplication::processEvents(); +} + +void tst_QGraphicsItem::initTestCase() +{ + QApplication::flush(); + QTest::qWait(1500); + processEvents(); +} + void tst_QGraphicsItem::init() { + processEvents(); } void tst_QGraphicsItem::cleanup() @@ -152,10 +167,10 @@ void tst_QGraphicsItem::setPos() QGraphicsScene scene; QGraphicsRectItem *rect = scene.addRect(QRectF(0, 0, 100, 100)); + processEvents(); QBENCHMARK { rect->setPos(10, 10); - rect->transform(); // prevent lazy optimizing } } @@ -163,7 +178,6 @@ void tst_QGraphicsItem::setTransform_data() { QTest::addColumn<QTransform>("transform"); - QTest::newRow("id") << QTransform(); QTest::newRow("rotate 45z") << QTransform().rotate(45); QTest::newRow("scale 2x2") << QTransform().scale(2, 2); QTest::newRow("translate 100, 100") << QTransform().translate(100, 100); @@ -177,10 +191,10 @@ void tst_QGraphicsItem::setTransform() QGraphicsScene scene; QGraphicsRectItem *item = scene.addRect(QRectF(0, 0, 100, 100)); + processEvents(); QBENCHMARK { item->setTransform(transform); - item->transform(); // prevent lazy optimizing } } @@ -188,10 +202,10 @@ void tst_QGraphicsItem::rotate() { QGraphicsScene scene; QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100)); + processEvents(); QBENCHMARK { item->rotate(45); - item->transform(); // prevent lazy optimizing } } @@ -199,10 +213,10 @@ void tst_QGraphicsItem::scale() { QGraphicsScene scene; QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100)); + processEvents(); QBENCHMARK { item->scale(2, 2); - item->transform(); // prevent lazy optimizing } } @@ -210,10 +224,10 @@ void tst_QGraphicsItem::shear() { QGraphicsScene scene; QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100)); + processEvents(); QBENCHMARK { item->shear(1.5, 1.5); - item->transform(); // prevent lazy optimizing } } @@ -221,21 +235,10 @@ void tst_QGraphicsItem::translate() { QGraphicsScene scene; QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100)); + processEvents(); QBENCHMARK { item->translate(100, 100); - item->transform(); // prevent lazy optimizing - } -} - -void tst_QGraphicsItem::setRotation() -{ - QGraphicsScene scene; - QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100)); - - QBENCHMARK { - item->setRotation(45); - item->transform(); // prevent lazy optimizing } } diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp index 5bd07f9..10d73d5 100644 --- a/tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp @@ -75,8 +75,16 @@ tst_QGraphicsScene::~tst_QGraphicsScene() { } +static inline void processEvents() +{ + QApplication::flush(); + QApplication::processEvents(); + QApplication::processEvents(); +} + void tst_QGraphicsScene::init() { + processEvents(); } void tst_QGraphicsScene::cleanup() @@ -148,6 +156,8 @@ void tst_QGraphicsScene::addItem() if (!sceneRect.isNull()) scene.setSceneRect(sceneRect); + processEvents(); + QBENCHMARK { QGraphicsItem *item = 0; for (int y = 0; y < numItems_Y; ++y) { @@ -209,7 +219,6 @@ void tst_QGraphicsScene::itemAt() if (!sceneRect.isNull()) scene.setSceneRect(sceneRect); - QGraphicsItem *item = 0; for (int y = 0; y < numItems_Y; ++y) { for (int x = 0; x < numItems_X; ++x) { QGraphicsRectItem *item = new QGraphicsRectItem(itemRect); @@ -219,9 +228,11 @@ void tst_QGraphicsScene::itemAt() } scene.itemAt(0, 0); // triggers indexing + processEvents(); + QGraphicsItem *item = 0; QBENCHMARK { - scene.itemAt(0, 0); + item = scene.itemAt(0, 0); } //let QGraphicsScene::_q_polishItems be called so ~QGraphicsItem doesn't spend all his time cleaning the unpolished list diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index 10e00a6..3c0ae71 100644 --- a/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -45,11 +45,7 @@ #include <QGraphicsScene> #include <QGraphicsView> #include <QImage> -#ifdef Q_WS_X11 -QT_BEGIN_NAMESPACE -extern void qt_x11_wait_for_window_manager(QWidget *); -QT_END_NAMESPACE -#endif + #include "chiptester/chiptester.h" //#define CALLGRIND_DEBUG #ifdef CALLGRIND_DEBUG @@ -58,34 +54,65 @@ QT_END_NAMESPACE //TESTED_FILES= -class QEventWaiter : public QEventLoop +static inline void processEvents() +{ + QPixmapCache::clear(); + QApplication::flush(); + QApplication::processEvents(); + QApplication::processEvents(); +} + +class TestView : public QGraphicsView { + Q_OBJECT public: - QEventWaiter(QObject *receiver, QEvent::Type type) - : waiting(false), t(type) - { - receiver->installEventFilter(this); - } + TestView() : QGraphicsView(), waiting(false), timerId(-1) + {} - void wait() + void waitForPaintEvent(int timeout = 4000) { + if (waiting) + return; waiting = true; - exec(); + timerId = startTimer(timeout); + eventLoop.exec(); + killTimer(timerId); + timerId = -1; + waiting = false; } - bool eventFilter(QObject *receiver, QEvent *event) + void tryResize(int width, int height) { - Q_UNUSED(receiver); - if (waiting && event->type() == t) { - waiting = false; - exit(); + QDesktopWidget *desktop = QApplication::desktop(); + if (desktop->width() < width) + width = desktop->width(); + if (desktop->height() < height) + height = desktop->height(); + if (size() != QSize(width, height)) { + resize(width, height); + QTest::qWait(250); + processEvents(); } - return false; + } + +protected: + void paintEvent(QPaintEvent *event) + { + QGraphicsView::paintEvent(event); + if (waiting) + eventLoop.exit(); + } + + void timerEvent(QTimerEvent *event) + { + if (event->timerId() == timerId) + eventLoop.exit(); } private: + QEventLoop eventLoop; bool waiting; - QEvent::Type t; + int timerId; }; class tst_QGraphicsView : public QObject @@ -97,6 +124,7 @@ public: virtual ~tst_QGraphicsView(); public slots: + void initTestCase(); void init(); void cleanup(); @@ -126,6 +154,9 @@ private slots: void moveItemCache(); void paintItemCache_data(); void paintItemCache(); + +private: + TestView mView; }; tst_QGraphicsView::tst_QGraphicsView() @@ -136,8 +167,25 @@ tst_QGraphicsView::~tst_QGraphicsView() { } +void tst_QGraphicsView::initTestCase() +{ + mView.setFrameStyle(0); + mView.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + mView.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + mView.tryResize(100, 100); + mView.show(); + QTest::qWaitForWindowShown(&mView); + QTest::qWait(300); + processEvents(); +} + void tst_QGraphicsView::init() { + mView.setRenderHints(QPainter::RenderHints(0)); + mView.viewport()->setMouseTracking(false); + mView.setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); + for (int i = 0; i < 3; ++i) + processEvents(); } void tst_QGraphicsView::cleanup() @@ -156,25 +204,18 @@ void tst_QGraphicsView::paintSingleItem() QGraphicsScene scene(0, 0, 100, 100); scene.addRect(0, 0, 10, 10); - QGraphicsView view(&scene); - view.show(); - view.resize(100, 100); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif + mView.setScene(&scene); + mView.tryResize(100, 100); + processEvents(); QImage image(100, 100, QImage::Format_ARGB32_Premultiplied); QPainter painter(&image); QBENCHMARK { - view.viewport()->render(&painter); + mView.viewport()->render(&painter); } } -#ifdef Q_OS_SYMBIAN -# define DEEP_STACKING_COUNT 85 -#else -# define DEEP_STACKING_COUNT 1000 -#endif +#define DEEP_STACKING_COUNT 85 void tst_QGraphicsView::paintDeepStackingItems() { @@ -188,17 +229,14 @@ void tst_QGraphicsView::paintDeepStackingItems() lastRect = rect; } - QGraphicsView view(&scene); - view.show(); - view.resize(100, 100); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif + mView.setScene(&scene); + mView.tryResize(100, 100); + processEvents(); QImage image(100, 100, QImage::Format_ARGB32_Premultiplied); QPainter painter(&image); QBENCHMARK { - view.viewport()->render(&painter); + mView.viewport()->render(&painter); } } @@ -215,17 +253,14 @@ void tst_QGraphicsView::paintDeepStackingItems_clipped() lastRect = rect; } - QGraphicsView view(&scene); - view.show(); - view.resize(100, 100); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif + mView.setScene(&scene); + mView.tryResize(100, 100); + processEvents(); QImage image(100, 100, QImage::Format_ARGB32_Premultiplied); QPainter painter(&image); QBENCHMARK { - view.viewport()->render(&painter); + mView.viewport()->render(&painter); } } @@ -234,18 +269,14 @@ void tst_QGraphicsView::moveSingleItem() QGraphicsScene scene(0, 0, 100, 100); QGraphicsRectItem *item = scene.addRect(0, 0, 10, 10); - QGraphicsView view(&scene); - view.show(); - view.resize(100, 100); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif + mView.setScene(&scene); + mView.tryResize(100, 100); + processEvents(); - QEventWaiter waiter(view.viewport(), QEvent::Paint); int n = 1; QBENCHMARK { item->setPos(25 * n, 25 * n); - waiter.wait(); + mView.waitForPaintEvent(); n = n ? 0 : 1; } } @@ -271,6 +302,8 @@ void tst_QGraphicsView::mapPointToScene() QGraphicsView view; view.setTransform(transform); + processEvents(); + QBENCHMARK { view.mapToScene(point); } @@ -297,6 +330,8 @@ void tst_QGraphicsView::mapPointFromScene() QGraphicsView view; view.setTransform(transform); + processEvents(); + QBENCHMARK { view.mapFromScene(point); } @@ -323,6 +358,8 @@ void tst_QGraphicsView::mapRectToScene() QGraphicsView view; view.setTransform(transform); + processEvents(); + QBENCHMARK { view.mapToScene(rect); } @@ -349,6 +386,8 @@ void tst_QGraphicsView::mapRectFromScene() QGraphicsView view; view.setTransform(transform); + processEvents(); + QBENCHMARK { view.mapFromScene(rect); } @@ -380,13 +419,14 @@ void tst_QGraphicsView::chipTester() QFETCH(int, operation); ChipTester tester; - tester.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&tester); -#endif tester.setAntialias(antialias); tester.setOpenGL(opengl); tester.setOperation(ChipTester::Operation(operation)); + tester.show(); + QTest::qWaitForWindowShown(&tester); + QTest::qWait(250); + processEvents(); + QBENCHMARK { tester.runBenchmark(); } @@ -436,20 +476,20 @@ void tst_QGraphicsView::deepNesting() } scene.setItemIndexMethod(bsp ? QGraphicsScene::BspTreeIndex : QGraphicsScene::NoIndex); scene.setSortCacheEnabled(sortCache); + scene.setSceneRect(scene.sceneRect()); - QGraphicsView view(&scene); - view.setRenderHint(QPainter::Antialiasing); - view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif - QTest::qWait(250); + mView.setRenderHint(QPainter::Antialiasing); + mView.setScene(&scene); + mView.tryResize(600, 600); + (void)scene.itemAt(0, 0); + processEvents(); QBENCHMARK { #ifdef CALLGRIND_DEBUG CALLGRIND_START_INSTRUMENTATION #endif - view.viewport()->repaint(); + mView.viewport()->update(); + mView.waitForPaintEvent(); #ifdef CALLGRIND_DEBUG CALLGRIND_STOP_INSTRUMENTATION #endif @@ -503,23 +543,6 @@ private: bool scale; }; -class CountPaintEventView : public QGraphicsView -{ -public: - CountPaintEventView(QGraphicsScene *scene = 0) - : QGraphicsView(scene), count(0) - { } - - int count; - -protected: - void paintEvent(QPaintEvent *event) - { - ++count; - QGraphicsView::paintEvent(event); - }; -}; - void tst_QGraphicsView::imageRiver_data() { QTest::addColumn<int>("direction"); @@ -541,13 +564,6 @@ void tst_QGraphicsView::imageRiver() QGraphicsScene scene(0, 0, 300, 300); - CountPaintEventView view(&scene); - view.resize(300, 300); - view.setFrameStyle(0); - view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - view.show(); - QPixmap pix(":/images/designer.png"); QVERIFY(!pix.isNull()); @@ -555,37 +571,31 @@ void tst_QGraphicsView::imageRiver() QFile file(":/random.data"); QVERIFY(file.open(QIODevice::ReadOnly)); QDataStream str(&file); -#if defined(Q_OS_SYMBIAN) for (int i = 0; i < 50; ++i) { -#else - for (int i = 0; i < 100; ++i) { -#endif - AnimatedPixmapItem *item; + AnimatedPixmapItem *item = 0; if (direction == 0) item = new AnimatedPixmapItem((i % 4) + 1, 0, rotation, scale); if (direction == 1) item = new AnimatedPixmapItem(0, (i % 4) + 1, rotation, scale); if (direction == 2) item = new AnimatedPixmapItem((i % 4) + 1, (i % 4) + 1, rotation, scale); item->setPixmap(pix); int rnd1, rnd2; str >> rnd1 >> rnd2; - item->setPos(-pix.width() + rnd1 % (view.width() + pix.width()), - -pix.height() + rnd2 % (view.height() + pix.height())); + item->setPos(-pix.width() + rnd1 % (300 + pix.width()), + -pix.height() + rnd2 % (300 + pix.height())); scene.addItem(item); } + scene.setSceneRect(0, 0, 300, 300); - view.count = 0; + mView.setScene(&scene); + mView.tryResize(300, 300); + processEvents(); QBENCHMARK { #ifdef CALLGRIND_DEBUG CALLGRIND_START_INSTRUMENTATION #endif -#if defined(Q_OS_SYMBIAN) for (int i = 0; i < 50; ++i) { -#else - for (int i = 0; i < 100; ++i) { -#endif scene.advance(); - while (view.count < (i+1)) - qApp->processEvents(); + mView.waitForPaintEvent(); } #ifdef CALLGRIND_DEBUG CALLGRIND_STOP_INSTRUMENTATION @@ -663,13 +673,6 @@ void tst_QGraphicsView::textRiver() QGraphicsScene scene(0, 0, 300, 300); - CountPaintEventView view(&scene); - view.resize(300, 300); - view.setFrameStyle(0); - view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - view.show(); - QPixmap pix(":/images/designer.png"); QVERIFY(!pix.isNull()); @@ -677,36 +680,32 @@ void tst_QGraphicsView::textRiver() QFile file(":/random.data"); QVERIFY(file.open(QIODevice::ReadOnly)); QDataStream str(&file); -#if defined(Q_OS_SYMBIAN) for (int i = 0; i < 50; ++i) { -#else - for (int i = 0; i < 100; ++i) { -#endif - AnimatedTextItem *item; + AnimatedTextItem *item = 0; if (direction == 0) item = new AnimatedTextItem((i % 4) + 1, 0, rotation, scale); if (direction == 1) item = new AnimatedTextItem(0, (i % 4) + 1, rotation, scale); if (direction == 2) item = new AnimatedTextItem((i % 4) + 1, (i % 4) + 1, rotation, scale); int rnd1, rnd2; str >> rnd1 >> rnd2; - item->setPos(-pix.width() + rnd1 % (view.width() + pix.width()), - -pix.height() + rnd2 % (view.height() + pix.height())); + item->setPos(-pix.width() + rnd1 % (300 + pix.width()), + -pix.height() + rnd2 % (300 + pix.height())); + item->setAcceptDrops(false); + item->setAcceptHoverEvents(false); scene.addItem(item); } + scene.setSceneRect(0, 0, 300, 300); - view.count = 0; + mView.setScene(&scene); + mView.tryResize(300, 300); + processEvents(); QBENCHMARK { #ifdef CALLGRIND_DEBUG CALLGRIND_START_INSTRUMENTATION #endif -#if defined(Q_OS_SYMBIAN) for (int i = 0; i < 50; ++i) { -#else - for (int i = 0; i < 100; ++i) { -#endif scene.advance(); - while (view.count < (i+1)) - qApp->processEvents(); + mView.waitForPaintEvent(); } #ifdef CALLGRIND_DEBUG CALLGRIND_STOP_INSTRUMENTATION @@ -773,13 +772,6 @@ void tst_QGraphicsView::moveItemCache() QGraphicsScene scene(0, 0, 300, 300); - CountPaintEventView view(&scene); - view.resize(600, 600); - view.setFrameStyle(0); - view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - view.show(); - QPixmap pix(":/images/wine.jpeg"); QVERIFY(!pix.isNull()); @@ -787,12 +779,8 @@ void tst_QGraphicsView::moveItemCache() QFile file(":/random.data"); QVERIFY(file.open(QIODevice::ReadOnly)); QDataStream str(&file); -#if defined(Q_OS_SYMBIAN) for (int i = 0; i < 5; ++i) { -#else - for (int i = 0; i < 50; ++i) { -#endif - AnimatedPixmapCacheItem *item; + AnimatedPixmapCacheItem *item = 0; if (direction == 0) item = new AnimatedPixmapCacheItem((i % 4) + 1, 0); if (direction == 1) item = new AnimatedPixmapCacheItem(0, (i % 4) + 1); if (direction == 2) item = new AnimatedPixmapCacheItem((i % 4) + 1, (i % 4) + 1); @@ -802,25 +790,23 @@ void tst_QGraphicsView::moveItemCache() item->setTransform(QTransform().rotate(45)); int rnd1, rnd2; str >> rnd1 >> rnd2; - item->setPos(-pix.width() + rnd1 % (view.width() + pix.width()), - -pix.height() + rnd2 % (view.height() + pix.height())); + item->setPos(-pix.width() + rnd1 % (400 + pix.width()), + -pix.height() + rnd2 % (400 + pix.height())); scene.addItem(item); } + scene.setSceneRect(0, 0, 400, 400); - view.count = 0; + mView.setScene(&scene); + mView.tryResize(400, 400); + processEvents(); QBENCHMARK { #ifdef CALLGRIND_DEBUG CALLGRIND_START_INSTRUMENTATION #endif -#if defined(Q_OS_SYMBIAN) - for (int i = 0; i < 50; ++i) { -#else - for (int i = 0; i < 100; ++i) { -#endif + for (int i = 0; i < 5; ++i) { scene.advance(); - while (view.count < (i+1)) - qApp->processEvents(); + mView.waitForPaintEvent(); } #ifdef CALLGRIND_DEBUG CALLGRIND_STOP_INSTRUMENTATION @@ -843,6 +829,7 @@ public: protected: void advance(int i) { + Q_UNUSED(i); if (partial) update(QRectF(boundingRect().center().x(), boundingRect().center().x(), 30, 30)); else @@ -880,13 +867,6 @@ void tst_QGraphicsView::paintItemCache() QGraphicsScene scene(0, 0, 300, 300); - CountPaintEventView view(&scene); - view.resize(600, 600); - view.setFrameStyle(0); - view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - view.show(); - QPixmap pix(":/images/wine.jpeg"); QVERIFY(!pix.isNull()); @@ -910,21 +890,19 @@ void tst_QGraphicsView::paintItemCache() item->setTransform(QTransform().rotate(45)); item->setPos(0, 0); scene.addItem(item); + scene.setSceneRect(-100, -100, 600, 600); - view.count = 0; + mView.tryResize(600, 600); + mView.setScene(&scene); + processEvents(); QBENCHMARK { #ifdef CALLGRIND_DEBUG CALLGRIND_START_INSTRUMENTATION #endif -#if defined(Q_OS_SYMBIAN) for (int i = 0; i < 5; ++i) { -#else - for (int i = 0; i < 50; ++i) { -#endif scene.advance(); - while (view.count < (i+1)) - qApp->processEvents(); + mView.waitForPaintEvent(); } #ifdef CALLGRIND_DEBUG CALLGRIND_STOP_INSTRUMENTATION diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index be6245a..f22ab8a 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -151,8 +151,9 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, mimeType = QLatin1String("text/html"); } - const QByteArray &ba = helpEngine->fileData(url); - return new HelpNetworkReply(request, ba.isEmpty() ? " " : ba, mimeType); + const QByteArray &data = helpEngine->findFile(url).isValid() + ? helpEngine->fileData(url) : QByteArray("File not found!"); + return new HelpNetworkReply(request, data, mimeType); } class HelpPage : public QWebPage diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 83b4d9c..9e0cb70 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -2265,24 +2265,31 @@ void Configure::generateBuildKey() QString build32Key = buildKey + "Windows " + compiler + " %1 " + build_options.join(" ") + " " + build_defines.join(" "); QString build64Key = buildKey + "Windows x64 " + compiler + " %1 " + build_options.join(" ") + " " + build_defines.join(" "); + QString buildSymbianKey = buildKey + "Symbian " + build_options.join(" ") + " " + build_defines.join(" "); build32Key = build32Key.simplified(); build64Key = build64Key.simplified(); - build32Key.prepend("# define "); - build64Key.prepend("# define "); + buildSymbianKey = buildSymbianKey.simplified(); + build32Key.prepend("# define "); + build64Key.prepend("# define "); + buildSymbianKey.prepend("# define "); - QString buildkey = // Debug builds - "#if (defined(_DEBUG) || defined(DEBUG))\n" - "# if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n" + QString buildkey = "#if defined(__SYMBIAN32__)\n" + + buildSymbianKey + "\"\n" + "#else\n" + // Debug builds + "# if (defined(_DEBUG) || defined(DEBUG))\n" + "# if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n" + build64Key.arg("debug") + "\"\n" - "# else\n" + "# else\n" + build32Key.arg("debug") + "\"\n" - "# endif\n" - "#else\n" + "# endif\n" + "# else\n" // Release builds - "# if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n" + "# if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n" + build64Key.arg("release") + "\"\n" - "# else\n" + "# else\n" + build32Key.arg("release") + "\"\n" + "# endif\n" "# endif\n" "#endif\n"; diff --git a/tools/configure/tools.cpp b/tools/configure/tools.cpp index aea2713..c4625af 100644 --- a/tools/configure/tools.cpp +++ b/tools/configure/tools.cpp @@ -146,6 +146,7 @@ void Tools::checkLicense(QMap<QString,QString> &dictionary, QMap<QString,QString if (products == 'B') { dictionary["EDITION"] = "Evaluation"; dictionary["QT_EDITION"] = "QT_EDITION_EVALUATION"; + licenseType = "Evaluation"; } } @@ -212,7 +213,7 @@ void Tools::checkLicense(QMap<QString,QString> &dictionary, QMap<QString,QString } // Override for evaluation licenses - if (dictionary["Edition"] == "Evaluation") + if (dictionary["EDITION"] == "Evaluation") dictionary["LICENSE_EXTENSION"] = "-EVALUATION"; if (QFile::exists(dictionary["QT_SOURCE_TREE"] + "/.LICENSE")) { |