diff options
author | axis <qt-info@nokia.com> | 2009-11-12 16:07:11 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-11-12 16:07:11 (GMT) |
commit | 97c76cf8a3320d6e99126965287697f8a14de4d7 (patch) | |
tree | 5f07c9d2bc99c2bd43fe462458d8423fb14715be | |
parent | 771672fa1a94a9b2b19e378d1b362dcdae323887 (diff) | |
parent | 8e589bc0aa6df55052e37b3107f2f03a1dc17d06 (diff) | |
download | Qt-97c76cf8a3320d6e99126965287697f8a14de4d7.zip Qt-97c76cf8a3320d6e99126965287697f8a14de4d7.tar.gz Qt-97c76cf8a3320d6e99126965287697f8a14de4d7.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-s60
77 files changed, 1178 insertions, 751 deletions
diff --git a/config.tests/x11/xsync/xsync.cpp b/config.tests/x11/xsync/xsync.cpp index ed3ecf5..8eea850 100644 --- a/config.tests/x11/xsync/xsync.cpp +++ b/config.tests/x11/xsync/xsync.cpp @@ -41,7 +41,9 @@ #include <X11/Xlib.h> #include <X11/Xutil.h> +extern "C" { #include <X11/extensions/sync.h> +} int main(int, char **) { diff --git a/demos/sub-attaq/animationmanager.cpp b/demos/sub-attaq/animationmanager.cpp index eb5a125..b3fc8e1 100644 --- a/demos/sub-attaq/animationmanager.cpp +++ b/demos/sub-attaq/animationmanager.cpp @@ -62,11 +62,18 @@ AnimationManager *AnimationManager::self() void AnimationManager::registerAnimation(QAbstractAnimation *anim) { + QObject::connect(anim, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterAnimation_helper(QObject*))); animations.append(anim); } +void AnimationManager::unregisterAnimation_helper(QObject *obj) +{ + unregisterAnimation(static_cast<QAbstractAnimation*>(obj)); +} + void AnimationManager::unregisterAnimation(QAbstractAnimation *anim) { + QObject::disconnect(anim, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterAnimation_helper(QObject*))); animations.removeAll(anim); } diff --git a/demos/sub-attaq/animationmanager.h b/demos/sub-attaq/animationmanager.h index 8db13eb..48d84d1 100644 --- a/demos/sub-attaq/animationmanager.h +++ b/demos/sub-attaq/animationmanager.h @@ -62,6 +62,9 @@ public slots: void pauseAll(); void resumeAll(); +private slots: + void unregisterAnimation_helper(QObject *obj); + private: static AnimationManager *instance; QList<QAbstractAnimation *> animations; diff --git a/demos/sub-attaq/boat.cpp b/demos/sub-attaq/boat.cpp index 0ad31b1..6fed9a9 100644 --- a/demos/sub-attaq/boat.cpp +++ b/demos/sub-attaq/boat.cpp @@ -62,7 +62,7 @@ static QAbstractAnimation *setupDestroyAnimation(Boat *boat) for (int i = 1; i <= 4; i++) { PixmapItem *step = new PixmapItem(QString("explosion/boat/step%1").arg(i),GraphicsScene::Big, boat); step->setZValue(6); - step->setOpacity(0); + step->setOpacity(0); //fade-in QPropertyAnimation *anim = new QPropertyAnimation(step, "opacity"); @@ -92,10 +92,10 @@ Boat::Boat() : PixmapItem(QString("boat"), GraphicsScene::Big), //The movement animation used to animate the boat movementAnimation = new QPropertyAnimation(this, "pos"); - //The movement animation used to animate the boat + //The destroy animation used to explode the boat destroyAnimation = setupDestroyAnimation(this); - //We setup the state machien of the boat + //We setup the state machine of the boat machine = new QStateMachine(this); QState *moving = new QState(machine); StopState *stopState = new StopState(this, moving); diff --git a/demos/sub-attaq/graphicsscene.cpp b/demos/sub-attaq/graphicsscene.cpp index e29095e..71d4fe7 100644 --- a/demos/sub-attaq/graphicsscene.cpp +++ b/demos/sub-attaq/graphicsscene.cpp @@ -278,4 +278,5 @@ void GraphicsScene::clearScene() boat->stop(); boat->hide(); + boat->setEnabled(true); } diff --git a/dist/changes-4.6.0 b/dist/changes-4.6.0 index 12803b8..69a0821 100644 --- a/dist/changes-4.6.0 +++ b/dist/changes-4.6.0 @@ -69,6 +69,8 @@ Third party components - Updated sqlite to version 3.6.19. + - Updated libpng to version 1.2.40 + **************************************************************************** * Library * diff --git a/doc/src/bughowto.qdoc b/doc/src/bughowto.qdoc index 971634a..e9ae965 100644 --- a/doc/src/bughowto.qdoc +++ b/doc/src/bughowto.qdoc @@ -48,24 +48,32 @@ about it so that we can fix it. Before reporting a bug, please check the \l{FAQs}, \l{Platform - Notes}, and the \l{Task Tracker} on the Qt website to see + Notes}, and the \l{Qt Bug Tracker} on the Qt website to see if the issue is already known. - If you have found a new bug, please submit a bug report using - the \l{Bug Report Form}. Always include the following information - in your bug report: + The first thing you should do is to sign up for an account for + the \l{Qt Bug Tracker}, if you do not already have one. Once you + have done that you can submit and track your bug reports and they + will be publicly available from the moment you submit them. + + Always include the following information in your bug report: \list 1 \o The name and version number of your compiler \o The name and version number of your operating system \o The version of Qt you are using, and what configure options it was - compiled with. + compiled with + \o Reliable and clear description on how to reproduce the problem \endlist + + If possible, please provide a test written using the QtTest module + as this will improve the procedure of reproducing your problem and + allow the developers to address the issue in a more efficient way. - If the problem you are reporting is only visible at run-time, try to - create a small test program that shows the problem when run. Often, - such a program can be created with some minor changes to one - of the many example programs in Qt's \c examples directory. + Otherwise, if the problem you are reporting is only visible at run-time, + try to create a small test program that shows the problem when run. + Often, such a program can be created with some minor changes to one of + the many example programs in Qt's examples directory. If you have implemented a bug fix and want to contribute your fix directly, then you can do so through the \l{Public Qt Repository}. diff --git a/doc/src/qt-webpages.qdoc b/doc/src/qt-webpages.qdoc index 1eee805..41f1350 100644 --- a/doc/src/qt-webpages.qdoc +++ b/doc/src/qt-webpages.qdoc @@ -50,7 +50,12 @@ */ /*! - \externalpage http://qt.nokia.com/bugreport-form + \externalpage http://bugreports.qt.nokia.com + \title Qt Bug Tracker +*/ + +/*! + \externalpage http://bugreports.qt.nokia.com \title Bug Report Form */ @@ -175,7 +180,7 @@ */ /*! - \externalpage http://qt.nokia.com/developer/task-tracker + \externalpage http://bugreports.qt.nokia.com \title Task Tracker */ diff --git a/examples/effects/blurpicker/blurpicker.cpp b/examples/effects/blurpicker/blurpicker.cpp index 1f46444..4911c73 100644 --- a/examples/effects/blurpicker/blurpicker.cpp +++ b/examples/effects/blurpicker/blurpicker.cpp @@ -49,24 +49,29 @@ #define M_PI 3.14159265358979323846 #endif -BlurPicker::BlurPicker(QWidget *parent): QGraphicsView(parent), m_index(0.0) +BlurPicker::BlurPicker(QWidget *parent): QGraphicsView(parent), m_index(0.0), m_animation(this, "index") { setBackgroundBrush(QPixmap(":/images/background.jpg")); - setScene(&m_scene); + setScene(new QGraphicsScene(this)); setupScene(); - updateIconPositions(); + setIndex(0); - connect(&m_timeLine, SIGNAL(valueChanged(qreal)), SLOT(updateIconPositions())); - m_timeLine.setDuration(400); + m_animation.setDuration(400); + m_animation.setEasingCurve(QEasingCurve::InOutSine); setRenderHint(QPainter::Antialiasing, true); setFrameStyle(QFrame::NoFrame); } -void BlurPicker::updateIconPositions() +qreal BlurPicker::index() const { - m_index = m_timeLine.currentFrame() / 1000.0; + return m_index; +} + +void BlurPicker::setIndex(qreal index) +{ + m_index = index; qreal baseline = 0; for (int i = 0; i < m_icons.count(); ++i) { @@ -82,12 +87,12 @@ void BlurPicker::updateIconPositions() static_cast<BlurEffect *>(icon->graphicsEffect())->setBaseLine(baseline); } - m_scene.update(); + scene()->update(); } void BlurPicker::setupScene() { - m_scene.setSceneRect(-200, -120, 400, 240); + scene()->setSceneRect(-200, -120, 400, 240); QStringList names; names << ":/images/accessories-calculator.png"; @@ -101,32 +106,34 @@ void BlurPicker::setupScene() for (int i = 0; i < names.count(); i++) { QPixmap pixmap(names[i]); - QGraphicsPixmapItem *icon = m_scene.addPixmap(pixmap); + QGraphicsPixmapItem *icon = scene()->addPixmap(pixmap); icon->setZValue(1); icon->setGraphicsEffect(new BlurEffect(icon)); m_icons << icon; } - QGraphicsPixmapItem *bg = m_scene.addPixmap(QPixmap(":/images/background.jpg")); + QGraphicsPixmapItem *bg = scene()->addPixmap(QPixmap(":/images/background.jpg")); bg->setZValue(0); bg->setPos(-200, -150); } void BlurPicker::keyPressEvent(QKeyEvent *event) { - if (event->key() == Qt::Key_Left) { - if (m_timeLine.state() == QTimeLine::NotRunning) { - m_timeLine.setFrameRange(m_index * 1000, m_index * 1000 - 1000); - m_timeLine.start(); - event->accept(); - } + int delta = 0; + switch (event->key()) + { + case Qt::Key_Left: + delta = -1; + break; + case Qt::Key_Right: + delta = 1; + break; + default: + break; } - - if (event->key() == Qt::Key_Right) { - if (m_timeLine.state() == QTimeLine::NotRunning) { - m_timeLine.setFrameRange(m_index * 1000, m_index * 1000 + 1000); - m_timeLine.start(); + if (m_animation.state() == QAbstractAnimation::Stopped && delta) { + m_animation.setEndValue(m_index + delta); + m_animation.start(); event->accept(); - } } } diff --git a/examples/effects/blurpicker/blurpicker.h b/examples/effects/blurpicker/blurpicker.h index b460df4..b302db4 100644 --- a/examples/effects/blurpicker/blurpicker.h +++ b/examples/effects/blurpicker/blurpicker.h @@ -44,31 +44,31 @@ #include <QGraphicsEffect> #include <QGraphicsView> -#include <QTimeLine> +#include <QPropertyAnimation> #include "blureffect.h" class BlurPicker: public QGraphicsView { Q_OBJECT + Q_PROPERTY(qreal index READ index WRITE setIndex); public: BlurPicker(QWidget *parent = 0); + qreal index() const; + void setIndex(qreal); + protected: void keyPressEvent(QKeyEvent *event); -private slots: - void updateIconPositions(); - private: void setupScene(); private: qreal m_index; - QGraphicsScene m_scene; QList<QGraphicsItem*> m_icons; - QTimeLine m_timeLine; + QPropertyAnimation m_animation; }; #endif // BLURPICKER_H diff --git a/examples/effects/customshader/blurpicker.cpp b/examples/effects/customshader/blurpicker.cpp index 6cda711..d38d99b 100644 --- a/examples/effects/customshader/blurpicker.cpp +++ b/examples/effects/customshader/blurpicker.cpp @@ -50,24 +50,29 @@ #define M_PI 3.14159265358979323846 #endif -BlurPicker::BlurPicker(QWidget *parent): QGraphicsView(parent), m_index(0.0) +BlurPicker::BlurPicker(QWidget *parent): QGraphicsView(parent), m_index(0.0), m_animation(this, "index") { setBackgroundBrush(QPixmap(":/images/background.jpg")); - setScene(&m_scene); + setScene(new QGraphicsScene(this)); setupScene(); - updateIconPositions(); + setIndex(0); - connect(&m_timeLine, SIGNAL(valueChanged(qreal)), SLOT(updateIconPositions())); - m_timeLine.setDuration(400); + m_animation.setDuration(400); + m_animation.setEasingCurve(QEasingCurve::InOutSine); setRenderHint(QPainter::Antialiasing, true); setFrameStyle(QFrame::NoFrame); } -void BlurPicker::updateIconPositions() +qreal BlurPicker::index() const { - m_index = m_timeLine.currentFrame() / 1000.0; + return m_index; +} + +void BlurPicker::setIndex(qreal index) +{ + m_index = index; qreal baseline = 0; for (int i = 0; i < m_icons.count(); ++i) { @@ -84,12 +89,12 @@ void BlurPicker::updateIconPositions() static_cast<BlurEffect *>(icon->graphicsEffect())->setBaseLine(baseline); } - m_scene.update(); + scene()->update(); } void BlurPicker::setupScene() { - m_scene.setSceneRect(-200, -120, 400, 240); + scene()->setSceneRect(-200, -120, 400, 240); QStringList names; names << ":/images/accessories-calculator.png"; @@ -103,7 +108,7 @@ void BlurPicker::setupScene() for (int i = 0; i < names.count(); i++) { QPixmap pixmap(names[i]); - QGraphicsPixmapItem *icon = m_scene.addPixmap(pixmap); + QGraphicsPixmapItem *icon = scene()->addPixmap(pixmap); icon->setZValue(1); if (i == 3) icon->setGraphicsEffect(new CustomShaderEffect()); @@ -112,26 +117,28 @@ void BlurPicker::setupScene() m_icons << icon; } - QGraphicsPixmapItem *bg = m_scene.addPixmap(QPixmap(":/images/background.jpg")); + QGraphicsPixmapItem *bg = scene()->addPixmap(QPixmap(":/images/background.jpg")); bg->setZValue(0); bg->setPos(-200, -150); } void BlurPicker::keyPressEvent(QKeyEvent *event) { - if (event->key() == Qt::Key_Left) { - if (m_timeLine.state() == QTimeLine::NotRunning) { - m_timeLine.setFrameRange(m_index * 1000, m_index * 1000 - 1000); - m_timeLine.start(); - event->accept(); - } + int delta = 0; + switch (event->key()) + { + case Qt::Key_Left: + delta = -1; + break; + case Qt::Key_Right: + delta = 1; + break; + default: + break; } - - if (event->key() == Qt::Key_Right) { - if (m_timeLine.state() == QTimeLine::NotRunning) { - m_timeLine.setFrameRange(m_index * 1000, m_index * 1000 + 1000); - m_timeLine.start(); + if (m_animation.state() == QAbstractAnimation::Stopped && delta) { + m_animation.setEndValue(m_index + delta); + m_animation.start(); event->accept(); - } } } diff --git a/examples/effects/customshader/blurpicker.h b/examples/effects/customshader/blurpicker.h index b460df4..b302db4 100644 --- a/examples/effects/customshader/blurpicker.h +++ b/examples/effects/customshader/blurpicker.h @@ -44,31 +44,31 @@ #include <QGraphicsEffect> #include <QGraphicsView> -#include <QTimeLine> +#include <QPropertyAnimation> #include "blureffect.h" class BlurPicker: public QGraphicsView { Q_OBJECT + Q_PROPERTY(qreal index READ index WRITE setIndex); public: BlurPicker(QWidget *parent = 0); + qreal index() const; + void setIndex(qreal); + protected: void keyPressEvent(QKeyEvent *event); -private slots: - void updateIconPositions(); - private: void setupScene(); private: qreal m_index; - QGraphicsScene m_scene; QList<QGraphicsItem*> m_icons; - QTimeLine m_timeLine; + QPropertyAnimation m_animation; }; #endif // BLURPICKER_H diff --git a/examples/effects/fademessage/fademessage.cpp b/examples/effects/fademessage/fademessage.cpp index 818d00f..a65c748 100644 --- a/examples/effects/fademessage/fademessage.cpp +++ b/examples/effects/fademessage/fademessage.cpp @@ -43,7 +43,7 @@ #include <QtGui> -FadeMessage::FadeMessage(QWidget *parent): QGraphicsView(parent), m_index(0.0) +FadeMessage::FadeMessage(QWidget *parent): QGraphicsView(parent) { setScene(&m_scene); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); @@ -51,9 +51,12 @@ FadeMessage::FadeMessage(QWidget *parent): QGraphicsView(parent), m_index(0.0) setupScene(); - m_timeLine = new QTimeLine(500, this); - m_timeLine->setCurveShape(QTimeLine::EaseInOutCurve); - connect(m_timeLine, SIGNAL(valueChanged(qreal)), m_effect, SLOT(setStrength(qreal))); + m_animation = new QPropertyAnimation(m_effect, "strength", this); + m_animation->setDuration(500); + m_animation->setEasingCurve(QEasingCurve::InOutSine); + m_animation->setStartValue(0); + m_animation->setEndValue(1); + setRenderHint(QPainter::Antialiasing, true); setFrameStyle(QFrame::NoFrame); @@ -63,13 +66,12 @@ void FadeMessage::togglePopup() { if (m_message->isVisible()) { m_message->setVisible(false); - m_timeLine->setDirection(QTimeLine::Backward); - m_timeLine->start(); + m_animation->setDirection(QAbstractAnimation::Backward); } else { m_message->setVisible(true); - m_timeLine->setDirection(QTimeLine::Forward); - m_timeLine->start(); + m_animation->setDirection(QAbstractAnimation::Forward); } + m_animation->start(); } void FadeMessage::setupScene() diff --git a/examples/effects/fademessage/fademessage.h b/examples/effects/fademessage/fademessage.h index 34e2fb8..e73ef6b 100644 --- a/examples/effects/fademessage/fademessage.h +++ b/examples/effects/fademessage/fademessage.h @@ -44,7 +44,7 @@ #include <QGraphicsEffect> #include <QGraphicsView> -#include <QTimeLine> +#include <QPropertyAnimation> #include "fademessage.h" @@ -62,11 +62,10 @@ private slots: void togglePopup(); private: - qreal m_index; QGraphicsScene m_scene; QGraphicsColorizeEffect *m_effect; QGraphicsItem *m_message; - QTimeLine *m_timeLine; + QPropertyAnimation *m_animation; }; #endif // FADEMESSAGE_H diff --git a/src/3rdparty/phonon/phonon/audiooutput.cpp b/src/3rdparty/phonon/phonon/audiooutput.cpp index 00b2ebd..962f828 100644 --- a/src/3rdparty/phonon/phonon/audiooutput.cpp +++ b/src/3rdparty/phonon/phonon/audiooutput.cpp @@ -257,6 +257,7 @@ void AudioOutputPrivate::setupBackendObject() // set up attributes pINTERFACE_CALL(setVolume(pow(volume, VOLTAGE_TO_LOUDNESS_EXPONENT))); +#ifndef QT_NO_PHONON_SETTINGSGROUP // if the output device is not available and the device was not explicitly set if (!callSetOutputDevice(this, device) && !outputDeviceOverridden) { // fall back in the preference list of output devices @@ -276,6 +277,7 @@ void AudioOutputPrivate::setupBackendObject() callSetOutputDevice(this, none); handleAutomaticDeviceChange(none, FallbackChange); } +#endif //QT_NO_PHONON_SETTINGSGROUP } void AudioOutputPrivate::_k_volumeChanged(qreal newVolume) @@ -305,6 +307,7 @@ void AudioOutputPrivate::_k_audioDeviceFailed() pDebug() << Q_FUNC_INFO; // outputDeviceIndex identifies a failing device // fall back in the preference list of output devices +#ifndef QT_NO_PHONON_SETTINGSGROUP const QList<int> deviceList = GlobalConfig().audioOutputDeviceListFor(category, GlobalConfig::AdvancedDevicesFromSettings | GlobalConfig::HideUnavailableDevices); for (int i = 0; i < deviceList.count(); ++i) { const int devIndex = deviceList.at(i); @@ -317,6 +320,7 @@ void AudioOutputPrivate::_k_audioDeviceFailed() } } } +#endif //QT_NO_PHONON_SETTINGSGROUP // if we get here there is no working output device. Tell the backend. const AudioOutputDevice none; callSetOutputDevice(this, none); @@ -326,6 +330,7 @@ void AudioOutputPrivate::_k_audioDeviceFailed() void AudioOutputPrivate::_k_deviceListChanged() { pDebug() << Q_FUNC_INFO; +#ifndef QT_NO_PHONON_SETTINGSGROUP // let's see if there's a usable device higher in the preference list const QList<int> deviceList = GlobalConfig().audioOutputDeviceListFor(category, GlobalConfig::AdvancedDevicesFromSettings); DeviceChangeType changeType = HigherPreferenceChange; @@ -351,6 +356,7 @@ void AudioOutputPrivate::_k_deviceListChanged() break; // found one with higher preference that works } } +#endif //QT_NO_PHONON_SETTINGSGROUP } static struct diff --git a/src/3rdparty/phonon/phonon/backendcapabilities.cpp b/src/3rdparty/phonon/phonon/backendcapabilities.cpp index 62c9cc9..5defe09 100644 --- a/src/3rdparty/phonon/phonon/backendcapabilities.cpp +++ b/src/3rdparty/phonon/phonon/backendcapabilities.cpp @@ -75,10 +75,12 @@ bool BackendCapabilities::isMimeTypeAvailable(const QString &mimeType) QList<AudioOutputDevice> BackendCapabilities::availableAudioOutputDevices() { QList<AudioOutputDevice> ret; +#ifndef QT_NO_PHONON_SETTINGSGROUP const QList<int> deviceIndexes = GlobalConfig().audioOutputDeviceListFor(Phonon::NoCategory); for (int i = 0; i < deviceIndexes.count(); ++i) { ret.append(AudioOutputDevice::fromIndex(deviceIndexes.at(i))); } +#endif //QT_NO_PHONON_SETTINGSGROUP return ret; } diff --git a/src/3rdparty/phonon/phonon/effectwidget.cpp b/src/3rdparty/phonon/phonon/effectwidget.cpp index fb9cf6e..f8341e5 100644 --- a/src/3rdparty/phonon/phonon/effectwidget.cpp +++ b/src/3rdparty/phonon/phonon/effectwidget.cpp @@ -97,8 +97,9 @@ void EffectWidgetPrivate::autogenerateUi() Q_Q(EffectWidget); QVBoxLayout *mainLayout = new QVBoxLayout(q); mainLayout->setMargin(0); - for (int i = 0; i < effect->parameters().count(); ++i) { - const EffectParameter ¶ = effect->parameters().at(i); + const QList<Phonon::EffectParameter> parameters = effect->parameters(); + for (int i = 0; i < parameters.count(); ++i) { + const EffectParameter ¶ = parameters.at(i); QVariant value = effect->parameterValue(para); QHBoxLayout *pLayout = new QHBoxLayout; mainLayout->addLayout(pLayout); diff --git a/src/3rdparty/phonon/phonon/globalconfig.cpp b/src/3rdparty/phonon/phonon/globalconfig.cpp index 3718c6a..429a29f 100644 --- a/src/3rdparty/phonon/phonon/globalconfig.cpp +++ b/src/3rdparty/phonon/phonon/globalconfig.cpp @@ -178,13 +178,15 @@ QList<int> GlobalConfig::audioOutputDeviceListFor(Phonon::Category category, int return listSortedByConfig(backendConfig, category, defaultList); } -#endif //QT_NO_SETTINGSGROUPS +#endif //QT_NO_PHONON_SETTINGSGROUP int GlobalConfig::audioOutputDeviceFor(Phonon::Category category, int override) const { +#ifndef QT_NO_PHONON_SETTINGSGROUP QList<int> ret = audioOutputDeviceListFor(category, override); - if (ret.isEmpty()) - return -1; - return ret.first(); + if (!ret.isEmpty()) + return ret.first(); +#endif //QT_NO_PHONON_SETTINGSGROUP + return -1; } #ifndef QT_NO_PHONON_AUDIOCAPTURE diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp index 117393a..bbb676b 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp @@ -971,7 +971,10 @@ void tst_QWebElement::render() QImage testImage(resource.width(), resource.height(), QImage::Format_ARGB32); QPainter painter0(&testImage); painter0.fillRect(imageRect, Qt::white); - painter0.drawImage(0, 0, resource); + //render() uses pixmaps internally, and pixmaps might have bit depths + // other than 32, giving different pixel values due to rounding. + QPixmap pix = QPixmap::fromImage(resource); + painter0.drawPixmap(0, 0, pix); painter0.end(); QImage image1(resource.width(), resource.height(), QImage::Format_ARGB32); diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp index 3065083..013ff7f 100644 --- a/src/corelib/animation/qpropertyanimation.cpp +++ b/src/corelib/animation/qpropertyanimation.cpp @@ -58,12 +58,12 @@ an example: \code - QPropertyAnimation animation(myWidget, "geometry"); - animation.setDuration(10000); - animation.setStartValue(QRect(0, 0, 100, 30)); - animation.setEndValue(QRect(250, 250, 100, 30)); + QPropertyAnimation *animation = new QPropertyAnimation(myWidget, "geometry"); + animation->setDuration(10000); + animation->setStartValue(QRect(0, 0, 100, 30)); + animation->setEndValue(QRect(250, 250, 100, 30)); - animation.start(); + animation->start(); \endcode The property name and the QObject instance of which property diff --git a/src/corelib/animation/qsequentialanimationgroup.cpp b/src/corelib/animation/qsequentialanimationgroup.cpp index 861e26e..5dbb8c3 100644 --- a/src/corelib/animation/qsequentialanimationgroup.cpp +++ b/src/corelib/animation/qsequentialanimationgroup.cpp @@ -63,12 +63,12 @@ pause to a sequential animation group. \code - QSequentialAnimationGroup group; + QSequentialAnimationGroup *group = new QSequentialAnimationGroup; - group.addAnimation(anim1); - group.addAnimation(anim2); + group->addAnimation(anim1); + group->addAnimation(anim2); - group.start(); + group->start(); \endcode In this example, \c anim1 and \c anim2 are two already set up diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp index 182594e..594a205 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp @@ -903,7 +903,7 @@ bool QGraphicsAnchorLayoutPrivate::simplifyGraphIteration(QGraphicsAnchorLayoutP QStack<QPair<AnchorVertex *, AnchorVertex *> > stack; stack.push(qMakePair(static_cast<AnchorVertex *>(0), layoutFirstVertex[orientation])); QVector<AnchorVertex*> candidates; - bool candidatesForward; + bool candidatesForward = true; // Walk depth-first, in the stack we store start of the candidate sequence (beforeSequence) // and the vertex to be visited. diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 9d495e9..4e5e5c8 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -9606,6 +9606,7 @@ void QGraphicsTextItem::setDefaultTextColor(const QColor &col) QPalette pal = c->palette(); pal.setColor(QPalette::Text, col); c->setPalette(pal); + update(); } /*! diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 27fd09e..3ef311c 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -3275,13 +3275,10 @@ void QGraphicsView::paintEvent(QPaintEvent *event) // Determine the exposed region d->exposedRegion = event->region(); - if (d->exposedRegion.isEmpty()) - d->exposedRegion = viewport()->rect(); QRectF exposedSceneRect = mapToScene(d->exposedRegion.boundingRect()).boundingRect(); // Set up the painter QPainter painter(viewport()); - painter.setClipRect(event->rect(), Qt::IntersectClip); #ifndef QT_NO_RUBBERBAND if (d->rubberBanding && !d->rubberBandRect.isEmpty()) painter.save(); diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 6d96d7a..ec8dd88 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -2073,7 +2073,7 @@ void QImage::setNumColors(int numColors) have entries for all the pixel/index values present in the image, otherwise the results are undefined. - \sa colorsCount(), colorTable(), setColor(), {QImage#Image + \sa colorCount(), colorTable(), setColor(), {QImage#Image Transformations}{Image Transformations} */ diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h index 6aee669..d0b488e 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_p.h +++ b/src/gui/inputmethod/qcoefepinputcontext_p.h @@ -84,7 +84,7 @@ public: bool filterEvent(const QEvent *event); void mouseHandler( int x, QMouseEvent *event); - bool isComposing() const { return m_isEditing; } + bool isComposing() const { return !m_preeditString.isEmpty(); } void setFocusWidget(QWidget * w); void widgetDestroyed(QWidget *w); @@ -140,7 +140,6 @@ private: QString m_preeditString; Qt::InputMethodHints m_lastImHints; TUint m_textCapabilities; - bool m_isEditing; bool m_inDestruction; bool m_pendingInputCapabilitiesChanged; int m_cursorVisibility; diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 0ed3cc0..08d86d7 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -65,7 +65,6 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent) m_fepState(q_check_ptr(new CAknEdwinState)), // CBase derived object needs check on new m_lastImHints(Qt::ImhNone), m_textCapabilities(TCoeInputCapabilities::EAllText), - m_isEditing(false), m_inDestruction(false), m_pendingInputCapabilitiesChanged(false), m_cursorVisibility(1), @@ -204,14 +203,26 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event) if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) { const QKeyEvent *keyEvent = static_cast<const QKeyEvent *>(event); - Q_ASSERT(m_lastImHints == focusWidget()->inputMethodHints()); - if (keyEvent->key() == Qt::Key_F20 && m_lastImHints & Qt::ImhHiddenText) { - // Special case in Symbian. On editors with secret text, F20 is for some reason - // considered to be a backspace. - QKeyEvent modifiedEvent(keyEvent->type(), Qt::Key_Backspace, keyEvent->modifiers(), - keyEvent->text(), keyEvent->isAutoRepeat(), keyEvent->count()); - QApplication::sendEvent(focusWidget(), &modifiedEvent); - return true; + switch (keyEvent->key()) { + case Qt::Key_F20: + Q_ASSERT(m_lastImHints == focusWidget()->inputMethodHints()); + if (m_lastImHints & Qt::ImhHiddenText) { + // Special case in Symbian. On editors with secret text, F20 is for some reason + // considered to be a backspace. + QKeyEvent modifiedEvent(keyEvent->type(), Qt::Key_Backspace, keyEvent->modifiers(), + keyEvent->text(), keyEvent->isAutoRepeat(), keyEvent->count()); + QApplication::sendEvent(focusWidget(), &modifiedEvent); + return true; + } + break; + case Qt::Key_Select: + if (!m_preeditString.isEmpty()) { + commitCurrentString(false); + return true; + } + break; + default: + break; } } @@ -245,7 +256,6 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event) void QCoeFepInputContext::mouseHandler( int x, QMouseEvent *event) { - Q_ASSERT(m_isEditing); Q_ASSERT(focusWidget()); if (event->type() == QEvent::MouseButtonPress && event->button() == Qt::LeftButton) { @@ -488,8 +498,6 @@ void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText, if (!w) return; - m_isEditing = true; - m_cursorPos = w->inputMethodQuery(Qt::ImCursorPosition).toInt(); QList<QInputMethodEvent::Attribute> attributes; @@ -555,8 +563,6 @@ void QCoeFepInputContext::CancelFepInlineEdit() event.setCommitString(QLatin1String(""), 0, 0); m_preeditString.clear(); sendEvent(event); - - m_isEditing = false; } TInt QCoeFepInputContext::DocumentLengthForFep() const @@ -711,7 +717,6 @@ void QCoeFepInputContext::commitCurrentString(bool triggeredBySymbian) sendEvent(event); m_longPress = 0; - m_isEditing = false; if (!triggeredBySymbian) { CCoeFep* fep = CCoeEnv::Static()->Fep(); diff --git a/src/gui/itemviews/qtreewidget.cpp b/src/gui/itemviews/qtreewidget.cpp index 040c498..c133ae4 100644 --- a/src/gui/itemviews/qtreewidget.cpp +++ b/src/gui/itemviews/qtreewidget.cpp @@ -2851,7 +2851,14 @@ QTreeWidgetItem *QTreeWidget::itemAt(const QPoint &p) const QRect QTreeWidget::visualItemRect(const QTreeWidgetItem *item) const { Q_D(const QTreeWidget); - return visualRect(d->index(item)); + //the visual rect for an item is across all columns. So we need to determine + //what is the first and last column and get their visual index rects + QModelIndex base = d->index(item); + const int firstVisiblesection = header()->logicalIndexAt(- header()->offset()); + const int lastVisibleSection = header()->logicalIndexAt(header()->length() - header()->offset() - 1); + QModelIndex first = base.sibling(base.row(), header()->logicalIndex(firstVisiblesection)); + QModelIndex last = base.sibling(base.row(), header()->logicalIndex(lastVisibleSection)); + return visualRect(first) | visualRect(last); } /*! diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp index 6f3cbaf..3eaf2e1 100644 --- a/src/gui/kernel/qaction.cpp +++ b/src/gui/kernel/qaction.cpp @@ -100,6 +100,21 @@ QActionPrivate::~QActionPrivate() { } +bool QActionPrivate::showStatusText(QWidget *widget, const QString &str) +{ +#ifdef QT_NO_STATUSTIP + Q_UNUSED(widget); + Q_UNUSED(str); +#else + if(QObject *object = widget ? widget : parent) { + QStatusTipEvent tip(str); + QApplication::sendEvent(object, &tip); + return true; + } +#endif + return false; +} + void QActionPrivate::sendDataChanged() { Q_Q(QAction); @@ -1206,16 +1221,7 @@ QAction::setData(const QVariant &data) bool QAction::showStatusText(QWidget *widget) { -#ifdef QT_NO_STATUSTIP - Q_UNUSED(widget); -#else - if(QObject *object = widget ? widget : parent()) { - QStatusTipEvent tip(statusTip()); - QApplication::sendEvent(object, &tip); - return true; - } -#endif - return false; + return d_func()->showStatusText(widget, statusTip()); } /*! diff --git a/src/gui/kernel/qaction_p.h b/src/gui/kernel/qaction_p.h index 2527a02..f7b035b 100644 --- a/src/gui/kernel/qaction_p.h +++ b/src/gui/kernel/qaction_p.h @@ -75,6 +75,8 @@ public: QActionPrivate(); ~QActionPrivate(); + bool showStatusText(QWidget *w, const QString &str); + QPointer<QActionGroup> group; QString text; QString iconText; diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 987aa26..4b8f6a0 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -791,7 +791,8 @@ void QApplicationPrivate::construct( } //make sure the plugin is loaded - qt_guiPlatformPlugin(); + if (qt_is_gui_used) + qt_guiPlatformPlugin(); #endif } diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index 3d4bb8c..192f9ac 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -601,6 +601,7 @@ void QGestureManager::deliverEvents(const QSet<QGesture *> &gestures, Qt::GestureType gestureType = gesture->gestureType(); Q_ASSERT(gestureType != Qt::CustomGesture); + Q_UNUSED(gestureType); if (target) { if (gesture->state() == Qt::GestureStarted) { diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 1a76083..89c18fb 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -1014,9 +1014,12 @@ bool QKeySequence::isEmpty() const */ QKeySequence QKeySequence::mnemonic(const QString &text) { + QKeySequence ret; + if(qt_sequence_no_mnemonics) - return QKeySequence(); + return ret; + bool found = false; int p = 0; while (p >= 0) { p = text.indexOf(QLatin1Char('&'), p) + 1; @@ -1025,13 +1028,22 @@ QKeySequence QKeySequence::mnemonic(const QString &text) if (text.at(p) != QLatin1Char('&')) { QChar c = text.at(p); if (c.isPrint()) { - c = c.toUpper(); - return QKeySequence(c.unicode() + Qt::ALT); + if (!found) { + c = c.toUpper(); + ret = QKeySequence(c.unicode() + Qt::ALT); +#ifdef QT_NO_DEBUG + return ret; +#else + found = true; + } else { + qWarning(qPrintable(QString::fromLatin1("QKeySequence::mnemonic: \"%1\" contains multiple occurences of '&'").arg(text))); +#endif + } } } p++; } - return QKeySequence(); + return ret; } /*! diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h index 9f08dc6..9e4cf60 100644 --- a/src/gui/kernel/qt_x11_p.h +++ b/src/gui/kernel/qt_x11_p.h @@ -163,7 +163,9 @@ extern "C" { #endif // QT_NO_XRENDER #ifndef QT_NO_XSYNC +extern "C" { # include "X11/extensions/sync.h" +} #endif // #define QT_NO_XKB diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index afe9986..7273c35 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -970,7 +970,7 @@ bool QBrush::operator==(const QBrush &b) const QDebug operator<<(QDebug dbg, const QBrush &b) { #ifndef Q_BROKEN_DEBUG_STREAM - const char *BRUSH_STYLES[] = { + static const char *BRUSH_STYLES[] = { "NoBrush", "SolidPattern", "Dense1Pattern", diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp index f880351..be4fff2 100644 --- a/src/gui/styles/qplastiquestyle.cpp +++ b/src/gui/styles/qplastiquestyle.cpp @@ -1094,8 +1094,6 @@ void QPlastiqueStyle::drawPrimitive(PrimitiveElement element, const QStyleOption QColor borderColor = option->palette.background().color().darker(178); QColor gradientStartColor = option->palette.button().color().lighter(104); QColor gradientStopColor = option->palette.button().color().darker(105); - QColor baseGradientStartColor = option->palette.base().color().darker(101); - QColor baseGradientStopColor = option->palette.base().color().darker(106); QColor highlightedGradientStartColor = option->palette.button().color().lighter(101); QColor highlightedGradientStopColor = mergedColors(option->palette.button().color(), option->palette.highlight().color(), 85); QColor highlightedBaseGradientStartColor = option->palette.base().color(); @@ -1978,7 +1976,13 @@ void QPlastiqueStyle::drawPrimitive(PrimitiveElement element, const QStyleOption QRect gradientRect(adjustedRect.left() + 1, adjustedRect.top() + 1, adjustedRect.right() - adjustedRect.left() - 1, adjustedRect.bottom() - adjustedRect.top() - 1); - qt_plastique_draw_gradient(painter, gradientRect, baseGradientStartColor, baseGradientStopColor); + if (option->palette.base().style() == Qt::SolidPattern) { + QColor baseGradientStartColor = option->palette.base().color().darker(101); + QColor baseGradientStopColor = option->palette.base().color().darker(106); + qt_plastique_draw_gradient(painter, gradientRect, baseGradientStartColor, baseGradientStopColor); + } else { + painter->fillRect(gradientRect, option->palette.base()); + } // draw "+" or "-" painter->setPen(alphaTextColor); painter->drawLine(center.x() - 2, center.y(), center.x() + 2, center.y()); diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index ce73fd8..59210c3 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -1180,7 +1180,7 @@ void QRenderRule::drawBackgroundImage(QPainter *p, const QRect &rect, QPoint off QRect r = originRect(rect, background()->origin); QRect aligned = QStyle::alignedRect(Qt::LeftToRight, background()->position, bgp.size(), r); - QRect inter = aligned.intersected(r); + QRect inter = aligned.translated(-off).intersected(r); switch (background()->repeat) { case Repeat_Y: diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 447087c..f1cd6bb 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -1613,7 +1613,8 @@ bool QFont::operator==(const QFont &f) const && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut - && f.d->kerning == d->kerning)); + && f.d->kerning == d->kerning + && f.d->capital == d->capital)); } @@ -1645,6 +1646,7 @@ bool QFont::operator<(const QFont &f) const #ifdef Q_WS_X11 if (r1.addStyle != r2.addStyle) return r1.addStyle < r2.addStyle; #endif // Q_WS_X11 + if (f.d->capital != d->capital) return f.d->capital < d->capital; int f1attrs = (f.d->underline << 3) + (f.d->overline << 2) + (f.d->strikeOut<<1) + f.d->kerning; int f2attrs = (d->underline << 3) + (d->overline << 2) + (d->strikeOut<<1) + d->kerning; diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp index b0d0baf..35639b7 100644 --- a/src/gui/widgets/qabstractscrollarea.cpp +++ b/src/gui/widgets/qabstractscrollarea.cpp @@ -1130,10 +1130,13 @@ void QAbstractScrollArea::mouseMoveEvent(QMouseEvent *e) void QAbstractScrollArea::wheelEvent(QWheelEvent *e) { Q_D(QAbstractScrollArea); - if (static_cast<QWheelEvent*>(e)->orientation() == Qt::Horizontal) - QApplication::sendEvent(d->hbar, e); - else - QApplication::sendEvent(d->vbar, e); + QScrollBar *const bars[2] = { d->hbar, d->vbar }; + int idx = (e->orientation() == Qt::Vertical) ? 1 : 0; + int other = (idx + 1) % 2; + if (!bars[idx]->isVisible() && bars[other]->isVisible()) + idx = other; // If the scrollbar of the event orientation is hidden, fallback to the other. + + QApplication::sendEvent(bars[idx], e); } #endif diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp index fec9fab..e0db9c2 100644 --- a/src/gui/widgets/qabstractslider.cpp +++ b/src/gui/widgets/qabstractslider.cpp @@ -690,8 +690,6 @@ void QAbstractSlider::wheelEvent(QWheelEvent * e) { Q_D(QAbstractSlider); e->ignore(); - if (e->orientation() != d->orientation && !rect().contains(e->pos())) - return; int stepsToScroll = 0; qreal offset = qreal(e->delta()) / 120; diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp index dffec11..953edab 100644 --- a/src/gui/widgets/qdockarealayout.cpp +++ b/src/gui/widgets/qdockarealayout.cpp @@ -1841,7 +1841,6 @@ void QDockAreaLayoutInfo::saveState(QDataStream &stream) const } } -#ifdef Q_WS_MAC static Qt::DockWidgetArea toDockWidgetArea(QInternal::DockPosition pos) { switch (pos) { @@ -1853,7 +1852,6 @@ static Qt::DockWidgetArea toDockWidgetArea(QInternal::DockPosition pos) } return Qt::NoDockWidgetArea; } -#endif static QRect constrainedRect(QRect rect, const QRect &desktop) { @@ -1933,6 +1931,9 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*> item_list.append(item); } else { QDockAreaLayoutItem item(new QDockWidgetItem(widget)); + if (!testing) { + item_list.append(item); + } if (flags & StateFlagFloating) { bool drawer = false; #ifdef Q_WS_MAC // drawer support @@ -1977,12 +1978,10 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*> if (!testing) { widget->setFloating(false); widget->setVisible(flags & StateFlagVisible); + emit widget->dockLocationChanged(toDockWidgetArea(dockPos)); } } - if (!testing) { - item_list.append(item); - } } } else if (nextMarker == SequenceMarker) { int dummy; diff --git a/src/gui/widgets/qdockwidget.cpp b/src/gui/widgets/qdockwidget.cpp index a8e2a37..9cf6af1 100644 --- a/src/gui/widgets/qdockwidget.cpp +++ b/src/gui/widgets/qdockwidget.cpp @@ -1225,6 +1225,7 @@ void QDockWidget::setFeatures(QDockWidget::DockWidgetFeatures features) features &= DockWidgetFeatureMask; if (d->features == features) return; + const bool closableChanged = (d->features ^ features) & DockWidgetClosable; d->features = features; QDockWidgetLayout *layout = qobject_cast<QDockWidgetLayout*>(this->layout()); @@ -1233,6 +1234,10 @@ void QDockWidget::setFeatures(QDockWidget::DockWidgetFeatures features) d->toggleViewAction->setEnabled((d->features & DockWidgetClosable) == DockWidgetClosable); emit featuresChanged(d->features); update(); + if (closableChanged && layout->nativeWindowDeco()) { + //this ensures the native decoration is drawn + d->setWindowState(true /*floating*/, true /*unplug*/); + } } QDockWidget::DockWidgetFeatures QDockWidget::features() const diff --git a/src/gui/widgets/qfontcombobox.cpp b/src/gui/widgets/qfontcombobox.cpp index 806db59..d601f81 100644 --- a/src/gui/widgets/qfontcombobox.cpp +++ b/src/gui/widgets/qfontcombobox.cpp @@ -247,7 +247,14 @@ void QFontComboBoxPrivate::_q_updateModel() } list = result; + //we need to block the signals so that the model doesn't emit reset + //this prevents the current index from changing + //it will be updated just after this + ///TODO: we should finda way to avoid blocking signals and have a real update of the model + const bool old = m->blockSignals(true); m->setStringList(list); + m->blockSignals(old); + if (list.isEmpty()) { if (currentFont != QFont()) { currentFont = QFont(); @@ -420,8 +427,10 @@ void QFontComboBox::setCurrentFont(const QFont &font) Q_D(QFontComboBox); if (font != d->currentFont) { d->currentFont = font; - emit currentFontChanged(d->currentFont); d->_q_updateModel(); + if (d->currentFont == font) { //else the signal has already be emitted by _q_updateModel + emit currentFontChanged(d->currentFont); + } } } diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp index 3d908a1..ea711e8 100644 --- a/src/gui/widgets/qlabel.cpp +++ b/src/gui/widgets/qlabel.cpp @@ -1170,22 +1170,10 @@ void QLabelPrivate::updateShortcut() // But then we do want to hide the ampersands, so we can't use shortcutId. hasShortcut = false; - if (control) { - ensureTextPopulated(); - // Underline the first character that follows an ampersand - shortcutCursor = control->document()->find(QLatin1String("&")); - if (shortcutCursor.isNull()) - return; - hasShortcut = true; - shortcutId = q->grabShortcut(QKeySequence::mnemonic(text)); - shortcutCursor.deleteChar(); // remove the ampersand - shortcutCursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor); - } else { - if (!text.contains(QLatin1Char('&'))) - return; - hasShortcut = true; - shortcutId = q->grabShortcut(QKeySequence::mnemonic(text)); - } + if (!text.contains(QLatin1Char('&'))) + return; + hasShortcut = true; + shortcutId = q->grabShortcut(QKeySequence::mnemonic(text)); } #endif // QT_NO_SHORTCUT @@ -1456,6 +1444,24 @@ void QLabelPrivate::ensureTextPopulated() const doc->setPlainText(text); #endif doc->setUndoRedoEnabled(false); + +#ifndef QT_NO_SHORTCUT + if (hasShortcut) { + // Underline the first character that follows an ampersand (and remove the others ampersands) + int from = 0; + bool found = false; + QTextCursor cursor; + while (!(cursor = control->document()->find((QLatin1String("&")), from)).isNull()) { + cursor.deleteChar(); // remove the ampersand + cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor); + from = cursor.position(); + if (!found && cursor.selectedText() != QLatin1String("&")) { //not a second & + found = true; + shortcutCursor = cursor; + } + } + } +#endif } } textDirty = false; diff --git a/src/gui/widgets/qlabel_p.h b/src/gui/widgets/qlabel_p.h index c5a74e2..ca17a35 100644 --- a/src/gui/widgets/qlabel_p.h +++ b/src/gui/widgets/qlabel_p.h @@ -113,7 +113,7 @@ public: mutable uint hasShortcut : 1; Qt::TextFormat textformat; mutable QTextControl *control; - QTextCursor shortcutCursor; + mutable QTextCursor shortcutCursor; Qt::TextInteractionFlags textInteractionFlags; inline bool needTextControl() const { diff --git a/src/gui/widgets/qlcdnumber.cpp b/src/gui/widgets/qlcdnumber.cpp index f33a98f..3497eba 100644 --- a/src/gui/widgets/qlcdnumber.cpp +++ b/src/gui/widgets/qlcdnumber.cpp @@ -444,7 +444,7 @@ QLCDNumber::~QLCDNumber() \obsolete \property QLCDNumber::numDigits \brief the current number of digits displayed - \sa setDigitCount + \sa setDigitCount() */ void QLCDNumber::setNumDigits(int numDigits) @@ -466,6 +466,10 @@ void QLCDNumber::setNumDigits(int numDigits) \sa smallDecimalPoint */ +/*! + Sets the current number of digits to \a numDigits. Must + be in the range 0..99. + */ void QLCDNumber::setDigitCount(int numDigits) { Q_D(QLCDNumber); @@ -483,7 +487,7 @@ void QLCDNumber::setDigitCount(int numDigits) d->ndigits = numDigits; d->digitStr.fill(QLatin1Char(' '), d->ndigits); d->points.fill(0, d->ndigits); - d->digitStr[d->ndigits - 1] = QLatin1Char('0'); // "0" is the default number + d->digitStr[d->ndigits - 1] = QLatin1Char('0'); // "0" is the default number } else { bool doDisplay = d->ndigits == 0; if (numDigits == d->ndigits) // no change @@ -521,6 +525,9 @@ int QLCDNumber::numDigits() const return d->ndigits; } +/*! + Returns the current number of digits. + */ int QLCDNumber::digitCount() const { Q_D(const QLCDNumber); diff --git a/src/gui/widgets/qmainwindowlayout.cpp b/src/gui/widgets/qmainwindowlayout.cpp index 027a5d6..fa6f7a1 100644 --- a/src/gui/widgets/qmainwindowlayout.cpp +++ b/src/gui/widgets/qmainwindowlayout.cpp @@ -1641,6 +1641,9 @@ void QMainWindowLayout::animationFinished(QWidget *widget) savedState.clear(); currentGapPos.clear(); pluggingWidget = 0; + //applying the state will make sure that the currentGap is updated correctly + //and all the geometries (especially the one from the central widget) is correct + layoutState.apply(false); } if (!widgetAnimator.animating()) { diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index cc39b7f..54d1612 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -602,14 +602,7 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason } #ifndef QT_NO_STATUSTIP } else if (previousAction) { - QWidget *w = causedPopup.widget; - while (QMenu *m = qobject_cast<QMenu*>(w)) - w = m->d_func()->causedPopup.widget; - if (w) { - QString empty; - QStatusTipEvent tip(empty); - QApplication::sendEvent(w, &tip); - } + previousAction->d_func()->showStatusText(topCausedWidget(), QString()); #endif } if (hideActiveMenu) { @@ -623,6 +616,15 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason } } +//return the top causedPopup.widget that is not a QMenu +QWidget *QMenuPrivate::topCausedWidget() const +{ + QWidget* top = causedPopup.widget; + while (QMenu* m = qobject_cast<QMenu *>(top)) + top = m->d_func()->causedPopup.widget; + return top; +} + QAction *QMenuPrivate::actionAt(QPoint p) const { if (!q_func()->rect().contains(p)) //sanity check @@ -1094,10 +1096,7 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e QAccessible::updateAccessibility(q, actionIndex, QAccessible::Selection); } #endif - QWidget *w = causedPopup.widget; - while (QMenu *m = qobject_cast<QMenu*>(w)) - w = m->d_func()->causedPopup.widget; - action->showStatusText(w); + action->showStatusText(topCausedWidget()); } else { actionAboutToTrigger = 0; } @@ -1801,10 +1800,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction) #ifndef QT_NO_MENUBAR // if this menu is part of a chain attached to a QMenuBar, set the // _NET_WM_WINDOW_TYPE_DROPDOWN_MENU X11 window type - QWidget* top = this; - while (QMenu* m = qobject_cast<QMenu *>(top)) - top = m->d_func()->causedPopup.widget; - setAttribute(Qt::WA_X11NetWmWindowTypeDropDownMenu, qobject_cast<QMenuBar *>(top) != 0); + setAttribute(Qt::WA_X11NetWmWindowTypeDropDownMenu, qobject_cast<QMenuBar *>(d->topCausedWidget()) != 0); #endif ensurePolished(); // Get the right font @@ -2752,18 +2748,14 @@ void QMenu::keyPressEvent(QKeyEvent *e) } } if (!key_consumed) { - if (QWidget *caused = d->causedPopup.widget) { - while(QMenu *m = qobject_cast<QMenu*>(caused)) - caused = m->d_func()->causedPopup.widget; #ifndef QT_NO_MENUBAR - if (QMenuBar *mb = qobject_cast<QMenuBar*>(caused)) { - QAction *oldAct = mb->d_func()->currentAction; - QApplication::sendEvent(mb, e); - if (mb->d_func()->currentAction != oldAct) - key_consumed = true; - } -#endif + if (QMenuBar *mb = qobject_cast<QMenuBar*>(d->topCausedWidget())) { + QAction *oldAct = mb->d_func()->currentAction; + QApplication::sendEvent(mb, e); + if (mb->d_func()->currentAction != oldAct) + key_consumed = true; } +#endif } #ifdef Q_OS_WIN32 diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h index a5bde7c..c021063 100644 --- a/src/gui/widgets/qmenu_p.h +++ b/src/gui/widgets/qmenu_p.h @@ -215,6 +215,7 @@ public: SelectedFromKeyboard, SelectedFromElsewhere }; + QWidget *topCausedWidget() const; QAction *actionAt(QPoint p) const; void setFirstActionActive(); void setCurrentAction(QAction *, int popup = -1, SelectionReason reason = SelectedFromElsewhere, bool activateFirst = false); diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index 689d2e1..b1ff662 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -332,7 +332,9 @@ void QMenuBarPrivate::popupAction(QAction *action, bool activateFirst) QPoint pos(q->mapToGlobal(QPoint(adjustedActionRect.left(), adjustedActionRect.bottom() + 1))); QSize popup_size = activeMenu->sizeHint(); - QRect screenRect = QApplication::desktop()->screenGeometry(pos); + //we put the popup menu on the screen containing the bottom-center of the action rect + QRect screenRect = QApplication::desktop()->screenGeometry(pos + QPoint(adjustedActionRect.width() / 2, 0)); + pos = QPoint(qMax(pos.x(), screenRect.x()), qMax(pos.y(), screenRect.y())); const bool fitUp = (q->mapToGlobal(adjustedActionRect.topLeft()).y() >= popup_size.height()); const bool fitDown = (pos.y() + popup_size.height() <= screenRect.bottom()); diff --git a/src/gui/widgets/qtoolbar.cpp b/src/gui/widgets/qtoolbar.cpp index 5596ca4..58a3d28 100644 --- a/src/gui/widgets/qtoolbar.cpp +++ b/src/gui/widgets/qtoolbar.cpp @@ -396,7 +396,7 @@ bool QToolBarPrivate::mouseMoveEvent(QMouseEvent *event) void QToolBarPrivate::unplug(const QRect &_r) { Q_Q(QToolBar); - layout->setExpanded(false, false); + layout->setExpanded(false); QRect r = _r; r.moveTopLeft(q->mapToGlobal(QPoint(0, 0))); setWindowState(true, true, r); diff --git a/src/gui/widgets/qtoolbararealayout.cpp b/src/gui/widgets/qtoolbararealayout.cpp index de11625..b7e985c 100644 --- a/src/gui/widgets/qtoolbararealayout.cpp +++ b/src/gui/widgets/qtoolbararealayout.cpp @@ -480,7 +480,7 @@ void QToolBarAreaLayoutInfo::moveToolBar(QToolBar *toolbar, int pos) } -QList<int> QToolBarAreaLayoutInfo::gapIndex(const QPoint &pos) const +QList<int> QToolBarAreaLayoutInfo::gapIndex(const QPoint &pos, int *minDistance) const { int p = pick(o, pos); @@ -509,12 +509,19 @@ QList<int> QToolBarAreaLayoutInfo::gapIndex(const QPoint &pos) const QList<int> result; result << j << k; + *minDistance = 0; //we found a perfect match + return result; + } + } else { + const int dist = distance(pos); + //it will only return a path if the minDistance is higher than the current distance + if (dist >= 0 && *minDistance > dist) { + *minDistance = dist; + + QList<int> result; + result << lines.count() << 0; return result; } - } else if (appendLineDropRect().contains(pos)) { - QList<int> result; - result << lines.count() << 0; - return result; } return QList<int>(); @@ -587,32 +594,20 @@ QRect QToolBarAreaLayoutInfo::itemRect(const QList<int> &path) const return result; } -QRect QToolBarAreaLayoutInfo::appendLineDropRect() const +int QToolBarAreaLayoutInfo::distance(const QPoint &pos) const { - QRect result; - switch (dockPos) { case QInternal::LeftDock: - result = QRect(rect.right(), rect.top(), - EmptyDockAreaSize, rect.height()); - break; + return pos.x() - rect.right(); case QInternal::RightDock: - result = QRect(rect.left() - EmptyDockAreaSize, rect.top(), - EmptyDockAreaSize, rect.height()); - break; + return rect.left() - pos.x(); case QInternal::TopDock: - result = QRect(rect.left(), rect.bottom() + 1, - rect.width(), EmptyDockAreaSize); - break; + return pos.y() - rect.bottom(); case QInternal::BottomDock: - result = QRect(rect.left(), rect.top() - EmptyDockAreaSize, - rect.width(), EmptyDockAreaSize); - break; + return rect.top() - pos.y(); default: - break; + return -1; } - - return result; } /****************************************************************************** @@ -1022,21 +1017,24 @@ QList<int> QToolBarAreaLayout::indexOf(QWidget *toolBar) const return result; } +//this functions returns the path to the possible gapindex for the position pos QList<int> QToolBarAreaLayout::gapIndex(const QPoint &pos) const { Qt::LayoutDirection dir = mainWindow->layoutDirection(); + int minDistance = 80; // when a dock area is empty, how "wide" is it? + QList<int> ret; //return value for (int i = 0; i < QInternal::DockCount; ++i) { QPoint p = pos; if (docks[i].o == Qt::Horizontal) p = QStyle::visualPos(dir, docks[i].rect, p); - QList<int> result = docks[i].gapIndex(p); + QList<int> result = docks[i].gapIndex(p, &minDistance); if (!result.isEmpty()) { result.prepend(i); - return result; + ret = result; } } - return QList<int>(); + return ret; } QList<int> QToolBarAreaLayout::currentGapIndex() const diff --git a/src/gui/widgets/qtoolbararealayout_p.h b/src/gui/widgets/qtoolbararealayout_p.h index 1e113b7..f0ab80c 100644 --- a/src/gui/widgets/qtoolbararealayout_p.h +++ b/src/gui/widgets/qtoolbararealayout_p.h @@ -155,8 +155,6 @@ public: class QToolBarAreaLayoutInfo { public: - enum { EmptyDockAreaSize = 80 }; // when a dock area is empty, how "wide" is it? - QToolBarAreaLayoutInfo(QInternal::DockPosition pos = QInternal::TopDock); QList<QToolBarAreaLayoutLine> lines; @@ -173,11 +171,11 @@ public: void removeToolBarBreak(QToolBar *before); void moveToolBar(QToolBar *toolbar, int pos); - QList<int> gapIndex(const QPoint &pos) const; + QList<int> gapIndex(const QPoint &pos, int *maxDistance) const; bool insertGap(const QList<int> &path, QLayoutItem *item); void clear(); QRect itemRect(const QList<int> &path) const; - QRect appendLineDropRect() const; + int distance(const QPoint &pos) const; QRect rect; Qt::Orientation o; diff --git a/src/gui/widgets/qtoolbarlayout.cpp b/src/gui/widgets/qtoolbarlayout.cpp index 7dc1e01..0afe5d8 100644 --- a/src/gui/widgets/qtoolbarlayout.cpp +++ b/src/gui/widgets/qtoolbarlayout.cpp @@ -642,7 +642,7 @@ QSize QToolBarLayout::expandedSize(const QSize &size) const return result; } -void QToolBarLayout::setExpanded(bool exp, bool animated) +void QToolBarLayout::setExpanded(bool exp) { if (exp == expanded) return; @@ -654,7 +654,6 @@ void QToolBarLayout::setExpanded(bool exp, bool animated) if (!tb) return; if (QMainWindow *win = qobject_cast<QMainWindow*>(tb->parentWidget())) { - animating = true; QMainWindowLayout *layout = qobject_cast<QMainWindowLayout*>(win->layout()); if (expanded) { tb->raise(); @@ -665,7 +664,7 @@ void QToolBarLayout::setExpanded(bool exp, bool animated) layoutActions(rect.size()); } } - layout->layoutState.toolBarAreaLayout.apply(animated); + layout->layoutState.toolBarAreaLayout.apply(win->isAnimated()); } } diff --git a/src/gui/widgets/qtoolbarlayout_p.h b/src/gui/widgets/qtoolbarlayout_p.h index d49a5df..afd0227 100644 --- a/src/gui/widgets/qtoolbarlayout_p.h +++ b/src/gui/widgets/qtoolbarlayout_p.h @@ -112,7 +112,7 @@ public: bool hasExpandFlag() const; public Q_SLOTS: - void setExpanded(bool b, bool animated = true); + void setExpanded(bool b); private: QList<QToolBarItem*> items; diff --git a/tests/auto/qabstractscrollarea/tst_qabstractscrollarea.cpp b/tests/auto/qabstractscrollarea/tst_qabstractscrollarea.cpp index 5033a50..99a263b 100644 --- a/tests/auto/qabstractscrollarea/tst_qabstractscrollarea.cpp +++ b/tests/auto/qabstractscrollarea/tst_qabstractscrollarea.cpp @@ -71,6 +71,8 @@ private slots: void viewportCrash(); void task214488_layoutDirection_data(); void task214488_layoutDirection(); + void wheelEvent_data(); + void wheelEvent(); }; tst_QAbstractScrollArea::tst_QAbstractScrollArea() @@ -296,10 +298,10 @@ public: setAttribute(Qt::WA_DropSiteRegistered, true); - startTimer(2000); + startTimer(200); } - void timerEvent(QTimerEvent *event) + void timerEvent(QTimerEvent *) { // should not crash. (void)new QScrollArea(this); @@ -385,5 +387,96 @@ void tst_QAbstractScrollArea::patternBackground() QCOMPARE(image.pixel(QPoint(20,20)) , QColor(Qt::red).rgb()); } +Q_DECLARE_METATYPE(QWheelEvent *); + +void tst_QAbstractScrollArea::wheelEvent_data() +{ + QTest::addColumn<QSize>("widgetSize"); + QTest::addColumn<QPoint>("initialOffset"); + QTest::addColumn<QWheelEvent *>("event"); + QTest::addColumn<int>("movedX"); // -1 , 0 , or 1 + QTest::addColumn<int>("movedY"); + + QPoint pos(100,100); + int delta =-120; + + QTest::newRow("1") << QSize(600,600) << QPoint(50,50) + << new QWheelEvent(pos, delta, 0, 0, Qt::Horizontal) << 1 << 0; + + QTest::newRow("2") << QSize(600,600) << QPoint(50,50) + << new QWheelEvent(pos, delta, 0, 0, Qt::Vertical) << 0 << 1; + + QTest::newRow("3") << QSize(600,600) << QPoint(50,50) + << new QWheelEvent(pos, -delta, 0, 0, Qt::Horizontal) << -1 << 0; + + QTest::newRow("4") << QSize(600,600) << QPoint(50,50) + << new QWheelEvent(pos, -delta, 0, 0, Qt::Vertical) << 0 << -1; + + QTest::newRow("5") << QSize(20,600) << QPoint(0,50) + << new QWheelEvent(pos, delta, 0, 0, Qt::Horizontal) << 0 << 1; + + QTest::newRow("6") << QSize(20,600) << QPoint(0,50) + << new QWheelEvent(pos, delta, 0, 0, Qt::Vertical) << 0 << 1; + + QTest::newRow("7") << QSize(20,600) << QPoint(0,50) + << new QWheelEvent(pos, -delta, 0, 0, Qt::Horizontal) << 0 << -1; + + QTest::newRow("8") << QSize(20,600) << QPoint(0,50) + << new QWheelEvent(pos, -delta, 0, 0, Qt::Vertical) << 0 << -1; + + QTest::newRow("9") << QSize(600,20) << QPoint(50,0) + << new QWheelEvent(pos, delta, 0, 0, Qt::Horizontal) << 1 << 0; + + QTest::newRow("a") << QSize(600,20) << QPoint(50,0) + << new QWheelEvent(pos, delta, 0, 0, Qt::Vertical) << 1 << 0; + + QTest::newRow("b") << QSize(600,20) << QPoint(50,0) + << new QWheelEvent(pos, -delta, 0, 0, Qt::Horizontal) << -1 << 0; + + QTest::newRow("c") << QSize(600,20) << QPoint(50,0) + << new QWheelEvent(pos, -delta, 0, 0, Qt::Vertical) << -1 << 0; +} + + + + +void tst_QAbstractScrollArea::wheelEvent() +{ + QFETCH(QSize, widgetSize); + QFETCH(QPoint, initialOffset); + QFETCH(QWheelEvent *, event); + QFETCH(int, movedX); + QFETCH(int, movedY); + + QScrollArea scrollArea; + scrollArea.resize(200, 200); + QLabel widget("H e l l o"); + widget.resize(widgetSize); + scrollArea.setWidget(&widget); + scrollArea.show(); + QTest::qWait(20); + + scrollArea.verticalScrollBar()->setValue(initialOffset.y()); + scrollArea.horizontalScrollBar()->setValue(initialOffset.x()); + + QCOMPARE(scrollArea.verticalScrollBar()->value(), initialOffset.y()); + QCOMPARE(scrollArea.horizontalScrollBar()->value(), initialOffset.x()); + + QApplication::sendEvent(scrollArea.viewport(), event); + + if(movedX == 0) + QCOMPARE(scrollArea.horizontalScrollBar()->value(), initialOffset.x()); + else + QVERIFY(movedX * scrollArea.horizontalScrollBar()->value() > movedX * initialOffset.x()); + + if(movedY == 0) + QCOMPARE(scrollArea.verticalScrollBar()->value(), initialOffset.y()); + else + QVERIFY(movedY * scrollArea.verticalScrollBar()->value() > movedY * initialOffset.y()); + + delete event; +} + + QTEST_MAIN(tst_QAbstractScrollArea) #include "tst_qabstractscrollarea.moc" diff --git a/tests/auto/qdockwidget/tst_qdockwidget.cpp b/tests/auto/qdockwidget/tst_qdockwidget.cpp index e62ba8c..c9a7f1c 100644 --- a/tests/auto/qdockwidget/tst_qdockwidget.cpp +++ b/tests/auto/qdockwidget/tst_qdockwidget.cpp @@ -87,12 +87,14 @@ private slots: void dockLocationChanged(); void setTitleBarWidget(); void titleBarDoubleClick(); + void restoreStateOfFloating(); // task specific tests: void task165177_deleteFocusWidget(); void task169808_setFloating(); void task237438_setFloatingCrash(); void task248604_infiniteResize(); void task258459_visibilityChanged(); + void taskQTBUG_1665_closableChanged(); }; // Testing get/set functions @@ -612,6 +614,7 @@ void tst_QDockWidget::dockLocationChanged() QMainWindow mw; QDockWidget dw; + dw.setObjectName("dock1"); QSignalSpy spy(&dw, SIGNAL(dockLocationChanged(Qt::DockWidgetArea))); mw.addDockWidget(Qt::LeftDockWidgetArea, &dw); @@ -636,6 +639,7 @@ void tst_QDockWidget::dockLocationChanged() QCOMPARE(spy.count(), 0); QDockWidget dw2; + dw2.setObjectName("dock2"); mw.addDockWidget(Qt::TopDockWidgetArea, &dw2); mw.tabifyDockWidget(&dw2, &dw); QCOMPARE(spy.count(), 1); @@ -657,6 +661,12 @@ void tst_QDockWidget::dockLocationChanged() QCOMPARE(qvariant_cast<Qt::DockWidgetArea>(spy.at(0).at(0)), Qt::TopDockWidgetArea); spy.clear(); + + QByteArray ba = mw.saveState(); + mw.restoreState(ba); + QCOMPARE(spy.count(), 1); + QCOMPARE(qvariant_cast<Qt::DockWidgetArea>(spy.at(0).at(0)), + Qt::TopDockWidgetArea); } void tst_QDockWidget::featuresChanged() @@ -714,6 +724,21 @@ void tst_QDockWidget::titleBarDoubleClick() QCOMPARE(win.dockWidgetArea(&dock), Qt::TopDockWidgetArea); } +void tst_QDockWidget::restoreStateOfFloating() +{ + QMainWindow mw; + QDockWidget dock; + dock.setObjectName("dock1"); + mw.addDockWidget(Qt::TopDockWidgetArea, &dock); + QVERIFY(!dock.isFloating()); + QByteArray ba = mw.saveState(); + dock.setFloating(true); + QVERIFY(dock.isFloating()); + QVERIFY(mw.restoreState(ba)); + QVERIFY(!dock.isFloating()); +} + + void tst_QDockWidget::task165177_deleteFocusWidget() { QMainWindow mw; @@ -834,5 +859,22 @@ void tst_QDockWidget::task258459_visibilityChanged() QCOMPARE(spy2.first().first().toBool(), true); //dock1 is visible } +void tst_QDockWidget::taskQTBUG_1665_closableChanged() +{ + QDockWidget dock; + dock.show(); + QTest::qWaitForWindowShown(&dock); + + if (dock.windowFlags() & Qt::FramelessWindowHint) + QSKIP("this machine doesn't support native dock widget", SkipAll); + + QVERIFY(dock.windowFlags() & Qt::WindowCloseButtonHint); + + //now let's remove the closable attribute + dock.setFeatures(dock.features() ^ QDockWidget::DockWidgetClosable); + QVERIFY(!(dock.windowFlags() & Qt::WindowCloseButtonHint)); +} + + QTEST_MAIN(tst_QDockWidget) #include "tst_qdockwidget.moc" diff --git a/tests/auto/qfont/tst_qfont.cpp b/tests/auto/qfont/tst_qfont.cpp index fa76e44..5622e10 100644 --- a/tests/auto/qfont/tst_qfont.cpp +++ b/tests/auto/qfont/tst_qfont.cpp @@ -395,6 +395,13 @@ void tst_QFont::compare() font.setOverline(false); QVERIFY( font == font2 ); QVERIFY(!(font < font2)); + + font.setCapitalization(QFont::SmallCaps); + QVERIFY( font != font2 ); + QCOMPARE(font < font2,!(font2 < font)); + font.setCapitalization(QFont::MixedCase); + QVERIFY( font == font2 ); + QVERIFY(!(font < font2)); } #if defined(Q_WS_X11) diff --git a/tests/auto/qfontcombobox/tst_qfontcombobox.cpp b/tests/auto/qfontcombobox/tst_qfontcombobox.cpp index 7045c19..b974ecab 100644 --- a/tests/auto/qfontcombobox/tst_qfontcombobox.cpp +++ b/tests/auto/qfontcombobox/tst_qfontcombobox.cpp @@ -153,7 +153,7 @@ void tst_QFontComboBox::currentFont() if (oldCurrentFont != box.currentFont()) { //the signal may be emit twice if there is a foundry into brackets - QVERIFY(spy0.count() >= 1); + QCOMPARE(spy0.count(),1); } } @@ -286,6 +286,10 @@ void tst_QFontComboBox::currentFontChanged() if (box.model()->rowCount() > 2) { QTest::keyPress(&box, Qt::Key_Down); QCOMPARE(spy0.count(), 1); + + QFont f( "Sans Serif" ); + box.setCurrentFont(f); + QCOMPARE(spy0.count(), 2); } else qWarning("Not enough fonts installed on test system. Consider adding some"); } diff --git a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp index e33c7b6..cd1eedd 100644 --- a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp +++ b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp @@ -399,7 +399,7 @@ void tst_QGraphicsGridLayout::columnAlignment() widget->resize(widget->effectiveSizeHint(Qt::MaximumSize)); view.show(); widget->show(); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); // Check default QCOMPARE(layout->columnAlignment(0), 0); QCOMPARE(layout->columnAlignment(1), 0); @@ -414,7 +414,7 @@ void tst_QGraphicsGridLayout::columnAlignment() layout->setAlignment(layout->itemAt(1,1), Qt::AlignRight); layout->setAlignment(layout->itemAt(1,2), Qt::AlignLeft); - QApplication::processEvents(); // process LayoutRequest + QApplication::sendPostedEvents(0, 0); // process LayoutRequest /* +----------+------------+---------+ | Left | HCenter | Right | @@ -846,7 +846,7 @@ void tst_QGraphicsGridLayout::rowAlignment() widget->resize(300, 400); view.show(); widget->show(); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); // Check default QCOMPARE(layout->rowAlignment(0), 0); QCOMPARE(layout->rowAlignment(1), 0); @@ -869,7 +869,7 @@ void tst_QGraphicsGridLayout::rowAlignment() layout->setAlignment(layout->itemAt(1,0), Qt::AlignTop); layout->setAlignment(layout->itemAt(2,0), Qt::AlignHCenter); - QApplication::processEvents(); // process LayoutRequest + QApplication::sendPostedEvents(0, 0); // process LayoutRequest QCOMPARE(layout->alignment(layout->itemAt(0,0)), Qt::AlignRight); //Qt::AlignRight | Qt::AlignBottom QCOMPARE(layout->itemAt(0,0)->geometry(), QRectF(50, 50, 50, 50)); @@ -1834,7 +1834,7 @@ void tst_QGraphicsGridLayout::defaultStretchFactors() desc.apply(layout, item); } - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); widget->show(); view.show(); @@ -1842,7 +1842,7 @@ void tst_QGraphicsGridLayout::defaultStretchFactors() if (newSize.isValid()) widget->resize(newSize); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); for (i = 0; i < expectedSizes.count(); ++i) { QSizeF itemSize = layout->itemAt(i)->geometry().size(); QCOMPARE(itemSize, expectedSizes.at(i)); @@ -1994,7 +1994,7 @@ void tst_QGraphicsGridLayout::alignment2() desc.apply(layout, item); } - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); widget->show(); view.resize(400,300); @@ -2002,7 +2002,7 @@ void tst_QGraphicsGridLayout::alignment2() if (newSize.isValid()) widget->resize(newSize); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); for (i = 0; i < expectedGeometries.count(); ++i) { QRectF itemRect = layout->itemAt(i)->geometry(); QCOMPARE(itemRect, expectedGeometries.at(i)); diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index d65c6ec..27c6809 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -413,6 +413,7 @@ private slots: void task243707_addChildBeforeParent(); void task197802_childrenVisibility(); void QTBUG_4233_updateCachedWithSceneRect(); + void QTBUG_5418_textItemSetDefaultColor(); private: QList<QGraphicsItem *> paintedItems; @@ -9751,5 +9752,62 @@ void tst_QGraphicsItem::scenePosChange() QCOMPARE(child2->changes.count(QGraphicsItem::ItemScenePositionHasChanged), 0); } +void tst_QGraphicsItem::QTBUG_5418_textItemSetDefaultColor() +{ + struct Item : public QGraphicsTextItem + { + bool painted; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *opt, QWidget *wid) + { + painted = true; + QGraphicsTextItem::paint(painter, opt, wid); + } + }; + + Item *i = new Item; + i->painted = false; + i->setPlainText("I AM A TROLL"); + + QGraphicsScene scene; + QGraphicsView view(&scene); + view.show(); + QTest::qWaitForWindowShown(&view); + scene.addItem(i); + QApplication::processEvents(); + QTRY_VERIFY(i->painted); + QApplication::processEvents(); + + i->painted = false; + QColor col(Qt::red); + i->setDefaultTextColor(col); + QApplication::processEvents(); + QTRY_VERIFY(i->painted); //check that changing the color force an update + + i->painted = false; + QImage image(400, 200, QImage::Format_RGB32); + image.fill(0); + QPainter painter(&image); + scene.render(&painter); + painter.end(); + QVERIFY(i->painted); + + int numRedPixel = 0; + QRgb rgb = col.rgb(); + for (int y = 0; y < image.height(); ++y) { + for (int x = 0; x < image.width(); ++x) { + // Because of antialiasing we allow a certain range of errors here. + QRgb pixel = image.pixel(x, y); + if (qAbs((int)(pixel & 0xff) - (int)(rgb & 0xff)) + + qAbs((int)((pixel & 0xff00) >> 8) - (int)((rgb & 0xff00) >> 8)) + + qAbs((int)((pixel & 0xff0000) >> 16) - (int)((rgb & 0xff0000) >> 16)) <= 50) { + if (++numRedPixel >= 10) { + return; + } + } + } + } + QCOMPARE(numRedPixel, -1); //color not found, FAIL! +} + QTEST_MAIN(tst_QGraphicsItem) #include "tst_qgraphicsitem.moc" diff --git a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp index 546f92d..d3087dc 100644 --- a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp +++ b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp @@ -664,16 +664,16 @@ void tst_QGraphicsLinearLayout::invalidate() widget->show(); layout.setContentsMargins(1, 2, 3, 4); - qApp->processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(layout.layoutRequest, 1); layout.setOrientation(Qt::Vertical); - qApp->processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(layout.layoutRequest, 2); for (int i = 0; i < count; ++i) layout.invalidate(); // Event is compressed, should only get one layoutrequest - qApp->processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(layout.layoutRequest, count ? 3 : 2); delete widget; } diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index 9c6aa39..f07453c 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -217,7 +217,6 @@ private slots: void update(); void inputMethodSensitivity(); void inputContextReset(); - void defaultClipIntersectToView(); // task specific tests below me void task172231_untransformableItems(); @@ -3693,77 +3692,6 @@ void tst_QGraphicsView::inputContextReset() QCOMPARE(inputContext.resets, 0); } -class ViewClipTester : public QGraphicsView -{ -public: - ViewClipTester(QGraphicsScene *scene = 0) - : QGraphicsView(scene) - { } - QRegion clipRegion; - -protected: - void drawBackground(QPainter *painter, const QRectF &rect) - { - clipRegion = painter->clipRegion(); - } -}; - -class ItemClipTester : public QGraphicsRectItem -{ -public: - ItemClipTester() : QGraphicsRectItem(0, 0, 20, 20) - { - setBrush(Qt::blue); - } - QRegion clipRegion; - - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) - { - clipRegion = painter->clipRegion(); - QGraphicsRectItem::paint(painter, option, widget); - } -}; - -void tst_QGraphicsView::defaultClipIntersectToView() -{ - QGraphicsScene scene; - ItemClipTester *tester = new ItemClipTester; - scene.addItem(tester); - - ViewClipTester view(&scene); - view.setAlignment(Qt::AlignTop | Qt::AlignLeft); - view.setFrameStyle(0); - view.resize(200, 200); - view.show(); - QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view); - - QRect viewRect(0, 0, 200, 200); - QCOMPARE(view.clipRegion, QRegion(viewRect)); - QCOMPARE(tester->clipRegion, QRegion(viewRect)); - - view.viewport()->update(0, 0, 5, 5); - view.viewport()->update(10, 10, 5, 5); - qApp->processEvents(); - viewRect = QRect(0, 0, 15, 15); - QCOMPARE(view.clipRegion, QRegion(viewRect)); - QCOMPARE(tester->clipRegion, QRegion(viewRect)); - - view.scale(2, 2); - qApp->processEvents(); - - viewRect.moveTop(-viewRect.height()); - viewRect = QRect(0, 0, 100, 100); - QCOMPARE(view.clipRegion, QRegion(viewRect)); - QCOMPARE(tester->clipRegion, QRegion(viewRect)); - - view.viewport()->update(0, 0, 5, 5); - view.viewport()->update(10, 10, 5, 5); - qApp->processEvents(); - viewRect = QRect(0, 0, 8, 8); - QCOMPARE(view.clipRegion, QRegion(viewRect)); - QCOMPARE(tester->clipRegion, QRegion(viewRect)); -} - void tst_QGraphicsView::task253415_reconnectUpdateSceneOnSceneChanged() { QGraphicsView view; diff --git a/tests/auto/qgridlayout/tst_qgridlayout.cpp b/tests/auto/qgridlayout/tst_qgridlayout.cpp index 46e2a03..313dc95 100644 --- a/tests/auto/qgridlayout/tst_qgridlayout.cpp +++ b/tests/auto/qgridlayout/tst_qgridlayout.cpp @@ -268,7 +268,7 @@ void tst_QGridLayout::setMinAndMaxSize() leftChild.setMinimumSize(100, 100); leftChild.setMaximumSize(200, 200); layout.addWidget(&leftChild, 0, 0); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(widget.minimumSize(), leftChild.minimumSize()); QCOMPARE(widget.maximumSize(), leftChild.maximumSize()); @@ -277,7 +277,7 @@ void tst_QGridLayout::setMinAndMaxSize() rightChild.setMinimumSize(100, 100); rightChild.setMaximumSize(200, 200); layout.addWidget(&rightChild, 0, 2); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(widget.minimumWidth(), leftChild.minimumWidth() + rightChild.minimumWidth()); @@ -293,7 +293,7 @@ void tst_QGridLayout::setMinAndMaxSize() layout.setColumnMinimumWidth(1, colMin); QCOMPARE(layout.columnMinimumWidth(1), colMin); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(widget.minimumWidth(), leftChild.minimumWidth() + rightChild.minimumWidth() + colMin); QCOMPARE(widget.maximumWidth(), @@ -306,7 +306,7 @@ void tst_QGridLayout::setMinAndMaxSize() layout.setColumnStretch(1,1); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(widget.minimumWidth(), leftChild.minimumWidth() + rightChild.minimumWidth() + colMin); QCOMPARE(widget.maximumWidth(), QLAYOUTSIZE_MAX); @@ -318,7 +318,7 @@ void tst_QGridLayout::setMinAndMaxSize() layout.setColumnStretch(1,0); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(widget.minimumWidth(), leftChild.minimumWidth() + rightChild.minimumWidth() + colMin); QCOMPARE(widget.maximumWidth(), @@ -335,7 +335,7 @@ void tst_QGridLayout::setMinAndMaxSize() static const int spacerS = 250; QSpacerItem *spacer = new QSpacerItem(spacerS, spacerS); layout.addItem(spacer, 0, 1); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(widget.minimumWidth(), leftChild.minimumWidth() + rightChild.minimumWidth() + spacerS); @@ -348,7 +348,7 @@ void tst_QGridLayout::setMinAndMaxSize() spacer->changeSize(spacerS, spacerS, QSizePolicy::Fixed, QSizePolicy::Minimum); layout.invalidate(); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(widget.minimumWidth(), leftChild.minimumWidth() + rightChild.minimumWidth() + spacerS); QCOMPARE(widget.maximumWidth(), @@ -358,13 +358,13 @@ void tst_QGridLayout::setMinAndMaxSize() layout.removeItem(spacer); rightChild.hide(); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(widget.minimumSize(), leftChild.minimumSize()); QCOMPARE(widget.maximumSize(), leftChild.maximumSize()); rightChild.show(); layout.removeWidget(&rightChild); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(widget.minimumSize(), leftChild.minimumSize()); QCOMPARE(widget.maximumSize(), leftChild.maximumSize()); @@ -373,7 +373,7 @@ void tst_QGridLayout::setMinAndMaxSize() bottomChild.setMinimumSize(100, 100); bottomChild.setMaximumSize(200, 200); layout.addWidget(&bottomChild, 1, 0); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(widget.minimumHeight(), leftChild.minimumHeight() + bottomChild.minimumHeight()); @@ -385,13 +385,13 @@ void tst_QGridLayout::setMinAndMaxSize() qMax(leftChild.maximumWidth(), bottomChild.maximumWidth())); bottomChild.hide(); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(widget.minimumSize(), leftChild.minimumSize()); QCOMPARE(widget.maximumSize(), leftChild.maximumSize()); bottomChild.show(); layout.removeWidget(&bottomChild); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(widget.minimumSize(), leftChild.minimumSize()); QCOMPARE(widget.maximumSize(), leftChild.maximumSize()); } @@ -423,7 +423,7 @@ void tst_QGridLayout::spacingAndSpacers() SizeHinter leftChild(100,100); leftChild.setPalette(QPalette(Qt::red)); layout.addWidget(&leftChild, 0, 0); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); expectedSizeHint = leftChild.sizeHint(); QCOMPARE(widget.sizeHint(), expectedSizeHint); @@ -431,7 +431,7 @@ void tst_QGridLayout::spacingAndSpacers() SizeHinter rightChild(200,100); rightChild.setPalette(QPalette(Qt::green)); layout.addWidget(&rightChild, 0, 2); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(rightChild.sizeHint(), QSize(200,100)); expectedSizeHint += QSize(rightChild.sizeHint().width(), 0); @@ -440,11 +440,11 @@ void tst_QGridLayout::spacingAndSpacers() layout.setColumnMinimumWidth(1, 100); widget.adjustSize(); expectedSizeHint += QSize(100,0); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(widget.sizeHint(), expectedSizeHint); rightChild.hide(); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); expectedSizeHint -= QSize(rightChild.sizeHint().width(), 0); QCOMPARE(widget.sizeHint(), expectedSizeHint); @@ -459,12 +459,12 @@ void tst_QGridLayout::spacingAndSpacers() leftChild.setMaximumWidth(200); rightChild.setMaximumWidth(200); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(widget.maximumWidth(), leftChild.maximumWidth() + rightChild.maximumWidth()); #endif layout.removeWidget(&rightChild); - QApplication::processEvents(); + QApplication::sendPostedEvents(0, 0); QCOMPARE(widget.sizeHint(), expectedSizeHint); diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp index 1c257bf..bc9ae6c 100644 --- a/tests/auto/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/qkeysequence/tst_qkeysequence.cpp @@ -119,6 +119,7 @@ private slots: void symetricConstructors_data(); void symetricConstructors(); void checkMultipleNames(); + void mnemonic_data(); void mnemonic(); void toString_data(); void toString(); @@ -133,6 +134,7 @@ private slots: void translated_data(); void translated(); + void initTestCase(); private: QTranslator *ourTranslator; @@ -299,7 +301,7 @@ void tst_QKeySequence::standardKeys_data() QTest::newRow("findNext") << (int)QKeySequence::FindNext<< QString("F3"); QTest::newRow("findPrevious") << (int)QKeySequence::FindPrevious << QString("SHIFT+F3"); QTest::newRow("close") << (int)QKeySequence::Close<< QString("CTRL+F4"); - QTest::newRow("replace") << (int)QKeySequence::Replace<< QString("CTRL+H"); + QTest::newRow("replace") << (int)QKeySequence::Replace<< QString("CTRL+H"); #endif QTest::newRow("bold") << (int)QKeySequence::Bold << QString("CTRL+B"); QTest::newRow("italic") << (int)QKeySequence::Italic << QString("CTRL+I"); @@ -357,17 +359,50 @@ void tst_QKeySequence::keyBindings() } + +void tst_QKeySequence::mnemonic_data() +{ + QTest::addColumn<QString>("string"); + QTest::addColumn<QString>("key"); + QTest::addColumn<bool>("warning"); + + QTest::newRow("1") << QString::fromLatin1("&bonjour") << QString::fromLatin1("ALT+B") << false; + QTest::newRow("2") << QString::fromLatin1("&&bonjour") << QString() << false; + QTest::newRow("3") << QString::fromLatin1("&&bon&jour") << QString::fromLatin1("ALT+J") << false; + QTest::newRow("4") << QString::fromLatin1("&&bon&jo&ur") << QString::fromLatin1("ALT+J") << true; + QTest::newRow("5") << QString::fromLatin1("b&on&&jour") << QString::fromLatin1("ALT+O") << false; + QTest::newRow("6") << QString::fromLatin1("bonjour") << QString() << false; + QTest::newRow("7") << QString::fromLatin1("&&&bonjour") << QString::fromLatin1("ALT+B") << false; + QTest::newRow("8") << QString::fromLatin1("bonjour&&&") << QString() << false; + QTest::newRow("9") << QString::fromLatin1("bo&&nj&o&&u&r") << QString::fromLatin1("ALT+O") << true; + QTest::newRow("10") << QString::fromLatin1("BON&JOUR") << QString::fromLatin1("ALT+J") << false; + QTest::newRow("11") << QString::fromUtf8("bonjour") << QString() << false; +} + void tst_QKeySequence::mnemonic() { #ifdef Q_WS_MAC QSKIP("mnemonics are not used on Mac OS X", SkipAll); #endif - QKeySequence k = QKeySequence::mnemonic("&Foo"); - QVERIFY(k == QKeySequence("ALT+F")); - k = QKeySequence::mnemonic("&& &x"); - QVERIFY(k == QKeySequence("ALT+X")); + QFETCH(QString, string); + QFETCH(QString, key); + QFETCH(bool, warning); + +#ifndef QT_NO_DEBUG + if (warning) { + QString str = QString::fromLatin1("QKeySequence::mnemonic: \"%1\" contains multiple occurences of '&'").arg(string); + QTest::ignoreMessage(QtWarningMsg, qPrintable(str)); + // qWarning(qPrintable(str)); + } +#endif + QKeySequence seq = QKeySequence::mnemonic(string); + QKeySequence res = QKeySequence(key); + + QCOMPARE(seq, res); } + + void tst_QKeySequence::toString_data() { QTest::addColumn<QString>("strSequence"); diff --git a/tests/auto/qlabel/tst_qlabel.cpp b/tests/auto/qlabel/tst_qlabel.cpp index 9d957a5..6b7e106 100644 --- a/tests/auto/qlabel/tst_qlabel.cpp +++ b/tests/auto/qlabel/tst_qlabel.cpp @@ -51,6 +51,7 @@ #include <qmovie.h> #include <qpicture.h> #include <qmessagebox.h> +#include <private/qlabel_p.h> //TESTED_CLASS= //TESTED_FILES= @@ -116,6 +117,9 @@ private slots: void unicodeText_data(); void unicodeText(); + void mnemonic_data(); + void mnemonic(); + private: QLabel *testWidget; QPointer<Widget> test_box; @@ -224,6 +228,7 @@ void tst_QLabel::setBuddy() QVERIFY( !test_edit->hasFocus() ); QTest::keyClick( test_box, 't', Qt::AltModifier ); QVERIFY( test_edit->hasFocus() ); + delete test_box; } void tst_QLabel::text() @@ -245,6 +250,7 @@ void tst_QLabel::setText_data() QTest::newRow( QString(prefix + "data1").toLatin1() ) << QString("This is the first line\nThis is the second line") << QString("Courier"); QTest::newRow( QString(prefix + "data2").toLatin1() ) << QString("This is the first line\nThis is the second line\nThis is the third line") << QString("Helvetica"); QTest::newRow( QString(prefix + "data3").toLatin1() ) << QString("This is <b>bold</b> richtext") << QString("Courier"); + QTest::newRow( QString(prefix + "data4").toLatin1() ) << QString("I Have a &shortcut") << QString("Helvetica"); } void tst_QLabel::setText() @@ -509,5 +515,50 @@ void tst_QLabel::unicodeText() testWidget->show(); } +void tst_QLabel::mnemonic_data() +{ + QTest::addColumn<QString>("text"); + QTest::addColumn<QString>("expectedDocText"); + QTest::addColumn<QString>("expectedShortcutCursor"); + + QTest::newRow("1") << QString("Normal") << QString("Normal") << QString(); + QTest::newRow("2") << QString("&Simple") << QString("Simple") << QString("S"); + QTest::newRow("3") << QString("Also &simple") << QString("Also simple") << QString("s"); + QTest::newRow("4") << QString("&&With &Double &&") << QString("&With Double &") << QString("D"); + QTest::newRow("5") << QString("Hep&&Hop") << QString("Hep&Hop") << QString(""); + QTest::newRow("6") << QString("Hep&&&Hop") << QString("Hep&Hop") << QString("H"); +} + + +void tst_QLabel::mnemonic() +{ + // this test that the mnemonics appears correctly when the label has a text control. + + QFETCH(QString, text); + QFETCH(QString, expectedDocText); + QFETCH(QString, expectedShortcutCursor); + + QWidget w; + QHBoxLayout *hbox = new QHBoxLayout; + QLabel *lab = new QLabel(text); + //lab->setText("plop &plop"); + QLineEdit *lineedit = new QLineEdit; + lab->setBuddy(lineedit); + lab->setTextInteractionFlags(Qt::TextSelectableByMouse); + + hbox->addWidget(lab); + hbox->addWidget(lineedit); + hbox->addWidget(new QLineEdit); + w.setLayout(hbox); + w.show(); + QTest::qWaitForWindowShown(&w); + + QLabelPrivate *d = static_cast<QLabelPrivate *>(QObjectPrivate::get(lab)); + QVERIFY(d->control); + QCOMPARE(d->control->document()->toPlainText(), expectedDocText); + QCOMPARE(d->shortcutCursor.selectedText(), expectedShortcutCursor); +} + + QTEST_MAIN(tst_QLabel) #include "tst_qlabel.moc" diff --git a/tests/auto/qscopedpointer/tst_qscopedpointer.cpp b/tests/auto/qscopedpointer/tst_qscopedpointer.cpp index ddd5579..b99760e 100644 --- a/tests/auto/qscopedpointer/tst_qscopedpointer.cpp +++ b/tests/auto/qscopedpointer/tst_qscopedpointer.cpp @@ -321,7 +321,7 @@ struct RefCounted instanceCount.ref(); } - RefCounted(RefCounted const &other) + RefCounted(RefCounted const &) : ref(0) { instanceCount.ref(); @@ -335,6 +335,7 @@ struct RefCounted RefCounted &operator=(RefCounted const &) { + return *this; } QAtomicInt ref; diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index c56e7e4..01c4f75 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -451,7 +451,7 @@ void MainWindow::setupActions() m_findAction = menu->addAction(tr("&Find in Text..."), m_centralWidget, SLOT(showTextSearch())); - m_findAction->setIconText("&Find"); + m_findAction->setIconText(tr("&Find")); m_findAction->setIcon(QIcon(resourcePath + QLatin1String("/find.png"))); m_findAction->setShortcuts(QKeySequence::Find); @@ -515,7 +515,7 @@ void MainWindow::setupActions() m_syncAction = menu->addAction(tr("Sync with Table of Contents"), this, SLOT(syncContents())); - m_syncAction->setIconText("Sync"); + m_syncAction->setIconText(tr("Sync")); m_syncAction->setIcon(QIcon(resourcePath + QLatin1String("/synctoc.png"))); menu->addSeparator(); diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index c07be8b..a8f6a02 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -194,6 +194,8 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node, synopsis = "class " + name; break; case Node::Function: + case Node::QmlSignal: + case Node::QmlMethod: func = (const FunctionNode *) node; if (style != SeparateList && !func->returnType().isEmpty()) synopsis = typified(func->returnType()) + " "; @@ -1154,14 +1156,14 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, } } else if ((*c)->type() == Node::QmlSignal) { - const QmlSignalNode* sn = static_cast<const QmlSignalNode*>(*c); + const FunctionNode* sn = static_cast<const FunctionNode*>(*c); if (sn->isAttached()) insert(qmlattachedsignals,*c,style,Okay); else insert(qmlsignals,*c,style,Okay); } else if ((*c)->type() == Node::QmlMethod) { - const QmlMethodNode* mn = static_cast<const QmlMethodNode*>(*c); + const FunctionNode* mn = static_cast<const FunctionNode*>(*c); if (mn->isAttached()) insert(qmlattachedmethods,*c,style,Okay); else @@ -1193,14 +1195,14 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, insert(qmlproperties,*c,style,Okay); } else if ((*c)->type() == Node::QmlSignal) { - const QmlSignalNode* sn = static_cast<const QmlSignalNode*>(*c); + const FunctionNode* sn = static_cast<const FunctionNode*>(*c); if (sn->isAttached()) insert(qmlattachedsignals,*c,style,Okay); else insert(qmlsignals,*c,style,Okay); } else if ((*c)->type() == Node::QmlMethod) { - const QmlMethodNode* mn = static_cast<const QmlMethodNode*>(*c); + const FunctionNode* mn = static_cast<const FunctionNode*>(*c); if (mn->isAttached()) insert(qmlattachedmethods,*c,style,Okay); else diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index cabbe38..ce71e51 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -686,20 +686,20 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, (command == COMMAND_QMLATTACHEDSIGNAL) || (command == COMMAND_QMLATTACHEDMETHOD)) { QString element; - QString name; + QString type; QmlClassNode* qmlClass = 0; - if (splitQmlArg(doc,arg,element,name)) { + if (splitQmlMethodArg(doc,arg,type,element)) { Node* n = tre->findNode(QStringList(element),Node::Fake); if (n && n->subType() == Node::QmlClass) { qmlClass = static_cast<QmlClassNode*>(n); if (command == COMMAND_QMLSIGNAL) - return new QmlSignalNode(qmlClass,name,false); + return makeFunctionNode(doc,arg,qmlClass,Node::QmlSignal,false,COMMAND_QMLSIGNAL); else if (command == COMMAND_QMLATTACHEDSIGNAL) - return new QmlSignalNode(qmlClass,name,true); + return makeFunctionNode(doc,arg,qmlClass,Node::QmlSignal,true,COMMAND_QMLATTACHEDSIGNAL); else if (command == COMMAND_QMLMETHOD) - return new QmlMethodNode(qmlClass,name,false); + return makeFunctionNode(doc,arg,qmlClass,Node::QmlMethod,false,COMMAND_QMLMETHOD); else if (command == COMMAND_QMLATTACHEDMETHOD) - return new QmlMethodNode(qmlClass,name,true); + return makeFunctionNode(doc,arg,qmlClass,Node::QmlMethod,true,COMMAND_QMLATTACHEDMETHOD); else return 0; // never get here. } @@ -717,15 +717,15 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, <type> <element>::<name> This function splits the argument into those three - parts, sets \a type, \a element, and \a property, + parts, sets \a type, \a element, and \a name, and returns true. If any of the parts isn't found, - a debug message is output and false is returned. + a qdoc warning is output and false is returned. */ bool CppCodeParser::splitQmlPropertyArg(const Doc& doc, const QString& arg, QString& type, QString& element, - QString& property) + QString& name) { QStringList blankSplit = arg.split(" "); if (blankSplit.size() > 1) { @@ -733,40 +733,47 @@ bool CppCodeParser::splitQmlPropertyArg(const Doc& doc, QStringList colonSplit(blankSplit[1].split("::")); if (colonSplit.size() > 1) { element = colonSplit[0]; - property = colonSplit[1]; + name = colonSplit[1]; return true; } else - doc.location().warning(tr("Missing QML element name or property name")); + doc.location().warning(tr("Missing parent QML element name")); } else - doc.location().warning(tr("Missing QML property type or property path")); + doc.location().warning(tr("Missing property type")); return false; } /*! A QML signal or method argument has the form... - <element>::<name> + <type> <element>::<name>(<param>, <param>, ...) This function splits the argument into those two parts, sets \a element, and \a name, and returns true. If either of the parts isn't found, a debug message is output and false is returned. */ -bool CppCodeParser::splitQmlArg(const Doc& doc, - const QString& arg, - QString& element, - QString& name) +bool CppCodeParser::splitQmlMethodArg(const Doc& doc, + const QString& arg, + QString& type, + QString& element) { QStringList colonSplit(arg.split("::")); if (colonSplit.size() > 1) { - element = colonSplit[0]; - name = colonSplit[1]; + QStringList blankSplit = colonSplit[0].split(" "); + if (blankSplit.size() > 1) { + type = blankSplit[0]; + element = blankSplit[1]; + } + else { + type = QString(""); + element = colonSplit[0]; + } return true; } else - doc.location().warning(tr("Missing QML element name or signal/method name")); + doc.location().warning(tr("Missing parent QML element or method signature")); return false; } @@ -811,10 +818,10 @@ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc, ++arg; while (arg != args.end()) { if (splitQmlPropertyArg(doc,(*arg),type,element,property)) { - QmlPropertyNode * qmlPropNode = new QmlPropertyNode(qmlPropGroup, - property, - type, - attached); + QmlPropertyNode* qmlPropNode = new QmlPropertyNode(qmlPropGroup, + property, + type, + attached); if (correspondingProperty) { bool writableList = type.startsWith("list") && correspondingProperty->dataType().endsWith('*'); qmlPropNode->setWritable(writableList || correspondingProperty->isWritable()); @@ -1265,7 +1272,9 @@ bool CppCodeParser::matchParameter(FunctionNode *func) bool CppCodeParser::matchFunctionDecl(InnerNode *parent, QStringList *parentPathPtr, FunctionNode **funcPtr, - const QString &templateStuff) + const QString &templateStuff, + Node::Type type, + bool attached) { CodeChunk returnType; QStringList parentPath; @@ -1295,8 +1304,9 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, if (tokenizer->parsingFnOrMacro() && (match(Tok_Q_DECLARE_FLAGS) || match(Tok_Q_PROPERTY))) returnType = CodeChunk(previousLexeme()); - else + else { return false; + } } if (returnType.toString() == "QBool") @@ -1326,8 +1336,9 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, readToken(); } } - if (tok != Tok_LeftParen) + if (tok != Tok_LeftParen) { return false; + } } else if (tok == Tok_LeftParen) { // constructor or destructor @@ -1373,8 +1384,9 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, returnType.append(lexeme()); readToken(); } - if (tok != Tok_Semicolon) + if (tok != Tok_Semicolon) { return false; + } } else if (tok == Tok_Colon) { returnType.appendHotspot(); @@ -1383,8 +1395,9 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, returnType.append(lexeme()); readToken(); } - if (tok != Tok_Semicolon) + if (tok != Tok_Semicolon) { return false; + } } VariableNode *var = new VariableNode(parent, name); @@ -1397,12 +1410,13 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, var->setStatic(sta); return false; } - if (tok != Tok_LeftParen) + if (tok != Tok_LeftParen) { return false; + } } readToken(); - FunctionNode *func = new FunctionNode(parent, name); + FunctionNode *func = new FunctionNode(type, parent, name, attached); func->setAccess(access); func->setLocation(location()); func->setReturnType(returnType.toString()); @@ -1423,12 +1437,14 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, if (tok != Tok_RightParen) { do { - if (!matchParameter(func)) + if (!matchParameter(func)) { return false; + } } while (match(Tok_Comma)); } - if (!match(Tok_RightParen)) + if (!match(Tok_RightParen)) { return false; + } func->setConst(match(Tok_const)); @@ -1444,8 +1460,9 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, if (!match(Tok_Semicolon) && tok != Tok_Eoi) { int braceDepth0 = tokenizer->braceDepth(); - if (!match(Tok_LeftBrace)) + if (!match(Tok_LeftBrace)) { return false; + } while (tokenizer->braceDepth() >= braceDepth0 && tok != Tok_Eoi) readToken(); match(Tok_RightBrace); @@ -2092,7 +2109,9 @@ bool CppCodeParser::matchDocsAndStuff() bool CppCodeParser::makeFunctionNode(const QString& synopsis, QStringList *parentPathPtr, FunctionNode **funcPtr, - InnerNode *root) + InnerNode *root, + Node::Type type, + bool attached) { Tokenizer *outerTokenizer = tokenizer; int outerTok = tok; @@ -2104,15 +2123,39 @@ bool CppCodeParser::makeFunctionNode(const QString& synopsis, tokenizer = &stringTokenizer; readToken(); - bool ok = matchFunctionDecl(root, parentPathPtr, funcPtr); + bool ok = matchFunctionDecl(root, parentPathPtr, funcPtr, QString(), type, attached); // potential memory leak with funcPtr tokenizer = outerTokenizer; tok = outerTok; - return ok; } +/*! + Create a new FunctionNode for a QML method or signal, as + specified by \a type, as a child of \a parent. \a sig is + the complete signature, and if \a attached is true, the + method or signal is "attached". \a qdoctag is the text of + the \a type. + */ +FunctionNode* CppCodeParser::makeFunctionNode(const Doc& doc, + const QString& sig, + InnerNode* parent, + Node::Type type, + bool attached, + QString qdoctag) +{ + QStringList pp; + FunctionNode* fn = 0; + if (!makeFunctionNode(sig,&pp,&fn,parent,type,attached) && + !makeFunctionNode("void "+sig,&pp,&fn,parent,type,attached)) { + doc.location().warning(tr("Invalid syntax in '\\%1'").arg(qdoctag)); + } + if (fn) + return fn; + return 0; +} + void CppCodeParser::parseQiteratorDotH(const Location &location, const QString &filePath) { diff --git a/tools/qdoc3/cppcodeparser.h b/tools/qdoc3/cppcodeparser.h index 233ac09..e2e9d55 100644 --- a/tools/qdoc3/cppcodeparser.h +++ b/tools/qdoc3/cppcodeparser.h @@ -99,11 +99,11 @@ class CppCodeParser : public CodeParser const QString& arg, QString& type, QString& element, - QString& property); - bool splitQmlArg(const Doc& doc, - const QString& arg, - QString& element, - QString& name); + QString& name); + bool splitQmlMethodArg(const Doc& doc, + const QString& arg, + QString& type, + QString& element); #endif virtual QSet<QString> otherMetaCommands(); virtual void processOtherMetaCommand(const Doc& doc, @@ -127,7 +127,9 @@ class CppCodeParser : public CodeParser bool matchFunctionDecl(InnerNode *parent, QStringList *parentPathPtr = 0, FunctionNode **funcPtr = 0, - const QString &templateStuff = QString()); + const QString &templateStuff = QString(), + Node::Type type = Node::Function, + bool attached = false); bool matchBaseSpecifier(ClassNode *classe, bool isClass); bool matchBaseList(ClassNode *classe, bool isClass); bool matchClassDecl(InnerNode *parent, @@ -143,7 +145,15 @@ class CppCodeParser : public CodeParser bool makeFunctionNode(const QString &synopsis, QStringList *parentPathPtr, FunctionNode **funcPtr, - InnerNode *root = 0); + InnerNode *root = 0, + Node::Type type = Node::Function, + bool attached = false); + FunctionNode* makeFunctionNode(const Doc& doc, + const QString& sig, + InnerNode* parent, + Node::Type type, + bool attached, + QString qdoctag); void parseQiteratorDotH(const Location &location, const QString &filePath); void instantiateIteratorMacro(const QString &container, const QString &includeFile, diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index afd1e74..f0ddade 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -4219,23 +4219,24 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, out() << "</div>"; } else if (node->type() == Node::QmlSignal) { - const QmlSignalNode* qsn = static_cast<const QmlSignalNode*>(node); + const FunctionNode* qsn = static_cast<const FunctionNode*>(node); out() << "<div class=\"qmlproto\">"; out() << "<table class=\"qmlname\">"; out() << "<tr><td>"; out() << "<a name=\"" + refForNode(qsn) + "\"></a>"; - generateQmlItem(qsn,relative,marker,false); + generateSynopsis(qsn,relative,marker,CodeMarker::Detailed,false); + //generateQmlItem(qsn,relative,marker,false); out() << "</td></tr>"; out() << "</table>"; out() << "</div>"; } else if (node->type() == Node::QmlMethod) { - const QmlMethodNode* qmn = static_cast<const QmlMethodNode*>(node); + const FunctionNode* qmn = static_cast<const FunctionNode*>(node); out() << "<div class=\"qmlproto\">"; out() << "<table class=\"qmlname\">"; out() << "<tr><td>"; out() << "<a name=\"" + refForNode(qmn) + "\"></a>"; - generateQmlItem(qmn,relative,marker,false); + generateSynopsis(qmn,relative,marker,CodeMarker::Detailed,false); out() << "</td></tr>"; out() << "</table>"; out() << "</div>"; diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index ecb4a44..373002c 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -218,6 +218,7 @@ Node *InnerNode::findNode(const QString& name, Type type) } /*! + Find the function node in this node for the function named \a name. */ FunctionNode *InnerNode::findFunctionNode(const QString& name) { @@ -225,6 +226,7 @@ FunctionNode *InnerNode::findFunctionNode(const QString& name) } /*! + Find the function node in this node that has the same name as \a clone. */ FunctionNode *InnerNode::findFunctionNode(const FunctionNode *clone) { @@ -248,6 +250,34 @@ FunctionNode *InnerNode::findFunctionNode(const FunctionNode *clone) } /*! + Returns the list of keys from the primary function map. + */ +QStringList InnerNode::primaryKeys() +{ + QStringList t; + QMap<QString, Node*>::iterator i = primaryFunctionMap.begin(); + while (i != primaryFunctionMap.end()) { + t.append(i.key()); + ++i; + } + return t; +} + +/*! + Returns the list of keys from the secondary function map. + */ +QStringList InnerNode::secondaryKeys() +{ + QStringList t; + QMap<QString, NodeList>::iterator i = secondaryFunctionMap.begin(); + while (i != secondaryFunctionMap.end()) { + t.append(i.key()); + ++i; + } + return t; +} + +/*! */ void InnerNode::setOverload(const FunctionNode *func, bool overlode) { @@ -392,6 +422,7 @@ const Node *InnerNode::findNode(const QString& name, Type type) const } /*! + Find the function node in this node that has the given \a name. */ const FunctionNode *InnerNode::findFunctionNode(const QString& name) const { @@ -400,9 +431,9 @@ const FunctionNode *InnerNode::findFunctionNode(const QString& name) const } /*! + Find the function node in this node that has the same name as \a clone. */ -const FunctionNode *InnerNode::findFunctionNode( - const FunctionNode *clone) const +const FunctionNode *InnerNode::findFunctionNode(const FunctionNode *clone) const { InnerNode *that = (InnerNode *) this; return that->findFunctionNode(clone); @@ -520,7 +551,7 @@ bool InnerNode::isSameSignature(const FunctionNode *f1, const FunctionNode *f2) void InnerNode::addChild(Node *child) { children.append(child); - if (child->type() == Function) { + if ((child->type() == Function) || (child->type() == QmlMethod)) { FunctionNode *func = (FunctionNode *) child; if (!primaryFunctionMap.contains(func->name())) { primaryFunctionMap.insert(func->name(), func); @@ -896,11 +927,40 @@ QString Parameter::reconstruct(bool value) const */ /*! + Construct a function node for a C++ function. It's parent + is \a parent, and it's name is \a name. */ FunctionNode::FunctionNode(InnerNode *parent, const QString& name) - : LeafNode(Function, parent, name), met(Plain), vir(NonVirtual), - con(false), sta(false), ove(false), rf(0), ap(0) + : LeafNode(Function, parent, name), + met(Plain), + vir(NonVirtual), + con(false), + sta(false), + ove(false), + att(false), + rf(0), + ap(0) +{ + // nothing. +} + +/*! + Construct a function node for a QML method or signal, specified + by \a type. It's parent is \a parent, and it's name is \a name. + If \a attached is true, it is an attached method or signal. + */ +FunctionNode::FunctionNode(Type type, InnerNode *parent, const QString& name, bool attached) + : LeafNode(type, parent, name), + met(Plain), + vir(NonVirtual), + con(false), + sta(false), + ove(false), + att(attached), + rf(0), + ap(0) { + // nothing. } /*! @@ -1034,6 +1094,13 @@ QString FunctionNode::signature(bool values) const return s; } +/*! + Print some debugging stuff. + */ +void FunctionNode::debug() const +{ + qDebug() << "QML METHOD" << name() << "rt" << rt << "pp" << pp; +} /*! \class PropertyNode @@ -1208,28 +1275,6 @@ bool QmlPropertyNode::fromTrool(Trool troolean, bool defaultValue) return defaultValue; } } - -/*! - Constructor for the QML signal node. - */ -QmlSignalNode::QmlSignalNode(QmlClassNode *parent, - const QString& name, - bool attached) - : LeafNode(QmlSignal, parent, name), att(attached) -{ - // nothing. -} - -/*! - Constructor for the QML method node. - */ -QmlMethodNode::QmlMethodNode(QmlClassNode *parent, - const QString& name, - bool attached) - : LeafNode(QmlMethod, parent, name), att(attached) -{ - // nothing. -} #endif QT_END_NAMESPACE diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 5712879..dbdc174 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -151,6 +151,7 @@ class Node virtual bool isInnerNode() const = 0; virtual bool isReimp() const { return false; } + virtual bool isFunction() const { return false; } Type type() const { return typ; } virtual SubType subType() const { return NoSubType; } InnerNode *parent() const { return par; } @@ -239,6 +240,9 @@ class InnerNode : public Node NodeList overloads(const QString &funcName) const; const QStringList& includes() const { return inc; } + QStringList primaryKeys(); + QStringList secondaryKeys(); + protected: InnerNode(Type type, InnerNode *parent, const QString& name); @@ -421,36 +425,6 @@ class QmlPropertyNode : public LeafNode Trool wri; bool att; }; - -class QmlSignalNode : public LeafNode -{ - public: - QmlSignalNode(QmlClassNode* parent, - const QString& name, - bool attached); - virtual ~QmlSignalNode() { } - - const QString& element() const { return parent()->name(); } - bool isAttached() const { return att; } - - private: - bool att; -}; - -class QmlMethodNode : public LeafNode -{ - public: - QmlMethodNode(QmlClassNode* parent, - const QString& name, - bool attached); - virtual ~QmlMethodNode() { } - - const QString& element() const { return parent()->name(); } - bool isAttached() const { return att; } - - private: - bool att; -}; #endif class EnumItem @@ -564,6 +538,7 @@ class FunctionNode : public LeafNode enum Virtualness { NonVirtual, ImpureVirtual, PureVirtual }; FunctionNode(InnerNode *parent, const QString &name); + FunctionNode(Type type, InnerNode *parent, const QString &name, bool attached); virtual ~FunctionNode() { } void setReturnType(const QString& returnType) { rt = returnType; } @@ -589,6 +564,7 @@ class FunctionNode : public LeafNode bool isStatic() const { return sta; } bool isOverload() const { return ove; } bool isReimp() const { return reimp; } + bool isFunction() const { return true; } int overloadNumber() const; int numOverloads() const; const QList<Parameter>& parameters() const { return params; } @@ -600,6 +576,10 @@ class FunctionNode : public LeafNode QStringList reconstructParams(bool values = false) const; QString signature(bool values = false) const; + const QString& element() const { return parent()->name(); } + bool isAttached() const { return att; } + + void debug() const; private: void setAssociatedProperty(PropertyNode *property); @@ -620,6 +600,7 @@ class FunctionNode : public LeafNode bool sta : 1; bool ove : 1; bool reimp: 1; + bool att: 1; QList<Parameter> params; const FunctionNode *rf; const PropertyNode *ap; diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index bcd9709..4d401de 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -225,6 +225,7 @@ const FunctionNode *Tree::findFunctionNode(const QStringList &path, { if (!relative) relative = root(); + do { const Node *node = relative; int i; @@ -244,8 +245,7 @@ const FunctionNode *Tree::findFunctionNode(const QStringList &path, NodeList baseClasses = allBaseClasses(static_cast<const ClassNode *>(node)); foreach (const Node *baseClass, baseClasses) { if (i == path.size() - 1) - next = static_cast<const InnerNode *>(baseClass)-> - findFunctionNode(path.at(i)); + next = static_cast<const InnerNode *>(baseClass)->findFunctionNode(path.at(i)); else next = static_cast<const InnerNode *>(baseClass)->findNode(path.at(i)); @@ -256,11 +256,10 @@ const FunctionNode *Tree::findFunctionNode(const QStringList &path, node = next; } - if (node && i == path.size() && node->type() == Node::Function) { + if (node && i == path.size() && node->isFunction()) { // CppCodeParser::processOtherMetaCommand ensures that reimplemented // functions are private. const FunctionNode *func = static_cast<const FunctionNode*>(node); - while (func->access() == Node::Private) { const FunctionNode *from = func->reimplementedFrom(); if (from != 0) { @@ -268,7 +267,8 @@ const FunctionNode *Tree::findFunctionNode(const QStringList &path, return from; else func = from; - } else + } + else break; } return func; @@ -303,7 +303,8 @@ const FunctionNode *Tree::findFunctionNode(const QStringList &parentPath, const Node *parent = findNode(parentPath, relative, findFlags); if (parent == 0 || !parent->isInnerNode()) { return 0; - } else { + } + else { return ((InnerNode *)parent)->findFunctionNode(clone); } } diff --git a/translations/assistant_fr.ts b/translations/assistant_fr.ts index 91fcc1a..9c5d651 100644 --- a/translations/assistant_fr.ts +++ b/translations/assistant_fr.ts @@ -4,7 +4,7 @@ <context> <name>AboutDialog</name> <message> - <location filename="../tools/assistant/tools/assistant/aboutdialog.cpp" line="110"/> + <location filename="../tools/assistant/tools/assistant/aboutdialog.cpp" line="+110"/> <source>&Close</source> <translation>&Fermer</translation> </message> @@ -12,19 +12,19 @@ <context> <name>AboutLabel</name> <message> - <location filename="../tools/assistant/tools/assistant/aboutdialog.cpp" line="96"/> + <location line="-14"/> <source>Warning</source> <translation>Avertissement</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/aboutdialog.cpp" line="97"/> + <location line="+1"/> <source>Unable to launch external application. </source> <translation>Impossible d'ouvrir l'application externe. </translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/aboutdialog.cpp" line="98"/> + <location line="+1"/> <source>OK</source> <translation>OK</translation> </message> @@ -32,46 +32,46 @@ <context> <name>BookmarkDialog</name> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkdialog.ui" line="19"/> + <location filename="../tools/assistant/tools/assistant/bookmarkdialog.ui"/> <source>Add Bookmark</source> <translation>Ajouter un signet</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkdialog.ui" line="29"/> + <location/> <source>Bookmark:</source> <translation>Signet :</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkdialog.ui" line="36"/> + <location/> <source>Add in Folder:</source> <translation>Ajouter dans le dossier :</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkdialog.ui" line="65"/> + <location/> <source>+</source> <translation>+</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkdialog.ui" line="93"/> + <location/> <source>New Folder</source> <translation>Nouveau dossier</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="184"/> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="202"/> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="241"/> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="259"/> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="289"/> + <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="+184"/> + <location line="+18"/> + <location line="+39"/> + <location line="+18"/> + <location line="+30"/> <source>Bookmarks</source> <translation>Signets</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="228"/> + <location line="-61"/> <source>Delete Folder</source> <translation>Supprimer le dossier</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="229"/> + <location line="+1"/> <source>Rename Folder</source> <translation>Renommer le dossier</translation> </message> @@ -79,23 +79,23 @@ <context> <name>BookmarkManager</name> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="663"/> + <location line="+435"/> <source>Bookmarks</source> <translation>Signets</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="700"/> + <location line="+37"/> <source>Remove</source> <translation>Suppression</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="701"/> + <location line="+1"/> <source>You are going to delete a Folder, this will also<br>remove it's content. Are you sure to continue?</source> <translation>Vous allez supprimer un dossier, ceci va aussi<br>supprimer son contenu. Voulez-vous continuer?</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="844"/> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="853"/> + <location line="+143"/> + <location line="+9"/> <source>New Folder</source> <translation>Nouveau dossier</translation> </message> @@ -103,47 +103,47 @@ <context> <name>BookmarkWidget</name> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="391"/> + <location line="-463"/> <source>Delete Folder</source> <translation>Supprimer le dossier</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="392"/> + <location line="+1"/> <source>Rename Folder</source> <translation>Renommer le dossier</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="394"/> + <location line="+2"/> <source>Show Bookmark</source> <translation>Afficher le signet</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="395"/> + <location line="+1"/> <source>Show Bookmark in New Tab</source> <translation>Afficher le signet dans un nouvel onglet</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="398"/> + <location line="+3"/> <source>Delete Bookmark</source> <translation>Supprimer le signet</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="399"/> + <location line="+1"/> <source>Rename Bookmark</source> <translation>Renommer le signet</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="437"/> + <location line="+38"/> <source>Filter:</source> <translation>Filtre :</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="461"/> + <location line="+24"/> <source>Add</source> <translation>Ajouter</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="470"/> + <location line="+9"/> <source>Remove</source> <translation>Retirer</translation> </message> @@ -151,48 +151,48 @@ <context> <name>CentralWidget</name> <message> - <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="238"/> + <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="+239"/> <source>Add new page</source> <translation>Créer une nouvelle page</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="247"/> + <location line="+9"/> <source>Close current page</source> <translation>Fermer la page courante</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="559"/> + <location line="+312"/> <source>Print Document</source> <translation>Imprimer le document</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="707"/> - <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="709"/> + <location line="+130"/> + <location line="+2"/> <source>unknown</source> <translation>inconnu</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="802"/> + <location line="+93"/> <source>Add New Page</source> <translation>Créer une nouvelle page</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="805"/> + <location line="+3"/> <source>Close This Page</source> <translation>Fermer cette page</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="808"/> + <location line="+3"/> <source>Close Other Pages</source> <translation>Fermer les autres pages</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="813"/> + <location line="+5"/> <source>Add Bookmark for this Page...</source> <translation>Ajouter un signet pour cette page...</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="1068"/> + <location line="+235"/> <source>Search</source> <translation>Recherche</translation> </message> @@ -200,12 +200,12 @@ <context> <name>ContentWindow</name> <message> - <location filename="../tools/assistant/tools/assistant/contentwindow.cpp" line="158"/> + <location filename="../tools/assistant/tools/assistant/contentwindow.cpp" line="+158"/> <source>Open Link</source> <translation>Ouvrir le lien</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/contentwindow.cpp" line="159"/> + <location line="+1"/> <source>Open Link in New Tab</source> <translation>Ouvrir le lien dans un nouvel onglet</translation> </message> @@ -213,12 +213,12 @@ <context> <name>FilterNameDialogClass</name> <message> - <location filename="../tools/assistant/tools/assistant/filternamedialog.ui" line="13"/> + <location filename="../tools/assistant/tools/assistant/filternamedialog.ui"/> <source>Add Filter Name</source> <translation>Ajouter un filtre</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/filternamedialog.ui" line="25"/> + <location/> <source>Filter Name:</source> <translation>Nom du filtre :</translation> </message> @@ -226,27 +226,27 @@ <context> <name>FindWidget</name> <message> - <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="113"/> + <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="-918"/> <source>Previous</source> <translation>Précédent</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="117"/> + <location line="+4"/> <source>Next</source> <translation>Suivant</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="121"/> + <location line="+4"/> <source>Case Sensitive</source> <translation>Sensible à la casse</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="124"/> + <location line="+3"/> <source>Whole words</source> <translation>Mots complets</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="136"/> + <location line="+12"/> <source><img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped</source> <translation><img src=":/trolltech/assistant/images/wrap.png">&nbsp;Recherche à partir du début</translation> </message> @@ -254,27 +254,27 @@ <context> <name>FontPanel</name> <message> - <location filename="../tools/shared/fontpanel/fontpanel.cpp" line="63"/> + <location filename="../tools/shared/fontpanel/fontpanel.cpp" line="+63"/> <source>Font</source> <translation>Police</translation> </message> <message> - <location filename="../tools/shared/fontpanel/fontpanel.cpp" line="74"/> + <location line="+11"/> <source>&Writing system</source> <translation>&Système d'écriture</translation> </message> <message> - <location filename="../tools/shared/fontpanel/fontpanel.cpp" line="77"/> + <location line="+3"/> <source>&Family</source> <translation>&Famille</translation> </message> <message> - <location filename="../tools/shared/fontpanel/fontpanel.cpp" line="81"/> + <location line="+4"/> <source>&Style</source> <translation>&Style</translation> </message> <message> - <location filename="../tools/shared/fontpanel/fontpanel.cpp" line="85"/> + <location line="+4"/> <source>&Point size</source> <translation>&Taille en points</translation> </message> @@ -282,39 +282,39 @@ <context> <name>HelpViewer</name> <message> - <location filename="../tools/assistant/tools/assistant/helpviewer.cpp" line="284"/> + <location filename="../tools/assistant/tools/assistant/helpviewer.cpp" line="+281"/> <source>Open Link in New Tab</source> <translation>Ouvrir le lien dans un nouvel onglet</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/helpviewer.cpp" line="431"/> + <location line="+147"/> <source><title>Error 404...</title><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div></source> <translation><title>Erreur 404...</title><div align="center"><br><br><h1>La page n'a pas pu être trouvée</h1><br><h3>'%1'</h3></div></translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/helpviewer.cpp" line="492"/> + <location line="+61"/> <source>Help</source> <translation>Aide</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/helpviewer.cpp" line="493"/> + <location line="+1"/> <source>Unable to launch external application. </source> <translation>Impossible de lancer l'application externe. </translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/helpviewer.cpp" line="493"/> + <location line="+0"/> <source>OK</source> <translation>OK</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/helpviewer.cpp" line="556"/> + <location line="+63"/> <source>Copy &Link Location</source> <translation>Copier l'&adresse cible</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/helpviewer.cpp" line="559"/> + <location line="+3"/> <source>Open Link in New Tab Ctrl+LMB</source> <translatorcomment>LMB? ← ouais exactement pareil...</translatorcomment> <translation>Ouvrir dans un nouvel onglet Ctrl+clic gauche</translation> @@ -323,17 +323,17 @@ <context> <name>IndexWindow</name> <message> - <location filename="../tools/assistant/tools/assistant/indexwindow.cpp" line="66"/> + <location filename="../tools/assistant/tools/assistant/indexwindow.cpp" line="+66"/> <source>&Look for:</source> <translation>&Rechercher :</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/indexwindow.cpp" line="134"/> + <location line="+68"/> <source>Open Link</source> <translation>Ouvrir le lien</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/indexwindow.cpp" line="135"/> + <location line="+1"/> <source>Open Link in New Tab</source> <translation>Ouvrir le lien dans un nouvel onglet</translation> </message> @@ -341,97 +341,97 @@ <context> <name>InstallDialog</name> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.ui" line="13"/> - <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="76"/> + <location filename="../tools/assistant/tools/assistant/installdialog.ui"/> + <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="+76"/> <source>Install Documentation</source> <translation>Installer la documentation</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.ui" line="19"/> + <location/> <source>Available Documentation:</source> <translation>Documentation disponible :</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.ui" line="29"/> + <location/> <source>Install</source> <translation>Installer</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.ui" line="36"/> + <location/> <source>Cancel</source> <translation>Annuler</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.ui" line="43"/> + <location/> <source>Close</source> <translation>Fermer</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.ui" line="63"/> + <location/> <source>Installation Path:</source> <translation>Chemin d'installation :</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.ui" line="73"/> + <location/> <source>...</source> <translation>…</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="106"/> + <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="+30"/> <source>Downloading documentation info...</source> <translation>Téléchargement des informations de la documentation…</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="154"/> + <location line="+48"/> <source>Download canceled.</source> <translation>Téléchargement annulé.</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="180"/> - <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="258"/> - <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="285"/> + <location line="+26"/> + <location line="+78"/> + <location line="+27"/> <source>Done.</source> <translation>Terminé.</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="195"/> + <location line="-90"/> <source>The file %1 already exists. Do you want to overwrite it?</source> <translation>Le fichier %1 existe déjà. Voulez-vous l'écraser?</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="206"/> + <location line="+11"/> <source>Unable to save the file %1: %2.</source> <translation>Impossible de sauver le fichier %1 : %2.</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="214"/> + <location line="+8"/> <source>Downloading %1...</source> <translation>Téléchargement de %1 en cours…</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="233"/> - <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="275"/> - <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="313"/> + <location line="+19"/> + <location line="+42"/> + <location line="+38"/> <source>Download failed: %1.</source> <translation>Échec du téléchargement : %1.</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="243"/> + <location line="-70"/> <source>Documentation info file is corrupt!</source> <translation>Le fichier d'information de documentation est corrompu!</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="280"/> + <location line="+37"/> <source>Download failed: Downloaded file is corrupted.</source> <translation>Échec du téléchargement : le fichier téléchargé est corrompu.</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="282"/> + <location line="+2"/> <source>Installing documentation %1...</source> <translation>Installation de la documentation %1…</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="304"/> + <location line="+22"/> <source>Error while installing documentation: %1</source> <translation>Erreur durant l'installation de la documentation : @@ -441,294 +441,304 @@ <context> <name>MainWindow</name> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="110"/> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="501"/> + <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="+110"/> + <location line="+383"/> <source>Index</source> <translation>Index</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="116"/> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="499"/> + <location line="-377"/> + <location line="+375"/> <source>Contents</source> <translation>Sommaire</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="121"/> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="503"/> + <location line="-370"/> + <location line="+374"/> <source>Bookmarks</source> <translation>Signets</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="133"/> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="348"/> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="860"/> + <location line="-362"/> + <location line="+207"/> + <location line="+514"/> <source>Qt Assistant</source> <translation>Qt Assistant</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="316"/> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="321"/> + <location line="-546"/> + <location line="+5"/> <source>Unfiltered</source> <translation>Non-filtré</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="342"/> + <location line="+21"/> <source>Looking for Qt Documentation...</source> <translation>Recherche la documentation de Qt…</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="426"/> + <location line="+84"/> <source>&File</source> <translation>&Fichier</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="428"/> + <location line="+2"/> <source>Page Set&up...</source> <translation>&Mise en page…</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="430"/> + <location line="+2"/> <source>Print Preview...</source> <translation>Aperçu avant impression…</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="433"/> + <location line="+3"/> <source>&Print...</source> <translation>&Imprimer…</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="440"/> + <location line="+7"/> <source>New &Tab</source> <translation>Nouvel ongle&t</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="443"/> + <location line="+3"/> <source>&Close Tab</source> <translation>&Fermer l'onglet</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="447"/> + <location line="+4"/> <source>&Quit</source> <translation>&Quitter</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="451"/> + <location line="+4"/> <source>&Edit</source> <translation>&Édition</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="452"/> + <location line="+1"/> <source>&Copy selected Text</source> <translation>&Copier le texte selectionné</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="460"/> + <location line="+8"/> <source>&Find in Text...</source> - <translation>&Trouver dans le texte…</translation> + <translation>&Rechercher dans le texte…</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="466"/> + <location line="+2"/> + <source>&Find</source> + <translation>&Rechercher</translation> + </message> + <message> + <location line="+4"/> <source>Find &Next</source> <translation>Rechercher le suiva&nt</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="470"/> + <location line="+4"/> <source>Find &Previous</source> <translation>Rechercher le &précédent</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="475"/> + <location line="+5"/> <source>Preferences...</source> <translation>Préférences…</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="478"/> + <location line="+3"/> <source>&View</source> <translation>&Affichage</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="479"/> + <location line="+1"/> <source>Zoom &in</source> <translation>Zoom &avant</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="485"/> + <location line="+6"/> <source>Zoom &out</source> <translation>Zoom a&rrière</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="491"/> + <location line="+6"/> <source>Normal &Size</source> <translation>&Taille normale</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="495"/> + <location line="+4"/> <source>Ctrl+0</source> <translation>Ctrl+0</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="500"/> + <location line="+5"/> <source>ALT+C</source> <translation>ALT+C</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="502"/> + <location line="+2"/> <source>ALT+I</source> <translation>ALT+I</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="504"/> + <location line="+2"/> <source>ALT+O</source> <translation>ALT+O</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="505"/> + <location line="+1"/> <source>Search</source> <translation>Recherche</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="506"/> + <location line="+1"/> <source>ALT+S</source> <translation>ALT+S</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="508"/> + <location line="+2"/> <source>&Go</source> <translation>&Aller</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="509"/> + <location line="+1"/> <source>&Home</source> <translation>&Accueil</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="510"/> + <location line="+1"/> <source>ALT+Home</source> <translation>ALT+Home</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="513"/> + <location line="+3"/> <source>&Back</source> <translation>&Précédent</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="518"/> + <location line="+5"/> <source>&Forward</source> <translation>&Suivant</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="524"/> + <location line="+6"/> <source>Sync with Table of Contents</source> <translation>Synchroniser la table des matières</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="531"/> + <location line="+2"/> + <source>Sync</source> + <translation>Rafraîchir</translation> + </message> + <message> + <location line="+5"/> <source>Next Page</source> <translation>Page suivante</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="532"/> + <location line="+1"/> <source>Ctrl+Alt+Right</source> <translation>Ctrl+Alt+Right</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="535"/> + <location line="+3"/> <source>Previous Page</source> <translation>Page précédente</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="536"/> + <location line="+1"/> <source>Ctrl+Alt+Left</source> <translation>Ctrl+Alt+Left</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="539"/> + <location line="+3"/> <source>&Bookmarks</source> <translation>&Signets</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="540"/> + <location line="+1"/> <source>Add Bookmark...</source> <translation>Ajouter un signet…</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="542"/> + <location line="+2"/> <source>CTRL+D</source> <translation>CTRL+D</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="544"/> + <location line="+2"/> <source>&Help</source> <translation>&Aide</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="545"/> + <location line="+1"/> <source>About...</source> <translation>À propos…</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="561"/> + <location line="+16"/> <source>Navigation Toolbar</source> <translation>Barre d'outils de navigation</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="583"/> + <location line="+22"/> <source>&Window</source> <translation>&Fenêtre</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="585"/> + <location line="+2"/> <source>Zoom</source> <translation>Zoom</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="586"/> + <location line="+1"/> <source>Minimize</source> <translation>Minimiser</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="587"/> + <location line="+1"/> <source>Ctrl+M</source> <translation>Ctrl+M</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="637"/> + <location line="+50"/> <source>Toolbars</source> <translation>Barres d'outils</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="652"/> + <location line="+15"/> <source>Filter Toolbar</source> <translation>Barre d'outils de filtrage</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="654"/> + <location line="+2"/> <source>Filtered by:</source> - <translation>Filtré par :</translation> + <translation>Filtre :</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="677"/> + <location line="+25"/> <source>Address Toolbar</source> <translation>Barre d'outils d'adresse</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="681"/> + <location line="+4"/> <source>Address:</source> <translation>Adresse :</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="795"/> + <location line="+114"/> <source>Could not find the associated content item.</source> <translatorcomment>what is item in this context? ← same question here</translatorcomment> <translation>Impossible de trouver l'élément de contenu associé.</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="866"/> + <location line="+71"/> <source>About %1</source> <translation>À propos de %1</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="980"/> + <location line="+114"/> <source>Updating search index</source> <translation>Mise à jour de l'index de recherche</translation> </message> @@ -736,48 +746,48 @@ <context> <name>PreferencesDialog</name> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.cpp" line="259"/> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.cpp" line="302"/> + <location filename="../tools/assistant/tools/assistant/preferencesdialog.cpp" line="+259"/> + <location line="+43"/> <source>Add Documentation</source> <translation>Ajouter de la documentation</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.cpp" line="259"/> + <location line="-43"/> <source>Qt Compressed Help Files (*.qch)</source> <translation>Fichiers d'aide Qt compressés (*.qch)</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.cpp" line="288"/> + <location line="+29"/> <source>The namespace %1 is already registered!</source> <translation>L'espace de nom %1 existe déjà!</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.cpp" line="296"/> + <location line="+8"/> <source>The specified file is not a valid Qt Help File!</source> <translation>Le fichier spécifié n'est pas un fichier d'aide Qt valide!</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.cpp" line="319"/> + <location line="+23"/> <source>Remove Documentation</source> <translation>Supprimer la documentation</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.cpp" line="320"/> + <location line="+1"/> <source>Some documents currently opened in Assistant reference the documentation you are attempting to remove. Removing the documentation will close those documents.</source> <translation>Certains documents ouverts dans Assistant ont des références vers la documentation que vous allez supprimer. Supprimer la documentation fermera ces documents.</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.cpp" line="322"/> + <location line="+2"/> <source>Cancel</source> <translation>Annuler</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.cpp" line="323"/> + <location line="+1"/> <source>OK</source> <translation>OK</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.cpp" line="411"/> + <location line="+88"/> <source>Use custom settings</source> <translation>Utiliser des paramètres personnalisés</translation> </message> @@ -785,119 +795,118 @@ <context> <name>PreferencesDialogClass</name> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="14"/> + <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui"/> <source>Preferences</source> <translation>Préférences</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="24"/> + <location/> <source>Fonts</source> <translation>Polices</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="38"/> + <location/> <source>Font settings:</source> <translation>Configuration des polices :</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="46"/> + <location/> <source>Browser</source> <translation>Navigateur</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="51"/> + <location/> <source>Application</source> <translation>Application</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="70"/> + <location/> <source>Filters</source> <translation>Filtres</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="76"/> + <location/> <source>Filter:</source> <translation>Filtre :</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="86"/> + <location/> <source>Attributes:</source> <translation>Attributs :</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="97"/> + <location/> <source>1</source> <translation>1</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="105"/> + <location/> <source>Add</source> <translation>Ajouter</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="112"/> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="163"/> + <location/> <source>Remove</source> <translation>Supprimer</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="120"/> + <location/> <source>Documentation</source> <translation>Documentation</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="126"/> + <location/> <source>Registered Documentation:</source> <translatorcomment>documentation enregistrée ? ← je préfère référencée pour les deux...</translatorcomment> <translation>Documentation référencée :</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="156"/> + <location/> <source>Add...</source> <translation>Ajouter…</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="188"/> + <location/> <source>Options</source> <translation>Options</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="206"/> + <location/> <source>On help start:</source> <translation>Au démarrage :</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="220"/> + <location/> <source>Show my home page</source> <translation>Afficher ma page d'accueil</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="225"/> + <location/> <source>Show a blank page</source> <translation>Afficher une page blanche</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="230"/> + <location/> <source>Show my tabs from last session</source> <translation>Afficher mes onglets de la dernière session</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="262"/> + <location/> <source>Homepage</source> <translation>Page d'accueil</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="289"/> + <location/> <source>Current Page</source> <translation>Page courante</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="296"/> + <location/> <source>Blank Page</source> <translation>Page blanche</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui" line="303"/> + <location/> <source>Restore to default</source> <translation>Restaurer les valeurs par défaut</translation> </message> @@ -905,69 +914,69 @@ <context> <name>QObject</name> <message> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="112"/> + <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="+112"/> <source>The specified collection file does not exist!</source> <translation>Le fichier de collection spécifié n'existe pas!</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="116"/> + <location line="+4"/> <source>Missing collection file!</source> <translation>Fichier de collection manquant!</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="125"/> + <location line="+9"/> <source>Invalid URL!</source> <translation>URL invalide!</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="129"/> + <location line="+4"/> <source>Missing URL!</source> <translation>URL manquante!</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="146"/> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="165"/> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="184"/> + <location line="+17"/> + <location line="+19"/> + <location line="+19"/> <source>Unknown widget: %1</source> <translation>Widget inconnu : %1</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="150"/> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="169"/> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="188"/> + <location line="-34"/> + <location line="+19"/> + <location line="+19"/> <source>Missing widget!</source> <translation>Widget manquant!</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="195"/> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="207"/> + <location line="+7"/> + <location line="+12"/> <source>The specified Qt help file does not exist!</source> <translation>Le fichier d'aide Qt spécifié n'existe pas!</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="200"/> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="212"/> + <location line="-7"/> + <location line="+12"/> <source>Missing help file!</source> <translation>Fichier d'aide manquant!</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="219"/> + <location line="+7"/> <source>Missing filter argument!</source> <translation>Argument de filtre manquant!</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="231"/> + <location line="+12"/> <source>Unknown option: %1</source> <translation>Option inconnue : %1</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="261"/> - <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="263"/> + <location line="+30"/> + <location line="+2"/> <source>Qt Assistant</source> <translation>Qt Assistant</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/main.cpp" line="217"/> + <location filename="../tools/assistant/tools/assistant/main.cpp" line="+225"/> <source>Could not register documentation file %1 @@ -980,17 +989,17 @@ Raison : %2</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/main.cpp" line="221"/> + <location line="+4"/> <source>Documentation successfully registered.</source> <translation>Documentation enregistrée avec succès.</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/main.cpp" line="229"/> + <location line="+8"/> <source>Documentation successfully unregistered.</source> <translation>Documentation retirée avec succès.</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/main.cpp" line="232"/> + <location line="+3"/> <source>Could not unregister documentation file %1 @@ -1003,12 +1012,12 @@ Raison : %2</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/main.cpp" line="269"/> + <location line="+37"/> <source>Cannot load sqlite database driver!</source> <translation>Impossible de charger le driver de la base de données sqlite!</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/main.cpp" line="278"/> + <location line="+9"/> <source>The specified collection file could not be read!</source> <translation>Le fichier de collection spécifié ne peut pas être lu!</translation> </message> @@ -1016,12 +1025,12 @@ Raison : <context> <name>RemoteControl</name> <message> - <location filename="../tools/assistant/tools/assistant/remotecontrol.cpp" line="163"/> + <location filename="../tools/assistant/tools/assistant/remotecontrol.cpp" line="+163"/> <source>Debugging Remote Control</source> <translation>Débogage du contrôle à distance</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/remotecontrol.cpp" line="164"/> + <location line="+1"/> <source>Received Command: %1 %2</source> <translation>Commande reçue : %1 %2</translation> </message> @@ -1029,22 +1038,22 @@ Raison : <context> <name>SearchWidget</name> <message> - <location filename="../tools/assistant/tools/assistant/searchwidget.cpp" line="195"/> + <location filename="../tools/assistant/tools/assistant/searchwidget.cpp" line="+196"/> <source>&Copy</source> <translation>&Copier</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/searchwidget.cpp" line="199"/> + <location line="+4"/> <source>Copy &Link Location</source> <translation>Copier &l'adresse du lien</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/searchwidget.cpp" line="203"/> + <location line="+4"/> <source>Open Link in New Tab</source> <translation>Ouvrir le lien dans un nouvel onglet</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/searchwidget.cpp" line="211"/> + <location line="+8"/> <source>Select All</source> <translation>Sélectionner tout</translation> </message> @@ -1052,27 +1061,27 @@ Raison : <context> <name>TopicChooser</name> <message> - <location filename="../tools/assistant/tools/assistant/topicchooser.ui" line="16"/> + <location filename="../tools/assistant/tools/assistant/topicchooser.ui"/> <source>Choose Topic</source> <translation>Choisir le domaine</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/topicchooser.ui" line="37"/> + <location/> <source>&Topics</source> <translation>&Domaines</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/topicchooser.ui" line="88"/> + <location/> <source>&Display</source> <translation>&Afficher</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/topicchooser.ui" line="104"/> + <location/> <source>&Close</source> <translation>&Fermer</translation> </message> <message> - <location filename="../tools/assistant/tools/assistant/topicchooser.cpp" line="54"/> + <location filename="../tools/assistant/tools/assistant/topicchooser.cpp" line="+54"/> <source>Choose a topic for <b>%1</b>:</source> <translation>Choisir le domaine pour <b>%1</b> :</translation> </message> diff --git a/translations/qt_help_fr.ts b/translations/qt_help_fr.ts index 632561a..3835d10 100644 --- a/translations/qt_help_fr.ts +++ b/translations/qt_help_fr.ts @@ -6,27 +6,27 @@ <message> <location filename="../tools/assistant/lib/qhelpsearchresultwidget.cpp" line="+110"/> <source>Search Results</source> - <translation type="unfinished">Résultats de la recherche</translation> + <translation>Résultats de la recherche</translation> </message> <message> <location line="+7"/> <source>Note:</source> - <translation type="unfinished">Note :</translation> + <translation>Note :</translation> </message> <message> <location line="+1"/> <source>The search results may not be complete since the documentation is still being indexed!</source> - <translation type="unfinished">Les résultats de la recherche risquent d'être incomplets car l'indexation de la documentation est en cours !</translation> + <translation>Les résultats de la recherche risquent d'être incomplets car l'indexation de la documentation est en cours !</translation> </message> <message> <location line="+11"/> <source>Your search did not match any documents.</source> - <translation type="unfinished">Votre recherche ne correspond à aucun document.</translation> + <translation>Votre recherche ne correspond à aucun document.</translation> </message> <message> <location line="+4"/> <source>(The reason for this might be that the documentation is still being indexed.)</source> - <translation type="unfinished">(Il est possible que cela soit dû au fait que la documentation est en cours d'indexation.)</translation> + <translation>(Il est possible que cela soit dû au fait que la documentation est en cours d'indexation.)</translation> </message> </context> <context> @@ -34,80 +34,80 @@ <message> <location filename="../tools/assistant/lib/qhelpcollectionhandler.cpp" line="+79"/> <source>The collection file '%1' is not set up yet!</source> - <translation type="unfinished">Le fichier de collection '%1' n'est pas encore paramétré !</translation> + <translation>Le fichier de collection '%1' n'est pas encore chargé !</translation> </message> <message> <location line="+23"/> <source>Cannot load sqlite database driver!</source> <translatorcomment>driver ?</translatorcomment> - <translation type="unfinished">Chargement du pilote de base de donnée sqlite impossible !</translation> + <translation>Chargement du pilote de base de données sqlite impossible !</translation> </message> <message> <location line="+11"/> <location line="+49"/> <source>Cannot open collection file: %1</source> <translatorcomment>collection ?</translatorcomment> - <translation type="unfinished">Impossible d'ouvrir le fichier collection : %1</translation> + <translation>Impossible d'ouvrir le fichier collection : %1</translation> </message> <message> <location line="-40"/> <source>Cannot create tables in file %1!</source> - <translation type="unfinished">Impossible de créer les tables dans le fichier : %1!</translation> + <translation>Impossible de créer les tables dans le fichier : %1 !</translation> </message> <message> <location line="+16"/> <source>The collection file '%1' already exists!</source> - <translation type="unfinished">Le fichier collection '%1' existe déjà !</translation> + <translation>Le fichier collection '%1' existe déjà !</translation> </message> <message> <location line="+6"/> <source>Cannot create directory: %1</source> - <translation type="unfinished">Impossible de créer le répertoire : %1</translation> + <translation>Impossible de créer le répertoire : %1</translation> </message> <message> <location line="+23"/> <source>Cannot copy collection file: %1</source> - <translation type="unfinished">Impossible de copier le fichier collection : %1</translation> + <translation>Impossible de copier le fichier collection : %1</translation> </message> <message> <location line="+119"/> <source>Unknown filter '%1'!</source> - <translation type="unfinished">Filtre '%1' inconnu !</translation> + <translation>Filtre '%1' inconnu !</translation> </message> <message> <location line="+55"/> <source>Cannot register filter %1!</source> - <translation type="unfinished">Impossible d'enregistrer le filtre %1 !</translation> + <translation>Impossible d'enregistrer le filtre %1 !</translation> </message> <message> <location line="+44"/> <source>Cannot open documentation file %1!</source> - <translation type="unfinished">Impossible d'ouvrir le fichier de documentation %1 !</translation> + <translation>Impossible d'ouvrir le fichier de documentation %1 !</translation> </message> <message> <location line="+6"/> <source>Invalid documentation file '%1'!</source> - <translation type="unfinished">fichier de documentation invalide : '%1' !</translation> + <translation>Fichier de documentation invalide : '%1' !</translation> </message> <message> <location line="+34"/> <source>The namespace %1 was not registered!</source> - <translation type="unfinished">L'espace de noms '%1' n'est pas référencé !</translation> + <translation>L'espace de noms '%1' n'était pas référencé !</translation> </message> <message> <location line="+120"/> <source>Namespace %1 already exists!</source> - <translation type="unfinished">L'espace de noms %1 existe déjà !</translation> + <translation>L'espace de noms %1 existe déjà !</translation> </message> <message> <location line="+13"/> <source>Cannot register namespace '%1'!</source> - <translation type="unfinished">Impossible d'enregistrer l'espace de noms '%1' !</translation> + <translation>Impossible d'enregistrer l'espace de noms '%1' !</translation> </message> <message> <location line="+24"/> <source>Cannot open database '%1' to optimize!</source> - <translation type="unfinished">Impossible d'ouvrir la base de données à optimiser '%1' !</translation> + <translation>Impossible d'ouvrir la base de données à optimiser '%1' !</translation> </message> </context> <context> @@ -116,7 +116,7 @@ <location filename="../tools/assistant/lib/qhelpdbreader.cpp" line="+98"/> <source>Cannot open database '%1' '%2': %3</source> <extracomment>The placeholders are: %1 - The name of the database which cannot be opened %2 - The unique id for the connection %3 - The actual error string</extracomment> - <translation type="unfinished">Impossible d'ouvrir la base de données '%1' '%2' : %3</translation> + <translation>Impossible d'ouvrir la base de données '%1' '%2' : %3</translation> </message> </context> <context> @@ -124,7 +124,7 @@ <message> <location filename="../tools/assistant/lib/qhelpenginecore.cpp" line="+524"/> <source>The specified namespace does not exist!</source> - <translation type="unfinished">L'espace de noms spécifié n'existe pas !</translation> + <translation>L'espace de noms spécifié n'existe pas !</translation> </message> </context> <context> @@ -132,7 +132,7 @@ <message> <location line="-402"/> <source>Cannot open documentation file %1: %2!</source> - <translation type="unfinished">Impossible d'ouvrir le fichier de documentation %1 : %2 !</translation> + <translation>Impossible d'ouvrir le fichier de documentation %1 : %2 !</translation> </message> </context> <context> @@ -140,113 +140,113 @@ <message> <location filename="../tools/assistant/lib/qhelpgenerator.cpp" line="+157"/> <source>Invalid help data!</source> - <translation type="unfinished">Données d'aide invalides !</translation> + <translation>Données d'aide invalides !</translation> </message> <message> <location line="+6"/> <source>No output file name specified!</source> - <translation type="unfinished">Aucun nom de fichier de sortie spécifié !</translation> + <translation>Aucun nom de fichier de sortie spécifié !</translation> </message> <message> <location line="+7"/> <source>The file %1 cannot be overwritten!</source> - <translation type="unfinished">Le fichier %1 ne peut être écrasé !</translation> + <translation>Le fichier %1 ne peut être écrasé !</translation> </message> <message> <location line="+7"/> <source>Building up file structure...</source> - <translation type="unfinished">Construction de la structure de fichiers en cours…</translation> + <translation>Construction de la structure de fichiers en cours…</translation> </message> <message> <location line="+11"/> <source>Cannot open data base file %1!</source> - <translation type="unfinished">Impossible d'ouvrir le fichier de base de données %1 !</translation> + <translation>Impossible d'ouvrir le fichier de base de données %1 !</translation> </message> <message> <location line="+11"/> <source>Cannot register namespace %1!</source> - <translation type="unfinished">Impossible d'enregistrer l'espace de noms %1 !</translation> + <translation>Impossible d'enregistrer l'espace de noms %1 !</translation> </message> <message> <location line="+6"/> <source>Insert custom filters...</source> - <translation type="unfinished">Insérer des filtres personnalisés…</translation> + <translation>Insértion des filtres personnalisés…</translation> </message> <message> <location line="+12"/> <source>Insert help data for filter section (%1 of %2)...</source> <translatorcomment>???</translatorcomment> - <translation type="unfinished">Insertion des données d'aide pour la section filtre (%1 de %2)…</translation> + <translation>Insertion des données d'aide pour la section filtre (%1 de %2)…</translation> </message> <message> <location line="+18"/> <source>Documentation successfully generated.</source> - <translation type="unfinished">Documentation générée.</translation> + <translation>Documentation générée avec succès.</translation> </message> <message> <location line="+76"/> <source>Some tables already exist!</source> - <translation type="unfinished">Certaines tables existent déjà !</translation> + <translation>Certaines tables existent déjà !</translation> </message> <message> <location line="+61"/> <source>Cannot create tables!</source> - <translation type="unfinished">Impossible de créer les tables !</translation> + <translation>Impossible de créer les tables !</translation> </message> <message> <location line="+86"/> <source>Cannot register virtual folder!</source> - <translation type="unfinished">Impossible d'enregistrer le dossier virtuel !</translation> + <translation>Impossible d'enregistrer le dossier virtuel !</translation> </message> <message> <location line="+10"/> <source>Insert files...</source> - <translation type="unfinished">Insertion des fichiers...</translation> + <translation>Insertion des fichiers...</translation> </message> <message> <location line="+42"/> <source>The referenced file %1 must be inside or within a subdirectory of (%2). Skipping it.</source> - <translation type="unfinished">Le fichier référencé %1 doit être dans le dossier (%2) ou un de ses sous-dossiers. Fichier non pris en compte.</translation> + <translation>Le fichier référencé %1 doit être dans le dossier (%2) ou un de ses sous-dossiers. Fichier non pris en compte.</translation> </message> <message> <location line="+7"/> <source>The file %1 does not exist! Skipping it.</source> - <translation type="unfinished">Le fichier %1 n'existe pas ! Fichier non pris en compte.</translation> + <translation>Le fichier %1 n'existe pas ! Fichier non pris en compte.</translation> </message> <message> <location line="+6"/> <source>Cannot open file %1! Skipping it.</source> - <translation type="unfinished">Impossible d'ouvrir le fichier %1 ! Fichier non pris en compte.</translation> + <translation>Impossible d'ouvrir le fichier %1 ! Fichier non pris en compte.</translation> </message> <message> <location line="+131"/> <source>The filter %1 is already registered!</source> - <translation type="unfinished">Le filtre %1 est déjà enregistré !</translation> + <translation>Le filtre %1 est déjà enregistré !</translation> </message> <message> <location line="+5"/> <source>Cannot register filter %1!</source> - <translation type="unfinished">Impossible d'enregistrer le filtre %1 !</translation> + <translation>Impossible d'enregistrer le filtre %1 !</translation> </message> <message> <location line="+24"/> <source>Insert indices...</source> - <translation type="unfinished">Insertion des index…</translation> + <translation>Insertion des index…</translation> </message> <message> <location line="+80"/> <source>Insert contents...</source> - <translation type="unfinished">insertion des contenus…</translation> + <translation>insertion du contenu…</translation> </message> <message> <location line="+8"/> <source>Cannot insert contents!</source> - <translation type="unfinished">Impossible d'insérer les contenus !</translation> + <translation>Impossible d'insérer le contenu !</translation> </message> <message> <location line="+12"/> <source>Cannot register contents!</source> - <translation type="unfinished">Impossible de référencer les contenus !</translation> + <translation>Impossible de référencer le contenu !</translation> </message> </context> <context> @@ -254,52 +254,52 @@ <message> <location filename="../tools/assistant/lib/qhelpsearchquerywidget.cpp" line="+411"/> <source>Search for:</source> - <translation type="unfinished">Rechercher :</translation> + <translation>Rechercher :</translation> </message> <message> <location line="+5"/> <source>Previous search</source> - <translation type="unfinished">Recherche précédente</translation> + <translation>Recherche précédente</translation> </message> <message> <location line="+4"/> <source>Next search</source> - <translation type="unfinished">Recherche suivante</translation> + <translation>Recherche suivante</translation> </message> <message> <location line="+2"/> <source>Search</source> - <translation type="unfinished">Recherche</translation> + <translation>Recherche</translation> </message> <message> <location line="+20"/> <source>Advanced search</source> - <translation type="unfinished">Recherche avancée</translation> + <translation>Recherche avancée</translation> </message> <message> <location line="+18"/> <source>words <B>similar</B> to:</source> - <translation type="unfinished">mots <B>semblables</B> à :</translation> + <translation>mots <B>semblables</B> à :</translation> </message> <message> <location line="+6"/> <source><B>without</B> the words:</source> - <translation type="unfinished"><B>Sans</B> les mots :</translation> + <translation><B>sans</B> les mots :</translation> </message> <message> <location line="+6"/> <source>with <B>exact phrase</B>:</source> - <translation type="unfinished">avec la <B>phrase exacte</B> :</translation> + <translation>avec la <B>phrase exacte</B> :</translation> </message> <message> <location line="+6"/> <source>with <B>all</B> of the words:</source> - <translation type="unfinished">Avec <B>tous</B> les mots :</translation> + <translation>avec <B>tous</B> les mots :</translation> </message> <message> <location line="+6"/> <source>with <B>at least one</B> of the words:</source> - <translation type="unfinished">avec <B>au moins un</B> des mots :</translation> + <translation>avec <B>au moins un</B> des mots :</translation> </message> </context> <context> @@ -307,7 +307,7 @@ <message> <location filename="../tools/assistant/lib/qhelpsearchresultwidget.cpp" line="+235"/> <source>0 - 0 of 0 Hits</source> - <translation type="unfinished">0 - 0 de 0 résultats</translation> + <translation>0 - 0 de 0 résultats</translation> </message> </context> <context> @@ -315,7 +315,7 @@ <message> <location line="-61"/> <source>%1 - %2 of %3 Hits</source> - <translation type="unfinished">%1 - %2 de %3 résultats</translation> + <translation>%1 - %2 de %3 résultats</translation> </message> </context> <context> @@ -323,53 +323,53 @@ <message> <location filename="../tools/assistant/lib/qhelp_global.h" line="+83"/> <source>Untitled</source> - <translation type="unfinished">Sans titre</translation> + <translation>Sans titre</translation> </message> <message> <location filename="../tools/assistant/lib/qhelpprojectdata.cpp" line="+85"/> <source>Unknown token.</source> <translatorcomment>contexte peu clair...</translatorcomment> - <translation type="unfinished">Identificateur inconnu.</translation> + <translation>Identificateur inconnu.</translation> </message> <message> <location line="+13"/> <source>Unknown token. Expected "QtHelpProject"!</source> - <translation type="unfinished">Identificateur inconnu. "QtHelpProject" attendu !</translation> + <translation>Identificateur inconnu. "QtHelpProject" attendu !</translation> </message> <message> <location line="+5"/> <source>Error in line %1: %2</source> - <translation type="unfinished">Erreur à la ligne %1 : %2</translation> + <translation>Erreur à la ligne %1 : %2</translation> </message> <message> <location line="+13"/> <source>A virtual folder must not contain a '/' character!</source> - <translation type="unfinished">Un dossier virtuel ne doit pas contenir le caractère '/' !</translation> + <translation>Un dossier virtuel ne doit pas contenir le caractère '/' !</translation> </message> <message> <location line="+4"/> <source>A namespace must not contain a '/' character!</source> - <translation type="unfinished">Un espace de noms ne doit pas contenir le caractère '/' !</translation> + <translation>Un espace de noms ne doit pas contenir le caractère '/' !</translation> </message> <message> <location line="+16"/> <source>Missing namespace in QtHelpProject.</source> - <translation type="unfinished">Espace de noms manquant dans QtHelpProject.</translation> + <translation>Espace de noms manquant dans QtHelpProject.</translation> </message> <message> <location line="+2"/> <source>Missing virtual folder in QtHelpProject</source> - <translation type="unfinished">Dossier virtuel manquant dans QtHelpProject</translation> + <translation>Dossier virtuel manquant dans QtHelpProject</translation> </message> <message> <location line="+88"/> <source>Missing attribute in keyword at line %1.</source> - <translation type="unfinished">Attribut manquant pour le mot clé à la ligne %1.</translation> + <translation>Attribut manquant pour le mot clé à la ligne %1.</translation> </message> <message> <location line="+123"/> <source>The input file %1 could not be opened!</source> - <translation type="unfinished">Le fichier source %1 n'a pas pu être ouvert !</translation> + <translation>Le fichier source %1 n'a pas pu être ouvert !</translation> </message> </context> </TS> |