summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-01-27 18:58:01 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-01-27 18:58:04 +0100
commitc30fc6949a5a619539d1862e484cdd0955a9b6e7 (patch)
tree043aeaa7117e5b805fb03926adadc78ffc100d47 /src
parent68fb37d762a818cc44ea69f7c3a80a3f010b6713 (diff)
parentaac064b1c74fc902eb0d3ffd4fa79acf1c85a6df (diff)
Merge remote-tracking branch 'origin/release' into stable
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qiodevice.cpp5
-rw-r--r--src/corelib/plugin/qlibrary.cpp21
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemsettings.mm1
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp4
-rw-r--r--src/sql/doc/src/sql-driver.qdoc67
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm8
6 files changed, 30 insertions, 76 deletions
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index a81b8580c4..53019e1ff4 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -259,9 +259,10 @@ QIODevicePrivate::~QIODevicePrivate()
\value NotOpen The device is not open.
\value ReadOnly The device is open for reading.
- \value WriteOnly The device is open for writing.
+ \value WriteOnly The device is open for writing. Note that this mode implies
+ Truncate.
\value ReadWrite The device is open for reading and writing.
- \value Append The device is opened in append mode, so that all data is
+ \value Append The device is opened in append mode so that all data is
written to the end of the file.
\value Truncate If possible, the device is truncated before it is opened.
All earlier contents of the device are lost.
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 468f759189..9736950c89 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -374,6 +374,7 @@ private:
static QBasicMutex qt_library_mutex;
static QLibraryStore *qt_library_data = 0;
+static bool qt_library_data_once;
QLibraryStore::~QLibraryStore()
{
@@ -429,8 +430,11 @@ Q_DESTRUCTOR_FUNCTION(qlibraryCleanup)
// must be called with a locked mutex
QLibraryStore *QLibraryStore::instance()
{
- if (Q_UNLIKELY(!qt_library_data))
+ if (Q_UNLIKELY(!qt_library_data_once && !qt_library_data)) {
+ // only create once per process lifetime
qt_library_data = new QLibraryStore;
+ qt_library_data_once = true;
+ }
return qt_library_data;
}
@@ -440,12 +444,15 @@ inline QLibraryPrivate *QLibraryStore::findOrCreate(const QString &fileName, con
QLibraryStore *data = instance();
// check if this library is already loaded
- QLibraryPrivate *lib = data->libraryMap.value(fileName);
+ QLibraryPrivate *lib = 0;
+ if (Q_LIKELY(data))
+ lib = data->libraryMap.value(fileName);
if (!lib)
lib = new QLibraryPrivate(fileName, version);
// track this library
- data->libraryMap.insert(fileName, lib);
+ if (Q_LIKELY(data))
+ data->libraryMap.insert(fileName, lib);
lib->libraryRefCount.ref();
return lib;
@@ -464,9 +471,11 @@ inline void QLibraryStore::releaseLibrary(QLibraryPrivate *lib)
// no one else is using
Q_ASSERT(lib->libraryUnloadCount.load() == 0);
- QLibraryPrivate *that = data->libraryMap.take(lib->fileName);
- Q_ASSERT(lib == that);
- Q_UNUSED(that);
+ if (Q_LIKELY(data)) {
+ QLibraryPrivate *that = data->libraryMap.take(lib->fileName);
+ Q_ASSERT(lib == that);
+ Q_UNUSED(that);
+ }
delete lib;
}
diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
index 194394d11a..1c08d4bcb7 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
@@ -254,6 +254,7 @@ QHash<QPlatformTheme::Font, QFont *> qt_mac_createRoleFonts()
fonts.insert(QPlatformTheme::ListBoxFont, qt_mac_qfontForThemeFont(kThemeViewsFont));
fonts.insert(QPlatformTheme::TitleBarFont, qt_mac_qfontForThemeFont(kThemeWindowTitleFont));
fonts.insert(QPlatformTheme::MenuFont, qt_mac_qfontForThemeFont(kThemeMenuItemFont));
+ fonts.insert(QPlatformTheme::MenuBarFont, qt_mac_qfontForThemeFont(kThemeMenuItemFont));
fonts.insert(QPlatformTheme::ComboMenuItemFont, qt_mac_qfontForThemeFont(kThemeSystemFont));
fonts.insert(QPlatformTheme::HeaderViewFont, qt_mac_qfontForThemeFont(kThemeSmallSystemFont));
fonts.insert(QPlatformTheme::TipLabelFont, qt_mac_qfontForThemeFont(kThemeSmallSystemFont));
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index a571f16eb6..a2ef8bf20f 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -287,12 +287,14 @@ XInput2DeviceData *QXcbConnection::deviceForId(int id)
return dev;
}
-#ifdef XCB_USE_XINPUT22
+#if defined(XCB_USE_XINPUT22) || !defined(QT_NO_TABLETEVENT)
static qreal fixed1616ToReal(FP1616 val)
{
return (qreal(val >> 16)) + (val & 0xFF) / (qreal)0xFF;
}
+#endif
+#ifdef XCB_USE_XINPUT22
static qreal valuatorNormalized(double value, XIValuatorClassInfo *vci)
{
if (value > vci->max)
diff --git a/src/sql/doc/src/sql-driver.qdoc b/src/sql/doc/src/sql-driver.qdoc
index 849cdcd544..f1fd2f6e90 100644
--- a/src/sql/doc/src/sql-driver.qdoc
+++ b/src/sql/doc/src/sql-driver.qdoc
@@ -175,73 +175,6 @@
built in release mode only. If you are expecting a debug version
to be built as well, don't use the \c{"-o Makefile"} option.
- \section3 How to build the MySQL driver for MinGW users
-
- The following steps have been used successfully for WinXP SP3. In
- this example, Qt 4.6.2 is shown.
-
- \list
-
- \li Download the following components:
- \list
- \li \c{MinGW-5.1.6.exe}
- \li \c{mingw-utils-0.3.tar.gz}
- \li Qt sources, e.g. \c{qt-everywhere-opensource-src-4.6.2.zip}
- \li \c{mysql-5.1.35-win32.msi}
- \endlist
-
- \li Install \c{MinGW-5.1.6.exe} in, e.g. \c{C:\MinGW}.
-
- \li Extract \c{mingw-utils-0.3.tar.gz} into, e.g. \c{C:\MinGW}.
-
- \li Add the path for \c{MinGW-5.1.6.exe} to your \c{PATH} variable,
- e.g. \c{C:\MinGW\bin;}
-
- \li Extract the Qt sources, (\c{qt-everywhere-opensource-src-4.6.2.zip}),
- into, e.g. \c{C:\Qt}.
-
- \li Add the path for the eventual Qt binary to your \c{PATH} variable,
- e.g. \c{C:\Qt\4.6.2\bin;}.
-
- \li Install MySQL (\c{mysql-5.1.35-win32.msi}), customizing the
- components. Select only the headers and libraries. Install in,
- e.g. \c{C:\MySQL\MySQL51}.
-
- \li Open the DOS prompt, go to \c{C:\MySQL\MySQL51\lib\opt}, and run
- the following commands:
- \list
- \li \c{reimp -d libmysql.lib}
- \li \c{dlltool -k -d libmysql.def -l libmysql.a}
- \endlist
-
- \li Open the DOS prompt, go to \c{C:\Qt\4.6.2} and run the following commands:
- \list
- \li \c{configure.exe -debug-and-release -platform win32-g++ -qt-sql-mysql
- -l mysql -I C:\MySQL\MySQL51\include -L C:\MySQL\MySQL51\lib\opt}
- \li \c{mingw32-make sub-src}
- \endlist
- This step takes a long time.
-
- \li Open the DOS prompt, go to
- \c{C:\Qt\4.6.2\src\plugins\sqldrivers\mysql} and run the
- following command:
- \list
- \li \c{qmake "INCLUDEPATH+=C:/MySQL/MySQL51/include" "LIBS+=-L. mysql" mysql.pro}
- \endlist
-
- \li Now the following libraries are ready in \c{C:\Qt\4.6.2\plugins\sqldrivers}.
- \list
- \li \c{libqsqlmysql4.a}
- \li \c{libqsqlmysqld4.a}
- \li \c{qsqlmysql4.dll}
- \li \c{qsqlmysqld4.dll}
- \endlist
- To use the SDK and QtCreator directly, copy these libraries to
- your \c{C:\Qt\...\qt\plugins\sqldrivers\}, and copy
- \c{C:\MySQL\MySQL51\lib\opt\libmysql.dll} to your \c{C:\Qt\...\qt\bin\}.
-
- \endlist
-
\target QOCI
\section2 QOCI for the Oracle Call Interface (OCI)
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index d13339b555..fa49bcb884 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -2077,6 +2077,10 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
ret = 0;
break;
+ case PM_MenuBarPanelWidth:
+ ret = 0;
+ break;
+
case QStyle::PM_MenuDesktopFrameWidth:
ret = 5;
break;
@@ -6259,6 +6263,10 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz = QSize(w, h);
}
break;
+ case CT_MenuBarItem:
+ if (!sz.isEmpty())
+ sz += QSize(12, 4); // Constants from QWindowsStyle
+ break;
case CT_ToolButton:
sz.rwidth() += 10;
sz.rheight() += 10;