summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2010-04-13 12:44:36 (GMT)
committerMartin Smith <msmith@trolltech.com>2010-04-13 12:44:36 (GMT)
commitaa7881ad6fbc3f79b273f5a03a3796febe7da976 (patch)
treea37c50edff6a87b72883a9dda765d0bc17b4d3f9
parent3d3bff79216a24625ac7e5aa33b40c5363a228fc (diff)
parent6bebe02e8d01e17f80d9951126c3158bf2bcc6e0 (diff)
downloadQt-aa7881ad6fbc3f79b273f5a03a3796febe7da976.zip
Qt-aa7881ad6fbc3f79b273f5a03a3796febe7da976.tar.gz
Qt-aa7881ad6fbc3f79b273f5a03a3796febe7da976.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
-rw-r--r--tests/auto/bic/tst_bic.cpp2
-rw-r--r--tests/auto/qfileinfo/tst_qfileinfo.cpp42
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp3
-rw-r--r--tools/assistant/tools/assistant/helpviewer.h3
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qtb.cpp34
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qtb.h3
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qwv.cpp32
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qwv.h2
8 files changed, 77 insertions, 44 deletions
diff --git a/tests/auto/bic/tst_bic.cpp b/tests/auto/bic/tst_bic.cpp
index 0331c96..2349afa 100644
--- a/tests/auto/bic/tst_bic.cpp
+++ b/tests/auto/bic/tst_bic.cpp
@@ -147,7 +147,9 @@ void tst_Bic::initTestCase_data()
QTest::newRow("QtXmlPatterns") << "QtXmlPatterns";
QTest::newRow("Qt3Support") << "Qt3Support";
QTest::newRow("QtTest") << "QtTest";
+#ifndef QT_NO_DBUS
QTest::newRow("QtDBus") << "QtDBus";
+#endif
QTest::newRow("QtDesigner") << "QtDesigner";
}
diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp
index eba04d9..da5c772 100644
--- a/tests/auto/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp
@@ -1087,11 +1087,7 @@ void tst_QFileInfo::isHidden_data()
QTest::newRow("C:/path/to/hidden-directory/.") << QDir::currentPath() + QString::fromLatin1("/hidden-directory/.") << true;
#endif
#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
-
- if (!QDir("./.hidden-directory").exists()
- && !QDir().mkdir("./.hidden-directory"))
- qWarning("Unable to create directory './.hidden-directory'. Some tests will fail.");
-
+ QVERIFY(QDir("./.hidden-directory").exists() || QDir().mkdir("./.hidden-directory"));
QTest::newRow("/path/to/.hidden-directory") << QDir::currentPath() + QString("/.hidden-directory") << true;
QTest::newRow("/path/to/.hidden-directory/.") << QDir::currentPath() + QString("/.hidden-directory/.") << true;
QTest::newRow("/path/to/.hidden-directory/..") << QDir::currentPath() + QString("/.hidden-directory/..") << true;
@@ -1119,34 +1115,24 @@ void tst_QFileInfo::isHidden_data()
{
QFile file(hiddenFileName);
- if (file.open(QIODevice::WriteOnly)) {
- QTextStream t(&file);
- t << "foobar";
- } else {
- qWarning("Failed to create hidden file");
- }
+ QVERIFY(file.open(QIODevice::WriteOnly));
+ QTextStream t(&file);
+ t << "foobar";
+
QFile file2(notHiddenFileName);
- if (file2.open(QIODevice::WriteOnly)) {
- QTextStream t(&file);
- t << "foobar";
- } else {
- qWarning("Failed to create non-hidden file");
- }
+ QVERIFY(file2.open(QIODevice::WriteOnly))
+ QTextStream t(&file);
+ t << "foobar";
}
RFs rfs;
TInt err = rfs.Connect();
- if (err == KErrNone) {
- HBufC* symFile = qt_QString2HBufC(hiddenFileName);
- err = rfs.SetAtt(*symFile, KEntryAttHidden, 0);
- rfs.Close();
- delete symFile;
- if (err != KErrNone) {
- qWarning("Failed to set hidden attribute for test file");
- }
- } else {
- qWarning("Failed to open RFs session");
- }
+ QCOMPARE(err, KErrNone);
+ HBufC* symFile = qt_QString2HBufC(hiddenFileName);
+ err = rfs.SetAtt(*symFile, KEntryAttHidden, 0);
+ rfs.Close();
+ delete symFile;
+ QCOMPARE(err, KErrNone);
#endif
}
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 76e20b9..1b2944e 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -6056,6 +6056,9 @@ void tst_QWidget::setToolTip()
#ifdef Q_OS_WINCE_WM
QSKIP("Mouse over doesn't work on Windows mobile.", SkipAll);
#endif
+#ifdef QT_MAC_USE_COCOA
+ QSKIP("Temporarily disable the rest on cocoa due to QCursor::setPos problems.", SkipAll);
+#endif
for (int pass = 0; pass < 2; ++pass) {
QWidget *popup = new QWidget(0, Qt::Popup);
diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h
index 246700f..6f1f48d 100644
--- a/tools/assistant/tools/assistant/helpviewer.h
+++ b/tools/assistant/tools/assistant/helpviewer.h
@@ -47,6 +47,7 @@
QT_BEGIN_NAMESPACE
+class QMouseEvent;
class QUrl;
class AbstractHelpViewer
@@ -64,6 +65,8 @@ public:
virtual void resetScale() = 0;
virtual qreal scale() const = 0;
+ virtual bool handleForwardBackwardMouseButtons(QMouseEvent *e) = 0;
+
static QString AboutBlank;
static QString LocalHelpFile;
static QString PageNotFoundMessage;
diff --git a/tools/assistant/tools/assistant/helpviewer_qtb.cpp b/tools/assistant/tools/assistant/helpviewer_qtb.cpp
index 07b89eb..3ff64e8 100644
--- a/tools/assistant/tools/assistant/helpviewer_qtb.cpp
+++ b/tools/assistant/tools/assistant/helpviewer_qtb.cpp
@@ -127,6 +127,20 @@ void HelpViewer::resetScale()
zoomCount = 0;
}
+bool HelpViewer::handleForwardBackwardMouseButtons(QMouseEvent *e)
+{
+ if (e->button() == Qt::XButton1) {
+ QTextBrowser::backward();
+ return true;
+ }
+
+ if (e->button() == Qt::XButton2) {
+ QTextBrowser::forward();
+ return true;
+ }
+ return false;
+}
+
void HelpViewer::setSource(const QUrl &url)
{
TRACE_OBJ
@@ -229,15 +243,10 @@ void HelpViewer::contextMenuEvent(QContextMenuEvent *e)
void HelpViewer::mouseReleaseEvent(QMouseEvent *e)
{
TRACE_OBJ
- if (e->button() == Qt::XButton1) {
- QTextBrowser::backward();
- return;
- }
-
- if (e->button() == Qt::XButton2) {
- QTextBrowser::forward();
+#ifndef Q_OS_LINUX
+ if (handleForwardBackwardMouseButtons(e))
return;
- }
+#endif
controlPressed = e->modifiers() & Qt::ControlModifier;
if ((controlPressed && hasAnchorAt(e->pos())) ||
@@ -249,6 +258,15 @@ void HelpViewer::mouseReleaseEvent(QMouseEvent *e)
QTextBrowser::mouseReleaseEvent(e);
}
+void HelpViewer::mousePressEvent(QMouseEvent *e)
+{
+#ifdef Q_OS_LINUX
+ if (handleForwardBackwardMouseButtons(e))
+ return;
+#endif
+ QTextBrowser::mousePressEvent(e);
+}
+
void HelpViewer::keyPressEvent(QKeyEvent *e)
{
TRACE_OBJ
diff --git a/tools/assistant/tools/assistant/helpviewer_qtb.h b/tools/assistant/tools/assistant/helpviewer_qtb.h
index a05782c..acb734b 100644
--- a/tools/assistant/tools/assistant/helpviewer_qtb.h
+++ b/tools/assistant/tools/assistant/helpviewer_qtb.h
@@ -72,6 +72,8 @@ public:
void resetScale();
qreal scale() const { return zoomCount; }
+ bool handleForwardBackwardMouseButtons(QMouseEvent *e);
+
void setSource(const QUrl &url);
inline bool hasSelection() const
@@ -91,6 +93,7 @@ private:
void contextMenuEvent(QContextMenuEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
void keyPressEvent(QKeyEvent *e);
+ void mousePressEvent(QMouseEvent *e);
private slots:
void openLinkInNewTab();
diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp
index 18046a7..db1cd58 100644
--- a/tools/assistant/tools/assistant/helpviewer_qwv.cpp
+++ b/tools/assistant/tools/assistant/helpviewer_qwv.cpp
@@ -301,6 +301,22 @@ void HelpViewer::resetScale()
setTextSizeMultiplier(1.0);
}
+bool HelpViewer::handleForwardBackwardMouseButtons(QMouseEvent *e)
+{
+ TRACE_OBJ
+ if (e->button() == Qt::XButton1) {
+ triggerPageAction(QWebPage::Back);
+ return true;
+ }
+
+ if (e->button() == Qt::XButton2) {
+ triggerPageAction(QWebPage::Forward);
+ return true;
+ }
+
+ return false;
+}
+
void HelpViewer::setSource(const QUrl &url)
{
TRACE_OBJ
@@ -328,15 +344,10 @@ void HelpViewer::wheelEvent(QWheelEvent *e)
void HelpViewer::mouseReleaseEvent(QMouseEvent *e)
{
TRACE_OBJ
- if (e->button() == Qt::XButton1) {
- triggerPageAction(QWebPage::Back);
+#ifndef Q_OS_LINUX
+ if (handleForwardBackwardMouseButtons(e))
return;
- }
-
- if (e->button() == Qt::XButton2) {
- triggerPageAction(QWebPage::Forward);
- return;
- }
+#endif
QWebView::mouseReleaseEvent(e);
}
@@ -356,6 +367,11 @@ void HelpViewer::actionChanged()
void HelpViewer::mousePressEvent(QMouseEvent *event)
{
TRACE_OBJ
+#ifdef Q_OS_LINUX
+ if (handleForwardBackwardMouseButtons(event))
+ return;
+#endif
+
HelpPage *currentPage = static_cast<HelpPage*>(page());
if (currentPage) {
currentPage->m_pressedButtons = event->buttons();
diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.h b/tools/assistant/tools/assistant/helpviewer_qwv.h
index 41ee553..a2c0389 100644
--- a/tools/assistant/tools/assistant/helpviewer_qwv.h
+++ b/tools/assistant/tools/assistant/helpviewer_qwv.h
@@ -69,6 +69,8 @@ public:
void resetScale();
qreal scale() const { return textSizeMultiplier(); }
+ bool handleForwardBackwardMouseButtons(QMouseEvent *e);
+
void setSource(const QUrl &url);
inline QUrl source() const { return url(); }