diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2010-11-04 11:03:03 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2010-11-04 11:03:03 (GMT) |
commit | 447c5812f996b632734fc74ca491422e7cbbed43 (patch) | |
tree | dab0597d1d74e0e6e377f3bffdf2315b52058539 /src | |
parent | 445ef8847979dab72893aab1924d46d0fe1a8a3e (diff) | |
parent | ab672d88f906b0d6f2d45f9ebbfbf12fdcfba51e (diff) | |
download | Qt-447c5812f996b632734fc74ca491422e7cbbed43.zip Qt-447c5812f996b632734fc74ca491422e7cbbed43.tar.gz Qt-447c5812f996b632734fc74ca491422e7cbbed43.tar.bz2 |
Merge branch '4.7-upstream' into 4.7-water
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/util/qdeclarativestateoperations.cpp | 2 | ||||
-rw-r--r-- | src/gui/dialogs/qdialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/dialogs/qfilesystemmodel.cpp | 45 | ||||
-rw-r--r-- | src/gui/dialogs/qinputdialog.cpp | 3 | ||||
-rw-r--r-- | src/gui/itemviews/qdirmodel.cpp | 19 | ||||
-rw-r--r-- | src/gui/kernel/qstandardgestures.cpp | 10 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 22 | ||||
-rw-r--r-- | src/gui/styles/qs60style_p.h | 1 | ||||
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 7 | ||||
-rw-r--r-- | src/network/kernel/qauthenticator.cpp | 10 | ||||
-rw-r--r-- | src/plugins/s60/feedback/feedback.pro | 2 |
11 files changed, 82 insertions, 41 deletions
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp index 8cb813c..d1d7822 100644 --- a/src/declarative/util/qdeclarativestateoperations.cpp +++ b/src/declarative/util/qdeclarativestateoperations.cpp @@ -648,7 +648,7 @@ void QDeclarativeStateChangeScript::setScript(const QDeclarativeScriptString &s) } /*! - \qmlproperty script StateChangeScript::script + \qmlproperty string StateChangeScript::name This property holds the name of the script. This name can be used by a ScriptAction to target a specific script. diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index 9e0437c..b7a0026 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -1111,7 +1111,7 @@ QSize QDialog::sizeHint() const // if size is not fixed, try to adjust it according to S60 layoutting if (minimumSize() != maximumSize()) { // In S60, dialogs are always the width of screen (in portrait, regardless of current layout) - return QSize(qMax(S60->screenHeightInPixels, S60->screenWidthInPixels), QWidget::sizeHint().height()); + return QSize(qMin(S60->screenHeightInPixels, S60->screenWidthInPixels), QWidget::sizeHint().height()); } else { return QWidget::sizeHint(); } diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp index 8a6190f..8a9f8ae 100644 --- a/src/gui/dialogs/qfilesystemmodel.cpp +++ b/src/gui/dialogs/qfilesystemmodel.cpp @@ -80,11 +80,43 @@ QT_BEGIN_NAMESPACE directories. In the simplest case, it can be used with a suitable display widget as part of a browser or filter. - QFileSystemModel will not fetch any files or directories until setRootPath + QFileSystemModel can be accessed using the standard interface provided by + QAbstractItemModel, but it also provides some convenience functions that are + specific to a directory model. + The fileInfo(), isDir(), name(), and path() functions provide information + about the underlying files and directories related to items in the model. + Directories can be created and removed using mkdir(), rmdir(). + + \note QFileSystemModel requires an instance of a GUI application. + + \section1 Example Usage + + A directory model that displays the contents of a default directory + is usually constructed with a parent object: + + \snippet doc/src/snippets/shareddirmodel/main.cpp 2 + + A tree view can be used to display the contents of the model + + \snippet doc/src/snippets/shareddirmodel/main.cpp 4 + + and the contents of a particular directory can be displayed by + setting the tree view's root index: + + \snippet doc/src/snippets/shareddirmodel/main.cpp 7 + + The view's root index can be used to control how much of a + hierarchical model is displayed. QDirModel provides a convenience + function that returns a suitable model index for a path to a + directory within the model. + + \section1 Caching and Performance + + QFileSystemModel will not fetch any files or directories until setRootPath() is called. This will prevent any unnecessary querying on the file system until that point such as listing the drives on Windows. - Unlike the QDirModel, QFileSystemModel uses a separate thread to populate + Unlike QDirModel, QFileSystemModel uses a separate thread to populate itself so it will not cause the main thread to hang as the file system is being queried. Calls to rowCount() will return 0 until the model populates a directory. @@ -92,15 +124,6 @@ QT_BEGIN_NAMESPACE QFileSystemModel keeps a cache with file information. The cache is automatically kept up to date using the QFileSystemWatcher. - QFileSystemModel can be accessed using the standard interface provided by - QAbstractItemModel, but it also provides some convenience functions that are - specific to a directory model. - The fileInfo(), isDir(), name(), and path() functions provide information - about the underlying files and directories related to items in the model. - Directories can be created and removed using mkdir(), rmdir(). - - \note QFileSystemModel requires an instance of a GUI application. - \sa {Model Classes} */ diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp index 700b234..abaaa49 100644 --- a/src/gui/dialogs/qinputdialog.cpp +++ b/src/gui/dialogs/qinputdialog.cpp @@ -231,7 +231,10 @@ void QInputDialogPrivate::ensureLayout() QObject::connect(buttonBox, SIGNAL(rejected()), q, SLOT(reject())); mainLayout = new QVBoxLayout(q); + //we want to let the input dialog grow to available size on Symbian. +#ifndef Q_OS_SYMBIAN mainLayout->setSizeConstraint(QLayout::SetMinAndMaxSize); +#endif mainLayout->addWidget(label); mainLayout->addWidget(inputWidget); mainLayout->addWidget(buttonBox); diff --git a/src/gui/itemviews/qdirmodel.cpp b/src/gui/itemviews/qdirmodel.cpp index 48599bc..cb6f81e 100644 --- a/src/gui/itemviews/qdirmodel.cpp +++ b/src/gui/itemviews/qdirmodel.cpp @@ -201,25 +201,6 @@ void QDirModelPrivate::invalidate() QDirModel keeps a cache with file information. The cache needs to be updated with refresh(). - A directory model that displays the contents of a default directory - is usually constructed with a parent object: - - \snippet doc/src/snippets/shareddirmodel/main.cpp 2 - - A tree view can be used to display the contents of the model - - \snippet doc/src/snippets/shareddirmodel/main.cpp 4 - - and the contents of a particular directory can be displayed by - setting the tree view's root index: - - \snippet doc/src/snippets/shareddirmodel/main.cpp 7 - - The view's root index can be used to control how much of a - hierarchical model is displayed. QDirModel provides a convenience - function that returns a suitable model index for a path to a - directory within the model. - QDirModel can be accessed using the standard interface provided by QAbstractItemModel, but it also provides some convenience functions that are specific to a directory model. The fileInfo() and isDir() diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp index 1821c3d..48b7ac1 100644 --- a/src/gui/kernel/qstandardgestures.cpp +++ b/src/gui/kernel/qstandardgestures.cpp @@ -194,13 +194,15 @@ QGestureRecognizer::Result QPinchGestureRecognizer::recognize(QGesture *state, d->hotSpot = p1.screenPos(); d->isHotSpotSet = true; + QPointF centerPoint = (p1.screenPos() + p2.screenPos()) / 2.0; if (d->isNewSequence) { d->startPosition[0] = p1.screenPos(); d->startPosition[1] = p2.screenPos(); + d->lastCenterPoint = centerPoint; + } else { + d->lastCenterPoint = d->centerPoint; } - - d->lastCenterPoint = d->centerPoint; - d->centerPoint = (p1.screenPos() + p2.screenPos()) / 2.0; + d->centerPoint = centerPoint; d->changeFlags |= QPinchGesture::CenterPointChanged; @@ -224,7 +226,7 @@ QGestureRecognizer::Result QPinchGestureRecognizer::recognize(QGesture *state, startAngle -= 360; const qreal rotationAngle = startAngle - angle; if (d->isNewSequence) - d->lastRotationAngle = rotationAngle; + d->lastRotationAngle = 0.0; else d->lastRotationAngle = d->rotationAngle; d->rotationAngle = rotationAngle; diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index d39a2ba..53ca28c 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -112,6 +112,8 @@ const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = { // *** End of generated data *** }; +QSet<const QWidget *> *QS60StylePrivate::m_autoFillDisabledWidgets = 0; + const short *QS60StylePrivate::m_pmPointer = QS60StylePrivate::data[0]; // theme background texture @@ -152,6 +154,8 @@ const double KTabFontMul = 0.72; QS60StylePrivate::~QS60StylePrivate() { + delete m_autoFillDisabledWidgets; + m_autoFillDisabledWidgets = 0; clearCaches(); //deletes also background image deleteThemePalette(); #ifdef Q_WS_S60 @@ -2521,9 +2525,9 @@ int QS60Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const metricValue = QS60StylePrivate::pixelMetric(PM_LayoutLeftMargin); } - if (widget && (metric == PM_LayoutTopMargin)) + if (widget && (metric == PM_LayoutTopMargin || metric == PM_LayoutLeftMargin || metric == PM_LayoutRightMargin)) if (widget->windowType() == Qt::Dialog) - //double the top layout margin for dialogs, it is very close to real value + //double the layout margins (except bottom) for dialogs, it is very close to real value //without having to define custom pixel metric metricValue *= 2; @@ -3184,6 +3188,13 @@ void QS60Style::polish(QWidget *widget) } d->setThemePalette(widget); d->setFont(widget); + + if (widget->autoFillBackground()) { + if (!d->m_autoFillDisabledWidgets) + d->m_autoFillDisabledWidgets = new QSet<const QWidget *>; + widget->setAutoFillBackground(false); + d->m_autoFillDisabledWidgets->insert(widget); + } } /*! @@ -3218,6 +3229,13 @@ void QS60Style::unpolish(QWidget *widget) if (widget) widget->setPalette(QPalette()); + + if (d->m_autoFillDisabledWidgets && + !d->m_autoFillDisabledWidgets->isEmpty() && + d->m_autoFillDisabledWidgets->contains(widget)) { + widget->setAutoFillBackground(true); + d->m_autoFillDisabledWidgets->remove(widget); + } #if defined(Q_WS_S60) && !defined(QT_NO_PROGRESSBAR) if (QProgressBar *bar = qobject_cast<QProgressBar *>(widget)) { diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index b46f75e..3d66c40 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -625,6 +625,7 @@ private: static qint64 m_webPaletteKey; static QPointer<QWidget> m_pressedWidget; + static QSet<const QWidget *> *m_autoFillDisabledWidgets; #ifdef Q_WS_S60 //list of progress bars having animation running diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 89f9b03..4d27531 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -373,6 +373,13 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket // - If withCredentials has been set to false (e.g. by QtWebKit for a cross-origin XMLHttpRequest) then // we need to bail out if authentication is required. if (priv->phase == QAuthenticatorPrivate::Done || !reply->request().withCredentials()) { + // Reset authenticator so the next request on that channel does not get messed up + auth = 0; + if (isProxy) + channels[i].proxyAuthenticator = QAuthenticator(); + else + channels[i].authenticator = QAuthenticator(); + // authentication is cancelled, send the current contents to the user. emit channels[i].reply->headerChanged(); emit channels[i].reply->readyRead(); diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp index 220f7da..73f6b94 100644 --- a/src/network/kernel/qauthenticator.cpp +++ b/src/network/kernel/qauthenticator.cpp @@ -164,9 +164,13 @@ QAuthenticator &QAuthenticator::operator=(const QAuthenticator &other) { if (d == other.d) return *this; - detach(); - d->user = other.d->user; - d->password = other.d->password; + + if (d && !d->ref.deref()) + delete d; + + d = other.d; + if (d) + d->ref.ref(); return *this; } diff --git a/src/plugins/s60/feedback/feedback.pro b/src/plugins/s60/feedback/feedback.pro index 32ddf6f..1069220 100644 --- a/src/plugins/s60/feedback/feedback.pro +++ b/src/plugins/s60/feedback/feedback.pro @@ -2,6 +2,8 @@ include(../../qpluginbase.pri) TARGET = qtactilefeedback$${QT_LIBINFIX} +QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/s60/feedback + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE contains(S60_VERSION, 5.0)|contains(S60_VERSION, symbian3) { |