summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| | * Windows: Fix Adobe/Mozilla format color fonts after Windows updateEskil Abrahamsen Blomfeldt2016-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the Anniversary update of Windows 10 (update 1607), color fonts using the Adobe/Mozilla format with embedded SVGs are detected as color fonts by DirectWrite, but they do not contain any colored layers. The result of this was that we would no longer draw these fonts using the pen color, but we would also not support the colored glyphs in the fonts. In order to still support using these fonts as regular monochromatic fonts, we check if there is actually a palette in the font file before registering it as a color font. [ChangeLog][QtGui][Windows] Fixed rendering Adobe/Mozilla format color fonts with other colors than black after Windows 10 Anniversary update. Task-number: QTBUG-55097 Change-Id: I8d74787e49530d1167b9f2533ffdf7ab814c3358 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
| | * Windows QPA: Introduce command line options for DirectWriteFriedemann Kleint2016-08-053-12/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add option "nodirectwrite" to turn off DirectWrite fonts and "nocolorfonts" to turn off DirectWrite for colored fonts. Task-number: QTBUG-55096 Task-number: QTBUG-55097 Change-Id: If12133fbd20dc7657b3616eff833a8e8c116e070 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | * Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7Liang Qi2016-08-0550-560/+899
| | |\
| | | * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-0550-560/+899
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: I6f3878b204464313aa2f9d988d3b35121d4d9867
| | | | * QUrl::resolved: keep treating file:name.txt as relative for nowDavid Faure2016-08-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8a33077 made QUrl::resolved() follow its documentation ("If relative is not a relative URL, this function will return relative directly.", where relative means scheme is empty). However there is much code out there (e.g. qtdeclarative) which relies on QUrl::fromLocalFile("fileName.txt") to be treated as relative, so for now, we still allow this (in Qt 5.6.x). For Qt 5.8, this commit will be reverted. [ChangeLog][QtCore][QUrl] [EDITORIAL: replaces 8a33077] QUrl::resolved() no longer treats a URL with a scheme as a relative URL if it matches this URL's scheme. For now it still treats "file:name.txt" as relative for compatibility, but be warned that in Qt 5.8 it will no longer consider those to be relative. Both isRelative() and RFC 3986 say that such URLs are not relative, so starting from Qt 5.8, resolved() will return them as is. Change-Id: Iff01e5b470319f6c46526086d765187e2259bdf5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | | | * Fix rasterwindow exampleJake Petroules2016-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At least with the eglfs platform plugin, the QBackingStore constructor results in a null pointer access if done before creation. Change-Id: I2e78e70700fa48499a35c55797e1b962b6e6285a Reviewed-by: Rebecca Worledge <rebecca.worledge@theqtcompany.com> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
| | | | * QString: fix append(const QStringRef &str)Anton Kudryavtsev2016-08-042-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use QStringRef::isNull instead of QStringRef::string() for validation. Non-NULL str.string() may yet leave us with a useless str.unicode(), which is the actual problem here; whereas !str.isNull() does really confirm that str.unicode() is sensible. Such test prevents situation like: const QString a; QString b; b.append(a); // b.isNull() == true b.append(QStringRef(&a)); // b.isNull() == false Auto test updated: create QStringRef from QString directly, without any condition. Change-Id: I082cd58ef656d8a53e3c1223aca01feea82fffb9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | | | * Remove unneeded ';' after some macrosKai Pastor2016-08-046-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The unneeded ';' triggered warnings in pedantic compilation mode. Change-Id: Id2324823e138560bb25234306601253d7bbd713e Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | | | * QLocalSocket/Tcp: open device before making a connectionAlex Trotsenko2016-08-042-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to QLocalSocket's documentation, connectToServer() must initiate a connection attempt after opening the device. Otherwise, if a connection succeeds immediately, connected() signal will be emitted on closed device. So, this patch ensures that TCP-based implementation behaves correctly. Change-Id: I4cc9474815e091a1491a429a6dc17f9cf0154f58 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | | * raspberry pi: manage eglfs display id with env varcharlycha2016-08-041-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specify the display to use by setting environment variable QT_QPA_EGLFS_DISPMANX_ID Possible values are : 0: MAIN LCD 1: AUX LCD 2: HDMI 3: SDTV 4: FORCE LCD 5: FORCE TV 6: FORCE OTHER Change-Id: I146db9a7f423bd4c6c1716c64d3df4d2388e85f9 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
| | | | * Fix 64-bit bilinear scaled image samplingAllan Sandfeld Jensen2016-08-041-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A constraint ensuring we do not sample beyond the current scan-line was missing in the SSE2 optimized sampling. Discovered with lancelot. Change-Id: Ib0ece8f8bfaa034733873dc5b8baaaad5d4c0380 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
| | | | * Don't call virtual functions with data from an old modelBogDan Vatra2016-08-042-4/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I4f1ec56ce722110042f72761bbc2976e580b7149 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | | * Doc: Fix references to Control, Meta key enumsKai Koehne2016-08-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also make use of qdoc's \note command. Change-Id: I276300cfcfde06e82b04793dbf25df8ec73e9838 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
| | | | * QStringListModel: begin/endResetModel() are no signalsMarc Mutz2016-08-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... so don't use emit on them. Just confuses readers. Change-Id: I24365fc533b5b35f8942d6014dbc68387aa23e22 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | | | * Polish the findfiles example to be actually usefulFriedemann Kleint2016-08-033-48/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Simplify the code, remove unused members - Fix the translations of plurals to use %n - Add tooltip displaying full paths in list - Add context menu allowing to copy the name and open - Display the correct slashes on Windows - Connect the returnPressed() signals of the line edits - Make the search recursive - Do not search binary files by checking the mime type Change-Id: I3663799c88931db1f58c03ea35211e7ab03737ec Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
| | | | * Polish the codecs exampleFriedemann Kleint2016-08-034-118/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Port to Qt 5 connection syntax. - Remove unneeded member variables. - Adapt to screen size. - Add a tab widget with a hex dump view to the preview dialog. - Handle conversion errors in preview dialog, add status label displaying errors and warnings about failures and invalid characters encountered. - Fix translated messages. Change-Id: I916100c903e73d0d2326523753ed7398b1c34df0 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
| | | | * Fixed Bug in QVariant comparison when containing QStringListsClemens Sielaff2016-08-032-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As it were, QStringLists were not handled explicitly when comparing QVariants. If both QStringLists contained only a single entry, they were treated as QStrings - if both QStringLists were empty, there were equal (correctly so) - but if one of the QStringLists had more than one entry, the compare function fell through to returning always 1. As discussed here: https://stackoverflow.com/a/38492467/3444217 Added rich comparison tests for all non-numerical, non-recursive QVariants that support them (except QModelIndex and QPersistentModelIndex) Task-number: QTBUG-54893 Change-Id: Icc5480d9ba056ee5efe83da566c5829caa1509d7 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
| | | | * Windows QPA: Handle key event sequences of surrogatesFriedemann Kleint2016-08-032-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Emoji characters as input by the virtual keyboard are received as a sequence of surrogates. Store state internally when a high surrogate is received and send off the sequence when the matching low surrogate is received via input method. Task-number: QTBUG-50617 Change-Id: I91e763ec3e0747d6852f7c5c2057a67b0c24e0f5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | | | * Polish charactermap exampleFriedemann Kleint2016-08-024-29/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use Qt 5 connection syntax. - Introduce helper function to calculate the square size, remove the existing 24 pixel limitation since that makes it impossible to render 20pt fonts. - Add filter chooser for font filters. - Add menu and info dialog showing DPI and default fonts. - Streamline code Change-Id: I0cd4d0475b5a7ed3c475de7a413abebbe688dfe2 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
| | | | * QTzTimeZonePrivate: skip redundant check, tidy upEdward Welbourne2016-08-021-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various transition functions checked on m_tranTimes.size() > 0 inside a block which was conditioned on this already; simplify the code by knowing this is true already. Tidied up an initializer at the same time. Change-Id: I3e933a69e1b71b94bfd4451e4d761844da669d33 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | | * Fix typo in QMessageBox documentationMitch Curtis2016-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I879817bf0209db331a9b1ef206bad7aa5b8a678f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | | | * tst_QTreeView: Fix UB (invalid downcast, member call)Marc Mutz2016-08-013-70/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported by UBSan: tst_qtreeview.cpp:2187:36: runtime error: downcast of address 0x7ffc15749f20 which does not point to an object of type 'PublicView' 0x7ffc15749f20: note: object is of type 'QTreeView' Fix by making the test a friend of QTreeView (and, for Clang, of QAbstractItemView) instead. Change-Id: I5b748696ab441a91058f4d45a18bd5ed75a6e560 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | | * tst_QAbstractItemView: Fix UB (invalid downcast, member call)Marc Mutz2016-08-012-178/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported by UBSan: tst_qabstractitemview.cpp:336:23: runtime error: member call on address 0x7ffe6fe96e10 which does not point to an object of type 'TestView' 0x7ffe6fe96e10: note: object is of type 'QListView' tst_qabstractitemview.cpp:337:5: runtime error: member call on address 0x7ffe6fe96e10 which does not point to an object of type 'TestView' 0x7ffe6fe96e10: note: object is of type 'QListView' tst_qabstractitemview.cpp:338:23: runtime error: member call on address 0x7ffe6fe96e10 which does not point to an object of type 'TestView' 0x7ffe6fe96e10: note: object is of type 'QListView' [etc ...] Fix by making the test a friend of QAbstractItemView instead. Change-Id: I1a08977042296eb34e9dbdb5c0595662dbd2e5ef Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | | * QDataWidgetMapper: Fix UB (member call)Marc Mutz2016-08-012-16/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As found by UBSan: qdatawidgetmapper.cpp:212:59: runtime error: member call on address 0x2b6cc8095be0 which does not point to an object of type 'QFocusHelper' 0x2b6cc8095be0: note: object is of type 'QLineEdit' Just make QDataWidgetMapperPrivate a friend of QWidget. Change-Id: I33d8d430c3a03b7173358d0f96dc7f850d11697c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | | | * QColor: remove 158 avoidable relocationsMarc Mutz2016-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of storing a pointer to a string, store the string in the RGBData struct. It's not as efficient as in other such cases, because one string is particularly long, but it's still more than acceptable. Text size increases slightly, but data size decreases a lot (can't say by how much, exactly, as I'm on a UBSan build). Change-Id: I1df2985fd1ebfccd84b48315d8d319dd9e25c8e7 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| | | | * QSortFilterProxyModel: Don't forward the hint from source's layoutChanged signalOlivier Goffart2016-08-012-2/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't forward a VerticalSortHint or HorizontalSortHint hint, because we might be filtering extra items. The documentation of QAbstractItemModel::LayoutChangeHint states: Note that VerticalSortHint and HorizontalSortHint carry the meaning that items are being moved within the same parent, not moved to a different parent in the model, and not filtered out or in. And some of the views rely on this assumption (QQmlDelegateModel for example) What happens in the test is the following: - 'model' emit the dataChanged signal when its data is changed. - 'proxi1' QSortFilterProxyModelPrivate::_q_sourceDataChanged does not forward the dataChanged signal imediatly, it will instead first re-sort the model and call layoutAboutToBeChanged / layouChanged with the VerticalSortHint - 'proxy2' would forward the layoutAboutToBeChanged with the hint, but in QSortFilterProxyModelPrivate::_q_sourceLayoutChanged, it will redo the mapping which will cause the changed data to be filtered. So proxy2 can't forward the VerticalSortHint as it removed rows in the process. Change-Id: I20b6983e9d18bf7509fe6144c74f37d24e4a18c2 Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com> Reviewed-by: David Faure <david.faure@kdab.com>
| | | | * REG: Fix unwanted cache flush in Freetype engineEskil Abrahamsen Blomfeldt2016-08-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Freetype cache was almost completely disabled by 134c6db8587a8ce156d4fa31ffa62605821851b2 because after that change, the lockedAlphaMapForGlyph() function would no longer cut off early for empty glyphs like spaces, but rather go through all alpha map functions before it realized that there was nothing to render. This would in turn invalidate the cache for every empty glyph, causing all glyphs to be rerendered for every isolated word. This change adds back a cut off. This is only needed in the lockedAlphaMapForGlyph() function, since the superclass implementation of the other alpha map functions already contains a cut off for width/height == 0. [ChangeLog][Qt Gui][Text] Fixed a performance regression in Freetype engine that was introduced in Qt 5.5. Change-Id: I381285939909e99cc5fb5f3497fecf9fa871f29a Task-number: QTBUG-49452 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | | | * Android: Fix CJK text with Android 7.0Eskil Abrahamsen Blomfeldt2016-08-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Android 7, some fonts are packed in .ttc files. We fix this simply by including them when populating the font database. Freetype supports this and in fact, QBasicFontDatabase::populateFontDatabase() also adds *.ttc. [ChangeLog][Android] Fixed CJK font resolution on Android 7. Task-number: QTBUG-53511 Change-Id: Iebe51b0e6ba2d6987693306cd9a12013ce886b58 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
| | | | * Fix UB (invalid enum value) in tst_QTreeViewMarc Mutz2016-07-311-30/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported by UBSan: tst_qtreeview.cpp:663:5: runtime error: load of value 4294967295, which is not a valid value for type 'DragDropMode' Instead of abusing -1 to indicate to not set the dragDropMode, use a separate boolean field in tha data. Change-Id: I13e7539c858f3b2462d57d660062ef3cb7aec61b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | | * QTreeWidget: Fix UB (member call)Marc Mutz2016-07-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before actually deleting QTreeWidgetItems from QTree{Model,Widget{,Item}} dtors, their 'view' members need to be set to nullptr, lest they attempt to delist themselves from the list of top-level items. For the QTreeModel::headerItem, this was forgottten. Found by UBSan: qtreewidget.cpp:1488:70: runtime error: member call on address 0x7ffd843dd470 which does not point to an object of type 'QAbstractItemView' 0x7ffd843dd470: note: object is of type 'QWidget' #0 0x2b83d5b48323 in QTreeWidgetItem::~QTreeWidgetItem() src/widgets/itemviews/qtreewidget.cpp:1488 #1 0x2b83d5b48860 in QTreeWidgetItem::~QTreeWidgetItem() src/widgets/itemviews/qtreewidget.cpp:1535 #2 0x2b83d5b41659 in QTreeModel::~QTreeModel() src/widgets/itemviews/qtreewidget.cpp:143 #3 0x2b83d5b41bc0 in QTreeModel::~QTreeModel() src/widgets/itemviews/qtreewidget.cpp:146 #4 0x2b83df220747 in QObjectPrivate::deleteChildren() src/corelib/kernel/qobject.cpp:2010 #5 0x2b83d4603dd0 in QWidget::~QWidget() src/widgets/kernel/qwidget.cpp:1675 #6 0x2b83d4d76066 in QFrame::~QFrame() src/widgets/widgets/qframe.cpp:256 #7 0x2b83d5270442 in QAbstractScrollArea::~QAbstractScrollArea() src/widgets/widgets/qabstractscrollarea.cpp:575 #8 0x2b83d5733eb9 in QAbstractItemView::~QAbstractItemView() src/widgets/itemviews/qabstractitemview.cpp:617 #9 0x2b83d598b216 in QTreeView::~QTreeView() src/widgets/itemviews/qtreeview.cpp:206 #10 0x2b83d5b218b6 in QTreeWidget::~QTreeWidget() src/widgets/itemviews/qtreewidget.cpp:2549 #11 0x4eef42 in tst_QTreeWidgetItemIterator::updateIfModifiedFromWidget() tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp:1089 Change-Id: I57c277adee8c99eb07b274d6d8ea1f6fbf3575be Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | | * QColor: Fix UB (left shift of negative number)Marc Mutz2016-07-311-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If hex2int(const char*) is called with invalid input, it is expected to return a negative value. However, it didn't check the return value of h2i() before attempting a left-shift on it, leading to UB when the first digit was already invalid. UBSan agrees: qcolor_p.cpp:55:23: runtime error: left shift of negative value -1 This is particularly worrisome as the function can be called with unsanitized input. Fix by checking each value for non-negativity, returning -1 early when errors are detected. Also port to QtMiscUtils::fromHex() and add some docs. Change-Id: I33dbc157ffb4fbfba27113a0a008eef35c1055f7 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | | * QAbstractItemView: Fix UB (invalid downcast)Marc Mutz2016-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just use QWidgetPrivate::get() instead. Fixes UBSan error: qabstractitemview.cpp:3814:61: runtime error: downcast of address 0x2b859001aa70 which does not point to an object of type 'QAbstractItemView' 0x2b859001aa70: note: object is of type 'QWidget' Change-Id: I0460fd8a0681e122d440755ebf07018d273b93f8 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | | * QRasterizer: fix UBs involving << with a negative LHSMarc Mutz2016-07-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Left-shifts of negative values are undefined in C++. In particular, they don't behave arithmetically. Reported by UBSan: qrasterizer.cpp:609:48: runtime error: left shift of negative value -640/-2240 qrasterizer.cpp:982:38: runtime error: left shift of negative value -2 Fix by using ordinary multiplication instead, because negative left-hand-side values don't look like they are an error. No errors were actually reported for a.y << 10, but I changed it nonetheless, since all a missing error means is that the test data didn't excercise this code path with negative Y values. Change-Id: I1fa9deca263f12206a3f7eab6ad875fc3242269d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | | | * Docs changed to reflect that valueName is required with value parsingKonstantin Shegunov2016-07-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the option expects a value the valueName parameter of the constructor isn't optional; it must be set. This requirement is made explicit in the documentation. Task-number: QTBUG-54855 Change-Id: I190884aff2fa8e96bc5c5e82cdfed85be761d6e3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <david.faure@kdab.com>
| | | | * QUrl: fix resolved() for data URLsDavid Faure2016-07-292-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They look relative because the path doesn't start with a '/' but they have a scheme so they shouldn't be combined as if it was one absolute and one relative URL. [ChangeLog][QtCore][QUrl] QUrl::resolved() no longer treats a URL with a scheme as a relative URL if it matches this URL's scheme. This special casing was incompatible with RFC 3986 and broke resolving data: URLs, for instance. Change-Id: I3758d3a2141cea7c6d13514243eb8dee5d510dd0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | | * qgrayraster: fix UBs involving << with a negative LHSMarc Mutz2016-07-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Left-shifts of negative values are undefined in C++. In particular, they don't behave arithmetically. Reported by UBSan: qgrayraster.c:510:19: runtime error: left shift of negative value -1/-42 qgrayraster.c:537:26: runtime error: left shift of negative value -1/-4/-128 qgrayraster.c:538:26: runtime error: left shift of negative value -1/-4/-128 qgrayraster.c:641:28: runtime error: left shift of negative value -1/-42 qgrayraster.c:676:44: runtime error: left shift of negative value -1/-4/-5/-14/-129 qgrayraster.c:807:19: runtime error: left shift of negative value -1/-42 qgrayraster.c:1101:9: runtime error: left shift of negative value -32/-46/-224/-8160 qgrayraster.c:1102:9: runtime error: left shift of negative value -32/-2626 qgrayraster.c:1454:36: runtime error: left shift of negative value -32/-96/-224/-466/-2626/-8160 qgrayraster.c:1535:30: runtime error: left shift of negative value -32/-46/-224/-2626/-8160 Fix by using ordinary multiplication instead, because negative left-hand-side values don't look like they are an error. Change-Id: I2e96de51adb4a030de8a49869ddd98a31dab31b3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * | | qdbusxml2cpp: Ported to QCommandLineParserAndreas Wilhelm2016-08-051-129/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I8a91a376ba60b110fff9eb84e1b02e3c6e8c5e30 Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | | Re-add the space character as a document terminatorAndy Shaw2016-08-051-4/+5
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With change 208496091d994c2ffe44ea41368fb659978c1581 the space character was replaced with a visual document terminator character. However this meant that if the whitespace was visualized without the document terminator character visualized then clicking after the text would cause it to be positioned off by one. By bringing back the space character when the terminator is not being visualized then it will correctly place the cursor at the end of the text. Change-Id: I335c1773a37a654f3196bd350562e8f92ffd5369 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | * | Windows QPA: Add missing parameter to qWarning()Friedemann Kleint2016-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning printed when wrapping foreign windows is missing a parameter. Amends change f2ef587906062706e576e376e4c6481ab192f50d. Task-number: QTBUG-41186 Change-Id: Iefbd174c1acc42e87fd1a764d96452b1745aa4c0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * | Fix registered style name of sub-familiesAllan Sandfeld Jensen2016-08-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An old line redefined the altStyleName variable causing sub-families to be registered with their language-name as their style-name. Change-Id: I8c21ad556f53ffd62f8ef9b326fb9431eea1d857 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | * | Register sub-families as separate fontsAllan Sandfeld Jensen2016-08-021-3/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If A is B, but not all B is A, we should not register A as an alias for B. It is better to register it as a separate font-family so when explicitly requested only faces from the sub-family are considered. Task-number: QTBUG-53459 Change-Id: Ie9f5db3ba3fa69a0edb5b1965cce25e4885a00fc Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | * | Doc: Fix broken external link to livecoding vfx videoTopi Reinio2016-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: Idf4ea5f175b3ad41292e5ba8e4538311b00c6d2f Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | | | winrt: update testsMaurice Kalinowski2016-08-091-3/+7
|/ / / | | | | | | | | | | | | | | | | | | Update due to behavior differences between win32 and winrt. Change-Id: I39532de98c25cd67da49cbb20d42dccc803f1805 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | winrt: Make test functionalMaurice Kalinowski2016-08-091-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | The adoptedThreads test never spawned any thread causing a test error later on. Hence add a winrt version using __beginthreadex which exists for that platform. Change-Id: I04f980218713df20cb41d804d732e0c99b958489 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | QNetworkManagerEngine: port away from Java-style iteratorsMarc Mutz2016-08-091-24/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They are slower, more annoying, and not safer than their STL counterparts. Port to C++11 range-for, or to "auto it, end" for loops in cases where the key was also accessed. Change-Id: Ib27608ddbe9c0775092a1c6495731ad324727d3e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QNetworkManagerEngine: add override keywordsMarc Mutz2016-08-091-11/+11
| | | | | | | | | | | | | | | Change-Id: Ie926119ee58d330e415634f93eb334c6befeede1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QNetworkManagerEngine: fix const-correctnessMarc Mutz2016-08-092-8/+8
| | | | | | | | | | | | | | | Change-Id: I058617315e7cf2c6fa49f1ed0d16cb5e2a78dd72 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QColor: mark as movable (except for QList)Marc Mutz2016-08-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Unbelievable that this has survived for so long... Change-Id: Icff6ecc56de773fa6054d5b96e421299a48bdbde Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Make sure QDBusConnection::connect() returns false if already connectedThiago Macieira2016-08-093-10/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDBusConnection::connect() behaves like QObject::connect with a connection type of Qt::UniqueConnection | Qt::QueuedConnection. So return false if it's already connected. [ChangeLog][QtDBus][QDBusConnection] Fixed a bug that would cause QDBusConnection::connect() to return true if a slot was already connected to the same D-Bus signal. QtDBus does not support multiple connections. Change-Id: I87e17314d8b24ae983b1fffd1453aef5a7c9ad0b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Fix build with clang-cl and the Intel compiler on WindowsThiago Macieira2016-08-091-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Neither clang-cl nor the Intel compiler are able to parse the MSVC code in a constexpr environment. For Clang, we can just use the __builtin functions, which it does make available on Windows. For the Intel compiler, there's no alternative, so we just don't use the _BitScanXxx functions. It will produce slower code, though. qalgorithms.h(587,19) : error: variables defined in a constexpr function must be initialized qalgorithms.h(635,12) : note: non-constexpr function '__popcnt' cannot be used in a constant expression etc. Change-Id: I149e0540c00745fe8119fffd14627ded43807000 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>