diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/itemmodels/qsortfilterproxymodel.cpp | 1 | ||||
-rw-r--r-- | src/corelib/itemmodels/qsortfilterproxymodel.h | 7 | ||||
-rw-r--r-- | src/corelib/kernel/qtimer.cpp | 10 | ||||
-rw-r--r-- | src/corelib/kernel/qtimer.h | 8 | ||||
-rw-r--r-- | src/corelib/plugin/qlibrary_unix.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qbytearray.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qstring.cpp | 13 | ||||
-rw-r--r-- | src/corelib/tools/qstring.h | 9 | ||||
-rw-r--r-- | src/corelib/tools/qstringlist.cpp | 14 | ||||
-rw-r--r-- | src/corelib/tools/qstringlist.h | 12 | ||||
-rw-r--r-- | src/gui/image/qpnghandler.cpp | 37 | ||||
-rw-r--r-- | src/plugins/printsupport/windows/qwindowsprintdevice.cpp | 4 | ||||
-rw-r--r-- | src/sql/models/qsqltablemodel.cpp | 4 | ||||
-rw-r--r-- | src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp | 2 | ||||
-rw-r--r-- | src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsstyle.cpp | 14 |
16 files changed, 98 insertions, 43 deletions
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp index 6b59b0723b..31b9bbc990 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp +++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp @@ -43,7 +43,6 @@ #include <qdebug.h> #include <qdatetime.h> #include <qpair.h> -#include <qregularexpression.h> #include <qstringlist.h> #include <private/qabstractitemmodel_p.h> #include <private/qabstractproxymodel_p.h> diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.h b/src/corelib/itemmodels/qsortfilterproxymodel.h index 0b7c69f37d..1304a95d13 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.h +++ b/src/corelib/itemmodels/qsortfilterproxymodel.h @@ -42,7 +42,10 @@ #include <QtCore/qabstractproxymodel.h> #include <QtCore/qregexp.h> -#include <QtCore/qregularexpression.h> + +#if QT_CONFIG(regularexpression) +# include <QtCore/qregularexpression.h> +#endif QT_REQUIRE_CONFIG(sortfilterproxymodel); @@ -87,8 +90,10 @@ public: QRegExp filterRegExp() const; void setFilterRegExp(const QRegExp ®Exp); +#if QT_CONFIG(regularexpression) QRegularExpression filterRegularExpression() const; void setFilterRegularExpression(const QRegularExpression ®ularExpression); +#endif int filterKeyColumn() const; void setFilterKeyColumn(int column); diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp index d8d520ff58..90f29aa630 100644 --- a/src/corelib/kernel/qtimer.cpp +++ b/src/corelib/kernel/qtimer.cpp @@ -571,7 +571,7 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv */ /*! - \fn template<typename Functor> QMetaObject::Connection connectTo(Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection) + \fn template<typename Functor> QMetaObject::Connection callOnTimeout(Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection) \since 5.12 \overload @@ -585,9 +585,9 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv */ /*! - \fn template<typename Functor> QMetaObject::Connection connectTo(QObject *context, Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection) + \fn template<typename Functor> QMetaObject::Connection callOnTimeout(QObject *context, Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection) \since 5.12 - \overload connectTo() + \overload callOnTimeout() Creates a connection from the timeout() signal to \a functor to be placed in a specific event loop of \a context, and returns a handle to the connection. @@ -599,9 +599,9 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv */ /*! - \fn template<typename PointerToMemberFunction> QMetaObject::Connection connectTo(QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType connectionType = Qt::AutoConnection) + \fn template<typename PointerToMemberFunction> QMetaObject::Connection callOnTimeout(QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType connectionType = Qt::AutoConnection) \since 5.12 - \overload connectTo() + \overload callOnTimeout() Creates a connection from the timeout() signal to the \a method in the \a receiver object. Returns a handle to the connection. diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h index f5c04c7f70..66f317c567 100644 --- a/src/corelib/kernel/qtimer.h +++ b/src/corelib/kernel/qtimer.h @@ -97,11 +97,11 @@ public: template<typename Functor, int> static void singleShot(int msec, Qt::TimerType timerType, const QObject *context, Functor functor); template <typename Functor> - QMetaObject::Connection connectTo(Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection); + QMetaObject::Connection callOnTimeout(Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection); template <typename Functor> - QMetaObject::Connection connectTo(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection); + QMetaObject::Connection callOnTimeout(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection); template <typename PointerToMemberFunction> - QMetaObject::Connection connectTo(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection); + QMetaObject::Connection callOnTimeout(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection); #else // singleShot to a QObject slot template <typename Duration, typename Func1> @@ -160,7 +160,7 @@ public: } template <typename ... Args> - QMetaObject::Connection connectTo(Args && ...args) + QMetaObject::Connection callOnTimeout(Args && ...args) { return QObject::connect(this, &QTimer::timeout, std::forward<Args>(args)... ); } diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp index 851b9ff82f..e03814984c 100644 --- a/src/corelib/plugin/qlibrary_unix.cpp +++ b/src/corelib/plugin/qlibrary_unix.cpp @@ -157,7 +157,7 @@ bool QLibraryPrivate::load_sys() // Do not unload the library during dlclose(). Consequently, the // library's specific static variables are not reinitialized if the // library is reloaded with dlopen() at a later time. -#ifdef RTLD_NODELETE +#if defined(RTLD_NODELETE) && !defined(Q_OS_ANDROID) if (loadHints & QLibrary::PreventUnloadHint) { dlFlags |= RTLD_NODELETE; } diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index d8aadaa744..1e591d6d69 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -432,7 +432,7 @@ int qstricmp(const char *str1, const char *str2) return int(Incomplete); }; -#ifdef __SSE4_1__ +#if defined(__SSE4_1__) && !(defined(__SANITIZE_ADDRESS__) || QT_HAS_FEATURE(address_sanitizer)) enum { PageSize = 4096, PageMask = PageSize - 1 }; const __m128i zero = _mm_setzero_si128(); forever { diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 6030d7058c..b3ed62982e 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -6225,7 +6225,17 @@ QString& QString::fill(QChar ch, int size) sensitivity setting \a cs. */ +/*! + \fn int QString::compare(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const + + \since 5.12 + \overload compare() + Performs a comparison of this with \a s, using the case + sensitivity setting \a cs. +*/ + +#if QT_STRINGVIEW_LEVEL < 2 /*! \overload compare() \since 4.2 @@ -6241,6 +6251,7 @@ int QString::compare(const QString &other, Qt::CaseSensitivity cs) const Q_DECL_ { return qt_compare_strings(*this, other, cs); } +#endif /*! \internal @@ -6267,6 +6278,7 @@ int QString::compare(QLatin1String other, Qt::CaseSensitivity cs) const Q_DECL_N return qt_compare_strings(*this, other, cs); } +#if QT_STRINGVIEW_LEVEL < 2 /*! \fn int QString::compare(const QStringRef &ref, Qt::CaseSensitivity cs = Qt::CaseSensitive) const \overload compare() @@ -6275,6 +6287,7 @@ int QString::compare(QLatin1String other, Qt::CaseSensitivity cs) const Q_DECL_N an integer less than, equal to, or greater than zero if the string is less than, equal to, or greater than \a ref. */ +#endif /*! \internal diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 77b562ec5b..da76601e88 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -608,8 +608,12 @@ public: QString &setUnicode(const QChar *unicode, int size); inline QString &setUtf16(const ushort *utf16, int size); +#if QT_STRINGVIEW_LEVEL < 2 int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW; + inline int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW; +#endif int compare(QLatin1String other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW; + inline int compare(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW; static inline int compare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW @@ -622,7 +626,6 @@ public: Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW { return -s2.compare(s1, cs); } - inline int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW; static int compare(const QString &s1, const QStringRef &s2, Qt::CaseSensitivity = Qt::CaseSensitive) Q_DECL_NOTHROW; @@ -1636,8 +1639,12 @@ inline bool operator> (const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW inline bool operator<=(const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs >= lhs; } inline bool operator>=(const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs <= lhs; } +#if QT_STRINGVIEW_LEVEL < 2 inline int QString::compare(const QStringRef &s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW { return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); } +#endif +inline int QString::compare(QStringView s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW +{ return -s.compare(*this, cs); } inline int QString::compare(const QString &s1, const QStringRef &s2, Qt::CaseSensitivity cs) Q_DECL_NOTHROW { return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); } inline int QStringRef::compare(const QString &s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp index 712ba74716..c85a4f41dd 100644 --- a/src/corelib/tools/qstringlist.cpp +++ b/src/corelib/tools/qstringlist.cpp @@ -323,6 +323,7 @@ static bool stringList_contains(const QStringList &stringList, const T &str, Qt: } +#if QT_STRINGVIEW_LEVEL < 2 /*! \fn bool QStringList::contains(const QString &str, Qt::CaseSensitivity cs) const @@ -332,7 +333,18 @@ static bool stringList_contains(const QStringList &stringList, const T &str, Qt: \sa indexOf(), lastIndexOf(), QString::contains() */ -bool QtPrivate::QStringList_contains(const QStringList *that, const QString &str, +#endif + +/*! + \fn bool QStringList::contains(QStringView str, Qt::CaseSensitivity cs) const + \overload + \since 5.12 + + Returns \c true if the list contains the string \a str; otherwise + returns \c false. The search is case insensitive if \a cs is + Qt::CaseInsensitive; the search is case sensitive by default. + */ +bool QtPrivate::QStringList_contains(const QStringList *that, QStringView str, Qt::CaseSensitivity cs) { return stringList_contains(*that, str, cs); diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h index e58445b8c0..b04b7c0bc8 100644 --- a/src/corelib/tools/qstringlist.h +++ b/src/corelib/tools/qstringlist.h @@ -117,8 +117,11 @@ public: { QList<QString>::operator=(std::move(other)); return *this; } #endif +#if QT_STRINGVIEW_LEVEL < 2 inline bool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; +#endif inline bool contains(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; + inline bool contains(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; inline QStringList operator+(const QStringList &other) const { QStringList n = *this; n += other; return n; } @@ -161,7 +164,7 @@ namespace QtPrivate { QStringList Q_CORE_EXPORT QStringList_filter(const QStringList *that, const QString &str, Qt::CaseSensitivity cs); - bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, const QString &str, Qt::CaseSensitivity cs); + bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, QStringView str, Qt::CaseSensitivity cs); bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, QLatin1String str, Qt::CaseSensitivity cs); void Q_CORE_EXPORT QStringList_replaceInStrings(QStringList *that, const QString &before, const QString &after, Qt::CaseSensitivity cs); @@ -213,16 +216,23 @@ inline QStringList QListSpecialMethods<QString>::filter(const QString &str, Qt:: return QtPrivate::QStringList_filter(self(), str, cs); } +#if QT_STRINGVIEW_LEVEL < 2 inline bool QStringList::contains(const QString &str, Qt::CaseSensitivity cs) const { return QtPrivate::QStringList_contains(this, str, cs); } +#endif inline bool QStringList::contains(QLatin1String str, Qt::CaseSensitivity cs) const { return QtPrivate::QStringList_contains(this, str, cs); } +inline bool QStringList::contains(QStringView str, Qt::CaseSensitivity cs) const +{ + return QtPrivate::QStringList_contains(this, str, cs); +} + inline QStringList &QListSpecialMethods<QString>::replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs) { QtPrivate::QStringList_replaceInStrings(self(), before, after, cs); diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index 94479b4f8e..242d8cd63b 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -245,7 +245,7 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scal png_set_interlace_handling(png_ptr); if (color_type == PNG_COLOR_TYPE_GRAY) { - // Black & White or 8-bit grayscale + // Black & White or grayscale if (bit_depth == 1 && png_get_channels(png_ptr, info_ptr) == 1) { png_set_invert_mono(png_ptr); png_read_update_info(png_ptr, info_ptr); @@ -266,19 +266,22 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scal else if (g == 1) image.setColor(0, qRgba(255, 255, 255, 0)); } - } else if (bit_depth == 16 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { - png_set_expand(png_ptr); - png_set_strip_16(png_ptr); + } else if (bit_depth == 16) { + bool hasMask = png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS); + if (!hasMask) + png_set_filler(png_ptr, 0xffff, PNG_FILLER_AFTER); + else + png_set_expand(png_ptr); png_set_gray_to_rgb(png_ptr); - if (image.size() != QSize(width, height) || image.format() != QImage::Format_ARGB32) { - image = QImage(width, height, QImage::Format_ARGB32); + QImage::Format format = hasMask ? QImage::Format_RGBA64 : QImage::Format_RGBX64; + if (image.size() != QSize(width, height) || image.format() != format) { + image = QImage(width, height, format); if (image.isNull()) return; } - if (QSysInfo::ByteOrder == QSysInfo::BigEndian) - png_set_swap_alpha(png_ptr); - png_read_update_info(png_ptr, info_ptr); + if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) + png_set_swap(png_ptr); } else if (bit_depth == 8 && !png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { png_set_expand(png_ptr); if (image.size() != QSize(width, height) || image.format() != QImage::Format_Grayscale8) { @@ -289,9 +292,7 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scal png_read_update_info(png_ptr, info_ptr); } else { - if (bit_depth == 16) - png_set_strip_16(png_ptr); - else if (bit_depth < 8) + if (bit_depth < 8) png_set_packing(png_ptr); int ncols = bit_depth < 8 ? 1 << bit_depth : 256; png_read_update_info(png_ptr, info_ptr); @@ -356,12 +357,14 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scal if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) { png_set_bgr(png_ptr); } - } else if (bit_depth == 16 && (color_type & PNG_COLOR_MASK_COLOR)) { + } else if (bit_depth == 16 && !(color_type & PNG_COLOR_MASK_PALETTE)) { QImage::Format format = QImage::Format_RGBA64; if (!(color_type & PNG_COLOR_MASK_ALPHA) && !png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { png_set_filler(png_ptr, 0xffff, PNG_FILLER_AFTER); format = QImage::Format_RGBX64; } + if (!(color_type & PNG_COLOR_MASK_COLOR)) + png_set_gray_to_rgb(png_ptr); if (image.size() != QSize(width, height) || image.format() != format) { image = QImage(width, height, format); if (image.isNull()) @@ -680,11 +683,11 @@ QImage::Format QPngHandlerPrivate::readImageFormat() int num_palette; png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); if (color_type == PNG_COLOR_TYPE_GRAY) { - // Black & White or 8-bit grayscale + // Black & White or grayscale if (bit_depth == 1 && png_get_channels(png_ptr, info_ptr) == 1) { format = QImage::Format_Mono; - } else if (bit_depth == 16 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { - format = QImage::Format_ARGB32; + } else if (bit_depth == 16) { + format = png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ? QImage::Format_RGBA64 : QImage::Format_RGBX64; } else if (bit_depth == 8 && !png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { format = QImage::Format_Grayscale8; } else { @@ -696,7 +699,7 @@ QImage::Format QPngHandlerPrivate::readImageFormat() { // 1-bit and 8-bit color format = bit_depth == 1 ? QImage::Format_Mono : QImage::Format_Indexed8; - } else if (bit_depth == 16 && (color_type & PNG_COLOR_MASK_COLOR)) { + } else if (bit_depth == 16 && !(color_type & PNG_COLOR_MASK_PALETTE)) { format = QImage::Format_RGBA64; if (!(color_type & PNG_COLOR_MASK_ALPHA) && !png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) format = QImage::Format_RGBX64; diff --git a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp index 071bc01192..f01e93d611 100644 --- a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp +++ b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp @@ -210,7 +210,7 @@ void QWindowsPrintDevice::loadPageSizes() const && DeviceCapabilities((LPWSTR)m_id.utf16(), NULL, DC_PAPERS, NULL, NULL) == paperCount) { QScopedArrayPointer<wchar_t> paperNames(new wchar_t[paperCount*64]); - QScopedArrayPointer<POINT> winSizes(new POINT[paperCount*sizeof(POINT)]); + QScopedArrayPointer<POINT> winSizes(new POINT[paperCount]); QScopedArrayPointer<wchar_t> papers(new wchar_t[paperCount]); // Get the details and match the default paper size @@ -356,7 +356,7 @@ void QWindowsPrintDevice::loadInputSlots() const if (int(binCount) > 0 && DeviceCapabilities(printerId, nullptr, DC_BINNAMES, nullptr, nullptr) == binCount) { - QScopedArrayPointer<WORD> bins(new WORD[binCount*sizeof(WORD)]); + QScopedArrayPointer<WORD> bins(new WORD[binCount]); QScopedArrayPointer<wchar_t> binNames(new wchar_t[binCount*24]); // Get the details and match the default paper size diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index 865f76c73a..a33f76838f 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -565,6 +565,10 @@ bool QSqlTableModel::isDirty(const QModelIndex &index) const Returns \c true if the value could be set or false on error, for example if \a index is out of bounds. + Returns \c false if the role is not Qt::EditRole. To set data + for roles other than EditRole, either use a custom proxy model + or subclass QSqlTableModel. + \sa editStrategy(), data(), submit(), submitAll(), revertRow() */ bool QSqlTableModel::setData(const QModelIndex &index, const QVariant &value, int role) diff --git a/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp b/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp index c76983200e..2115a14adf 100644 --- a/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp +++ b/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp @@ -62,7 +62,7 @@ static const char docTypeHeader[] = #define PROGRAMNAME "qdbuscpp2xml" #define PROGRAMVERSION "0.2" -#define PROGRAMCOPYRIGHT "Copyright (C) 2017 The Qt Company Ltd." +#define PROGRAMCOPYRIGHT "Copyright (C) 2018 The Qt Company Ltd." static QString outputFile; static int flags; diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp index bbe738dadb..5b76502c94 100644 --- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp +++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp @@ -46,7 +46,7 @@ #define PROGRAMNAME "qdbusxml2cpp" #define PROGRAMVERSION "0.8" -#define PROGRAMCOPYRIGHT "Copyright (C) 2017 The Qt Company Ltd." +#define PROGRAMCOPYRIGHT "Copyright (C) 2018 The Qt Company Ltd." #define ANNOTATION_NO_WAIT "org.freedesktop.DBus.Method.NoReply" diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index d4ccd0931e..611de6991f 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -845,12 +845,14 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, #endif // QT_CONFIG(itemviews) if (!(opt->state & State_Off)) { QPointF points[6]; - points[0] = { opt->rect.x() + QStyleHelper::dpiScaled(3.5), opt->rect.y() + QStyleHelper::dpiScaled(5.5) }; - points[1] = { points[0].x(), points[0].y() + QStyleHelper::dpiScaled(2) }; - points[2] = { points[1].x() + QStyleHelper::dpiScaled(2), points[1].y() + QStyleHelper::dpiScaled(2) }; - points[3] = { points[2].x() + QStyleHelper::dpiScaled(4), points[2].y() - QStyleHelper::dpiScaled(4) }; - points[4] = { points[3].x(), points[3].y() - QStyleHelper::dpiScaled(2) }; - points[5] = { points[4].x() - QStyleHelper::dpiScaled(4), points[4].y() + QStyleHelper::dpiScaled(4) }; + qreal scaleh = opt->rect.width() / 12.0; + qreal scalev = opt->rect.height() / 12.0; + points[0] = { opt->rect.x() + 3.5 * scaleh, opt->rect.y() + 5.5 * scalev }; + points[1] = { points[0].x(), points[0].y() + 2 * scalev }; + points[2] = { points[1].x() + 2 * scaleh, points[1].y() + 2 * scalev }; + points[3] = { points[2].x() + 4 * scaleh, points[2].y() - 4 * scalev }; + points[4] = { points[3].x(), points[3].y() - 2 * scalev }; + points[5] = { points[4].x() - 4 * scaleh, points[4].y() + 4 * scalev }; p->setPen(QPen(opt->palette.text().color(), 0)); p->setBrush(opt->palette.text().color()); p->drawPolygon(points, 6); |