diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-08-18 10:39:16 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-08-18 10:39:16 (GMT) |
commit | 0b96a20f201dbd91599ee890f42dd8e452d15f79 (patch) | |
tree | fbefbfe77e669f7d58a39c2be612a7098e6f7e17 /tests | |
parent | 379073630202d37cf8e3927dc9745134ac2f5512 (diff) | |
parent | 7a64a3f67d53a99e6e2200f6481c98013004b4e4 (diff) | |
download | Qt-0b96a20f201dbd91599ee890f42dd8e452d15f79.zip Qt-0b96a20f201dbd91599ee890f42dd8e452d15f79.tar.gz Qt-0b96a20f201dbd91599ee890f42dd8e452d15f79.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into qtscript-jsc-backend
Conflicts:
src/script/qscriptclass.cpp
src/script/qscriptcontext.cpp
src/script/qscriptengine.cpp
src/script/qscriptvalue.cpp
Diffstat (limited to 'tests')
17 files changed, 79 insertions, 548 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 585f461..1ae6913 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -11,8 +11,6 @@ SUBDIRS += \ compilerwarnings \ exceptionsafety \ linguist \ - macgui \ - macplist \ mediaobject \ # mediaobject_wince_ds9 \ This is Windows CE only (we test the second phonon backend ds9 here) moc \ @@ -74,7 +72,6 @@ SUBDIRS += \ qabstractspinbox \ qabstracttextdocumentlayout \ qaccessibility \ - qaccessibility_mac \ qaction \ qactiongroup \ qalgorithms \ @@ -97,7 +94,6 @@ SUBDIRS += \ qcombobox \ qcompleter \ qcomplextext \ - qcopchannel \ qcoreapplication \ qcryptographichash \ qcssparser \ @@ -113,7 +109,6 @@ SUBDIRS += \ qdialog \ qdialogbuttonbox \ qdir \ - qdirectpainter \ qdirmodel \ qdockwidget \ qdom \ @@ -209,7 +204,6 @@ SUBDIRS += \ qmouseevent \ qmouseevent_modal \ qmovie \ - qmultiscreen \ qmutex \ qmutexlocker \ qnativesocketengine \ @@ -349,7 +343,6 @@ SUBDIRS += \ qtextlayout \ qtextlist \ qtextobject \ - qtextpiecetable \ qtextscriptengine \ qtextstream \ qtexttable \ @@ -404,6 +397,19 @@ SUBDIRS += \ utf8 contains(QT_CONFIG, OdfWriter):SUBDIRS += qzip qtextodfwriter +mac: { + SUBDIRS += macgui \ + macplist \ + qaccessibility_mac +} +embedded: { + SUBDIRS += qcopchannel \ + qdirectpainter \ + qmultiscreen +} +!win32: { + SUBDIRS += qtextpiecetable +} # Enable the tests specific to QtXmlPatterns. If you add a test, remember to # update runQtXmlPatternsTests.sh too. Remember that this file, auto.pro, is diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/finddialog.cpp b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/finddialog.cpp index 7958055..7215ebe 100644 --- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/finddialog.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/finddialog.cpp @@ -1,44 +1,3 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - #include "finddialog.h" #include "mainwindow.h" #include "tabbedbrowser.h" @@ -51,83 +10,18 @@ #include <QDateTime> #include <QGridLayout> -CaseSensitiveModel::CaseSensitiveModel(int rows, int columns, QObject *parent) - : QStandardItemModel(rows, columns, parent) -{} -QModelIndexList CaseSensitiveModel::match(const QModelIndex &start, int role, const QVariant &value, - int hits, Qt::MatchFlags flags) const -{ - if (flags == Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) - flags |= Qt::MatchCaseSensitive; - - return QStandardItemModel::match(start, role, value, hits, flags); -} - FindDialog::FindDialog(MainWindow *parent) : QDialog(parent) { - contentsWidget = new QWidget(this); - ui.setupUi(contentsWidget); - ui.comboFind->setModel(new CaseSensitiveModel(0, 1, ui.comboFind)); - - QVBoxLayout *l = new QVBoxLayout(this); - l->setMargin(0); - l->setSpacing(0); - l->addWidget(contentsWidget); - - lastBrowser = 0; - onceFound = false; - findExpr.clear(); - sb = new QStatusBar(this); l->addWidget(sb); sb->showMessage(tr("Enter the text you want to find.")); - connect(ui.findButton, SIGNAL(clicked()), this, SLOT(findButtonClicked())); - connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(reject())); -} - -FindDialog::~FindDialog() -{ -} - -void FindDialog::findButtonClicked() -{ - doFind(ui.radioForward->isChecked()); } void FindDialog::doFind(bool forward) { - QTextBrowser *browser = static_cast<QTextBrowser*>(mainWindow()->browsers()->currentBrowser()); - sb->clearMessage(); - - if (ui.comboFind->currentText() != findExpr || lastBrowser != browser) - onceFound = false; - findExpr = ui.comboFind->currentText(); - - QTextDocument::FindFlags flags = 0; - - if (ui.checkCase->isChecked()) - flags |= QTextDocument::FindCaseSensitively; - - if (ui.checkWords->isChecked()) - flags |= QTextDocument::FindWholeWords; - - QTextCursor c = browser->textCursor(); - if (!c.hasSelection()) { - if (forward) - c.movePosition(QTextCursor::Start); - else - c.movePosition(QTextCursor::End); - - browser->setTextCursor(c); - } - - QTextDocument::FindFlags options; - if (forward == false) - flags |= QTextDocument::FindBackward; - QTextCursor found = browser->document()->find(findExpr, c, flags); if (found.isNull()) { if (onceFound) { @@ -141,8 +35,6 @@ void FindDialog::doFind(bool forward) } else { browser->setTextCursor(found); } - onceFound |= !found.isNull(); - lastBrowser = browser; } bool FindDialog::hasFindExpression() const diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.ts.result index 21d1ca0..de2c45a 100644 --- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.ts.result @@ -4,22 +4,22 @@ <context> <name>FindDialog</name> <message> - <location filename="finddialog.cpp" line="57"/> + <location filename="finddialog.cpp" line="19"/> <source>Enter the text you want to find.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="finddialog.cpp" line="107"/> + <location filename="finddialog.cpp" line="29"/> <source>Search reached end of the document</source> <translation type="unfinished"></translation> </message> <message> - <location filename="finddialog.cpp" line="109"/> + <location filename="finddialog.cpp" line="31"/> <source>Search reached start of the document</source> <translation type="unfinished"></translation> </message> <message> - <location filename="finddialog.cpp" line="111"/> + <location filename="finddialog.cpp" line="33"/> <source>Text not found</source> <translation type="unfinished"></translation> </message> diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/finddialog.cpp b/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/finddialog.cpp index 045fab1..756c9a3 100644 --- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/finddialog.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/finddialog.cpp @@ -1,44 +1,3 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - #include "finddialog.h" #include "mainwindow.h" #include "tabbedbrowser.h" @@ -51,86 +10,17 @@ #include <QDateTime> #include <QGridLayout> -CaseSensitiveModel::CaseSensitiveModel(int rows, int columns, QObject *parent) - : QStandardItemModel(rows, columns, parent) -{} -QModelIndexList CaseSensitiveModel::match(const QModelIndex &start, int role, const QVariant &value, - int hits, Qt::MatchFlags flags) const -{ - if (flags == Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) - flags |= Qt::MatchCaseSensitive; - - return QStandardItemModel::match(start, role, value, hits, flags); -} - FindDialog::FindDialog(MainWindow *parent) : QDialog(parent) { - contentsWidget = new QWidget(this); - ui.setupUi(contentsWidget); - ui.comboFind->setModel(new CaseSensitiveModel(0, 1, ui.comboFind)); - - QVBoxLayout *l = new QVBoxLayout(this); - l->setMargin(0); - l->setSpacing(0); - l->addWidget(contentsWidget); - - lastBrowser = 0; - onceFound = false; - findExpr.clear(); - - sb = new QStatusBar(this); - l->addWidget(sb); - - // Move it to another line and change the text, // then lupdate should add this one as a new one, and mark the old one as obsolete. sb->showMessage(tr("Enter the text you want to find.")); - connect(ui.findButton, SIGNAL(clicked()), this, SLOT(findButtonClicked())); - connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(reject())); -} - -FindDialog::~FindDialog() -{ -} - -void FindDialog::findButtonClicked() -{ - doFind(ui.radioForward->isChecked()); } void FindDialog::doFind(bool forward) { - QTextBrowser *browser = static_cast<QTextBrowser*>(mainWindow()->browsers()->currentBrowser()); - sb->clearMessage(); - - if (ui.comboFind->currentText() != findExpr || lastBrowser != browser) - onceFound = false; - findExpr = ui.comboFind->currentText(); - - QTextDocument::FindFlags flags = 0; - - if (ui.checkCase->isChecked()) - flags |= QTextDocument::FindCaseSensitively; - - if (ui.checkWords->isChecked()) - flags |= QTextDocument::FindWholeWords; - - QTextCursor c = browser->textCursor(); - if (!c.hasSelection()) { - if (forward) - c.movePosition(QTextCursor::Start); - else - c.movePosition(QTextCursor::End); - - browser->setTextCursor(c); - } - - QTextDocument::FindFlags options; - if (forward == false) - flags |= QTextDocument::FindBackward; - QTextCursor found = browser->document()->find(findExpr, c, flags); if (found.isNull()) { if (onceFound) { @@ -144,31 +34,4 @@ void FindDialog::doFind(bool forward) } else { browser->setTextCursor(found); } - onceFound |= !found.isNull(); - lastBrowser = browser; -} - -bool FindDialog::hasFindExpression() const -{ - return !findExpr.isEmpty(); -} - -void FindDialog::statusMessage(const QString &message) -{ - if (isVisible()) - sb->showMessage(message); - else - static_cast<MainWindow*>(parent())->statusBar()->showMessage(message, 2000); -} - -MainWindow *FindDialog::mainWindow() const -{ - return static_cast<MainWindow*>(parentWidget()); -} - -void FindDialog::reset() -{ - ui.comboFind->setFocus(); - ui.comboFind->lineEdit()->setSelection( - 0, ui.comboFind->lineEdit()->text().length()); } diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.ts.result index b7074fe..4012182 100644 --- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.ts.result @@ -8,22 +8,22 @@ <translation type="obsolete">Skriv inn teksten du soker etter</translation> </message> <message> - <location filename="finddialog.cpp" line="60"/> + <location filename="finddialog.cpp" line="18"/> <source>Enter the text you want to find.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="finddialog.cpp" line="110"/> + <location filename="finddialog.cpp" line="28"/> <source>Search reached end of the document</source> <translation type="unfinished"></translation> </message> <message> - <location filename="finddialog.cpp" line="112"/> + <location filename="finddialog.cpp" line="30"/> <source>Search reached start of the document</source> <translation type="unfinished"></translation> </message> <message> - <location filename="finddialog.cpp" line="114"/> + <location filename="finddialog.cpp" line="32"/> <source>Text not found</source> <translation type="unfinished"></translation> </message> diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before index 076520a..1ad6ec8 100644 --- a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before +++ b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before @@ -3,18 +3,18 @@ <context> <name>FindDialog</name> <message> - <location filename="project.ui" line="27"/> + <location filename="project.ui" line="15"/> <source>Qt Assistant - Find text</source> <!--should be changed to unfinished, since we are changing the sourcetext in the UI file--> <translation>Qt Assistant - Finn tekst</translation> </message> <message> - <location filename="project.ui" line="30"/> + <location filename="project.ui" line="18"/> <source>300px</source> <translation>300px</translation> </message> <message> - <location filename="project.ui" line="33"/> + <location filename="project.ui" line="21"/> <source>400px</source> <translation type="unfinished"></translation> </message> diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result index b21f583..4c5f74d 100644 --- a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result @@ -4,18 +4,18 @@ <context> <name>FindDialog</name> <message> - <location filename="project.ui" line="27"/> + <location filename="project.ui" line="15"/> <source>Qt Assistant - Find Text</source> <oldsource>Qt Assistant - Find text</oldsource> <translation type="unfinished">Qt Assistant - Finn tekst</translation> </message> <message> - <location filename="project.ui" line="30"/> + <location filename="project.ui" line="18"/> <source>300px</source> <translation>300px</translation> </message> <message> - <location filename="project.ui" line="33"/> + <location filename="project.ui" line="21"/> <source>401 pixels</source> <translation type="unfinished"></translation> </message> diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui index 2a0bb70..d332eeb 100644 --- a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui +++ b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui @@ -1,45 +1,5 @@ <ui version="4.0" > <author></author> - <comment>********************************************************************* -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** $QT_END_LICENSE$ -** -*********************************************************************</comment> <exportmacro></exportmacro> <class>FindDialog</class> <widget class="QWidget" name="FindDialog" > diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result index 97d3bce..8c48245 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result @@ -79,27 +79,27 @@ backslashed \ stuff.</source> <context> <name>FindDialog</name> <message> - <location filename="finddialog.cpp" line="57"/> + <location filename="finddialog.cpp" line="85"/> <source>Enter the text you are looking for.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="finddialog.cpp" line="107"/> + <location filename="finddialog.cpp" line="135"/> <source>Search reached end of the document</source> <translation type="unfinished"></translation> </message> <message> - <location filename="finddialog.cpp" line="109"/> + <location filename="finddialog.cpp" line="137"/> <source>Search reached start of the document</source> <translation type="unfinished"></translation> </message> <message> - <location filename="finddialog.cpp" line="111"/> + <location filename="finddialog.cpp" line="139"/> <source>Text not found</source> <translation type="unfinished"></translation> </message> <message> - <location filename="finddialog.cpp" line="147"/> + <location filename="finddialog.cpp" line="175"/> <source>null comment</source> <translation type="unfinished"></translation> </message> @@ -107,7 +107,7 @@ backslashed \ stuff.</source> <context> <name>Kåntekst</name> <message utf8="true"> - <location filename="finddialog.cpp" line="152"/> + <location filename="finddialog.cpp" line="180"/> <source>encoding, using QApplication</source> <translation type="unfinished"></translation> </message> @@ -151,28 +151,28 @@ backslashed \ stuff.</source> <context> <name>QCoreApplication</name> <message> - <location filename="finddialog.cpp" line="144"/> + <location filename="finddialog.cpp" line="172"/> <source>with comment</source> <comment>comment</comment> <translation type="unfinished"></translation> </message> <message> - <location filename="finddialog.cpp" line="145"/> + <location filename="finddialog.cpp" line="173"/> <source>empty comment</source> <translation type="unfinished"></translation> </message> <message> - <location filename="finddialog.cpp" line="146"/> + <location filename="finddialog.cpp" line="174"/> <source>null comment</source> <translation type="unfinished"></translation> </message> <message> - <location filename="finddialog.cpp" line="149"/> + <location filename="finddialog.cpp" line="177"/> <source>encoding, using QCoreApplication</source> <translation type="unfinished"></translation> </message> <message> - <location filename="finddialog.cpp" line="150"/> + <location filename="finddialog.cpp" line="178"/> <source>encoding, using QApplication</source> <translation type="unfinished"></translation> </message> diff --git a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result index ddf58c3..7f665f4 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result @@ -4,12 +4,12 @@ <context> <name>FindDialog</name> <message> - <location filename="project.ui" line="27"/> + <location filename="project.ui" line="15"/> <source>Qt Assistant - Finn text</source> <translation type="unfinished"></translation> </message> <message utf8="true"> - <location filename="project.ui" line="30"/> + <location filename="project.ui" line="18"/> <source>Finn tekst - Der Bjørn möchte auch mal.</source> <translation type="unfinished"></translation> </message> diff --git a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ui b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ui index 9beb8d5..65a00c7 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ui +++ b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ui @@ -1,45 +1,5 @@ <ui version="4.0" > <author></author> - <comment>********************************************************************* -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** $QT_END_LICENSE$ -** -*********************************************************************</comment> <exportmacro></exportmacro> <class>FindDialog</class> <widget class="QWidget" name="FindDialog" > diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result b/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result index e132342..f6415bf 100644 --- a/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result +++ b/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result @@ -4,22 +4,22 @@ <context> <name>FindDialog</name> <message> - <location filename="sub/finddialog.cpp" line="57"/> + <location filename="sub/finddialog.cpp" line="16"/> <source>Enter the text you want to find.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="sub/finddialog.cpp" line="107"/> + <location filename="sub/finddialog.cpp" line="25"/> <source>Search reached end of the document</source> <translation type="unfinished"></translation> </message> <message> - <location filename="sub/finddialog.cpp" line="109"/> + <location filename="sub/finddialog.cpp" line="27"/> <source>Search reached start of the document</source> <translation type="unfinished"></translation> </message> <message> - <location filename="sub/finddialog.cpp" line="111"/> + <location filename="sub/finddialog.cpp" line="29"/> <source>Text not found</source> <translation type="unfinished"></translation> </message> diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result b/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result index 6646014..581e4b6 100644 --- a/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result +++ b/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result @@ -4,32 +4,32 @@ <context> <name>FindDialog</name> <message> - <location filename="project.ui" line="27"/> + <location filename="project.ui" line="15"/> <source>Qt Assistant - Finn text</source> <translation type="unfinished"></translation> </message> <message> - <location filename="project.ui" line="30"/> + <location filename="project.ui" line="18"/> <source>Finn tekst</source> <translation type="unfinished"></translation> </message> <message> - <location filename="sub/finddialog.cpp" line="57"/> + <location filename="sub/finddialog.cpp" line="16"/> <source>Enter the text you want to find.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="sub/finddialog.cpp" line="107"/> + <location filename="sub/finddialog.cpp" line="25"/> <source>Search reached end of the document</source> <translation type="unfinished"></translation> </message> <message> - <location filename="sub/finddialog.cpp" line="109"/> + <location filename="sub/finddialog.cpp" line="27"/> <source>Search reached start of the document</source> <translation type="unfinished"></translation> </message> <message> - <location filename="sub/finddialog.cpp" line="111"/> + <location filename="sub/finddialog.cpp" line="29"/> <source>Text not found</source> <translation type="unfinished"></translation> </message> diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/project.ui b/tests/auto/linguist/lupdate/testdata/recursivescan/project.ui index 97553db..8dea10b 100644 --- a/tests/auto/linguist/lupdate/testdata/recursivescan/project.ui +++ b/tests/auto/linguist/lupdate/testdata/recursivescan/project.ui @@ -1,45 +1,5 @@ <ui version="4.0" > <author></author> - <comment>********************************************************************* -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** $QT_END_LICENSE$ -** -*********************************************************************</comment> <exportmacro></exportmacro> <class>FindDialog</class> <widget class="QWidget" name="FindDialog" > diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp b/tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp index 3800ee7..3875473 100644 --- a/tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp +++ b/tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp @@ -1,44 +1,3 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - #include "finddialog.h" #include "mainwindow.h" #include "tabbedbrowser.h" @@ -51,83 +10,14 @@ #include <QDateTime> #include <QGridLayout> -CaseSensitiveModel::CaseSensitiveModel(int rows, int columns, QObject *parent) - : QStandardItemModel(rows, columns, parent) -{} -QModelIndexList CaseSensitiveModel::match(const QModelIndex &start, int role, const QVariant &value, - int hits, Qt::MatchFlags flags) const -{ - if (flags == Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) - flags |= Qt::MatchCaseSensitive; - - return QStandardItemModel::match(start, role, value, hits, flags); -} - FindDialog::FindDialog(MainWindow *parent) : QDialog(parent) { - contentsWidget = new QWidget(this); - ui.setupUi(contentsWidget); - ui.comboFind->setModel(new CaseSensitiveModel(0, 1, ui.comboFind)); - - QVBoxLayout *l = new QVBoxLayout(this); - l->setMargin(0); - l->setSpacing(0); - l->addWidget(contentsWidget); - - lastBrowser = 0; - onceFound = false; - findExpr.clear(); - - sb = new QStatusBar(this); - l->addWidget(sb); - sb->showMessage(tr("Enter the text you want to find.")); - - connect(ui.findButton, SIGNAL(clicked()), this, SLOT(findButtonClicked())); - connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(reject())); -} - -FindDialog::~FindDialog() -{ -} - -void FindDialog::findButtonClicked() -{ - doFind(ui.radioForward->isChecked()); } void FindDialog::doFind(bool forward) { - QTextBrowser *browser = static_cast<QTextBrowser*>(mainWindow()->browsers()->currentBrowser()); - sb->clearMessage(); - - if (ui.comboFind->currentText() != findExpr || lastBrowser != browser) - onceFound = false; - findExpr = ui.comboFind->currentText(); - - QTextDocument::FindFlags flags = 0; - - if (ui.checkCase->isChecked()) - flags |= QTextDocument::FindCaseSensitively; - - if (ui.checkWords->isChecked()) - flags |= QTextDocument::FindWholeWords; - - QTextCursor c = browser->textCursor(); - if (!c.hasSelection()) { - if (forward) - c.movePosition(QTextCursor::Start); - else - c.movePosition(QTextCursor::End); - - browser->setTextCursor(c); - } - - QTextDocument::FindFlags options; - if (forward == false) - flags |= QTextDocument::FindBackward; - QTextCursor found = browser->document()->find(findExpr, c, flags); if (found.isNull()) { if (onceFound) { @@ -138,34 +28,5 @@ void FindDialog::doFind(bool forward) } else { statusMessage(tr( "Text not found" )); } - } else { - browser->setTextCursor(found); } - onceFound |= !found.isNull(); - lastBrowser = browser; -} - -bool FindDialog::hasFindExpression() const -{ - return !findExpr.isEmpty(); -} - -void FindDialog::statusMessage(const QString &message) -{ - if (isVisible()) - sb->showMessage(message); - else - static_cast<MainWindow*>(parent())->statusBar()->showMessage(message, 2000); -} - -MainWindow *FindDialog::mainWindow() const -{ - return static_cast<MainWindow*>(parentWidget()); -} - -void FindDialog::reset() -{ - ui.comboFind->setFocus(); - ui.comboFind->lineEdit()->setSelection( - 0, ui.comboFind->lineEdit()->text().length()); } diff --git a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp index 5af6f39..3ff177a 100644 --- a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp +++ b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp @@ -113,6 +113,7 @@ private slots: void oneKeyValue(); void updateOnSetKeyValues(); void restart(); + void valueChanged(); }; tst_QPropertyAnimation::tst_QPropertyAnimation() @@ -1052,6 +1053,33 @@ void tst_QPropertyAnimation::restart() anim.start(); } +void tst_QPropertyAnimation::valueChanged() +{ + qRegisterMetaType<QVariant>("QVariant"); + + //we check that we receive the valueChanged signal + MyErrorObject o; + o.setOle(0); + QCOMPARE(o.property("ole").toInt(), 0); + QPropertyAnimation anim(&o, "ole"); + anim.setEndValue(5); + anim.setDuration(1000); + QSignalSpy spy(&anim, SIGNAL(valueChanged(QVariant))); + anim.start(); + + QTest::qWait(anim.duration() + 50); + + QCOMPARE(anim.state(), QAbstractAnimation::Stopped); + QCOMPARE(anim.currentTime(), anim.duration()); + + //let's check that the values go forward + QCOMPARE(spy.count(), 6); //we should have got everything from 0 to 5 + for (int i = 0; i < spy.count(); ++i) { + QCOMPARE(qvariant_cast<QVariant>(spy.at(i).first()).toInt(), i); + } +} + + QTEST_MAIN(tst_QPropertyAnimation) #include "tst_qpropertyanimation.moc" diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index 2f41d77..e650dc8 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -3270,6 +3270,7 @@ void tst_QTableView::task259308_scrollVerticalHeaderSwappedSections() tv.setModel(&model); tv.show(); tv.verticalHeader()->swapSections(0, model.rowCount() - 1); + tv.setCurrentIndex(model.index(model.rowCount() - 1, 0)); QTest::qWait(60); QTest::keyClick(&tv, Qt::Key_PageUp); // PageUp won't scroll when at top |