summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/auto.pro20
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/finddialog.cpp108
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.ts.result8
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/finddialog.cpp137
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.ts.result8
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui40
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result22
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result4
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseui/project.ui40
-rw-r--r--tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result8
-rw-r--r--tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result12
-rw-r--r--tests/auto/linguist/lupdate/testdata/recursivescan/project.ui40
-rw-r--r--tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp139
-rw-r--r--tests/auto/qmenu/tst_qmenu.cpp1
-rw-r--r--tests/auto/qsharedpointer/tst_qsharedpointer.cpp37
-rw-r--r--tests/auto/qtableview/tst_qtableview.cpp1
-rw-r--r--tests/auto/qtoolbutton/tst_qtoolbutton.cpp6
19 files changed, 88 insertions, 555 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/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp
index b06b247..90b9a2a 100644
--- a/tests/auto/qmenu/tst_qmenu.cpp
+++ b/tests/auto/qmenu/tst_qmenu.cpp
@@ -710,7 +710,6 @@ void tst_QMenu::task250673_activeMultiColumnSubMenuPosition()
uint i = 2;
while (main.columnCount() < 2) {
main.addAction(QString("Item %1").arg(i));
- qDebug() << "adding action" << i;
++i;
Q_ASSERT(i<1000);
}
diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
index ab75c91..c9b2325 100644
--- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
@@ -761,17 +761,46 @@ void tst_QSharedPointer::differentPointers()
{
DiffPtrDerivedData *aData = new DiffPtrDerivedData;
Data *aBase = aData;
- Q_ASSERT(aData == aBase);
- Q_ASSERT(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase));
+
+ // ensure that this compiler isn't broken
+ if (*reinterpret_cast<quintptr *>(&aData) == *reinterpret_cast<quintptr *>(&aBase))
+ qFatal("Something went very wrong -- we couldn't create two different pointers to the same object");
+ if (aData != aBase)
+ QSKIP("Broken compiler", SkipAll);
+ if (aBase != aData)
+ QSKIP("Broken compiler", SkipAll);
QSharedPointer<DiffPtrDerivedData> ptr = QSharedPointer<DiffPtrDerivedData>(aData);
QSharedPointer<Data> baseptr = qSharedPointerCast<Data>(ptr);
- QVERIFY(ptr == baseptr);
+ qDebug("naked: orig: %p; base: %p (%s) -- QSharedPointer: orig: %p; base %p (%s) -- result: %s",
+ aData, aBase, aData == aBase ? "equal" : "not equal",
+ ptr.data(), baseptr.data(), ptr.data() == baseptr.data() ? "equal" : "not equal",
+ baseptr.data() == aData ? "equal" : "not equal");
+
QVERIFY(ptr.data() == baseptr.data());
+ QVERIFY(baseptr.data() == ptr.data());
+ QVERIFY(ptr == baseptr);
+ QVERIFY(baseptr == ptr);
+
+ QVERIFY(ptr.data() == aBase);
+ QVERIFY(aBase == ptr.data());
+ QVERIFY(ptr.data() == aData);
+ QVERIFY(aData == ptr.data());
+
QVERIFY(ptr == aBase);
+ QVERIFY(aBase == ptr);
QVERIFY(ptr == aData);
- QVERIFY(baseptr == aData);
+ QVERIFY(aData == ptr);
+
+ QVERIFY(baseptr.data() == aBase);
+ QVERIFY(aBase == baseptr.data());
QVERIFY(baseptr == aBase);
+ QVERIFY(aBase == baseptr);
+
+ QVERIFY(baseptr.data() == aData);
+ QVERIFY(aData == baseptr.data());
+ QVERIFY(baseptr == aData);
+ QVERIFY(aData == baseptr);
}
check();
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
diff --git a/tests/auto/qtoolbutton/tst_qtoolbutton.cpp b/tests/auto/qtoolbutton/tst_qtoolbutton.cpp
index 6376c5d..aca9a20 100644
--- a/tests/auto/qtoolbutton/tst_qtoolbutton.cpp
+++ b/tests/auto/qtoolbutton/tst_qtoolbutton.cpp
@@ -222,8 +222,10 @@ void tst_QToolButton::task176137_autoRepeatOfAction()
tb.setAutoRepeat (true);
QSignalSpy repeatSpy(&action,SIGNAL(triggered())); // new spy
QTest::mousePress ( &tb, Qt::LeftButton);
- QTest::mouseRelease ( &tb, Qt::LeftButton, 0, QPoint (), 2000);
- QCOMPARE (repeatSpy.count(), (2000 - tb.autoRepeatDelay()) / tb.autoRepeatInterval() + 1);
+ QTest::mouseRelease ( &tb, Qt::LeftButton, 0, QPoint (), 3000);
+ qreal expected = (3000 - tb.autoRepeatDelay()) / tb.autoRepeatInterval() + 1;
+ //we check that the difference is less than 10% (on some systems timers are not super accurate)
+ QVERIFY ( qAbs( (expected - repeatSpy.count()) / expected) < 0.1);
}