summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix QWidget::setWindowRole()Alexander Volkov2016-08-195-5/+40
| | | | | | | | | | | Introduce QXcbWindowFunctions::setWmWindowRole() and call it either from the implementation of QWidget::setWindowRole() or after the creation of the corresponding QWidgetWindow. Change-Id: I143450f4673dd707bb491c1d0f0e8b61d564283d Task-number: QTBUG-45484 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Ivan Čukić <ivan.cukic@kde.org>
* qwidgetbackingstore: fix QT_NO_OPENGL compilePeter Seiderer2016-08-181-0/+2
| | | | | | | | | Readd QT_NO_OPENGL protection for qt_dummy_platformTextureList declaration (lost by commit 2a7cee47e5e84c73e32a6953e145771196645f1a). Task-number: QTBUG-55269 Change-Id: I7ec613387af81d018dbbe99d2dfd3a6f36242a4c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* DirectWrite: Fix calculating bounding box of glyphsEskil Abrahamsen Blomfeldt2016-08-181-1/+1
| | | | | | | | | | | | | | | | | | We don't support vertical text layouts in Qt, so the vertical advance should always be 0 (like it is in other engines). Since we were setting this, we would calculate the bounding box of strings in the DirectWrite engine as if the layouts were diagonal, adding up both the horizontal and vertical advances. [ChangeLog][QtGui][Windows] Fixed height of text bounding box when using no or vertical hinting preference, or when the device pixel ratio is different from 1. Task-number: QTBUG-51024 Change-Id: I329917eb8da71fdfdffe9651ca8f0f48d26b6a60 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* winrt: only update window title for top level widgetsMaurice Kalinowski2016-08-183-8/+6
| | | | | | | | | Previously we always updated the window title, independently whether the window was visible / the toplevel one. This can also cause troubles when setting the title during initialization. Change-Id: I02ec0f0e385fa490f641ce83a6cb27717a31620f Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* winrt: Fix crashes for visible window managementMaurice Kalinowski2016-08-182-1/+5
| | | | | | | | | | | | First, offscreen windows/surfaces should not be tracked in the visible window list. Secondly when destroying a window, it is not guaranteed that it had been removed first, hence enforce it to guarantee that the visibleWindows list stays correct and does not hold invalid weak pointers to non existing windows. Change-Id: I7027ecd010b8bcb3d05e3f5d460662e883e42e50 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* winrt: Fix crash when managing multiple top-level windowsMaurice Kalinowski2016-08-181-1/+1
| | | | | | | | | | When a window gets removed, the active focus window needs to be set to 0 instead of the the current window. Otherwise QGuiApplicationPrivate::focus_window is set to an invalid pointer and crashes when dereferenced. Change-Id: I258b95e447de4cbfb7f19955079c2545a738e03f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* QTestLib: Disable window state restore on macOSMorten Johan Sørvig2016-08-184-1/+124
| | | | | | | | | | | For test runs we want to start with a clean slate and ignore previously saved window state. This also prevents the “previous restore failed” dialog from from showing and blocking the test run. Change-Id: I8e5b87a903cf1d937d628c2b062f917c4c37f176 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Do not disable subpixel rendering on compile timeAllan Sandfeld Jensen2016-08-181-1/+1
| | | | | | | | | | This is a runtime setting, as the user's freetype version can differ from the developer's, and freetype already safely handles it internally when not available. Task-number: QTBUG-55345 Change-Id: I26e73728196d60ae26e5f1919ecd0dadac393890 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QCocoaInputContext: Fix wrong memory releaseGabriel de Dietrich2016-08-181-1/+1
| | | | | | | | | | | As per Core Foundation ownership conventions, we should release 'source', which is a copy, and not 'langRef', which is a reference. This has shown to lead to crashes in some occasions. Change-Id: I2e59b8d62aac13bc60dc013c1ea621850132c719 Task-number: QTBUG-48772 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* QJsonValue: use Q_NULLPTR instead of 0 in ctorDyami Caliri2016-08-171-1/+1
| | | | | | | | Use Q_NULLPTR in all public headers Task-number: QTBUG-45291 Change-Id: Ib294deb3c210a9a186448cbf9656af7a09fea2c1 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Cocoa QPA Menus: Propagate enabled state downwardsGabriel de Dietrich2016-08-175-41/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NSMenu has autoenableItems set to true by default, and we keep it this way in Qt. This means that NSMenuItem's enabled property is basically ignored and therefore QCocoaMenuItem::syncModalState() is wrong. What is also wrong, is syncModalState()'s name in both QCocoaMenuItem and QCocoaMenu. Indeed, this function's role should be to ensure that the enabled state is properly propagated down the menu hierarchy, whether the reason is being in the context of a modal dialog or the parent menu having been disabled by the app. Notice that the latter case is specially needed when a menubar menu is explicitly disabled. Therefore, we introduce a separate flag for the parent enabled state in order to avoid polluting the app-set enabled state flag. This is done in both QCocoaMenu and QCocoaMenuItem. In the case of QCocoaMenuItem, these two flags define whether an NSMenuItem is enabled state conjointly, and set from -[QCocoaMenuDelegate validateMenuItem:]. The rest of the logic remains as before. Similar logic is used in QCocoaMenu::isEnabled(). In addition, the presence of the second flag allows us to show disabled submenus in the same fashion native Cocoa applications do. This means, the submenu item itself remains enabled, allowing to show the submenu popup where all its menu items will appear disabled. Bonus change: merged all the bool flags into a bitfield and made the compiler happy about the ivar reordering in QCocoaMenu and QCocoaMenuItem's constructor. Task-number: QTBUG-54698 Task-number: QTBUG-55121 Change-Id: Ie156cb3aa57a519103908ad4605f7b43c57e5aef Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Update PCRE to 8.39André Klitzing2016-08-1728-3170/+4228
| | | | | | Change-Id: I619ef88ea05a6bcfb6908dc18d9de7daa9113392 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Support stretch when using DirectWrite font engineEskil Abrahamsen Blomfeldt2016-08-171-3/+13
| | | | | | | | | | | | | | | | | | The DirectWrite font we get when converting the GDI font does not respect the stretch we have set, as this is an attribute of the text layout in DirectWrite and not the font description. To compensate for this, we scale advances and glyphs in the engine if the stretch is different from 100%. [ChangeLog][QtGui][Windows] Fixed stretch when combined with either no or vertical hinting preference or a device pixel ratio different from 1. Task-number: QTBUG-54494 Change-Id: Icc06d1457191782d1a281c99da2da3081a82c542 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Protect QImage::convertToFormat against null QImageAllan Sandfeld Jensen2016-08-171-1/+1
| | | | | | | | QImage may have a null d-pointer, and convertToFormat_helper was the only method not protected against it. Change-Id: Ibfe5b139e3922f2a0c8284c6ae1932c2150efc66 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Disable switchable widget compositing when using XCB in Parallels VMAndy Nichols2016-08-174-1/+25
| | | | | | | | | | | | | | The Parallels 3D hardware acceleration does not seem to play nice with Qt Creator when switching between tabs that have OpenGL Qt Quick Content and those that have just raster widget content. QWidgetBackingstore has the ability to switch how content is flushed depending on if the SwitchableWidgetComposition capability is available. Previously for XCB it was always enabled, but should be disabled when using the GLX integration for the Parallels VM. Change-Id: I42e41456e0873f6780f5d0333dbfaaf8fcce4a5e Task-number: QTCREATORBUG-16742 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* ~QGraphicsProxyWidget: Remove event filter on widget before deleting itFriedemann Kleint2016-08-161-0/+1
| | | | | | | | | Prevent events being received on the widget during its destruction phase. Task-number: QTBUG-55112 Change-Id: I0d990fc69eee06b7e5af3845aa3f7627e3e3d5b9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix documentation of the Windows parts of QSettings::setPath()Friedemann Kleint2016-08-161-10/+14
| | | | | | | | | | Explain in terms of CSIDL_ values and update the sample locations. Task-number: QTBUG-55065 Change-Id: I15ddf32555d43cffae66d98c6ac12d62a98d5e6d Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* QLinkedList: compile with -Wzero-as-null-pointer-constantMarc Mutz2016-08-161-2/+2
| | | | | | | | | The existing header check unfortunately doesn't detect uses of '0' as nullptr in template code. Task-number: QTBUG-45291 Change-Id: Ibe701402d95deca98c5286e2cee5f7118fd7f606 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QWindowsServices::openUrl(): Don't convert URLs with fragments/queries to ↵Friedemann Kleint2016-08-161-2/+3
| | | | | | | | | | local files Pass the URL instead. Task-number: QTBUG-55300 Change-Id: I4ce9171db5c1a9e07b17911729b165c115329664 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Restore documented behavior for the WA_X11NetWmWindowType* attributesAlexander Volkov2016-08-152-5/+45
| | | | | | | | | Use QXcbWindowFunctions::setWmWindowType() to add the corresponding types to the window's _NET_WM_WINDOW_TYPE X11 window property. Change-Id: Ia2413ad7a69ab8d49b448de11dd07c77101a564c Task-number: QTBUG-39887 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* xcb: Add qt.qpa.input.events and guard mouse event logs tooLaszlo Agocs2016-08-154-21/+30
| | | | | | | | | | | | | Make mouse behave like touch and scrolling does: only do high frequency qCDebugs when the category is enabled. Switch over mouse, touch and scroll event logging to a new sub-category: qt.qpa.input.events. This way qt.qpa.input in itself behaves sanely on xcb, similarly to f.ex. eglfs, giving only the basic, but important info. Change-Id: I8dd588e72ae9d1c66096489fa3c5291f6d318ca0 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Fix rendering error in some animated gifsEirik Aavitsland2016-08-151-1/+1
| | | | | | | | | | | | | | The code for handling of the rarely used "restore to previous" frame disposal option would mistakenly clear the entire existing frame. It looks like this was a copy/paste mistake in the code; the intention obviously was to clear the newly created backingstore instead. This fixes the rendering of http://media1.giphy.com/media/9Jevgp0CgvAnm/giphy.gif Task-number: QTBUG-55141 Change-Id: I4d344b7733edd62346656154e215c21727f9b6bb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Updated Qt logo for the "About Qt" dialogAlessandro Portale2016-08-121-0/+0
| | | | | | | | | The Qt logo has changed (see http://brand.qt.io/ ) but it had not been updated in the QMessageBox::aboutQt dialog, yet. Task-number: QTBUG-55137 Change-Id: I81431e44efe65f576e62b92214aa835b82675d00 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix typo in QKeySequence docLiang Qi2016-08-121-1/+1
| | | | | | Task-number: QTBUG-55181 Change-Id: I70615a2b4b026a83f506df928a79c9e60543e655 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Fix grammar in QToolBar docsMitch Curtis2016-08-121-1/+1
| | | | | Change-Id: Ibc65fd7c95246c7b7e38fd7f0d16d83d7c3301d9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix typo (word repetition) in documentationFrederik Schwarzer2016-08-121-1/+1
| | | | | Change-Id: I1c8785e39f28f94846126fc45b875e6425a4ce12 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Doc: Fix incorrect arguments in QTableWidget::setCellWidget() snippetTopi Reinio2016-08-121-2/+2
| | | | | | Task-number: QTWEBSITE-722 Change-Id: I15fc2b3e035c48272bbd00edbf227ef5a942597f Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Doc: Change instances of '(Mac) OS X' to 'macOS'Topi Reinio2016-08-1289-304/+304
| | | | | | | | | | | | | | | As of version 10.12 (Sierra), the name of Apple's desktop operating system will be macOS. Change the occurrences where the Mac platform is discussed to use a macro \macos, which expands to 'macOS'. This helps with adapting to future renaming. Update the instructions on mac-specific Q_OS_* macro usage. Add a \target for the old 'Qt for OS X' topic to keep links working for other documentation modules that try to link with the old name. Change-Id: Id33fb0cd985df702a4ae4efb4c5fd428e77d9b85 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* QStringListModel: fix dataChanged's roles parameterMarc Mutz2016-08-121-1/+7
| | | | | | | | | | | | | In QStringListModel, the display and the edit roles are synonyms, so when one is changed, the other changes with it. However, in setData() we only emitted a vector with just the role that was passed in by the user. Fix by always passing both roles, regardless of which one was used to set the data. Change-Id: I498e7cb33796fae266901817b01ad85d861d4bb4 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QCommandLineParser: call qCoreApp post routines before ::exit()David Faure2016-08-121-0/+5
| | | | | | | This gives a chance for some cleanups at least. Change-Id: I3a628e32c6fc8c7fa00943769210c517005f2a0a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cocoa: Update deprecated dragging session APIsGabriel de Dietrich2016-08-111-10/+13
| | | | | Change-Id: I06e2dd3861c4bc5d85421ac71daf188732279e77 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Drag and Drop: Don't let Cocoa override proposed actionsGabriel de Dietrich2016-08-111-1/+9
| | | | | | | | | | | | When pressing the Command key, or any other modifier key, Cocoa will filter whatever the application has set in the QDrag object. However, Qt is already taking all this into account, so we should not let yet another voice chime in. Task-number: QTBUG-55177 Change-Id: I7c56e72d846d10cdfc132776bdfdd6b79799bcff Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Cache the current QOpenGLFramebufferObjectSérgio Martins2016-08-112-1/+11
| | | | | | | | | | | | | This doesn't cover FBOs bound directly with glBindFramebuffer(), but it's perfect to create a fast path for code we know uses QOGLFBO, thus avoiding expensive glGetIntegerv() driver calls. The use case is to use this in QSG24BitTextMaskShader::activate(), where we need to check if the current FBO is sRGB capable. Change-Id: I434eeeb7e6a3d16be9327315536ad7280245085d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QDateTimeParser::getAmPmText() use QLocale instead of tr()Edward Welbourne2016-08-111-5/+3
| | | | | | | | | | I am not convinced toUpper/toLower is a generally sound solution here; however, QLocale doesn't make the upper/lower case distinction this parser does and a bug report shows tr() isn't doing an adequate job. Task-number: QTBUG-47815 Change-Id: Iaf654d1d76d4c38d74fc647e168d50debb924a8f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* AtSpiAdaptor: fix 'defined' field in GetAttributeValueMarc Mutz2016-08-111-2/+1
| | | | | | | | | Value was inverted. Found by own code review. Change-Id: I2027d97e1f9d52f6d79fb72ecad9ee2034f9af25 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Android: don't wait if the event loop is stoppedBogDan Vatra2016-08-101-4/+10
| | | | | | | | | | | | QAndroidEventDispatcherStopper is stopped when the application is in background and the user uses the task manager to kill the task. If the application has services the task manager doesn't kills it, but instead it tries to gently terminate the activity. The problem is that the activity is still backgrounded (meaning that the Qt event loop is freezed), therefore terminateQt will hang. Task-number: QTBUG-54012 Change-Id: I6e333cbcaf41e9e298eeb8b2b0bc3adcf446783f Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* evdevtouch: Avoid crashing on exitLaszlo Agocs2016-08-103-2/+12
| | | | | | | | | | | | | | | 26238aca8c442736f380eb523ef48468f892bdb7 causes double deletion of the QTouchDevice in case the post routine already cleaned up the list by the time the touch handler gets to do it. Just check the list of devices to see if the one we hold is still there. If not, the pointer is likely to be a dangling one so do nothing. This will avoid dying with bus error or similar on application exit. Task-number: QTBUG-51562 Change-Id: I50c1edee7405aad308274538219698388c2cc9f9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QTabBar: Cache title text sizesGabriel de Dietrich2016-08-102-32/+58
| | | | | | | | | | | | | | | | | | | The first part adds QTabBarPrivate::initBasicStyleOption() which is basically QTabBar::initStyleOption() but without the expensive QFontMetrics::elidedText() call. That is because QTabBar::tabSizeHint() would call initStyleOption() and then immediately discard the result of that computation. Then, QTabBar::tabSizeHint() is modified to cache the calls to QFontMetrics::size(), which is also expensive. The cache is invalidated when the style or the font changes, or when the elide mode is set. Change-Id: I591b2e401af3576a2ebabc5b94f19ae157e28cf2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Wayne Arnold <wayne.arnold@autodesk.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* HiDPI Drag and Drop: Properly render the default image on MacGabriel de Dietrich2016-08-091-1/+15
| | | | | | | | | | | | | | | | | This is only when the attached MIME data contains text, and we fall back to rendering that text into a pixmap. It requires getting the device pixel ratio from the source which, for now, may be a QWidget or a QWindow. Other cases may exist, but that would bring more dependencies than desired. Similarly, it fixes the draggabletext example. Other examples would require either to get updated pixmaps or change substantially in order to support HiDPI (e.g., the fridgemagnets example). Change-Id: I66198214233e3e06c87505744e2aaa9691fe1bb6 Reviewed-by: Filipe Azevedo <filipe.azevedo@kdab.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* winrt: support fullscreen modeMaurice Kalinowski2016-08-091-1/+50
| | | | | | | | | Enable switching application to fullscreen mode. This is mostly required for desktop targets of WinRT. Task-number: QTBUG-54517 Change-Id: I67e4020bc2ec8da86d94815e5765959f4ae2b63f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Always generate size hint for spacer itemsJarek Kobus2016-08-081-1/+5
| | | | | | Task-number: QTBUG-55008 Change-Id: I53c86b64aa3c0a3e5f80551baefe775c2d4b1e90 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QMap: remove statement about STL support during Qt's own configurationGiuseppe D'Angelo2016-08-071-6/+0
| | | | | | | | Since STL support is mandatory in Qt 5, the sentence is a tautology and can be removed. Change-Id: I8676368cc917aa00a85b1113ed2a47694427b2ce Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix permissions on lock files on UnixSimon Hausmann2016-08-051-2/+2
| | | | | | | | | | | | | | We should create the files with 0666 and let the umask take care of adjusting to the final permissions in the file system. [ChangeLog][QtCore][QLockFile] Fixed permissions on lock files on Unix to allow for adjustments via umask. Change-Id: Iee6a6ac3920d0ffd4465f54ac6e955f7fe087173 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Improve reliability of callgrind benchmark resultsSimon Hausmann2016-08-051-1/+6
| | | | | | | | | When running under callgrind, do not bother with the use of the watchdog. The constructor waits for the thread to start, which adds an overall run-time cost that depends on the OS scheduling. Change-Id: I162e2e311c43a6892ebc67dea39899e40babb61d Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Added pointer check in QFontDatabase::loadJesus Fernandez2016-08-051-0/+1
| | | | | | | | | CID 11131 (#1 of 1): Dereference after null check (FORWARD_NULL)46. var_deref_op: Dereferencing null pointer fe. Change-Id: Ifc0cd0b208db511516db93c3d0e0367299df6d80 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Improve performance of QColor::name, now more than 4 times fasterDavid Faure2016-08-051-2/+3
| | | | | | | | | | | | | | Before: HexRgb: 0.00230 ms per iteration, HexArgb: 0.00290 ms per iteration After: HexRgb: 0.00051 ms per iteration, HexArgb: 0.00061 ms per iteration This showed up as a relevant optimization when profiling KIconLoader which uses QColor::name() as part of the key -- thanks to Mark Gaiser for the investigation and first suggestion of a solution. I have also seen customer code writing a replacement for QColor::name() because it was too slow to be used as a hash key. Change-Id: I009ccdd712ea0d869d466e2c9894e0cea58f0e68 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QNativeSocketEngine::option(): return a correct value on invalid callAlex Trotsenko2016-08-051-1/+1
| | | | | | | | Instead of 'true', it should be '-1'. Change-Id: I5e8f99153da68d34b37477ef4cedbc447fba347f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* 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>
* QString: fix append(const QStringRef &str)Anton Kudryavtsev2016-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>