summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/Qt5CTestMacros.cmake11
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in5
-rw-r--r--src/corelib/global/qtypetraits.h4
-rw-r--r--src/corelib/io/qprocess_win.cpp6
-rw-r--r--src/corelib/io/qwindowspipereader.cpp12
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp5
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp4
-rw-r--r--src/corelib/plugin/qplugin.qdoc2
-rw-r--r--src/corelib/tools/qlist.cpp3
-rw-r--r--src/corelib/tools/qlocale.cpp4
-rw-r--r--src/corelib/tools/qstring.cpp32
-rw-r--r--src/corelib/tools/qstringlist.cpp3
-rw-r--r--src/corelib/tools/qvector.cpp3
-rw-r--r--src/gui/QtGui.dynlist5
-rw-r--r--src/gui/gui.pro1
-rw-r--r--src/gui/image/qicon.cpp1
-rw-r--r--src/gui/image/qpixmap_raster.cpp5
-rw-r--r--src/gui/kernel/qguiapplication.cpp2
-rw-r--r--src/gui/kernel/qwindow.cpp5
-rw-r--r--src/gui/painting/qcosmeticstroker.cpp28
-rw-r--r--src/gui/painting/qcosmeticstroker_p.h4
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp26
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h1
-rw-r--r--src/gui/painting/qrasterizer.cpp2
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp16
-rw-r--r--src/gui/text/qfontengine_ft.cpp26
-rw-r--r--src/network/kernel/qnetworkproxy.cpp2
-rw-r--r--src/opengl/qgl.cpp8
-rw-r--r--src/platformsupport/eglconvenience/eglconvenience.pri1
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp8
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp7
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouch.cpp8
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouch_p.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm8
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuitem.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuloader.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuloader.mm10
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemsettings.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h4
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm35
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h4
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm32
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp11
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h1
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp2
-rw-r--r--src/sql/drivers/psql/qsql_psql.cpp38
-rw-r--r--src/sql/drivers/sqlite/qsql_sqlite.cpp3
-rw-r--r--src/tools/qdoc/codemarker.cpp5
-rw-r--r--src/tools/qdoc/main.cpp4
-rw-r--r--src/tools/qdoc/qmlvisitor.cpp25
-rw-r--r--src/widgets/QtGui.dynlist8
-rw-r--r--src/widgets/QtWidgets.dynlist5
-rw-r--r--src/widgets/dialogs/qfileinfogatherer.cpp2
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp2
-rw-r--r--src/widgets/itemviews/qitemdelegate.cpp3
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.cpp3
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm35
-rw-r--r--src/widgets/widgets.pro2
58 files changed, 372 insertions, 132 deletions
diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake
index 60b98a7138..b313cd5c08 100644
--- a/src/corelib/Qt5CTestMacros.cmake
+++ b/src/corelib/Qt5CTestMacros.cmake
@@ -19,6 +19,13 @@ if (CMAKE_TOOLCHAIN_FILE)
list(APPEND BUILD_OPTIONS_LIST "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
endif()
+if (NO_WIDGETS)
+ list(APPEND BUILD_OPTIONS_LIST "-DNO_WIDGETS=True")
+endif()
+if (NO_DBUS)
+ list(APPEND BUILD_OPTIONS_LIST "-DNO_DBUS=True")
+endif()
+
macro(expect_pass _dir)
string(REPLACE "(" "_" testname "${_dir}")
string(REPLACE ")" "_" testname "${testname}")
@@ -80,7 +87,7 @@ function(test_module_includes)
set(packages_string
"
${packages_string}
- find_package(Qt5${_package} REQUIRED)
+ find_package(Qt5${_package} 5.0.0 REQUIRED)
"
)
endforeach()
@@ -90,7 +97,7 @@ function(test_module_includes)
list(REMOVE_AT all_args 0 1)
set(packages_string
"${packages_string}
- find_package(Qt5${qtmodule} REQUIRED)
+ find_package(Qt5${qtmodule} 5.0.0 REQUIRED)
include_directories(\${Qt5${qtmodule}_INCLUDE_DIRS})
add_definitions(\${Qt5${qtmodule}_DEFINITIONS})\n"
)
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index 4e0fcda20e..29e37be64a 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -41,6 +41,11 @@ set(Qt5Core_QMAKE_EXECUTABLE Qt5::qmake)
set(Qt5Core_MOC_EXECUTABLE Qt5::moc)
set(Qt5Core_RCC_EXECUTABLE Qt5::rcc)
+set_property(TARGET Qt5::Core PROPERTY INTERFACE_QT_MAJOR_VERSION 5)
+set_property(TARGET Qt5::Core APPEND PROPERTY
+ COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION
+)
+
!!IF isEmpty(CMAKE_ARCHDATA_DIR_IS_ABSOLUTE)
list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5Core_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5Core_install_prefix}/$${CMAKE_ARCHDATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
!!ELSE
diff --git a/src/corelib/global/qtypetraits.h b/src/corelib/global/qtypetraits.h
index 7ccad067d0..2ae66da92b 100644
--- a/src/corelib/global/qtypetraits.h
+++ b/src/corelib/global/qtypetraits.h
@@ -245,6 +245,10 @@ template<> struct is_integral<unsigned long long> : true_type { };
template <class T> struct is_integral<const T> : is_integral<T> { };
template <class T> struct is_integral<volatile T> : is_integral<T> { };
template <class T> struct is_integral<const volatile T> : is_integral<T> { };
+#if defined (Q_COMPILER_UNICODE_STRINGS)
+template<> struct is_integral<char16_t> : true_type { };
+template<> struct is_integral<char32_t> : true_type { };
+#endif
// is_floating_point is false except for the built-in floating-point types.
// A cv-qualified type is integral if and only if the underlying type is.
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index 693778e629..ab1f05777a 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -312,11 +312,13 @@ void QProcessPrivate::destroyChannel(Channel *channel)
}
} else if (channel == &stdoutChannel) {
if (stdoutReader) {
+ stdoutReader->stop();
stdoutReader->deleteLater();
stdoutReader = 0;
}
} else if (channel == &stderrChannel) {
if (stderrReader) {
+ stderrReader->stop();
stderrReader->deleteLater();
stderrReader = 0;
}
@@ -795,8 +797,8 @@ void QProcessPrivate::findExitCode()
DWORD theExitCode;
if (GetExitCodeProcess(pid->hProcess, &theExitCode)) {
exitCode = theExitCode;
- //### for now we assume a crash if exit code is less than -1 or the magic number
- crashed = (exitCode == 0xf291 || (int)exitCode < 0);
+ crashed = (exitCode == 0xf291 // our magic number, see killProcess
+ || (theExitCode >= 0x80000000 && theExitCode < 0xD0000000));
}
}
diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp
index efadb357a9..2cb5845768 100644
--- a/src/corelib/io/qwindowspipereader.cpp
+++ b/src/corelib/io/qwindowspipereader.cpp
@@ -64,7 +64,7 @@ QWindowsPipeReader::QWindowsPipeReader(QObject *parent)
connect(dataReadNotifier, &QWinOverlappedIoNotifier::notified, this, &QWindowsPipeReader::notified);
}
-static void qt_cancelIo(HANDLE handle, OVERLAPPED *overlapped)
+static bool qt_cancelIo(HANDLE handle, OVERLAPPED *overlapped)
{
typedef BOOL (WINAPI *PtrCancelIoEx)(HANDLE, LPOVERLAPPED);
static PtrCancelIoEx ptrCancelIoEx = 0;
@@ -74,16 +74,18 @@ static void qt_cancelIo(HANDLE handle, OVERLAPPED *overlapped)
ptrCancelIoEx = PtrCancelIoEx(GetProcAddress(kernel32, "CancelIoEx"));
}
if (ptrCancelIoEx)
- ptrCancelIoEx(handle, overlapped);
+ return ptrCancelIoEx(handle, overlapped);
else
- CancelIo(handle);
+ return CancelIo(handle);
}
QWindowsPipeReader::~QWindowsPipeReader()
{
if (readSequenceStarted) {
- qt_cancelIo(handle, &overlapped);
- dataReadNotifier->waitForNotified(-1, &overlapped);
+ if (qt_cancelIo(handle, &overlapped))
+ dataReadNotifier->waitForNotified(-1, &overlapped);
+ else
+ qErrnoWarning("QWindowsPipeReader: qt_cancelIo on handle %x failed.", handle);
}
}
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 989456efbb..0d67c1f17b 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -2109,9 +2109,8 @@ void QAbstractItemModel::fetchMore(const QModelIndex &)
The default implementation always returns false.
- If canFetchMore() returns true, QAbstractItemView will call fetchMore().
- However, the fetchMore() function is only called when the model is being
- populated incrementally.
+ If canFetchMore() returns true, the fetchMore() function should
+ be called. This is the behavior of QAbstractItemView, for example.
\sa fetchMore()
*/
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 3540e3163d..cce8c30d81 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -725,6 +725,10 @@ void QCoreApplication::init()
qt_call_pre_routines();
qt_startup_hook();
+
+#ifndef QT_NO_QOBJECT
+ QCoreApplicationPrivate::is_app_running = true; // No longer starting up.
+#endif
}
/*!
diff --git a/src/corelib/plugin/qplugin.qdoc b/src/corelib/plugin/qplugin.qdoc
index 74c4289017..eacfe995ae 100644
--- a/src/corelib/plugin/qplugin.qdoc
+++ b/src/corelib/plugin/qplugin.qdoc
@@ -43,7 +43,7 @@
to the interface class called \a ClassName. The \a Identifier must
be unique. For example:
- \snippet tools/plugandpaint/interfaces.h 3
+ \snippet plugins/interfaces.h 3
This macro is normally used right after the class definition for
\a ClassName, in a header file. See the
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index 49f5ae4210..760c944c29 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -511,7 +511,8 @@ void **QListData::erase(void **xi)
Construct a list from the std::initializer_list specified by \a args.
- This constructor is only enabled if the compiler supports C++0x
+ This constructor is only enabled if the compiler supports C++11 initializer
+ lists.
*/
/*! \fn QList::~QList()
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 63028cff66..21a01c4867 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -736,13 +736,13 @@ QLocale::QLocale(QLocalePrivate &dd)
The separator can be either underscore or a minus sign.
If the string violates the locale format, or language is not
- a valid ISO 369 code, the "C" locale is used instead. If country
+ a valid ISO 639 code, the "C" locale is used instead. If country
is not present, or is not a valid ISO 3166 code, the most
appropriate country is chosen for the specified language.
The language, script and country codes are converted to their respective
\c Language, \c Script and \c Country enums. After this conversion is
- performed the constructor behaves exactly like QLocale(Country, Script,
+ performed, the constructor behaves exactly like QLocale(Country, Script,
Language).
This constructor is much slower than QLocale(Country, Script, Language).
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index eb8750838b..a3f6a0b075 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -4128,6 +4128,13 @@ QString::Data *QString::fromAscii_helper(const char *str, int size)
\sa toLatin1(), fromUtf8(), fromLocal8Bit()
*/
+/*!
+ \fn QString QString::fromLatin1(const QByteArray &str)
+ \overload
+ \since 5.0
+
+ Returns a QString initialized with the Latin-1 string \a str.
+*/
/*! \fn QString QString::fromLocal8Bit(const char *str, int size)
Returns a QString initialized with the first \a size characters
@@ -4140,6 +4147,14 @@ QString::Data *QString::fromAscii_helper(const char *str, int size)
\sa toLocal8Bit(), fromLatin1(), fromUtf8()
*/
+
+/*!
+ \fn QString QString::fromLocal8Bit(const QByteArray &str)
+ \overload
+ \since 5.0
+
+ Returns a QString initialized with the 8-bit string \a str.
+*/
QString QString::fromLocal8Bit_helper(const char *str, int size)
{
if (!str)
@@ -4172,6 +4187,15 @@ QString QString::fromLocal8Bit_helper(const char *str, int size)
\sa toAscii(), fromLatin1(), fromUtf8(), fromLocal8Bit()
*/
+/*!
+ \fn QString QString::fromAscii(const QByteArray &str)
+ \deprecated
+ \overload
+ \since 5.0
+
+ Returns a QString initialized with the string \a str.
+*/
+
/*! \fn QString QString::fromUtf8(const char *str, int size)
Returns a QString initialized with the first \a size bytes
of the UTF-8 string \a str.
@@ -4193,6 +4217,14 @@ QString QString::fromLocal8Bit_helper(const char *str, int size)
\sa toUtf8(), fromLatin1(), fromLocal8Bit()
*/
+
+/*!
+ \fn QString QString::fromUtf8(const QByteArray &str)
+ \overload
+ \since 5.0
+
+ Returns a QString initialized with the UTF-8 string \a str.
+*/
QString QString::fromUtf8_helper(const char *str, int size)
{
if (!str)
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp
index fa2e12b67b..a5559a181b 100644
--- a/src/corelib/tools/qstringlist.cpp
+++ b/src/corelib/tools/qstringlist.cpp
@@ -738,7 +738,8 @@ int QtPrivate::QStringList_removeDuplicates(QStringList *that)
Construct a list from a std::initializer_list given by \a args.
- This constructor is only enabled if the compiler supports C++0x
+ This constructor is only enabled if the compiler supports C++11 initializer
+ lists.
*/
diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp
index 725cf894c6..a443a6b4e8 100644
--- a/src/corelib/tools/qvector.cpp
+++ b/src/corelib/tools/qvector.cpp
@@ -230,7 +230,8 @@
Construct a vector from the std::initilizer_list given by \a args.
- This constructor is only enabled if the compiler supports C++0x
+ This constructor is only enabled if the compiler supports C++11 initializer
+ lists.
*/
diff --git a/src/gui/QtGui.dynlist b/src/gui/QtGui.dynlist
new file mode 100644
index 0000000000..7e15e37845
--- /dev/null
+++ b/src/gui/QtGui.dynlist
@@ -0,0 +1,5 @@
+{
+ extern "C++" {
+ "QGuiApplication::notify(QObject*, QEvent*)";
+ };
+};
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index f21c7a5ce7..14c267df70 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -35,3 +35,4 @@ include(itemmodels/itemmodels.pri)
QMAKE_LIBS += $$QMAKE_LIBS_GUI
+QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index 6b91ead666..1b36fa257a 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -946,6 +946,7 @@ void QIcon::setThemeName(const QString &name)
*/
QString QIcon::themeName()
{
+ QIconLoader::instance()->ensureInitialized();
return QIconLoader::instance()->themeName();
}
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index 554b31debf..8d5891aae2 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -239,8 +239,9 @@ QImage QRasterPlatformPixmap::toImage(const QRect &rect) const
return image;
QRect clipped = rect.intersected(QRect(0, 0, w, h));
- if (d % 8 == 0)
- return QImage(image.scanLine(clipped.y()) + clipped.x() * (d / 8),
+ const uint du = uint(d);
+ if ((du % 8 == 0) && (((uint(clipped.x()) * du)) % 32 == 0))
+ return QImage(image.scanLine(clipped.y()) + clipped.x() * (du / 8),
clipped.width(), clipped.height(),
image.bytesPerLine(), image.format());
else
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 51d1d76302..a1c9af45b8 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -928,6 +928,8 @@ static bool runningUnderDebugger()
void QGuiApplicationPrivate::init()
{
+ QCoreApplicationPrivate::is_app_running = false; // Starting up.
+
bool doGrabUnderDebugger = false;
QList<QByteArray> pluginList;
// Get command line params
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 6aff1cac9e..f09edfe88e 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1435,7 +1435,12 @@ void QWindow::resize(const QSize &newSize)
if (d->platformWindow) {
d->platformWindow->setGeometry(QRect(position(), newSize));
} else {
+ const QSize oldSize = d->geometry.size();
d->geometry.setSize(newSize);
+ if (newSize.width() != oldSize.width())
+ emit widthChanged(newSize.width());
+ if (newSize.height() != oldSize.height())
+ emit heightChanged(newSize.height());
}
}
diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp
index 1ba55aa7f1..7f53bec52f 100644
--- a/src/gui/painting/qcosmeticstroker.cpp
+++ b/src/gui/painting/qcosmeticstroker.cpp
@@ -290,11 +290,14 @@ void QCosmeticStroker::setup()
ppl = buffer->bytesPerLine()>>2;
}
+ // dashes are sensitive to clips, so we need to clip consistently when painting to the same device
+ QRect clipRect = strokeSelection & Dashed ? deviceRect : clip;
+
// setup FP clip bounds
- xmin = clip.left() - 1;
- xmax = clip.right() + 2;
- ymin = clip.top() - 1;
- ymax = clip.bottom() + 2;
+ xmin = clipRect.left() - 1;
+ xmax = clipRect.right() + 2;
+ ymin = clipRect.top() - 1;
+ ymax = clipRect.bottom() + 2;
lastPixel.x = -1;
}
@@ -580,6 +583,7 @@ void QCosmeticStroker::drawPath(const QVectorPath &path)
patternOffset = state->lastPen.dashOffset()*64;
lastPixel.x = -1;
+ const qreal *begin = points;
const qreal *end = points + 2*path.elementCount();
// handle closed path case
bool closed = path.hasImplicitClose() || (points[0] == end[-2] && points[1] == end[-1]);
@@ -589,6 +593,7 @@ void QCosmeticStroker::drawPath(const QVectorPath &path)
calculateLastPoint(p2.x(), p2.y(), p.x(), p.y());
}
+ bool fastPenAliased = (state->flags.fast_pen && !state->flags.antialiased);
points += 2;
while (points < end) {
QPointF p2 = QPointF(points[0], points[1]) * state->matrix;
@@ -596,9 +601,22 @@ void QCosmeticStroker::drawPath(const QVectorPath &path)
if (!closed && drawCaps && points == end - 2)
caps |= CapEnd;
+ QCosmeticStroker::Point last = this->lastPixel;
stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps);
- p = p2;
+ /* fix for gaps in polylines with fastpen and aliased in a sequence
+ of points with small distances: if current point p2 has been dropped
+ out, keep last non dropped point p. */
+ if (fastPenAliased) {
+ if (last.x != lastPixel.x || last.y != lastPixel.y ||
+ points == begin + 2 || points == end - 2 ) {
+ {
+ p = p2;
+ }
+ }
+ } else {
+ p = p2;
+ }
points += 2;
caps = NoCaps;
}
diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h
index fb37b70ba5..05c8a2b0cf 100644
--- a/src/gui/painting/qcosmeticstroker_p.h
+++ b/src/gui/painting/qcosmeticstroker_p.h
@@ -83,8 +83,9 @@ public:
HorizontalMask = 0xc
};
- QCosmeticStroker(QRasterPaintEngineState *s, const QRect &dr)
+ QCosmeticStroker(QRasterPaintEngineState *s, const QRect &dr, const QRect &dr_unclipped)
: state(s),
+ deviceRect(dr_unclipped),
clip(dr),
pattern(0),
reversePattern(0),
@@ -108,6 +109,7 @@ public:
QRasterPaintEngineState *state;
+ QRect deviceRect;
QRect clip;
// clip bounds in real
qreal xmin, xmax;
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 801a5689c1..a123c147a2 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -1054,20 +1054,20 @@ void QRasterPaintEnginePrivate::drawImage(const QPointF &pt,
void QRasterPaintEnginePrivate::systemStateChanged()
{
- QRect clipRect(0, 0,
+ deviceRectUnclipped = QRect(0, 0,
qMin(QT_RASTER_COORD_LIMIT, device->width()),
qMin(QT_RASTER_COORD_LIMIT, device->height()));
if (!systemClip.isEmpty()) {
- QRegion clippedDeviceRgn = systemClip & clipRect;
+ QRegion clippedDeviceRgn = systemClip & deviceRectUnclipped;
deviceRect = clippedDeviceRgn.boundingRect();
baseClip->setClipRegion(clippedDeviceRgn);
} else {
- deviceRect = clipRect;
+ deviceRect = deviceRectUnclipped;
baseClip->setClipRect(deviceRect);
}
#ifdef QT_DEBUG_DRAW
- qDebug() << "systemStateChanged" << this << "deviceRect" << deviceRect << clipRect << systemClip;
+ qDebug() << "systemStateChanged" << this << "deviceRect" << deviceRect << deviceRectUnclipped << systemClip;
#endif
exDeviceRect = deviceRect;
@@ -1529,7 +1529,7 @@ void QRasterPaintEngine::drawRects(const QRect *rects, int rectCount)
if (s->penData.blend) {
QRectVectorPath path;
if (s->flags.fast_pen) {
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
for (int i = 0; i < rectCount; ++i) {
path.set(rects[i]);
@@ -1576,7 +1576,7 @@ void QRasterPaintEngine::drawRects(const QRectF *rects, int rectCount)
if (s->penData.blend) {
QRectVectorPath path;
if (s->flags.fast_pen) {
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
for (int i = 0; i < rectCount; ++i) {
path.set(rects[i]);
@@ -1610,7 +1610,7 @@ void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen)
return;
if (s->flags.fast_pen) {
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
stroker.drawPath(path);
} else if (s->flags.non_complex_pen && path.shape() == QVectorPath::LinesHint) {
@@ -1953,7 +1953,7 @@ void QRasterPaintEngine::drawPolygon(const QPointF *points, int pointCount, Poly
if (s->penData.blend) {
QVectorPath vp((qreal *) points, pointCount, 0, QVectorPath::polygonFlags(mode));
if (s->flags.fast_pen) {
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
stroker.drawPath(vp);
} else {
@@ -2018,7 +2018,7 @@ void QRasterPaintEngine::drawPolygon(const QPoint *points, int pointCount, Polyg
QVectorPath vp((qreal *) fpoints.data(), pointCount, 0, QVectorPath::polygonFlags(mode));
if (s->flags.fast_pen) {
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
stroker.drawPath(vp);
} else {
@@ -3126,7 +3126,7 @@ void QRasterPaintEngine::drawPoints(const QPointF *points, int pointCount)
return;
}
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
stroker.drawPoints(points, pointCount);
}
@@ -3146,7 +3146,7 @@ void QRasterPaintEngine::drawPoints(const QPoint *points, int pointCount)
return;
}
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
stroker.drawPoints(points, pointCount);
}
@@ -3167,7 +3167,7 @@ void QRasterPaintEngine::drawLines(const QLine *lines, int lineCount)
return;
if (s->flags.fast_pen) {
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
for (int i=0; i<lineCount; ++i) {
const QLine &l = lines[i];
@@ -3239,7 +3239,7 @@ void QRasterPaintEngine::drawLines(const QLineF *lines, int lineCount)
if (!s->penData.blend)
return;
if (s->flags.fast_pen) {
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
for (int i=0; i<lineCount; ++i) {
QLineF line = lines[i];
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h
index e5bb0406ae..00a9ae750c 100644
--- a/src/gui/painting/qpaintengine_raster_p.h
+++ b/src/gui/painting/qpaintengine_raster_p.h
@@ -323,6 +323,7 @@ public:
#endif
QRect deviceRect;
+ QRect deviceRectUnclipped;
QStroker basicStroker;
QScopedPointer<QDashStroker> dashStroker;
diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp
index 8483a05d60..a6be7c6c78 100644
--- a/src/gui/painting/qrasterizer.cpp
+++ b/src/gui/painting/qrasterizer.cpp
@@ -891,6 +891,8 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width,
const Q16Dot16 rowHeight = qMin(yFP + Q16Dot16Factor, yPb)
- qMax(yFP, yPa);
const int y = Q16Dot16ToInt(yFP);
+ if (y > d->clipRect.bottom())
+ break;
for (int i = 0; i < n; ++i) {
buffer.addSpan(x[i], len[i], y,
Q16Dot16ToInt(Q16Dot16Multiply(rowHeight, coverage[i])));
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 81c9c676ba..6676d3daa6 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -109,7 +109,8 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
m_current_fontengine = fontEngine;
const int margin = m_current_fontengine->glyphMargin(m_type);
- const int paddingDoubled = glyphPadding() * 2;
+ const int padding = glyphPadding();
+ const int paddingDoubled = padding * 2;
bool supportsSubPixelPositions = fontEngine->supportsSubPixelPositions();
if (fontEngine->m_subPixelPositionCount == 0) {
@@ -122,6 +123,11 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
}
}
+ if (m_cx == 0 && m_cy == 0) {
+ m_cx = padding;
+ m_cy = padding;
+ }
+
QHash<GlyphAndSubPixelPosition, Coord> listItemCoordinates;
int rowHeight = 0;
@@ -203,21 +209,21 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
m_currentRowHeight = qMax(m_currentRowHeight, c.h + margin * 2);
- if (m_cx + c.w > requiredWidth) {
+ if (m_cx + c.w + padding > requiredWidth) {
int new_width = requiredWidth*2;
- while (new_width < m_cx + c.w)
+ while (new_width < m_cx + c.w + padding)
new_width *= 2;
if (new_width <= maxTextureWidth()) {
requiredWidth = new_width;
} else {
// no room on the current line, start new glyph strip
- m_cx = 0;
+ m_cx = padding;
m_cy += m_currentRowHeight + paddingDoubled;
m_currentRowHeight = c.h + margin * 2; // New row
}
}
- if (maxTextureHeight() > 0 && m_cy + c.h > maxTextureHeight()) {
+ if (maxTextureHeight() > 0 && m_cy + c.h + padding > maxTextureHeight()) {
// We can't make a cache of the required size, so we bail out
return false;
}
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 8486810299..19b4411b47 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -899,18 +899,28 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph,
info.yOff = 0;
if ((set && set->outline_drawing) || fetchMetricsOnly) {
- // If the advance doesn't fit in signed char, don't cache it
- if (qAbs(info.xOff) >= 128)
- return 0;
- g = new Glyph;
- g->data = 0;
- g->linearAdvance = slot->linearHoriAdvance >> 10;
int left = FLOOR(slot->metrics.horiBearingX);
int right = CEIL(slot->metrics.horiBearingX + slot->metrics.width);
int top = CEIL(slot->metrics.horiBearingY);
int bottom = FLOOR(slot->metrics.horiBearingY - slot->metrics.height);
- g->width = TRUNC(right-left);
- g->height = TRUNC(top-bottom);
+ int width = right-left;
+ int height = top-bottom;
+
+ // If any of the metrics are too large to fit, don't cache them
+ if (qAbs(info.xOff) >= 128
+ || qAbs(TRUNC(top)) >= 128
+ || TRUNC(width) >= 256
+ || TRUNC(height) >= 256
+ || qAbs(TRUNC(left)) >= 128
+ || qAbs(TRUNC(ROUND(slot->advance.x))) >= 128) {
+ return 0;
+ }
+
+ g = new Glyph;
+ g->data = 0;
+ g->linearAdvance = slot->linearHoriAdvance >> 10;
+ g->width = TRUNC(width);
+ g->height = TRUNC(height);
g->x = TRUNC(left);
g->y = TRUNC(top);
g->advance = TRUNC(ROUND(slot->advance.x));
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 931c52eab0..a38655d244 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -706,7 +706,7 @@ quint16 QNetworkProxy::port() const
If a QAbstractSocket or QTcpSocket has the
QNetworkProxy::DefaultProxy type, then the QNetworkProxy set with
this function is used. If you want more flexibility in determining
- which the proxy, use the QNetworkProxyFactory class.
+ which proxy is used, use the QNetworkProxyFactory class.
Setting a default proxy value with this function will override the
application proxy factory set with
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 4345804da8..def0470622 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -3810,7 +3810,7 @@ void QGLWidget::setFormat(const QGLFormat &format)
attributes that were requested.
*/
-/*
+/*!
\fn void QGLWidget::setContext(QGLContext *context,
const QGLContext* shareContext,
bool deleteOldContext)
@@ -3836,6 +3836,12 @@ void QGLWidget::setFormat(const QGLFormat &format)
to the old context (as returned by context()), and want to restore
that context later.
+ \note This function is obsolete and should no longer be used. If you were
+ using it to recreate the context for a QGLWidget, you should instead create a
+ new QGLWidget or use the QOpenGLContext API in conjunction with QWindow.
+ There is currently no officially supported way to substitute QGLWidget's
+ context with your own implementation of QGLContext.
+
\sa context(), isSharing()
*/
diff --git a/src/platformsupport/eglconvenience/eglconvenience.pri b/src/platformsupport/eglconvenience/eglconvenience.pri
index 22ade42816..506f4ab4ea 100644
--- a/src/platformsupport/eglconvenience/eglconvenience.pri
+++ b/src/platformsupport/eglconvenience/eglconvenience.pri
@@ -14,5 +14,6 @@ contains(QT_CONFIG,egl) {
SOURCES += \
$$PWD/qxlibeglintegration.cpp
}
+ CONFIG += egl
}
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
index 81acc161fe..4932087c5f 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
@@ -57,7 +57,13 @@ QEvdevKeyboardManager::QEvdevKeyboardManager(const QString &key, const QString &
{
Q_UNUSED(key);
- QStringList args = specification.split(QLatin1Char(':'));
+
+ QString spec = QString::fromLocal8Bit(qgetenv("QT_QPA_EVDEV_KEYBOARD_PARAMETERS"));
+
+ if (spec.isEmpty())
+ spec = specification;
+
+ QStringList args = spec.split(QLatin1Char(':'));
QStringList devices;
foreach (const QString &arg, args) {
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
index 415cffa4ae..6c430091c1 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
@@ -59,7 +59,12 @@ QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specif
{
Q_UNUSED(key);
- QStringList args = specification.split(QLatin1Char(':'));
+ QString spec = QString::fromLocal8Bit(qgetenv("QT_QPA_EVDEV_MOUSE_PARAMETERS"));
+
+ if (spec.isEmpty())
+ spec = specification;
+
+ QStringList args = spec.split(QLatin1Char(':'));
QStringList devices;
foreach (const QString &arg, args) {
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
index 8c86eee469..2c93da147e 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
@@ -159,7 +159,7 @@ static inline bool testBit(long bit, const long *array)
return (array[bit / LONG_BITS] >> bit % LONG_BITS) & 1;
}
-QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &spec, QObject *parent)
+QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification, QObject *parent)
: QObject(parent), m_notify(0), m_fd(-1), d(0)
#ifdef USE_MTDEV
, m_mtdev(0)
@@ -170,7 +170,13 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &spec, QObject
QString dev;
// only the first device argument is used for now
+ QString spec = QString::fromLocal8Bit(qgetenv("QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS"));
+
+ if (spec.isEmpty())
+ spec = specification;
+
QStringList args = spec.split(QLatin1Char(':'));
+
for (int i = 0; i < args.count(); ++i) {
if (args.at(i).startsWith(QLatin1String("/dev/"))) {
dev = args.at(i);
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch_p.h b/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
index ceb57bdf05..be7dbfba14 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
+++ b/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
@@ -61,7 +61,7 @@ class QEvdevTouchScreenHandler : public QObject
Q_OBJECT
public:
- explicit QEvdevTouchScreenHandler(const QString &spec = QString(), QObject *parent = 0);
+ explicit QEvdevTouchScreenHandler(const QString &specification = QString(), QObject *parent = 0);
~QEvdevTouchScreenHandler();
private slots:
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
index 55f94df45a..e756c375f3 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
@@ -202,6 +202,14 @@ static void cleanupCocoaApplicationDelegate()
if ([self canQuit]) {
if (!startedQuit) {
startedQuit = true;
+ // Close open windows. This is done in order to deliver de-expose
+ // events while the event loop is still running.
+ const QWindowList topLevels = QGuiApplication::topLevelWindows();
+ for (int i = 0; i < topLevels.size(); ++i) {
+ QWindow *window = topLevels.at(i);
+ topLevels.at(i)->close();
+ }
+
QGuiApplication::exit(0);
startedQuit = false;
}
diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm
index bdcad6f490..40cffab3c9 100644
--- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm
@@ -195,7 +195,7 @@ NSMenuItem *QCocoaMenuItem::sync()
QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader();
switch (m_role) {
case ApplicationSpecificRole:
- mergeItem = [loader appSpecificMenuItem];
+ mergeItem = [loader appSpecificMenuItem:reinterpret_cast<NSInteger>(this)];
break;
case AboutRole:
mergeItem = [loader aboutMenuItem];
diff --git a/src/plugins/platforms/cocoa/qcocoamenuloader.h b/src/plugins/platforms/cocoa/qcocoamenuloader.h
index f95f684e8c..a45ec0fa89 100644
--- a/src/plugins/platforms/cocoa/qcocoamenuloader.h
+++ b/src/plugins/platforms/cocoa/qcocoamenuloader.h
@@ -79,7 +79,7 @@
- (NSMenuItem *)aboutMenuItem;
- (NSMenuItem *)aboutQtMenuItem;
- (NSMenuItem *)hideMenuItem;
-- (NSMenuItem *)appSpecificMenuItem;
+- (NSMenuItem *)appSpecificMenuItem:(NSInteger)tag;
- (IBAction)terminate:(id)sender;
- (IBAction)orderFrontStandardAboutPanel:(id)sender;
- (IBAction)hideOtherApplications:(id)sender;
diff --git a/src/plugins/platforms/cocoa/qcocoamenuloader.mm b/src/plugins/platforms/cocoa/qcocoamenuloader.mm
index 2a9dcec64b..726fe5c6d2 100644
--- a/src/plugins/platforms/cocoa/qcocoamenuloader.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenuloader.mm
@@ -246,11 +246,17 @@ QT_END_NAMESPACE
return [[hideItem retain] autorelease];
}
-- (NSMenuItem *)appSpecificMenuItem
+- (NSMenuItem *)appSpecificMenuItem:(NSInteger)tag
{
+ NSMenuItem *item = [appMenu itemWithTag:tag];
+
+ // No reason to create the item if it already exists. See QTBUG-27202.
+ if (item)
+ return [[item retain] autorelease];
+
// Create an App-Specific menu item, insert it into the menu and return
// it as an autorelease item.
- NSMenuItem *item = [[NSMenuItem alloc] init];
+ item = [[NSMenuItem alloc] init];
NSInteger location;
if (lastAppSpecificItem == nil) {
diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
index 6f8d0fa22a..8b0c14a984 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
@@ -179,14 +179,14 @@ QHash<QPlatformTheme::Palette, QPalette*> qt_mac_createRolePalettes()
if (mac_widget_colors[i].active != 0) {
qc = qt_mac_colorForThemeTextColor(mac_widget_colors[i].active);
pal.setColor(QPalette::Active, QPalette::Text, qc);
+ pal.setColor(QPalette::Inactive, QPalette::Text, qc);
pal.setColor(QPalette::Active, QPalette::WindowText, qc);
+ pal.setColor(QPalette::Inactive, QPalette::WindowText, qc);
pal.setColor(QPalette::Active, QPalette::HighlightedText, qc);
+ pal.setColor(QPalette::Inactive, QPalette::HighlightedText, qc);
qc = qt_mac_colorForThemeTextColor(mac_widget_colors[i].inactive);
- pal.setColor(QPalette::Inactive, QPalette::Text, qc);
pal.setColor(QPalette::Disabled, QPalette::Text, qc);
- pal.setColor(QPalette::Inactive, QPalette::WindowText, qc);
pal.setColor(QPalette::Disabled, QPalette::WindowText, qc);
- pal.setColor(QPalette::Inactive, QPalette::HighlightedText, qc);
pal.setColor(QPalette::Disabled, QPalette::HighlightedText, qc);
}
if (mac_widget_colors[i].paletteRole == QPlatformTheme::MenuPalette) {
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index 84dcaad206..fdb3f4672f 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -108,6 +108,7 @@ public:
void setWindowIcon(const QIcon &icon);
void raise();
void lower();
+ bool isExposed() const;
void propagateSizeHints();
void setOpacity(qreal level);
void setMask(const QRegion &region);
@@ -146,6 +147,8 @@ public:
QCocoaMenuBar *menubar() const;
qreal devicePixelRatio() const;
+ void exposeWindow();
+ void obscureWindow();
protected:
// NSWindow handling. The QCocoaWindow/QNSView can either be displayed
// in an existing NSWindow or in one created by Qt.
@@ -182,6 +185,7 @@ public: // for QNSView
bool m_hasModalSession;
bool m_frameStrutEventsEnabled;
+ bool m_isExposed;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 5eab036661..9466b68bec 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -200,6 +200,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
, m_menubar(0)
, m_hasModalSession(false)
, m_frameStrutEventsEnabled(false)
+ , m_isExposed(false)
{
#ifdef QT_COCOA_ENABLE_WINDOW_DEBUG
qDebug() << "QCocoaWindow::QCocoaWindow" << this;
@@ -284,9 +285,12 @@ void QCocoaWindow::setVisible(bool visible)
}
- // Make sure the QWindow has a frame ready before we show the NSWindow.
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
- QWindowSystemInterface::flushWindowSystemEvents();
+ // This call is here to handle initial window show correctly:
+ // - top-level windows need to have backing store content ready when the
+ // window is shown, sendin the expose event here makes that more likely.
+ // - QNSViews for child windows are initialy not hidden and won't get the
+ // viewDidUnhide message.
+ exposeWindow();
if (m_nsWindow) {
// setWindowState might have been called while the window was hidden and
@@ -338,8 +342,6 @@ void QCocoaWindow::setVisible(bool visible)
} else {
[m_contentView setHidden:YES];
}
- if (!QCoreApplication::closingDown())
- QWindowSystemInterface::handleExposeEvent(window(), QRegion());
}
}
@@ -376,7 +378,7 @@ NSUInteger QCocoaWindow::windowStyleMask(Qt::WindowFlags flags)
NSInteger styleMask = NSBorderlessWindowMask;
if ((type & Qt::Popup) == Qt::Popup) {
- if (!windowIsPopupType(type))
+ if (!windowIsPopupType(type) && !(flags & Qt::FramelessWindowHint))
styleMask = (NSUtilityWindowMask | NSResizableWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask | NSTitledWindowMask);
} else {
@@ -491,6 +493,11 @@ void QCocoaWindow::lower()
[m_nsWindow orderBack: m_nsWindow];
}
+bool QCocoaWindow::isExposed() const
+{
+ return m_isExposed;
+}
+
void QCocoaWindow::propagateSizeHints()
{
QCocoaAutoReleasePool pool;
@@ -898,6 +905,22 @@ qreal QCocoaWindow::devicePixelRatio() const
}
}
+void QCocoaWindow::exposeWindow()
+{
+ if (!m_isExposed) {
+ m_isExposed = true;
+ QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry()));
+ }
+}
+
+void QCocoaWindow::obscureWindow()
+{
+ if (m_isExposed) {
+ m_isExposed = false;
+ QWindowSystemInterface::handleExposeEvent(window(), QRegion());
+ }
+}
+
QMargins QCocoaWindow::frameMargins() const
{
NSRect frameW = [m_nsWindow frame];
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index 5fe0861e0a..5ccea3c387 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -59,6 +59,7 @@ QT_END_NAMESPACE
QPoint m_backingStoreOffset;
CGImageRef m_maskImage;
uchar *m_maskData;
+ bool m_shouldInvalidateWindowShadow;
QWindow *m_window;
QCocoaWindow *m_platformWindow;
Qt::MouseButtons m_buttons;
@@ -76,9 +77,12 @@ QT_END_NAMESPACE
- (void)setQCocoaGLContext:(QCocoaGLContext *)context;
- (void)flushBackingStore:(QCocoaBackingStore *)backingStore region:(const QRegion &)region offset:(QPoint)offset;
- (void)setMaskRegion:(const QRegion *)region;
+- (void)invalidateWindowShadowIfNeeded;
- (void)drawRect:(NSRect)dirtyRect;
- (void)updateGeometry;
- (void)windowNotification : (NSNotification *) windowNotification;
+- (void)viewDidHide;
+- (void)viewDidUnhide;
- (BOOL)isFlipped;
- (BOOL)acceptsFirstResponder;
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 18714ddbae..e608731cc1 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -80,6 +80,7 @@ static QTouchDevice *touchDevice = 0;
m_backingStore = 0;
m_maskImage = 0;
m_maskData = 0;
+ m_shouldInvalidateWindowShadow = false;
m_window = 0;
m_buttons = Qt::NoButton;
m_sendKeyEvent = false;
@@ -266,10 +267,10 @@ static QTouchDevice *touchDevice = 0;
QWindowSystemInterface::handleWindowStateChanged(m_window, Qt::WindowMinimized);
} else if (notificationName == NSWindowDidDeminiaturizeNotification) {
QWindowSystemInterface::handleWindowStateChanged(m_window, Qt::WindowNoState);
- // Qt expects an expose event after restore/deminiaturize. This also needs
- // to be a non-synchronous event to make sure it gets processed after
- // the state change event sent above.
- QWindowSystemInterface::handleExposeEvent(m_window, QRegion(m_window->geometry()));
+ } else if ([notificationName isEqualToString: @"NSWindowDidOrderOffScreenNotification"]) {
+ m_platformWindow->obscureWindow();
+ } else if ([notificationName isEqualToString: @"NSWindowDidOrderOnScreenAndFinishAnimatingNotification"]) {
+ m_platformWindow->exposeWindow();
} else {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
@@ -285,6 +286,16 @@ static QTouchDevice *touchDevice = 0;
}
}
+- (void)viewDidHide
+{
+ m_platformWindow->obscureWindow();
+}
+
+- (void)viewDidUnhide
+{
+ m_platformWindow->exposeWindow();
+}
+
- (void) flushBackingStore:(QCocoaBackingStore *)backingStore region:(const QRegion &)region offset:(QPoint)offset
{
m_backingStore = backingStore;
@@ -300,13 +311,14 @@ static QTouchDevice *touchDevice = 0;
- (void) setMaskRegion:(const QRegion *)region
{
+ m_shouldInvalidateWindowShadow = true;
if (m_maskImage)
CGImageRelease(m_maskImage);
if (region->isEmpty()) {
m_maskImage = 0;
}
- const QRect &rect = qt_mac_toQRect([self frame]);
+ const QRect &rect = region->boundingRect();
QImage maskImage(rect.size(), QImage::Format_RGB888);
maskImage.fill(Qt::white);
QPainter p(&maskImage);
@@ -319,6 +331,14 @@ static QTouchDevice *touchDevice = 0;
m_maskImage = qt_mac_toCGImage(maskImage, true, &m_maskData);
}
+- (void)invalidateWindowShadowIfNeeded
+{
+ if (m_shouldInvalidateWindowShadow && m_platformWindow->m_nsWindow) {
+ [m_platformWindow->m_nsWindow invalidateShadow];
+ m_shouldInvalidateWindowShadow = false;
+ }
+}
+
- (void) drawRect:(NSRect)dirtyRect
{
if (!m_backingStore)
@@ -373,6 +393,8 @@ static QTouchDevice *touchDevice = 0;
CGContextRestoreGState(cgContext);
CGImageRelease(cleanImg);
CGImageRelease(subMask);
+
+ [self invalidateWindowShadowIfNeeded];
}
- (BOOL) isFlipped
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 20d312216a..5af6a9ec9d 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -186,6 +186,7 @@ QXcbWindow::QXcbWindow(QWindow *window)
, m_gravity(XCB_GRAVITY_STATIC)
, m_mapped(false)
, m_transparent(false)
+ , m_usingSyncProtocol(false)
, m_deferredActivation(false)
, m_embedded(false)
, m_netWmUserTimeWindow(XCB_NONE)
@@ -354,7 +355,9 @@ void QXcbWindow::create()
properties[propertyCount++] = atom(QXcbAtom::WM_TAKE_FOCUS);
properties[propertyCount++] = atom(QXcbAtom::_NET_WM_PING);
- if (m_screen->syncRequestSupported())
+ m_usingSyncProtocol = m_screen->syncRequestSupported() && window()->surfaceType() != QSurface::OpenGLSurface;
+
+ if (m_usingSyncProtocol)
properties[propertyCount++] = atom(QXcbAtom::_NET_WM_SYNC_REQUEST);
if (window()->flags() & Qt::WindowContextHelpButtonHint)
@@ -371,7 +374,7 @@ void QXcbWindow::create()
m_syncValue.hi = 0;
m_syncValue.lo = 0;
- if (m_screen->syncRequestSupported()) {
+ if (m_usingSyncProtocol) {
m_syncCounter = xcb_generate_id(xcb_connection());
Q_XCB_CALL(xcb_sync_create_counter(xcb_connection(), m_syncCounter, m_syncValue));
@@ -463,7 +466,7 @@ void QXcbWindow::destroy()
if (connection()->focusWindow() == this)
connection()->setFocusWindow(0);
- if (m_syncCounter && m_screen->syncRequestSupported())
+ if (m_syncCounter && m_usingSyncProtocol)
Q_XCB_CALL(xcb_sync_destroy_counter(xcb_connection(), m_syncCounter));
if (m_window) {
if (m_netWmUserTimeWindow) {
@@ -1824,7 +1827,7 @@ void QXcbWindow::handleFocusOutEvent(const xcb_focus_out_event_t *)
void QXcbWindow::updateSyncRequestCounter()
{
- if (m_screen->syncRequestSupported() && (m_syncValue.lo != 0 || m_syncValue.hi != 0)) {
+ if (m_usingSyncProtocol && (m_syncValue.lo != 0 || m_syncValue.hi != 0)) {
Q_XCB_CALL(xcb_sync_set_counter(xcb_connection(), m_syncCounter, m_syncValue));
xcb_flush(xcb_connection());
connection()->sync();
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index 1810a58c7b..f4bd2d96ff 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -189,6 +189,7 @@ private:
bool m_mapped;
bool m_transparent;
+ bool m_usingSyncProtocol;
bool m_deferredActivation;
bool m_deferredExpose;
bool m_configureNotifyPending;
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp
index a7f583c3b8..f0f1f64141 100644
--- a/src/sql/drivers/odbc/qsql_odbc.cpp
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp
@@ -1407,7 +1407,7 @@ bool QODBCResult::exec()
// (How many leading digits do we want to keep? With SQL Server 2005, this should be 3: 123000000)
int keep = (int)qPow(10.0, 9 - qMin(9, precision));
- dt->fraction /= keep * keep;
+ dt->fraction = (dt->fraction / keep) * keep;
}
r = SQLBindParameter(d->hStmt,
diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp
index 7d844fa1bd..4749b8b97b 100644
--- a/src/sql/drivers/psql/qsql_psql.cpp
+++ b/src/sql/drivers/psql/qsql_psql.cpp
@@ -124,7 +124,16 @@ inline void qPQfreemem(void *buffer)
class QPSQLDriverPrivate
{
public:
- QPSQLDriverPrivate(QPSQLDriver *qq) : q(qq), connection(0), isUtf8(false), pro(QPSQLDriver::Version6), sn(0), pendingNotifyCheck(false) {}
+ QPSQLDriverPrivate(QPSQLDriver *qq)
+ : q(qq),
+ connection(0),
+ isUtf8(false),
+ pro(QPSQLDriver::Version6),
+ sn(0),
+ pendingNotifyCheck(false),
+ hasBackslashEscape(false)
+ { }
+
QPSQLDriver *q;
PGconn *connection;
bool isUtf8;
@@ -132,6 +141,7 @@ public:
QSocketNotifier *sn;
QStringList seid;
mutable bool pendingNotifyCheck;
+ bool hasBackslashEscape;
void appendTables(QStringList &tl, QSqlQuery &t, QChar type);
PGresult * exec(const char * stmt) const;
@@ -139,6 +149,7 @@ public:
QPSQLDriver::Protocol getPSQLVersion();
bool setEncodingUtf8();
void setDatestyle();
+ void detectBackslashEscape();
};
void QPSQLDriverPrivate::appendTables(QStringList &tl, QSqlQuery &t, QChar type)
@@ -621,6 +632,23 @@ void QPSQLDriverPrivate::setDatestyle()
PQclear(result);
}
+void QPSQLDriverPrivate::detectBackslashEscape()
+{
+ // standard_conforming_strings option introduced in 8.2
+ // http://www.postgresql.org/docs/8.2/static/runtime-config-compatible.html
+ if (pro < QPSQLDriver::Version82) {
+ hasBackslashEscape = true;
+ } else {
+ hasBackslashEscape = false;
+ PGresult* result = exec(QLatin1Literal("SELECT '\\\\' x"));
+ int status = PQresultStatus(result);
+ if (status == PGRES_COMMAND_OK || status == PGRES_TUPLES_OK)
+ if (QString::fromLatin1(PQgetvalue(result, 0, 0)) == QLatin1Literal("\\"))
+ hasBackslashEscape = true;
+ PQclear(result);
+ }
+}
+
static QPSQLDriver::Protocol qMakePSQLVersion(int vMaj, int vMin)
{
switch (vMaj) {
@@ -732,6 +760,7 @@ QPSQLDriver::QPSQLDriver(PGconn *conn, QObject *parent)
d->connection = conn;
if (conn) {
d->pro = d->getPSQLVersion();
+ d->detectBackslashEscape();
setOpen(true);
setOpenError(false);
}
@@ -833,6 +862,7 @@ bool QPSQLDriver::open(const QString & db,
}
d->pro = d->getPSQLVersion();
+ d->detectBackslashEscape();
d->isUtf8 = d->setEncodingUtf8();
d->setDatestyle();
@@ -1218,12 +1248,10 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const
}
break;
case QVariant::String:
- {
- // Escape '\' characters
r = QSqlDriver::formatValue(field, trimStrings);
- r.replace(QLatin1String("\\"), QLatin1String("\\\\"));
+ if (d->hasBackslashEscape)
+ r.replace(QLatin1String("\\"), QLatin1String("\\\\"));
break;
- }
case QVariant::Bool:
if (field.value().toBool())
r = QLatin1String("TRUE");
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp
index 1af5d6274e..854705b3f6 100644
--- a/src/sql/drivers/sqlite/qsql_sqlite.cpp
+++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp
@@ -234,8 +234,7 @@ void QSQLiteResultPrivate::initColumns(bool emptyResultset)
}
}
- int dotIdx = colName.lastIndexOf(QLatin1Char('.'));
- QSqlField fld(colName.mid(dotIdx == -1 ? 0 : dotIdx + 1), fieldType);
+ QSqlField fld(colName, fieldType);
fld.setSqlType(stp);
rInf.append(fld);
}
diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp
index ff36064941..6095d0d2fa 100644
--- a/src/tools/qdoc/codemarker.cpp
+++ b/src/tools/qdoc/codemarker.cpp
@@ -382,7 +382,7 @@ QString CodeMarker::sortName(const Node *node, const QString* name)
(node->type() == Node::QmlSignal) ||
(node->type() == Node::QmlSignalHandler)) {
const FunctionNode* func = static_cast<const FunctionNode *>(node);
- return QLatin1Char('E') + func->signature();
+ return QLatin1Char('E') + func->name();
}
return QLatin1Char('B') + nodeName;
@@ -438,8 +438,7 @@ void CodeMarker::insert(FastSection &fastSection,
if (!irrelevant) {
if (!inheritedMember || style == Subpage) {
QString key = sortName(node);
- if (!fastSection.memberMap.contains(key))
- fastSection.memberMap.insert(key, node);
+ fastSection.memberMap.insertMulti(key, node);
}
else {
if (node->parent()->type() == Node::Class) {
diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp
index 50632f1da4..6c8b947c46 100644
--- a/src/tools/qdoc/main.cpp
+++ b/src/tools/qdoc/main.cpp
@@ -371,7 +371,9 @@ static void processQdocconfFile(const QString &fileName)
excludedDirsList = config.getCanonicalRelativePathList(CONFIG_EXCLUDEDIRS);
foreach (const QString &excludeDir, excludedDirsList) {
QString p = QDir::fromNativeSeparators(excludeDir);
- excludedDirs.insert(p);
+ QDir tmp(p);
+ if (tmp.exists())
+ excludedDirs.insert(p);
}
Generator::debugSegfault("Reading excludefiles");
diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp
index 058ab9a725..ffe1afe28b 100644
--- a/src/tools/qdoc/qmlvisitor.cpp
+++ b/src/tools/qdoc/qmlvisitor.cpp
@@ -88,6 +88,7 @@ QmlDocVisitor::QmlDocVisitor(const QString &filePath,
QSet<QString> &topics)
: nestingLevel(0)
{
+ lastEndOffset = 0;
this->filePath = filePath;
this->name = QFileInfo(filePath).baseName();
document = code;
@@ -117,21 +118,21 @@ QQmlJS::AST::SourceLocation QmlDocVisitor::precedingComment(quint32 offset) cons
QQmlJS::AST::SourceLocation loc = it.previous();
- if (loc.begin() <= lastEndOffset)
+ if (loc.begin() <= lastEndOffset) {
// Return if we reach the end of the preceding structure.
break;
-
- else if (usedComments.contains(loc.begin()))
+ }
+ else if (usedComments.contains(loc.begin())) {
// Return if we encounter a previously used comment.
break;
-
+ }
else if (loc.begin() > lastEndOffset && loc.end() < offset) {
-
// Only examine multiline comments in order to avoid snippet markers.
if (document.at(loc.offset - 1) == QLatin1Char('*')) {
QString comment = document.mid(loc.offset, loc.length);
- if (comment.startsWith(QLatin1Char('!')) || comment.startsWith(QLatin1Char('*')))
+ if (comment.startsWith(QLatin1Char('!')) || comment.startsWith(QLatin1Char('*'))) {
return loc;
+ }
}
}
}
@@ -165,8 +166,9 @@ bool QmlDocVisitor::applyDocumentation(QQmlJS::AST::SourceLocation location, Nod
node->setDoc(doc);
applyMetacommands(loc, node, doc);
usedComments.insert(loc.offset);
- if (doc.isEmpty())
+ if (doc.isEmpty()) {
return false;
+ }
return true;
}
Location codeLoc(filePath);
@@ -601,9 +603,15 @@ void QmlDocVisitor::endVisit(QQmlJS::AST::FunctionDeclaration* fd)
/*!
Begin the visit of the signal handler declaration \a sb, but only
if the nesting level is 1.
+
+ This visit is now deprecated. It has been decided to document
+ public signals. If a signal handler must be discussed in the
+ documentation, that discussion must take place in the comment
+ for the signal.
*/
-bool QmlDocVisitor::visit(QQmlJS::AST::UiScriptBinding* sb)
+bool QmlDocVisitor::visit(QQmlJS::AST::UiScriptBinding* )
{
+#if 0
if (nestingLevel > 1) {
return true;
}
@@ -617,6 +625,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiScriptBinding* sb)
}
}
}
+#endif
return true;
}
diff --git a/src/widgets/QtGui.dynlist b/src/widgets/QtGui.dynlist
deleted file mode 100644
index ea47f598a7..0000000000
--- a/src/widgets/QtGui.dynlist
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- extern "C++" {
- "qt_x11ft_convert_pattern(_FcPattern*, QByteArray*, int*, bool*)";
- "QApplication::x11ClientMessage(QWidget*, _XEvent*, bool)";
- "QApplication::notify(QObject*, QEvent*)";
- "QApplication::qwsEventFilter(QWSEvent*)";
- };
-};
diff --git a/src/widgets/QtWidgets.dynlist b/src/widgets/QtWidgets.dynlist
new file mode 100644
index 0000000000..94fd207dde
--- /dev/null
+++ b/src/widgets/QtWidgets.dynlist
@@ -0,0 +1,5 @@
+{
+ extern "C++" {
+ "QApplication::notify(QObject*, QEvent*)";
+ };
+};
diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp
index e8da8aa651..213aefe5f5 100644
--- a/src/widgets/dialogs/qfileinfogatherer.cpp
+++ b/src/widgets/dialogs/qfileinfogatherer.cpp
@@ -238,7 +238,7 @@ QExtendedInformation QFileInfoGatherer::getInfo(const QFileInfo &fileInfo) const
#endif
#ifdef Q_OS_WIN
- if (fileInfo.isSymLink() && m_resolveSymlinks) {
+ if (m_resolveSymlinks && fileInfo.isSymLink()) {
QFileInfo resolvedInfo(fileInfo.symLinkTarget());
resolvedInfo = resolvedInfo.canonicalFilePath();
if (resolvedInfo.exists()) {
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index 5bf5356d89..d91ac424e2 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -800,7 +800,7 @@ QString QFileSystemModelPrivate::name(const QModelIndex &index) const
if (!index.isValid())
return QString();
QFileSystemNode *dirNode = node(index);
- if (dirNode->isSymLink() && fileInfoGatherer.resolveSymlinks()) {
+ if (fileInfoGatherer.resolveSymlinks() && !resolvedSymLinks.isEmpty() && dirNode->isSymLink()) {
QString fullPath = QDir::fromNativeSeparators(filePath(index));
if (resolvedSymLinks.contains(fullPath))
return resolvedSymLinks[fullPath];
diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp
index ea474f14ab..f2c3c4702f 100644
--- a/src/widgets/itemviews/qitemdelegate.cpp
+++ b/src/widgets/itemviews/qitemdelegate.cpp
@@ -1299,6 +1299,9 @@ QStyleOptionViewItem QItemDelegate::setOptions(const QModelIndex &index,
if (value.canConvert<QBrush>())
opt.palette.setBrush(QPalette::Text, qvariant_cast<QBrush>(value));
+ // disable style animations for checkboxes etc. within itemviews (QTBUG-30146)
+ opt.styleObject = 0;
+
return opt;
}
diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp
index 2b3ea35cb0..e92ccc2455 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.cpp
+++ b/src/widgets/itemviews/qstyleditemdelegate.cpp
@@ -388,6 +388,9 @@ void QStyledItemDelegate::initStyleOption(QStyleOptionViewItem *option,
}
option->backgroundBrush = qvariant_cast<QBrush>(index.data(Qt::BackgroundRole));
+
+ // disable style animations for checkboxes etc. within itemviews (QTBUG-30146)
+ option->styleObject = 0;
}
/*!
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index eefacc4864..4adda2f151 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -1205,7 +1205,6 @@ void QMacStylePrivate::initHIThemePushButton(const QStyleOptionButton *btn,
const ThemeDrawState tds,
HIThemeButtonDrawInfo *bdi) const
{
- bool drawColorless = btn->palette.currentColorGroup() == QPalette::Active;
ThemeDrawState tdsModified = tds;
if (btn->state & QStyle::State_On)
tdsModified = kThemeStatePressed;
@@ -1213,7 +1212,7 @@ void QMacStylePrivate::initHIThemePushButton(const QStyleOptionButton *btn,
bdi->state = tdsModified;
bdi->value = kThemeButtonOff;
- if (drawColorless && tdsModified == kThemeStateInactive)
+ if (tds == kThemeStateInactive)
bdi->state = kThemeStateActive;
if (btn->state & QStyle::State_HasFocus)
bdi->adornment = kThemeAdornmentFocus;
@@ -1284,10 +1283,9 @@ void QMacStylePrivate::initComboboxBdi(const QStyleOptionComboBox *combo, HIThem
bdi->value = kThemeButtonOff;
if (combo->state & QStyle::State_HasFocus)
bdi->adornment = kThemeAdornmentFocus;
- bool drawColorless = combo->palette.currentColorGroup() == QPalette::Active && tds == kThemeStateInactive;
if (combo->activeSubControls & QStyle::SC_ComboBoxArrow)
bdi->state = kThemeStatePressed;
- else if (drawColorless)
+ else if (tds == kThemeStateInactive)
bdi->state = kThemeStateActive;
else
bdi->state = tds;
@@ -1608,8 +1606,6 @@ void QMacStylePrivate::getSliderInfo(QStyle::ComplexControl cc, const QStyleOpti
tdi->enableState = (slider->state & QStyle::State_Enabled) ? kThemeTrackActive
: kThemeTrackDisabled;
- if (!(slider->state & QStyle::State_Active))
- tdi->enableState = kThemeTrackInactive;
if (!isScrollbar) {
if (slider->state & QStyle::QStyle::State_HasFocus)
tdi->attributes |= kThemeTrackHasFocus;
@@ -3027,12 +3023,11 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
case PE_IndicatorViewItemCheck:
case PE_IndicatorRadioButton:
case PE_IndicatorCheckBox: {
- bool drawColorless = (!(opt->state & State_Active))
- && opt->palette.currentColorGroup() == QPalette::Active;
+ bool drawColorless = tds == kThemeStateInactive;
HIThemeButtonDrawInfo bdi;
bdi.version = qt_mac_hitheme_version;
bdi.state = tds;
- if (drawColorless && tds == kThemeStateInactive)
+ if (drawColorless)
bdi.state = kThemeStateActive;
bdi.adornment = kThemeDrawIndicatorOnly;
if (opt->state & State_HasFocus)
@@ -3554,13 +3549,10 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
int arrowYOffset = bdi.kind == kThemePushButton ? 4 : 2;
HIRect arrowRect = CGRectMake(ir.right() - mbi - QMacStylePrivate::PushButtonRightOffset,
ir.height() / 2 - arrowYOffset, mbi, ir.height() / 2);
- bool drawColorless = btn->palette.currentColorGroup() == QPalette::Active;
- if (drawColorless && tds == kThemeStateInactive)
- tds = kThemeStateActive;
HIThemePopupArrowDrawInfo pdi;
pdi.version = qt_mac_hitheme_version;
- pdi.state = tds;
+ pdi.state = tds == kThemeStateInactive ? kThemeStateActive : tds;
pdi.orientation = kThemeArrowDown;
if (arrowRect.size.width < 8.)
pdi.size = kThemeArrow5pt;
@@ -5118,7 +5110,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
HIThemeFrameDrawInfo fdi;
fdi.version = qt_mac_hitheme_version;
- fdi.state = tds;
+ fdi.state = tds == kThemeStateInactive ? kThemeStateActive : tds;
fdi.kind = kHIThemeFrameTextFieldSquare;
fdi.isFocused = false;
HIRect hirect = qt_hirectForQRect(lineeditRect);
@@ -5149,11 +5141,10 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
else if (sb->activeSubControls == SC_SpinBoxUp
&& (sb->state & State_Sunken))
tds = kThemeStatePressedUp;
- bdi.state = tds;
- if (!(sb->state & State_Active)
- && sb->palette.currentColorGroup() == QPalette::Active
- && tds == kThemeStateInactive)
+ if (tds == kThemeStateInactive)
bdi.state = kThemeStateActive;
+ else
+ bdi.state = tds;
bdi.value = kThemeButtonOff;
bdi.adornment = kThemeAdornmentNone;
@@ -5170,7 +5161,10 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
int(outRect.size.height - newRect.size.height));
newRect = qt_hirectForQRect(updown, off_rct);
- HIThemeDrawButton(&newRect, &bdi, cg, kHIThemeOrientationNormal, 0);
+ if (tds == kThemeStateInactive)
+ d->drawColorlessButton(newRect, &bdi, p, sb);
+ else
+ HIThemeDrawButton(&newRect, &bdi, cg, kHIThemeOrientationNormal, 0);
}
}
break;
@@ -5178,8 +5172,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
if (const QStyleOptionComboBox *combo = qstyleoption_cast<const QStyleOptionComboBox *>(opt)){
HIThemeButtonDrawInfo bdi;
d->initComboboxBdi(combo, &bdi, widget, d->getDrawState(opt->state));
- bool drawColorless = combo->palette.currentColorGroup() == QPalette::Active && tds == kThemeStateInactive;
- if (!drawColorless)
+ if (!tds == kThemeStateInactive)
QMacStylePrivate::drawCombobox(qt_hirectForQRect(combo->rect), bdi, p);
else
d->drawColorlessButton(qt_hirectForQRect(combo->rect), &bdi, p, opt);
diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro
index 6b9aa92fd9..18a4d57900 100644
--- a/src/widgets/widgets.pro
+++ b/src/widgets/widgets.pro
@@ -32,7 +32,7 @@ QMAKE_LIBS += $$QMAKE_LIBS_GUI
contains(DEFINES,QT_EVAL):include($$QT_SOURCE_TREE/src/corelib/eval.pri)
-QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist
+QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtWidgets.dynlist
# Code coverage with TestCocoon
# The following is required as extra compilers use $$QMAKE_CXX instead of $(CXX).