summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in4
-rw-r--r--src/corelib/Qt5CoreMacros.cmake25
-rw-r--r--src/corelib/global/qcompilerdetection.h6
-rw-r--r--src/corelib/global/qglobal.cpp8
-rw-r--r--src/corelib/global/qglobal.h2
-rw-r--r--src/corelib/io/qurlquery.h2
-rw-r--r--src/corelib/kernel/qmetaobject.cpp16
-rw-r--r--src/corelib/tools/qdatetime.cpp138
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp15
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp1
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp10
-rw-r--r--src/plugins/platforms/windows/qwindowsmime.cpp3
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.cpp1
-rw-r--r--src/tools/moc/main.cpp10
-rw-r--r--src/widgets/accessible/qaccessiblewidget.cpp19
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp16
-rw-r--r--src/widgets/util/qsystemtrayicon_win.cpp2
18 files changed, 172 insertions, 108 deletions
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index cd330f5d34..246aa8376e 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -18,6 +18,10 @@ list(APPEND Qt5Core_INCLUDE_DIRS \"$${CMAKE_DATA_DIR}mkspecs/default\")
!!ENDIF
!!IF !isEmpty(CMAKE_ADD_FPIE_FLAGS)
+# Targets using Qt need to use the POSITION_INDEPENDENT_CODE property. The
+# Qt5_POSITION_INDEPENDENT_CODE variable is used in the # qt5_use_module
+# macro to add it.
+set(Qt5_POSITION_INDEPENDENT_CODE True)
set(Qt5Core_EXECUTABLE_COMPILE_FLAGS \"-fPIE\")
!!ENDIF
diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake
index bc4c020826..cbd141aeb3 100644
--- a/src/corelib/Qt5CoreMacros.cmake
+++ b/src/corelib/Qt5CoreMacros.cmake
@@ -223,16 +223,21 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.8)
set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${Qt5${_module}_INCLUDE_DIRS})
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${Qt5${_module}_COMPILE_DEFINITIONS})
- # We can't just append to the COMPILE_FLAGS property. That creats a ';' separated list
- # which breaks the compile commmand line.
- # Ensure non-duplication here manually instead.
- get_property(_target_type TARGET ${_target} PROPERTY TYPE)
- if ("${_target_type}" STREQUAL "EXECUTABLE" AND Qt5${_module}_EXECUTABLE_COMPILE_FLAGS)
- get_target_property(_flags ${_target} COMPILE_FLAGS)
- string(FIND "${_flags}" "${Qt5${_module}_EXECUTABLE_COMPILE_FLAGS}" _find_result)
- if (NOT _find_result)
- set_target_properties(${_target} PROPERTIES COMPILE_FLAGS "${_flags} ${Qt5${_module}_EXECUTABLE_COMPILE_FLAGS}")
- endif()
+ if (Qt5_POSITION_INDEPENDENT_CODE)
+ set_property(TARGET ${_target} PROPERTY POSITION_INDEPENDENT_CODE ${Qt5_POSITION_INDEPENDENT_CODE})
+ if (CMAKE_VERSION VERSION_LESS 2.8.9)
+ # We can't just append to the COMPILE_FLAGS property. That creats a ';' separated list
+ # which breaks the compile commmand line.
+ # Ensure non-duplication here manually instead.
+ get_property(_target_type TARGET ${_target} PROPERTY TYPE)
+ if ("${_target_type}" STREQUAL "EXECUTABLE" AND Qt5${_module}_EXECUTABLE_COMPILE_FLAGS)
+ get_target_property(_flags ${_target} COMPILE_FLAGS)
+ string(FIND "${_flags}" "${Qt5${_module}_EXECUTABLE_COMPILE_FLAGS}" _find_result)
+ if (NOT _find_result)
+ set_target_properties(${_target} PROPERTIES COMPILE_FLAGS "${_flags} ${Qt5${_module}_EXECUTABLE_COMPILE_FLAGS}")
+ endif()
+ endif()
+ endif()
endif()
endforeach()
endfunction()
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 8621d8b400..68c8f73fe3 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -779,4 +779,10 @@
# endif
#endif
+#ifdef Q_COMPILER_RVALUE_REFS
+#define qMove(x) std::move(x)
+#else
+#define qMove(x) (x)
+#endif
+
#endif // QCOMPILERDETECTION_H
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 1bc02e0a70..900859141d 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -3006,4 +3006,12 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
{Debugging Techniques}
*/
+/*!
+ \macro qMove(x)
+ \relates <QtGlobal>
+
+ It expands to "std::move" if your compiler supports that C++11 function, or to nothing
+ otherwise.
+*/
+
QT_END_NAMESPACE
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 38655f1776..93bdd3c03a 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1193,7 +1193,7 @@ Q_CORE_EXPORT int qrand();
# define Q_OF_ELF
#endif
-#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && !defined(__PIC__)
+#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && !defined(__PIC__) && !defined(__PIE__)
# error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\
"Compile your code with -fPIC or -fPIE."
#endif
diff --git a/src/corelib/io/qurlquery.h b/src/corelib/io/qurlquery.h
index 4b9d104498..5939fd938a 100644
--- a/src/corelib/io/qurlquery.h
+++ b/src/corelib/io/qurlquery.h
@@ -145,7 +145,7 @@ inline void QUrl::removeAllEncodedQueryItems(const QByteArray &key)
inline void QUrl::setEncodedQueryItems(const QList<QPair<QByteArray, QByteArray> > &qry)
{
- QUrlQuery q(*this);
+ QUrlQuery q;
QList<QPair<QByteArray, QByteArray> >::ConstIterator it = qry.constBegin();
for ( ; it != qry.constEnd(); ++it)
q.addQueryItem(QString::fromUtf8(it->first), QString::fromUtf8(it->second));
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 417c49bc42..3e82de78ea 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -2056,20 +2056,8 @@ bool QMetaMethod::invoke(QObject *object,
const char *retType = typeName();
if (qstrcmp(returnValue.name(), retType) != 0) {
// normalize the return value as well
- // the trick here is to make a function signature out of the return type
- // so that we can call normalizedSignature() and avoid duplicating code
- QByteArray unnormalized;
- int len = qstrlen(returnValue.name());
-
- unnormalized.reserve(len + 3);
- unnormalized = "_("; // the function is called "_"
- unnormalized.append(returnValue.name());
- unnormalized.append(')');
-
- QByteArray normalized = QMetaObject::normalizedSignature(unnormalized.constData());
- normalized.truncate(normalized.length() - 1); // drop the ending ')'
-
- if (qstrcmp(normalized.constData() + 2, retType) != 0)
+ QByteArray normalized = QMetaObject::normalizedType(returnValue.name());
+ if (qstrcmp(normalized.constData(), retType) != 0)
return false;
}
}
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 021053fc6d..d2064b3e84 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -52,6 +52,7 @@
#include <locale.h>
#endif
+#include <cmath>
#include <time.h>
#ifdef Q_OS_WIN
# include <qt_windows.h>
@@ -767,9 +768,10 @@ QString QDate::toString(Qt::DateFormat f) const
{
if (year() < 0 || year() > 9999)
return QString();
+ QString year(QString::number(y).rightJustified(4, QLatin1Char('0')));
QString month(QString::number(m).rightJustified(2, QLatin1Char('0')));
QString day(QString::number(d).rightJustified(2, QLatin1Char('0')));
- return QString::number(y) + QLatin1Char('-') + month + QLatin1Char('-') + day;
+ return year + QLatin1Char('-') + month + QLatin1Char('-') + day;
}
}
}
@@ -1763,60 +1765,115 @@ int QTime::msecsTo(const QTime &t) const
*/
#ifndef QT_NO_DATESTRING
-/*!
- \fn QTime QTime::fromString(const QString &string, Qt::DateFormat format)
- Returns the time represented in the \a string as a QTime using the
- \a format given, or an invalid time if this is not possible.
+// These anonymous functions tidy up QDateTime::fromString()
+// and avoid confusion of reponsibility between it and QTime::fromString().
+namespace {
+inline bool isMidnight(int hour, int minute, int second, int msec)
+{
+ return hour == 24 && minute == 0 && second == 0 && msec == 0;
+}
- Note that fromString() uses a "C" locale encoded string to convert
- milliseconds to a float value. If the default locale is not "C",
- this may result in two conversion attempts (if the conversion
- fails for the default locale). This should be considered an
- implementation detail.
-*/
-QTime QTime::fromString(const QString& s, Qt::DateFormat f)
+QTime fromStringImpl(const QString &s, Qt::DateFormat f, bool &isMidnight24)
{
if (s.isEmpty()) {
- QTime t;
- t.mds = NullTime;
- return t;
+ // Return a null time.
+ return QTime();
}
switch (f) {
case Qt::SystemLocaleDate:
case Qt::SystemLocaleShortDate:
case Qt::SystemLocaleLongDate:
- return fromString(s, QLocale::system().timeFormat(f == Qt::SystemLocaleLongDate ? QLocale::LongFormat
- : QLocale::ShortFormat));
+ {
+ QLocale::FormatType formatType(Qt::SystemLocaleLongDate ? QLocale::LongFormat : QLocale::ShortFormat);
+ return QTime::fromString(s, QLocale::system().timeFormat(formatType));
+ }
case Qt::LocaleDate:
case Qt::DefaultLocaleShortDate:
case Qt::DefaultLocaleLongDate:
- return fromString(s, QLocale().timeFormat(f == Qt::DefaultLocaleLongDate ? QLocale::LongFormat
- : QLocale::ShortFormat));
- default:
- {
- bool ok = true;
- const int hour(s.mid(0, 2).toInt(&ok));
- if (!ok)
- return QTime();
- const int minute(s.mid(3, 2).toInt(&ok));
- if (!ok)
- return QTime();
- if (f == Qt::ISODate && s.size() == 5) {
+ {
+ QLocale::FormatType formatType(f == Qt::DefaultLocaleLongDate ? QLocale::LongFormat : QLocale::ShortFormat);
+ return QTime::fromString(s, QLocale().timeFormat(formatType));
+ }
+ case Qt::TextDate:
+ case Qt::ISODate:
+ {
+ bool ok = true;
+ const int hour(s.mid(0, 2).toInt(&ok));
+ if (!ok)
+ return QTime();
+ const int minute(s.mid(3, 2).toInt(&ok));
+ if (!ok)
+ return QTime();
+ if (f == Qt::ISODate) {
+ if (s.size() == 5) {
// Do not need to specify seconds if using ISO format.
return QTime(hour, minute, 0, 0);
+ } else if ((s.size() > 6 && s[5] == QLatin1Char(',')) || s[5] == QLatin1Char('.')) {
+ // Possibly specifying fraction of a minute.
+
+ // We only want 5 digits worth of fraction of minute. This follows the existing
+ // behaviour that determines how milliseconds are read; 4 millisecond digits are
+ // read and then rounded to 3. If we read at most 5 digits for fraction of minute,
+ // the maximum amount of millisecond digits it will expand to once converted to
+ // seconds is 4. E.g. 12:34,99999 will expand to 12:34:59.9994. The milliseconds
+ // will then be rounded up AND clamped to 999.
+ const QString minuteFractionStr(QLatin1String("0.") + s.mid(6, 5));
+ const float minuteFraction = minuteFractionStr.toFloat(&ok);
+ if (!ok)
+ return QTime();
+ const float secondWithMs = minuteFraction * 60;
+ const float second = std::floor(secondWithMs);
+ const float millisecond = 1000 * (secondWithMs - second);
+ const int millisecondRounded = qMin(qRound(millisecond), 999);
+
+ if (isMidnight(hour, minute, second, millisecondRounded)) {
+ isMidnight24 = true;
+ return QTime(0, 0, 0, 0);
+ }
+
+ return QTime(hour, minute, second, millisecondRounded);
+ }
+ }
+
+ const int second(s.mid(6, 2).toInt(&ok));
+ if (!ok)
+ return QTime();
+ const QString msec_s(QLatin1String("0.") + s.mid(9, 4));
+ const double msec(msec_s.toDouble(&ok));
+ if (!ok)
+ return QTime(hour, minute, second, 0);
+
+ if (f == Qt::ISODate) {
+ if (isMidnight(hour, minute, second, msec)) {
+ isMidnight24 = true;
+ return QTime(0, 0, 0, 0);
}
- const int second(s.mid(6, 2).toInt(&ok));
- if (!ok)
- return QTime();
- const QString msec_s(QLatin1String("0.") + s.mid(9, 4));
- const float msec(msec_s.toFloat(&ok));
- if (!ok)
- return QTime(hour, minute, second, 0);
- return QTime(hour, minute, second, qMin(qRound(msec * 1000.0), 999));
}
+ return QTime(hour, minute, second, qMin(qRound(msec * 1000.0), 999));
}
+ }
+}
+}
+
+
+/*!
+ \fn QTime QTime::fromString(const QString &string, Qt::DateFormat format)
+
+ Returns the time represented in the \a string as a QTime using the
+ \a format given, or an invalid time if this is not possible.
+
+ Note that fromString() uses a "C" locale encoded string to convert
+ milliseconds to a float value. If the default locale is not "C",
+ this may result in two conversion attempts (if the conversion
+ fails for the default locale). This should be considered an
+ implementation detail.
+*/
+QTime QTime::fromString(const QString& s, Qt::DateFormat f)
+{
+ bool unused;
+ return fromStringImpl(s, f, unused);
}
/*!
@@ -3245,11 +3302,12 @@ QDateTime QDateTime::fromString(const QString& s, Qt::DateFormat f)
}
}
- QTime time(QTime::fromString(tmp, Qt::ISODate));
- if (!time.isValid() && tmp == QString::fromLatin1("24:00:00")) {
+ bool isMidnight24 = false;
+ // Might be end of day (24:00, including variants), which QTime considers invalid.
+ QTime time(fromStringImpl(tmp, Qt::ISODate, isMidnight24));
+ if (isMidnight24) {
// ISO 8601 (section 4.2.3) says that 24:00 is equivalent to 00:00 the next day.
date = date.addDays(1);
- // Don't need to correct time since QDateTime constructor will do it for us.
}
return QDateTime(date, time, ts);
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index 4a1a499be0..46cd1cc0a7 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -512,7 +512,7 @@ public:
// special constructor that is enabled only if X derives from QObject
#if QT_DEPRECATED_SINCE(5, 0)
template <class X>
- QT_DEPRECATED inline QWeakPointer(X *ptr) : d(ptr ? d->getAndRef(ptr) : 0), value(ptr)
+ QT_DEPRECATED inline QWeakPointer(X *ptr) : d(ptr ? Data::getAndRef(ptr) : 0), value(ptr)
{ }
#endif
#endif
diff --git a/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp b/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp
index 56952dfb3e..64877d71ea 100644
--- a/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp
+++ b/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp
@@ -152,7 +152,6 @@ messageDebugEntries[] = {
{WM_KILLFOCUS, "WM_KILLFOCUS", true},
{WM_ENABLE, "WM_ENABLE", true},
{WM_SHOWWINDOW, "WM_SHOWWINDOW", true},
- {WM_GETMINMAXINFO, "WM_GETMINMAXINFO"},
{WM_WINDOWPOSCHANGING, "WM_WINDOWPOSCHANGING", true},
{WM_WINDOWPOSCHANGED, "WM_WINDOWPOSCHANGED", true},
{WM_SETCURSOR, "WM_SETCURSOR", false},
@@ -199,13 +198,13 @@ messageDebugEntries[] = {
{WM_RENDERALLFORMATS, "WM_RENDERALLFORMATS", true},
{WM_DESTROYCLIPBOARD, "WM_DESTROYCLIPBOARD", true},
{WM_CAPTURECHANGED, "WM_CAPTURECHANGED", true},
- {WM_IME_STARTCOMPOSITION, "WM_IME_STARTCOMPOSITION"},
- {WM_IME_COMPOSITION, "WM_IME_COMPOSITION"},
- {WM_IME_ENDCOMPOSITION, "WM_IME_ENDCOMPOSITION"},
- {WM_IME_NOTIFY, "WM_IME_NOTIFY"},
- {WM_IME_REQUEST, "WM_IME_REQUEST"},
- {WM_DISPLAYCHANGE, "WM_DISPLAYCHANGE"},
- {WM_THEMECHANGED , "WM_THEMECHANGED"}
+ {WM_IME_STARTCOMPOSITION, "WM_IME_STARTCOMPOSITION", true},
+ {WM_IME_COMPOSITION, "WM_IME_COMPOSITION", true},
+ {WM_IME_ENDCOMPOSITION, "WM_IME_ENDCOMPOSITION", true},
+ {WM_IME_NOTIFY, "WM_IME_NOTIFY", true},
+ {WM_IME_REQUEST, "WM_IME_REQUEST", true},
+ {WM_DISPLAYCHANGE, "WM_DISPLAYCHANGE", true},
+ {WM_THEMECHANGED, "WM_THEMECHANGED", true}
};
static inline const MessageDebugEntry *messageDebugEntry(UINT msg)
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index d31b059445..52950ecde5 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -398,6 +398,7 @@ QVariant QWindowsIntegration::styleHint(QPlatformIntegration::StyleHint hint) co
case QPlatformIntegration::KeyboardInputInterval:
case QPlatformIntegration::ShowIsFullScreen:
case QPlatformIntegration::PasswordMaskDelay:
+ case QPlatformIntegration::StartDragVelocity:
break; // Not implemented
case QPlatformIntegration::FontSmoothingGamma:
return QVariant(QWindowsFontDatabase::fontSmoothingGamma());
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index ec37c4bbef..d3a3468037 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -796,10 +796,10 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
// Get the modifier states (may be altered later, depending on key code)
int state = 0;
- state |= (nModifiers & ShiftAny ? Qt::ShiftModifier : 0);
- state |= (nModifiers & ControlAny ? Qt::ControlModifier : 0);
- state |= (nModifiers & AltAny ? Qt::AltModifier : 0);
- state |= (nModifiers & MetaAny ? Qt::MetaModifier : 0);
+ state |= (nModifiers & ShiftAny ? int(Qt::ShiftModifier) : 0);
+ state |= (nModifiers & ControlAny ? int(Qt::ControlModifier) : 0);
+ state |= (nModifiers & AltAny ? int(Qt::AltModifier) : 0);
+ state |= (nModifiers & MetaAny ? int(Qt::MetaModifier) : 0);
// Now we know enough to either have MapVirtualKey or our own keymap tell us if it's a deadkey
const bool isDeadKey = isADeadKey(msg.wParam, state)
@@ -920,7 +920,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
case Qt::Key_9:
state |= ((msg.wParam >= '0' && msg.wParam <= '9')
|| (msg.wParam >= VK_OEM_PLUS && msg.wParam <= VK_OEM_3))
- ? 0 : Qt::KeypadModifier;
+ ? 0 : int(Qt::KeypadModifier);
default:
if ((uint)msg.lParam == 0x004c0001 || (uint)msg.lParam == 0xc04c0001)
state |= Qt::KeypadModifier;
diff --git a/src/plugins/platforms/windows/qwindowsmime.cpp b/src/plugins/platforms/windows/qwindowsmime.cpp
index 963ee88423..3c87a3a18d 100644
--- a/src/plugins/platforms/windows/qwindowsmime.cpp
+++ b/src/plugins/platforms/windows/qwindowsmime.cpp
@@ -150,7 +150,8 @@ static bool qt_write_dibv5(QDataStream &s, QImage image)
//depth will be always 32
int bpl_bmp = image.width()*4;
- BMP_BITMAPV5HEADER bi ={0};
+ BMP_BITMAPV5HEADER bi;
+ ZeroMemory(&bi, sizeof(bi));
bi.bV5Size = sizeof(BMP_BITMAPV5HEADER);
bi.bV5Width = image.width();
bi.bV5Height = image.height();
diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
index e785fd9c72..0f69221f4c 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
@@ -543,6 +543,7 @@ void QXcbCursor::setPos(const QPoint &pos)
xcb_window_t root;
getPosAndRoot(conn, &root, 0);
xcb_warp_pointer(conn, XCB_NONE, root, 0, 0, 0, 0, pos.x(), pos.y());
+ xcb_flush(conn);
}
QT_END_NAMESPACE
diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp
index 08c180f44b..7db8737975 100644
--- a/src/tools/moc/main.cpp
+++ b/src/tools/moc/main.cpp
@@ -67,7 +67,15 @@ static QByteArray combinePath(const QByteArray &infile, const QByteArray &outfil
{
QFileInfo inFileInfo(QDir::current(), QFile::decodeName(infile));
QFileInfo outFileInfo(QDir::current(), QFile::decodeName(outfile));
- return QFile::encodeName(outFileInfo.dir().relativeFilePath(inFileInfo.filePath()));
+ const QByteArray relativePath = QFile::encodeName(outFileInfo.dir().relativeFilePath(inFileInfo.filePath()));
+#ifdef Q_OS_WIN
+ // It's a system limitation.
+ // It depends on the Win API function which is used by the program to open files.
+ // cl apparently uses the functions that have the MAX_PATH limitation.
+ if (outFileInfo.dir().absolutePath().length() + relativePath.length() + 1 >= 260)
+ return QFile::encodeName(inFileInfo.absoluteFilePath());
+#endif
+ return relativePath;
}
diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp
index 17ba14de39..bf3c187d62 100644
--- a/src/widgets/accessible/qaccessiblewidget.cpp
+++ b/src/widgets/accessible/qaccessiblewidget.cpp
@@ -377,25 +377,6 @@ QAccessibleWidget::relations(QAccessible::Relation match /*= QAccessible::AllRel
}
}
- if (match & QAccessible::Controller) {
- const QAccessible::Relation rel = QAccessible::Controller;
- QACConnectionObject *connectionObject = (QACConnectionObject*)object();
- const QObjectList senderList = connectionObject->senderList();
- for (int s = 0; s < senderList.count(); ++s) {
- QObject *sender = senderList.at(s);
- if (sender->isWidgetType() && sender != object()) {
- QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(sender);
- QACConnectionObject *connectionSender = (QACConnectionObject*)sender;
- QStringList senderPrimarySignals = static_cast<QAccessibleWidget*>(iface)->d->primarySignals;
- for (int sig = 0; sig < senderPrimarySignals.count(); ++sig) {
- const QByteArray strSignal = senderPrimarySignals.at(sig).toLatin1();
- if (connectionSender->isSender(object(), strSignal.constData()))
- rels.append(qMakePair(iface, rel));
- }
- }
- }
- }
-
if (match & QAccessible::Controlled) {
QObjectList allReceivers;
QACConnectionObject *connectionObject = (QACConnectionObject*)object();
diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp
index 6359ebfb09..4a4f109a82 100644
--- a/src/widgets/dialogs/qwizard_win.cpp
+++ b/src/widgets/dialogs/qwizard_win.cpp
@@ -306,7 +306,7 @@ bool QVistaHelper::setDWMTitleBar(TitleBarChangeType type)
{
bool value = false;
if (vistaState() == VistaAero) {
- WIZ_MARGINS mar = {0};
+ WIZ_MARGINS mar = {0, 0, 0, 0};
if (type == NormalTitleBar)
mar.cyTopHeight = 0;
else
@@ -639,13 +639,14 @@ bool QVistaHelper::eventFilter(QObject *obj, QEvent *event)
HFONT QVistaHelper::getCaptionFont(HANDLE hTheme)
{
- LOGFONT lf = {0};
+ LOGFONT lf = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { 0 } };
if (!hTheme)
pGetThemeSysFont(hTheme, WIZ_TMT_CAPTIONFONT, &lf);
else
{
- NONCLIENTMETRICS ncm = {sizeof(NONCLIENTMETRICS)};
+ NONCLIENTMETRICS ncm;
+ ncm.cbSize = sizeof(NONCLIENTMETRICS);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, false);
lf = ncm.lfMessageFont;
}
@@ -662,7 +663,8 @@ bool QVistaHelper::drawTitleText(QPainter *painter, const QString &text, const Q
// Set up a memory DC and bitmap that we'll draw into
HDC dcMem;
HBITMAP bmp;
- BITMAPINFO dib = {{0}};
+ BITMAPINFO dib;
+ ZeroMemory(&dib, sizeof(dib));
dcMem = CreateCompatibleDC(hdc);
dib.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
@@ -680,7 +682,8 @@ bool QVistaHelper::drawTitleText(QPainter *painter, const QString &text, const Q
HFONT hOldFont = (HFONT)SelectObject(dcMem, (HGDIOBJ) hCaptionFont);
// Draw the text!
- WIZ_DTTOPTS dto = { sizeof(WIZ_DTTOPTS) };
+ WIZ_DTTOPTS dto;
+ dto.dwSize = sizeof(WIZ_DTTOPTS);
const UINT uFormat = WIZ_DT_SINGLELINE|WIZ_DT_CENTER|WIZ_DT_VCENTER|WIZ_DT_NOPREFIX;
RECT rctext ={0,0, rect.width(), rect.height()};
@@ -708,7 +711,8 @@ bool QVistaHelper::drawBlackRect(const QRect &rect, HDC hdc)
// Set up a memory DC and bitmap that we'll draw into
HDC dcMem;
HBITMAP bmp;
- BITMAPINFO dib = {{0}};
+ BITMAPINFO dib;
+ ZeroMemory(&dib, sizeof(dib));
dcMem = CreateCompatibleDC(hdc);
dib.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
diff --git a/src/widgets/util/qsystemtrayicon_win.cpp b/src/widgets/util/qsystemtrayicon_win.cpp
index 731b547e2a..e81a8eee93 100644
--- a/src/widgets/util/qsystemtrayicon_win.cpp
+++ b/src/widgets/util/qsystemtrayicon_win.cpp
@@ -466,7 +466,7 @@ QRect QSystemTrayIconSys::findIconGeometry(const int iconId)
if (currentIconHandle == m_hwnd &&
currentIconId == iconId && !isHidden) {
SendMessage(trayHandle, TB_GETITEMRECT, toolbarButton , (LPARAM)data);
- RECT iconRect = {0, 0};
+ RECT iconRect = {0, 0, 0, 0};
if(ReadProcessMemory(trayProcess, data, &iconRect, sizeof(RECT), &numBytes)) {
MapWindowPoints(trayHandle, NULL, (LPPOINT)&iconRect, 2);
QRect geometry(iconRect.left + 1, iconRect.top + 1,