summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-01-24 16:37:58 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-24 18:34:11 +0100
commitd0c360fd88760372f4f67219440ee17a11023d98 (patch)
treee08ad106519090524a526a43d82500c0a0775171 /src
parent9c6a91d07bae5517a9909ef5b6f4acb1e99ec948 (diff)
parent627d9cbd3c45834fe7aa1f2ee37fdfca07a03976 (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src')
-rw-r--r--src/corelib/doc/qtcore.qdocconf2
-rw-r--r--src/gui/doc/src/coordsys.qdoc8
-rw-r--r--src/network/ssl/qsslconfiguration.cpp3
-rw-r--r--src/network/ssl/qsslconfiguration_p.h2
-rw-r--r--src/network/ssl/qsslsocket.cpp15
-rw-r--r--src/network/ssl/qsslsocket_p.h2
-rw-r--r--src/platformsupport/linuxaccessibility/linuxaccessibility.pri2
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm33
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.cpp20
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp1
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp4
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp12
-rw-r--r--src/widgets/widgets/qmainwindow.cpp3
13 files changed, 92 insertions, 15 deletions
diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf
index afd46dfaff..bf402cae97 100644
--- a/src/corelib/doc/qtcore.qdocconf
+++ b/src/corelib/doc/qtcore.qdocconf
@@ -37,6 +37,6 @@ exampledirs += \
snippets \
../../../examples/threads/ \
../../../examples/tools/ \
- ../../../examples/widgets/widgets/analogclock
+ ../../../examples/widgets/
imagedirs += images
diff --git a/src/gui/doc/src/coordsys.qdoc b/src/gui/doc/src/coordsys.qdoc
index 653719e369..e66afcfe55 100644
--- a/src/gui/doc/src/coordsys.qdoc
+++ b/src/gui/doc/src/coordsys.qdoc
@@ -230,7 +230,7 @@
\row
\li {2,1}
- \snippet gui/analogclock/main.cpp 1
+ \snippet analogclock/main.cpp 1
We translate the coordinate system so that point (0, 0) is in the
widget's center, instead of being at the top-left corner. We also
@@ -244,7 +244,7 @@
See also the \l {Window-Viewport Conversion} section.
- \snippet gui/analogclock/main.cpp 2
+ \snippet analogclock/main.cpp 2
We draw the clock's hour hand by rotating the coordinate system
and calling QPainter::drawConvexPolygon(). Thank's to the
@@ -259,14 +259,14 @@
the code guarantees that the code that follows won't be disturbed
by the transformations we've used.
- \snippet gui/analogclock/main.cpp 3
+ \snippet analogclock/main.cpp 3
We do the same for the clock's minute hand, which is defined by
the four points (1, 0), (0, 1), (-1, 0), and (0, -40). These
coordinates specify a hand that is thinner and longer than the
minute hand.
- \snippet gui/analogclock/main.cpp 4
+ \snippet analogclock/main.cpp 4
Finally, we draw the clock face, which consists of twelve short
lines at 30-degree intervals. At the end of that, the painter is
diff --git a/src/network/ssl/qsslconfiguration.cpp b/src/network/ssl/qsslconfiguration.cpp
index 46aa1a1eb5..0ae67b3c1f 100644
--- a/src/network/ssl/qsslconfiguration.cpp
+++ b/src/network/ssl/qsslconfiguration.cpp
@@ -181,6 +181,7 @@ bool QSslConfiguration::operator==(const QSslConfiguration &other) const
d->protocol == other.d->protocol &&
d->peerVerifyMode == other.d->peerVerifyMode &&
d->peerVerifyDepth == other.d->peerVerifyDepth &&
+ d->allowRootCertOnDemandLoading == other.d->allowRootCertOnDemandLoading &&
d->sslOptions == other.d->sslOptions;
}
@@ -208,6 +209,7 @@ bool QSslConfiguration::isNull() const
return (d->protocol == QSsl::SecureProtocols &&
d->peerVerifyMode == QSslSocket::AutoVerifyPeer &&
d->peerVerifyDepth == 0 &&
+ d->allowRootCertOnDemandLoading == true &&
d->caCertificates.count() == 0 &&
d->ciphers.count() == 0 &&
d->localCertificate.isNull() &&
@@ -519,6 +521,7 @@ QList<QSslCertificate> QSslConfiguration::caCertificates() const
void QSslConfiguration::setCaCertificates(const QList<QSslCertificate> &certificates)
{
d->caCertificates = certificates;
+ d->allowRootCertOnDemandLoading = false;
}
/*!
diff --git a/src/network/ssl/qsslconfiguration_p.h b/src/network/ssl/qsslconfiguration_p.h
index 841641d6aa..3e6e43361d 100644
--- a/src/network/ssl/qsslconfiguration_p.h
+++ b/src/network/ssl/qsslconfiguration_p.h
@@ -83,6 +83,7 @@ public:
: protocol(QSsl::SecureProtocols),
peerVerifyMode(QSslSocket::AutoVerifyPeer),
peerVerifyDepth(0),
+ allowRootCertOnDemandLoading(true),
sslOptions(QSslConfigurationPrivate::defaultSslOptions)
{ }
@@ -98,6 +99,7 @@ public:
QSsl::SslProtocol protocol;
QSslSocket::PeerVerifyMode peerVerifyMode;
int peerVerifyDepth;
+ bool allowRootCertOnDemandLoading;
QSsl::SslOptions sslOptions;
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 87ea975bec..cfc3c19bba 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -903,7 +903,12 @@ void QSslSocket::setSslConfiguration(const QSslConfiguration &configuration)
d->configuration.peerVerifyMode = configuration.peerVerifyMode();
d->configuration.protocol = configuration.protocol();
d->configuration.sslOptions = configuration.d->sslOptions;
- d->allowRootCertOnDemandLoading = false;
+
+ // if the CA certificates were set explicitly (either via
+ // QSslConfiguration::setCaCertificates() or QSslSocket::setCaCertificates(),
+ // we cannot load the certificates on demand
+ if (!configuration.d->allowRootCertOnDemandLoading)
+ d->allowRootCertOnDemandLoading = false;
}
/*!
@@ -2381,6 +2386,14 @@ QByteArray QSslSocketPrivate::peek(qint64 maxSize)
/*!
\internal
*/
+bool QSslSocketPrivate::rootCertOnDemandLoadingSupported()
+{
+ return s_loadRootCertsOnDemand;
+}
+
+/*!
+ \internal
+*/
QList<QByteArray> QSslSocketPrivate::unixRootCertDirectories()
{
return QList<QByteArray>() << "/etc/ssl/certs/" // (K)ubuntu, OpenSUSE, Mandriva, MeeGo ...
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index 3dc80ea22a..851dec5840 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -182,6 +182,8 @@ public:
virtual QSslCipher sessionCipher() const = 0;
virtual void continueHandshake() = 0;
+ Q_AUTOTEST_EXPORT static bool rootCertOnDemandLoadingSupported();
+
private:
static bool ensureLibraryLoaded();
static void ensureCiphersAndCertsLoaded();
diff --git a/src/platformsupport/linuxaccessibility/linuxaccessibility.pri b/src/platformsupport/linuxaccessibility/linuxaccessibility.pri
index 09d437678f..2721002ea5 100644
--- a/src/platformsupport/linuxaccessibility/linuxaccessibility.pri
+++ b/src/platformsupport/linuxaccessibility/linuxaccessibility.pri
@@ -1,4 +1,4 @@
-qtHaveModule(dbus):contains(QT_CONFIG, xcb):contains(QT_CONFIG, accessibility) {
+contains(QT_CONFIG, accessibility-atspi-bridge) {
QT += dbus
include(../../3rdparty/atspi2/atspi2.pri)
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 14c24beabf..61ddfe9498 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -490,6 +490,39 @@ static QTouchDevice *touchDevice = 0;
[self handleMouseEvent:theEvent];
}
+- (void)updateTrackingAreas
+{
+ [super updateTrackingAreas];
+
+ // [NSView addTrackingArea] is slow, so bail out early if we can:
+ if (NSIsEmptyRect([self visibleRect]))
+ return;
+
+ QCocoaAutoReleasePool pool;
+ if (NSArray *trackingArray = [self trackingAreas]) {
+ NSUInteger size = [trackingArray count];
+ for (NSUInteger i = 0; i < size; ++i) {
+ NSTrackingArea *t = [trackingArray objectAtIndex:i];
+ [self removeTrackingArea:t];
+ }
+ }
+
+ // Ideally, we shouldn't have NSTrackingMouseMoved events included below, it should
+ // only be turned on if mouseTracking, hover is on or a tool tip is set.
+ // Unfortunately, Qt will send "tooltip" events on mouse moves, so we need to
+ // turn it on in ALL case. That means EVERY QCocoaView gets to pay the cost of
+ // mouse moves delivered to it (Apple recommends keeping it OFF because there
+ // is a performance hit). So it goes.
+ NSUInteger trackingOptions = NSTrackingMouseEnteredAndExited | NSTrackingActiveInActiveApp
+ | NSTrackingInVisibleRect | NSTrackingMouseMoved;
+ NSTrackingArea *ta = [[[NSTrackingArea alloc] initWithRect:[self frame]
+ options:trackingOptions
+ owner:self
+ userInfo:nil]
+ autorelease];
+ [self addTrackingArea:ta];
+}
+
- (void)mouseMoved:(NSEvent *)theEvent
{
[self handleMouseEvent:theEvent];
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index 46a2c682b3..b4699b6306 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -769,6 +769,7 @@ public:
inline void selectNameFilter(const QString &filter);
inline void updateSelectedNameFilter() { selectNameFilter(m_data.selectedNameFilter()); }
inline QString selectedNameFilter() const;
+ void selectFile(const QString &fileName) const;
bool hideFiltersDetails() const { return m_hideFiltersDetails; }
void setHideFiltersDetails(bool h) { m_hideFiltersDetails = h; }
void setDefaultSuffix(const QString &s);
@@ -1071,6 +1072,11 @@ void QWindowsNativeFileDialogBase::setLabelText(QFileDialogOptions::DialogLabel
}
}
+void QWindowsNativeFileDialogBase::selectFile(const QString &fileName) const
+{
+ m_fileDialog->SetFileName((wchar_t*)fileName.utf16());
+}
+
// Return the index of the selected filter, accounting for QFileDialog
// sometimes stripping the filter specification depending on the
// hideFilterDetails setting.
@@ -1362,6 +1368,12 @@ QWindowsNativeDialogBase *QWindowsFileDialogHelper::createNativeDialog()
result->setLabelText(QFileDialogOptions::Accept, opts->labelText(QFileDialogOptions::Accept));
result->updateDirectory();
result->updateSelectedNameFilter();
+ const QStringList initialSelection = opts->initiallySelectedFiles();
+ if (initialSelection.size() > 0) {
+ QFileInfo info(initialSelection.front());
+ if (!info.isDir())
+ result->selectFile(info.fileName());
+ }
const QString defaultSuffix = opts->defaultSuffix();
if (!defaultSuffix.isEmpty())
result->setDefaultSuffix(defaultSuffix);
@@ -1383,9 +1395,13 @@ QString QWindowsFileDialogHelper::directory() const
return m_data.directory();
}
-void QWindowsFileDialogHelper::selectFile(const QString & /* filename */)
+void QWindowsFileDialogHelper::selectFile(const QString &fileName)
{
- // Not implemented.
+ if (QWindowsContext::verboseDialogs)
+ qDebug("%s %s" , __FUNCTION__, qPrintable(fileName));
+
+ if (QWindowsNativeFileDialogBase *nfd = nativeFileDialog())
+ nfd->selectFile(fileName);
}
QStringList QWindowsFileDialogHelper::selectedFiles() const
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 44c730d375..32de54562a 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -771,6 +771,7 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
HANDLE_PLATFORM_WINDOW_EVENT(xcb_unmap_notify_event_t, event, handleUnmapNotifyEvent);
case XCB_CLIENT_MESSAGE:
handleClientMessageEvent((xcb_client_message_event_t *)event);
+ break;
case XCB_ENTER_NOTIFY:
HANDLE_PLATFORM_WINDOW_EVENT(xcb_enter_notify_event_t, event, handleEnterNotifyEvent);
case XCB_LEAVE_NOTIFY:
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index 9af1f0404f..9fe6e4253b 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -84,8 +84,10 @@
#include <QtGui/QScreen>
#ifndef QT_NO_ACCESSIBILITY
#include <qpa/qplatformaccessibility.h>
+#ifndef QT_NO_ACCESSIBILITY_ATSPI_BRIDGE
#include "../../../platformsupport/linuxaccessibility/bridge_p.h"
#endif
+#endif
QT_BEGIN_NAMESPACE
@@ -112,7 +114,7 @@ QXcbIntegration::QXcbIntegration(const QStringList &parameters)
m_fontDatabase.reset(new QGenericUnixFontDatabase());
m_inputContext.reset(QPlatformInputContextFactory::create());
-#ifndef QT_NO_ACCESSIBILITY
+#ifndef QT_NO_ACCESSIBILITY_ATSPI_BRIDGE
m_accessibility.reset(new QSpiAccessibleBridge());
#endif
}
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp
index e89d9bc5f6..5dc59436ad 100644
--- a/src/widgets/graphicsview/qgraphicsitem.cpp
+++ b/src/widgets/graphicsview/qgraphicsitem.cpp
@@ -3272,12 +3272,14 @@ void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool clim
if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
QGraphicsItem *oldFocusScopeItem = p->d_ptr->focusScopeItem;
p->d_ptr->focusScopeItem = q_ptr;
+ if (oldFocusScopeItem)
+ oldFocusScopeItem->d_ptr->focusScopeItemChange(false);
+ focusScopeItemChange(true);
if (!p->focusItem() && !focusFromHide) {
- if (oldFocusScopeItem)
- oldFocusScopeItem->d_ptr->focusScopeItemChange(false);
- focusScopeItemChange(true);
- // If you call setFocus on a child of a focus scope that
- // doesn't currently have a focus item, then stop.
+ // Calling setFocus() on a child of a focus scope that does
+ // not have focus changes only the focus scope pointer,
+ // so that focus is restored the next time the scope gains
+ // focus.
return;
}
break;
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp
index 4f81decfbc..5bb331a99a 100644
--- a/src/widgets/widgets/qmainwindow.cpp
+++ b/src/widgets/widgets/qmainwindow.cpp
@@ -1480,6 +1480,9 @@ bool QMainWindow::event(QEvent *event)
\obsolete
This property is not implemented in Qt 5. Setting it has no effect.
+
+ A replacement API (QtMacUnifiedToolBar) is available in QtMacExtras at
+ http://qt.gitorious.org/qtplayground/qtmacextras
*/
void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set)
{