Commit Graph

24467 Commits

Author SHA1 Message Date
Thiago Macieira
61e621def3 Remove unnecessary check from qt_safe_pipe: condition can never happen
FD_CLOEXEC is implicit for us, so no caller will need to set O_CLOEXEC.

Change-Id: Ib056b47dde3341ef9a52ffff13efcb635dea95f0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-07-17 17:36:14 +00:00
Thiago Macieira
7331b15525 Add QTemporaryDir::errorString()
[ChangeLog][QtCore][QTemporaryDir] Added errorString() method that
returns the string explaining why creating the temporary directory
failed.

Change-Id: Ib306f8f647014b399b87ffff13f0a1f3c89e0a2c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-07-17 17:36:07 +00:00
Thiago Macieira
5af7f7ec46 Make the -pkg-config and -force-pkg-config options be the same
There's really no difference between them, other than -force-pkg-config
skipping the check if the tool is even available and printing a warning.

Change-Id: I04cb83c6649ef73866a84032ea46093c4a00ce00
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-07-17 17:36:03 +00:00
Simon Hausmann
dcc301abfa Merge "Merge remote-tracking branch 'origin/5.5' into HEAD" into refs/staging/dev 2015-07-17 14:43:34 +00:00
Simon Hausmann
b2603b7665 Merge remote-tracking branch 'origin/5.5' into HEAD
Conflicts:
	src/plugins/platforms/windows/qwindowsopengltester.cpp

Change-Id: Ia7abeba9395ccf84e2fa81b91a5725a86dedb9fe
2015-07-17 16:35:42 +02:00
David Faure
5443da6c27 QFileDialog: add setSupportedSchemes and pass it along to the QPA.
This also finishes the implementation of the static methods which
were being passed a supportedSchemes argument but weren't using it.
Now they can pass it along to the QFileDialog instance, which then
passes it to the helper used by the QPA implementation of the file
dialog. The default implementation only supports local files and
can therefore ignore this, but other implementations can use this
argument to restrict the protocols allowed to the user.

[ChangeLog][Widgets][QFileDialog] Add supportedSchemes property.

Change-Id: I5235f70e785da1c06866a8355ef98f571890c4a2
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-07-17 14:29:47 +00:00
David Faure
4e4b16dc17 Doc: fix punctuation and missing word in QFileDialog docu.
Change-Id: I7388eda21bcea755db07c8b9603ec4e5f521c2fd
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
2015-07-17 14:29:43 +00:00
David Faure
31a1b3df1d QtConcurrent example: remove unneeded explicit template type
I show this code during trainings and this explicit template type
just makes the line of code more complex than it has to be.

Change-Id: I294c65f48967e54c67d9c3b8e1de96c3c2495a5b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-17 14:29:42 +00:00
Friedemann Kleint
4b8ba3c91a Fix sub test float of tests/auto/testlib/selftests/tst_selftests for MSVC 2015.
From MSVC 2015 onwards, MSVC formats floats using printf("%g") like
g++, so the fiddling of the expected output needs to restricted
accordingly.

Change-Id: I6e7f78e5e90f70886a8b2ef37c0fb9bf82b5e1a3
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-07-17 14:15:19 +00:00
Friedemann Kleint
2fe56e37ed Polish the examples/widgets/mainwindows example.
- Introduce Qt 5 signals & slot syntax.
- Replace QSignalMapper used for the corner/area
  actions by a by a functor.
- Improve command line parsing.
- Reorder class declarations.
- Remove commented-out code.
- Use QDialogButtonBox in dialogs.
- Fix minor issues in code, use multi-argument version
  of QString::arg(), QDir::toNativeSeparators() to
  present file paths to the user, static method
  invocations.

Change-Id: I865c56639c74135b59740797e9a9dfbfca2e72b6
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-17 14:15:11 +00:00
Friedemann Kleint
7f77d4fcd5 tst_qprintdevice: Extend output.
Show the printer parameters using the new QDebug operator
for QPrintDevice for better error analysis in the CI.

Produces output:
Created printer *HP_Color_LaserJet_CM6030_MFP*:
QPrintDevice(id="HP_Color_LaserJet_CM6030_MFP", state=0, name="HP Color LaserJet CM6030 MFP", makeAndModel="HP Color LaserJet CM6030 MFP Postscript (recommended)", default, defaultPageSize=QPageSize("Letter", "Letter", 612x792pt, 2), supportsCustomPageSizes, physicalPageSize=(278, 396)..(907, 1296), defaultResolution=600, defaultDuplexMode=0, defaultColorMode=1, supportedMimeTypes=( "application/pdf" "application/postscript" "image/gif" "image/png" "image/jpeg" "image/tiff" "text/html" "text/plain"))

Task-number: QTBUG-47246
Change-Id: I5245d19ecf958a730a0288d5eff2d24fc3064a55
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
2015-07-17 14:15:04 +00:00
Friedemann Kleint
fdb8ef6507 Polish the widgets/mainwindows/sdi example.
- Introduce Qt 5 signals & slot syntax.
- Use QCommandLineParser to obtain file arguments, factor
  out positioning into tile() function to be able to
  use it from command line and open/new slots.
- Merge MainWindow::createMenus()/createQToolBars()
  into MainWindow::createActions(), removing the need
  to store the actions as member variables.
  Use QMenu::addAction() for brevity.
- Use QIcon::fromTheme() to obtain system icons and use
  resource icons as fallback.
- Rewrite settings code to use
  QWidget::saveGeometry(), Widget::restoreGeometry() since
  saving size and position does not work well with multiple
  screens. Query the available size when determining
  the initial size instead of using hard-coded values
  for High-DPI screens.
- Fix minor issues in code, use multi-argument version
  of QString::arg(), QDir::toNativeSeparators() to
  present file paths to the user and and static method invocation.
- Fix snippet references accordingly.

Change-Id: I3ea0372bc7ff82247192f54620289352fb68d60f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-17 14:14:56 +00:00
Friedemann Kleint
696ea2fff1 tst_qmimedatabase: Add some log output when running update-mime-database.
When running the test, one gets the impression that it hangs.
Add some debug output including time to show what happens.

Change-Id: Iac6b4f0518ecec62169bf2269a0a8ec9192da570
Reviewed-by: David Faure <david.faure@kdab.com>
2015-07-17 14:14:42 +00:00
Laszlo Agocs
756266d015 Map Shift+Tab to Shift+Backtab in evdevkeyboard
This mapping has to be done manually, like we do on Windows
for example.

libinput maps through xkbcommon, like xcb, so it is already correct.

Task-number: QTBUG-46845
Change-Id: I61f3f1160e2581aae2ef43cc260f191f6d344fec
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
2015-07-17 11:24:35 +00:00
Friedemann Kleint
26bcc0565f QDir::removeRecursively(): Retry file deletion with write permission set.
On Windows, having read-only files in a directory can cause removal
to fail. When file deletion fails, check on the permissions, set
write permissions and retry.

Split apart code paths by OS in tst_QDir::removeRecursivelyFailure();
deletion of the read-only directory on UNIX should still fail.

Change-Id: I36e54be5229a7b552e90fd5f42722b868fa0b6ee
Reviewed-by: David Faure <david.faure@kdab.com>
2015-07-17 11:06:28 +00:00
Friedemann Kleint
d6553d2cd8 Stabilize tst_QListView::batchedMode().
The test showed failures on OS X:

FAIL!  : tst_QListView::batchedMode() Compared values are not the same
    Actual   (ba.size()): 2
    Expected (3)        : 3
    Loc: [tst_qlistview.cpp(848)]

Use QTRY_COMPARE() to count the number of visible indexes with
a helper function instead of using hard-coded timeouts. Item 3
appears with a little delay on OS X.

Change-Id: I2fb2ff5ebdf9dbe85bdc79401375ad6f47b7b12b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-17 10:30:39 +00:00
Kavindra Palaraja
99b94aadf8 Fixed typo in QObject docs.
The code samples seem to be using Qt::FindDirectChildOnly. Changed this
to Qt::FindDirectChildrenOnly.

Task-number: QTBUG-46383
Change-Id: I99b05e5e279bff8f799a09b0d7b02512fc73170b
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-07-17 04:27:14 +00:00
Thiago Macieira
2dbe90c248 forkfd: update the API to add a reading and closing function
Right now the two functions being added are just wrappers, but this will
allow us in the future to support FreeBSD and Linux's system calls that
do the equivalent of forkfd, but have slightly different semantics in
the actual getting of the information from the file descriptor.

See-Also: https://lkml.org/lkml/2015/3/12/1044
See-Also: http://www.freebsd.org/cgi/man.cgi?query=pdfork
Change-Id: Ia0aac2f09e9245339951ffff13c94acb5f4ff204
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-07-17 00:55:45 +00:00
Thiago Macieira
8485fe9af8 Don't complain about non-matching Qt versions in qwidget.cpp
Commit 5bf67f5f41 did it for qobject.cpp,
but I missed qwidget.cpp (I hadn't realized the test existed there too).

Change-Id: Ib056b47dde3341ef9a52ffff13eeceafcfc64893
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-17 00:55:35 +00:00
Thiago Macieira
0d9db5821c configure.bat: Search for icl.exe before cl.exe
The Intel compiler's compilervars.bat also puts the MSVC compiler in
PATH, so cl.exe was always being found first.

Change-Id: I72e524da10fb0e221c4530a3e5c1a4a347c3f878
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-07-17 00:52:57 +00:00
Thiago Macieira
78d8759b04 configure: Initialize variables for the EGLFS backends
Otherwise the information is missing from configure's output summary:

    EGLFS ................ no
      EGLFS i.MX6....... .
      EGLFS KMS .......... no
      EGLFS Mali .........
      EGLFS Raspberry Pi .
      EGLFS X11 .......... no

Change-Id: Iee8cbc07c4434ce9b560ffff13cb331778c70261
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-07-17 00:51:00 +00:00
Thiago Macieira
d0813bfa6a Update the list of compilers we are free of warnings with
I've tested with GCC 5, Clang 3.5 and 3.6 on Linux.

Change-Id: Ia0aac2f09e9245339951ffff13c87198f2e8aa35
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-07-17 00:50:04 +00:00
Thiago Macieira
769047fbc7 configure: properly quote the test name containing spaces
Such as "OpenGL ES 2.0"

Change-Id: Ib306f8f647014b399b87ffff13f15f58c84a12ae
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-07-17 00:49:09 +00:00
Friedemann Kleint
2a289d1947 Stabilize tst_QApplication::touchEventPropagation().
The test checks whether a child window receives
mouse events synthesizes from touch. Enlarge the child
window so that it fully covers the parent and move the
touch point a bit inside so that it is not affected
by window manager positioning issues.
Use QTRY_VERIFY.

FAIL!  : tst_QApplication::touchEventPropagation() 'widget.seenMouseEvent' returned FALSE. ()
     Loc: [/work/build/qt/qtbase/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp(2107)]

Change-Id: Ic08e68b1e547cc7148cd8994464fdc2a14ac507b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-16 21:45:28 +00:00
Friedemann Kleint
a847c2cb61 Stabilize tst_QTouchEvent::touchBeginWithGraphicsWidget().
The test sends touch events to the root item at the top left
corner which fails if the views starts to scroll.
Make the view sufficiently large to prevent scrolling and align
at top left.

FAIL!  : tst_QTouchEvent::touchBeginWithGraphicsWidget() Compared values are not the same
     Actual   (((root->touchBeginCounter))): 0
     Expected (1)                          : 1
     Loc: [/work/build/qt/qtbase/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp(1471)]

Change-Id: I357322ccc809ddb5cb587febf3c75cbe497e59d8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-16 21:43:31 +00:00
Thiago Macieira
e9a7825cf7 Remove the ref-qualified versions of segments and normalized
They can't be ref-qualified if the QVersionNumber object doesn't actually
hold a QVector<int>, as the next commit will make it: for segments(),
there might not be a QVector to be moved; for normalized(), the common
case will be that there's no gain in ref-qualifying.

Change-Id: I4bfb8b8765a502c0de6aed693752217106e575a2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-07-16 18:33:48 +00:00
Olivier Goffart
4e8adb4b7b QMainWindow: Remove dockwidgets from the floating tabs when plugging
Example on how to reproduce the bug with examples/widgets/mainwindows/mainwindow:

 - Select the option "Groupped Dragging" from the "Main window" menu
 - Drag and drop dock widget so there are at least three of them in
   the same group of tabs (for example red, black, and green)
 - Drag the tab bar of one of them outside to make it floating
   (for example black)
 - Drag away the group of two remaining tabs to make them floating
 - Drack back the floating-alone (black) dock widget somewhere
   back inside the main window.
 => The black dock widget is tabbed with the other instead of being
    where we put it

That's because it was still inactive (skipped) in the tab group.

Task-number: QTBUG-47209
Change-Id: I84ac33d4ca1df0381c6007486b41830bd7be99a8
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-07-16 15:06:02 +00:00
Friedemann Kleint
3e34484a3f tst_qaccessibility: Add message in case fuzzy comparison of QRect fails.
Change-Id: I815dc5e79c539b384793bf3573f6149240cf0390
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-07-16 13:29:41 +00:00
Marc Mutz
b31923c5e5 QStyleSheetStyle: mark QRenderRule and ButtonInfo movable
Because they are.

Change-Id: Iab029e4b120f10efc99d62960b88fbba7603cc1b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-16 13:25:14 +00:00
Marc Mutz
a3f780b4a1 QCommandLineOption: prevent aggressive inlining
Even though we expect very few option names, GCC unrolls the
loop calling IsInvalidName::operator() four times. Together
with the lead-in/lead-out for size() % 4 != 0, that makes
for five inlined copies of the function call operator.

I don't know how to prevent the unrolling, but at least I can
stop the inlining.

Change-Id: Ib9d6c33e8193464a73927a92b8b54c3452cb26a3
Reviewed-by: David Faure <david.faure@kdab.com>
2015-07-16 13:24:23 +00:00
Marc Mutz
c3597c3fcf QCommandLineOption: never inline the warning function
We suppose that this function will never be called, yet the
compiler still inlines it in all four places.

Stop it.

Change-Id: If601bc3644cacb77aeab9d615578e4afb349a73e
Reviewed-by: David Faure <david.faure@kdab.com>
2015-07-16 13:24:16 +00:00
Marc Mutz
1aaed259e0 QFileSystemModel: add a symbolic constant for the number of columns
There are other literal 4's used in the implementation, so
disambiguate.

Change-Id: I5b0e4ac0018f9d5734e3de8b4f75259e175b23d3
Reviewed-by: David Faure <david.faure@kdab.com>
2015-07-16 13:23:04 +00:00
Marc Mutz
ae2de2fe99 QPlatformBackingStore: don't hold QBackingstoreTextureInfo in QList
QBackingstoreTextureInfo is larger than a void*, so holding them in
a QList is needlessly inefficient. Worse, the code could come to
depend on the fragile property of (inefficient) QLists that
references to elements therein never are invalidated.

Change-Id: I5edf846ee8f01ae36c9314147261748270e1fdf6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-07-16 13:21:52 +00:00
Marc Mutz
0d4711e2f5 QStyleSheetStyle: scope a ButtonInfo object better
Only one of the three following branches actually uses the ButtonInfo
object, so create it only in that branch.

Change-Id: I65c1d45d807258ed3352018c088bb4c4c66f9b84
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-16 13:21:46 +00:00
Marc Mutz
54a09a4188 Mark some QtMetaTypePrivate classes movable
These types are held in QVariant.

This change should be BC, because it's private API, even though
it is located in a public header file. The classes are used as
private data members in the respective public API classes, but
we don't change the size or composition, and holding these
types in a QList would be outside the use of non-private API
for which we promise BC.

Change-Id: I7ef1c1ca57e9d87c6474c97bb2fa8afef170c88f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-16 13:21:41 +00:00
Marc Mutz
7e1d5c7b18 QStyleSheetStyle: remove empty QRenderRule dtor
Prevents the compiler from synthesizing move assignment
operators for QRenderRule, thus ButtonInfo.

Change-Id: I3a4d67198606a7b84eeb9f454f4e076deb70d048
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-16 13:21:36 +00:00
Marc Mutz
2c41d6f7a1 QPolygon(F): add some move ctors
Change-Id: Ib0eb071e371a7198db26d4279bb901e49b3da2fe
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-16 13:21:30 +00:00
Marc Mutz
6e42a1ad4e QStyleSheetStyle: separate data and functions in QRenderRule
In preparation of marking it movable. For this, it is important to
have a good overview over the data members. Distributing them among
the function members is not helpful for that. Fix.

Change-Id: I29e6e270c698ce32f7e58e083e6205bdba9c1362
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-16 13:21:24 +00:00
Marc Mutz
2c235303c2 QPlatformFontDatabase: compress an array of ushorts
First, all values in the array fit into 8-bit, so change the type
from ushort to quint8.

Then, instead of appending a zero as end marker, statically
determine the size of the array and use that number.

Also fixes (benign) off-by-one error in the existing reserve()
call.

Change-Id: Id05b6a56b55d2e0769b00496a55808bb7351b084
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-16 13:21:15 +00:00
Marc Mutz
0b43c0a743 Mark QNetworkReplyImplPrivate::InternalNotifications as primitive
Held in QQueue, thus QList.

Change-Id: I9d13babb4c08eddbd67ede31da48c0c5f5fdbd5f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-16 13:21:11 +00:00
Marc Mutz
4927980523 QPairVariantInterfaceImpl: init all fields
Same pattern as used for Q{Sequential,Associative}IterableImpl.

Change-Id: Iacec3266af80eecf491d2bb766c6fddd1365bdaa
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-16 13:21:05 +00:00
Thiago Macieira
827f934760 QThread: simplify the pthread_cleanup_pop function
Make sure that the QString is not in scope anymore when the pthread
cleanup happens. C++ destructors in scope are pthread cleanup handlers.

Change-Id: I9a75ad8521ae4e5cbbe5ffff13d1ae1c7e31f6bb
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-07-16 13:20:59 +00:00
Marc Mutz
73991bee38 QCommandLineOption: add some Q_UNLIKELY
These are all error conditions, and should not happen in practice.

Naturally, there's no savings in executable size, because the
compiler just shuffles the layout of the branches around.

Change-Id: I52b98cc696fd808735c7d73c1f21e02478ff4f5a
Reviewed-by: David Faure <david.faure@kdab.com>
2015-07-16 13:20:44 +00:00
Marc Mutz
cde7f1b469 QCommandLineOption: reduce string data
... by centralizing the common part of repeated qWarnings() in a single
function, passing the variable part through %s.

Change-Id: I114d10f41d4b0bbf59ef87f75308dc5b3ccd3967
Reviewed-by: David Faure <david.faure@kdab.com>
2015-07-16 13:20:38 +00:00
Laszlo Agocs
9d0a10dc84 Move eglfs-only parts back from eglconvenience
The integration, screen, window and cursor classes were split in Qt 5.3 under a plan
of sharing these between eglfs, the Android port and potentially other future plugins.
This never materialized.

Maintaining the artificial split is getting difficult and is prone to errors. Therefore
it is time to merge back these base classes into eglfs. The result is cleaner, smaller,
and potentially better performing code. eglconvenience is now restored to be a collection
of convenience classes instead of platform plugin bits.

Change-Id: I75c6ad876ef66a1a0c5b39c1c307f928d2ed47d4
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
2015-07-16 13:20:09 +00:00
Tasuku Suzuki
8f814e8cba QT_LOGGING_RULES supports multiple rules separated by semicolons
[ChangeLog][QtCore][Logging] QT_LOGGING_RULES now supports multiple
rules separated by semicolons

Change-Id: I7fdd62a3d719aeb16cad54f193befb6c203bc160
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-07-16 13:04:40 +00:00
Thiago Macieira
287971eb7f Refactor QVersionNumber to use the public functions when possible
Use segmentCount() and segmentAt() instead of going to m_segments. This
is done in preparation for a major refactor of QVersionNumber that will
store the version numbers in the object itself, without QVector.

Change-Id: I03dbdee59a3c74c21a0a4e70c1bb9182250f6223
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-07-16 13:00:51 +00:00
Thiago Macieira
7714ef7406 Set Q_CC_INTEL to the ICC version when in MSVC compat mode
Commit ffcad3244f did that for the GCC-
compat mode, but I forgot the MSVC one.

Change-Id: Ib1d49f003062638b4e27e5ead4554e25f539c373
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-16 08:28:18 +00:00
Thiago Macieira
cf3a639f9d Improve ICC compatibility with older MSVC versions (up to 2010)
Like on OS X and Linux, ICC uses the native compiler's standard library
headers, so the C++11 features that depend on headers need special
attention.
 * <initializer_list> is missing with MSVC 2012. It is present on 2010
   for some reason and it appears to work
 * ICC disables Unicode string support prior to MSVC 2015, probably
   because MSVC Standard Library headers have a typedef for char16_t

std::nullptr and std::move should have come with MSVC 2010, but I'm not
keeping compatibility with MSVC 2008. It's been deprecated since ICC
14.0 (Composer XE 2013 SP1, released in 2013) and support was removed in
15.0 (Composer XE 2015, released in 2014). ICC hasn't supported MSVC
2005 since ICC 13.0 (Composer XE 2013).

Task-number: QTBUG-47119
Change-Id: Ib306f8f647014b399b87ffff13f139174aeeafff
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2015-07-16 08:28:14 +00:00
Thiago Macieira
3aa5ef2ea9 Disable thread-safe statics for MSVC 2015: they're broken
An object that throws in its constructor cannot be reentered. This
violates both C++11 and C++98. It's also a regression from MSVC 2013.

The unit test is renamed to indicate what it really does, as opposed to
a misleading name that was probably a "thinko" on my part.

Task-number: QTBUG-47224
Change-Id: Ib306f8f647014b399b87ffff13f132436d0578ef
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-07-16 08:28:07 +00:00