Commit Graph

18076 Commits

Author SHA1 Message Date
Robin Burchell
5ef4e0ed0c QPainter: Fix a hard to trigger null dereference in QPainterPrivate::drawTextItem.
Done-with: Mohammed Hassan <mohammed.hassan@jollamobile.com>
Change-Id: I24c724d24346fb5be8c4a66d68a11d51be5ad5f2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-04-03 01:15:16 +02:00
Mitch Curtis
78f6d144d6 Serialize QPicture using the latest QDataStream version.
The QDataStream version with which QPicture was previously serialized
with was hard-coded to 11 (Qt 4.5). This prevents features of
serializable types used by QPicture from being serialized if they
were added after Qt 4.5; namely features of QFont like
HintingPreference.

[ChangeLog][QtGui][QPicture] QPicture now serializes its data properly
by also accounting for QDataStream versions greater than Qt 4.5.

Task-number: QTBUG-20578

Change-Id: Idd27682b187f4d4a3695c52bbf68e84853c024a8
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-04-02 15:18:11 +02:00
Marc Mutz
463d58325c QColor::colorNames(): reserve the result QStringList
Avoids reallocations.

Change-Id: I56afcdb400d1e07394e62a610f838a33feda9fe8
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-04-02 09:34:22 +02:00
Jan Arve Saether
81c5769493 Fix warnings produced by QT_ASCII_CAST_WARNINGS in widgets/accessible
Change-Id: Ibd468f6f7b4f8b5c4776655d33f27989bafa9b58
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-04-02 09:34:22 +02:00
Trung Ngo
b79a3cd788 IBus: Implement IBus' surrounding text feature
Task-number: QTBUG-37540
Change-Id: I5aacaedff3ada57f6f2c09b0d856340b1a25d1e5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-04-02 09:34:22 +02:00
Trung Ngo
52b802cc66 IBus: Implement QDBusArgument serialization operators
Task-number: QTBUG-37540
Change-Id: Idbe952dbd9851dde2c4aee0662d845996bf0c36a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-04-02 09:34:22 +02:00
Trung Ngo
db665477e9 IBus: New version of IBus.InputContext DBus declaration file
Task-number: QTBUG-37540
Change-Id: I9977198b15c0f827b7483f4131c45fe2a86e8ef5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-04-02 09:34:22 +02:00
Iikka Eklund
d6f58e5e17 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-04-02 07:36:48 +02:00
Joerg Bornemann
83de197a57 qmake: use the manifest embedding feature of the MSVC linker
Since VS 2012 the linker supports the /MANIFEST:embed option, which can
be used to embed the automatically generated manifest without calling
mt.exe. Using this feature simplifies our generated makefiles, esp. in
the case of incremental linking.

Task-number: QTBUG-37363
Change-Id: I2c2d8d2abf36c1b9e7b41bc15244344aab8f5b6e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-04-01 15:56:37 +02:00
Mitch Curtis
3217582405 Simplify and update QDataStream's versioning documentation.
Now we'll no longer need to maintain two separate tables containing the
same information.

Also, update the version after
4f50be8d18.

Change-Id: I82fe243889cee67e47296cc4498c9a93d5472e81
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-04-01 15:03:16 +02:00
Mitch Curtis
de59f74282 Add Qt_DefaultCompiledVersion to the QDataStream::Version enum.
This allows code to, amongst other things, use the latest compiled
QDataStream version in static const variables, where previously the
only alternative was to hard-code the version (and update it with every
Qt version bump) or use QDataStream().version(), which is not allowed
because it increases Qt's startup time.

Change-Id: If1f29fc9cd83c9d7fe619a4ca197152aa9c77a04
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-04-01 12:44:40 +02:00
Iikka Eklund
0ab63b035a Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I2a6eb9dd7724931bc89f28bcc156e77c4e26d069
2014-04-01 11:44:27 +03:00
J-P Nurmi
0cb2c760c2 Item views: respect selection mode when closing an editor
Task-number: QTBUG-31411
Change-Id: I1a52eb739e0bc2afa7227f006461916df8ecaf48
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2014-04-01 05:27:00 +02:00
J-P Nurmi
cc08fc7bfd Item views: respect focus policy when closing an editor
Task-number: QTBUG-31411
Change-Id: Ib0a72755c35a553653ea014672d59979a550b7ae
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2014-04-01 05:26:50 +02:00
Marc Mutz
a6f8aa0ae1 QStringList: use QList:.swap(int,int) in removeDuplicates instead of assignment
This is faster because it just swaps the pointers stored instead of touching
the refcounts. It's the same as qMove()ing the right-hand-side, but benefits
C++98, too.

Change-Id: I6b7e3d0e5c7eb81f88fe9069d6662335d24aa86c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-03-31 22:54:14 +02:00
Marc Mutz
08b8f9d087 tst_QStringList: add more checks for removeDuplicates
Check whether a detach happened, and also check that non-consecutive duplicates
are properly removed.

Change-Id: Iac7a3d8fe5ed5a69a9a0b55ddbf95308f11122c2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-03-31 22:54:14 +02:00
Marc Mutz
35ed65b1a9 QStringList: use a functor instead of a function pointer for std::sort
A function pointer requires aggressive optimization to inline. A function object
otoh is inlined by compilers two decades old.

Even shaves off 544B in text size off of a -O3 GCC 4.7 QtCore build.

Change-Id: Ibfd41654257360fa0f118701f502e6c23a6c28b3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-03-31 22:54:14 +02:00
Marc Mutz
adf0db5243 QStringList::join: micro-optimization
Don't call that->size() if we have already saved its value in a local temp.

Surprisingly, this saves 56B in text size even on a -O3 GCC build, proving
that the compiler does _not_ have enough context to const-fold the repeated
size() evaluation.

Change-Id: I2c41ddc4376f4e1534fc2f0d4789e42b984d3ba6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-03-31 22:54:14 +02:00
Marc Mutz
47d2d19cf6 QStringList: add op<< overload for QList<QString>
QStringList << QList<QString> already compiled, but was interpreted as
QStringList << QStringList(QList<QString>), which involves the QList
copy ctor. Adding the overload saves that copy.

Cannot use a using declaration here, since the return type is different.

Change-Id: I119cc98e7e2df24549a1abb158543b729edc30ef
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-03-31 22:54:14 +02:00
Marc Mutz
2a9d3b7a46 QStringList: remove copy ctor
The compiler-generated one is just fine, and enables the move constructor
inherited from QList, too.

This is BC and SC since QStringList isn't exported.

Change-Id: Ic49000d9feb66504d7ec7e5d519e7a13ca9e5d9e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-03-31 22:54:14 +02:00
Marc Mutz
c3a2fe6436 QCUPSSupport: Extract Method bannerPageToString() from setBannerPages()
The new function just converts the job-sheets cups option argument,
reducing the number of almost-identical switch statements to one.

Effects on a stripped Linux AMD64 GCC 4.7 -std=c++11 -O2 build:
  text: -1008B
  data:   +-0B
  relocs: +-0

Change-Id: I56843fa963e098e5c8ae203584f34bf5798667e6
Reviewed-by: Martin Klapetek <mklapetek@kde.org>
Reviewed-by: John Layt <jlayt@kde.org>
2014-03-31 22:54:14 +02:00
Marc Mutz
c36746a829 QCUPSSupport: Extract Method jobHoldToString() from setJobHold()
The new function just calculates the job-hold-until cups option argument,
reducing the number of setCupsOption() calls down to one.

Effects on a stripped Linux AMD64 GCC 4.7 c++11 release build:
  text:  -552B
  data:   +-0B
  relocs: +-0

Change-Id: I4aa4118c3493cd302dd8fd7f4985c7e0f70ef071
Reviewed-by: Martin Klapetek <mklapetek@kde.org>
Reviewed-by: John Layt <jlayt@kde.org>
2014-03-31 22:54:14 +02:00
Dimitar Asenov
3270b4490b Add a new optimization flag to QGraphicsItem.
The new flag ItemContainsChildrenInShape is similar to the existing
flag ItemClipsChildrenToShape. Setting the new flag makes QGraphicsScene
assume that children are drawn within the shape of the current item
but this is not enforced by clipping. When an application manually
ensures this clipping boundary, setting the new flag removes the
overhead of enforcing the clip with ItemClipsChildrenToShape, while
still allowing other routines to behave more optimially by assuming
children are within the shape of the current item.

[ChangeLog][QtWidgets][QGraphicsItem] Added the
ItemContainsChildrenInShape flag that enables using optimizations
of ItemClipsChildrenToShape without the overhead of enforcing the clip.

Change-Id: I5496fe1ca331b77fd51e0df8a3ace2b8e939eaf2
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2014-03-31 22:54:14 +02:00
Martin Smith
d13d03f012 qdoc: Unexplained empty ref attributes in qhp files
This update fixes a bug introduced by the extensive changes
for QTBUG-35377. Three node subtypes - Group, Module, and
QML module, were promoted to be first line node types in the
update for QTBUG-35377. This broke the file name construction
routine for those node subtypes, which used to have the DocNode
node type. This caused empty ref attributes to appear for those
keyword elements in the qhp file. The file name construction
routine has now been corrected to account for this.

Task-number: QTBUG-37658
Change-Id: I307979255fdfd48493b3a4cebaf996b2130bc2c7
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-03-31 21:05:30 +02:00
Martin Smith
2ea15849a0 qdoc: \l{Qt::Window} links to the wrong page
kThis update fixes a bug introduced by the extensive changes
for QTBUG-35377. The name Qt represents two namespaces, one
in C++ and one in QML. The name "Window" is used in both of
them, so the link \l{Qt::Window} would cause a collision in
the single tree qdoc. In the multiple tree qdoc, there is
no collision, but in this case the link should have gone to
the C++ page and it went to the QML page instead. The fix
involved correcting the way qdoc searches for link targets.

Task-number: QTBUG-37633
Change-Id: Ib9b209eced937a0be0d3299f300ebf22b2776012
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-03-31 21:05:23 +02:00
Martin Smith
900c150a07 qdoc: fix inheritance information for some QML types
This update fixes a bug introduced by the extensive changes
for QTBUG-35377. For a QML base type loaded from an index file,
its QML base type was not being resolved. This resulted in the
"All members" page for some QML types to be incomplete because
the pointer to the base type was 0 when it should have been set.
This change also introduces the concept of "just in time"
resolution for base type pointers, which appears to speed up
qdoc a little.

Task-number: QTBUG-37326
Change-Id: I5f09336ec70ba84029b44b245c56f7f8fe349757
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-03-31 21:05:16 +02:00
Martin Smith
c55d437d29 doc: Remove "current child" code
The current child concept was added to the Name
Collision Node to heuristically provide better
linking when a link operation reached a collision
node. It is doubtful that this improved linking
much, but now that qdoc uses multiple trees, it
is much less likely that collision nodes will
occur. In fact, there are none in in the current
Qt5. Therefore, the current child code is hereby
removed from qdoc.

Task-number: QTBUG-37067
Change-Id: I33aea5d550afb7ceaf941d49112e02c21d44f6dc
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-03-31 21:05:07 +02:00
Martin Smith
a9d75c8eb8 qdoc: Teach qdoc to use multiple trees (part 3)
With this update, qdoc is now ready for testing
with multiple trees. In making this change to using
multiple trees, it has become clear that qdoc does
not really need trees the way it currently uses them.
Each C++ class or namespace, or QML type is naturally
a tree tree structure, but above that level, what we
currently call a tree in qdoc should really be called
a collection of maps. This change has moved qdoc in
that direction. It remains to replace the Tree class
with a class that encapsulates a set of maps, one for
each major node type. That can be implemented later.

Task-number: QTBUG-35377
Change-Id: I39068a0cb26c01f14ec0e4621742d727efb913bf
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-03-31 21:05:00 +02:00
Martin Smith
5fecc6512f qdoc: Teach qdoc to use multiple trees (part 2)
qdoc now knows how to search the forrest of node
trees in an optimal order. But there remain some
problems with specific searches that cross module
boundaries. These include group membership and C++
and QML module membership, as well ass C++ base
class resolution. Part 3 will be concerned with
fixing these remaining bugs.

With this update, qdoc now takes less time to
generate the docs for Qt 5. Testing indicates
that qdoc run time has dropped from about 14
minutes to about 7.5 minutes on an iMac.

Task-number: QTBUG-35377
Change-Id: I6bded6ef54124b4f6e5914cad4548f0b600209b0
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-03-31 21:04:52 +02:00
Martin Smith
e9954e3162 qdoc: Teach qdoc to use multiple trees
qdoc now builds a separate Node Tree for each index
file it parsed. The main Node Tree now contains only
the Nodes of things being documented in the current
module. This should make qdoc run a little faster.

qdoc now uses these separate trees to make intra-module
and inter-module linking more robust by searching the
trees in an order that depends on the type of link it
is searching for. The tree for the current module is
always searched first. Then qdoc searches the trees
for either the C++ modules or the QML modules, depending
on whether it is looking for a C++ link or a QML link.

In preparation for this update, qdoc was also simplified
a lot. Many functions became obsolete and were removed.
Others were combined.

Task-number: QTBUG-35377
Change-Id: Iea4e49869ff6a6ff0f4d53090728770d40d892f3
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-03-31 21:04:43 +02:00
Maurice Kalinowski
f4f23bd5b0 Add support for device capabilities on WinRT
WinRT distinguishes between regular capabilities and device
capabilities. For now the latter section are location, microphone,
proximity and webcam. Hence we must add those properly to the generated
manifest.

However, Windows Phone currently combines all of these into the
Capability section, so add a warning if someone uses devicecapabilities
for Windows Phone.

Task-number: QTBUG-37932
Change-Id: I8e9550f29b6afdea3737cc85bdc68344fc04223d
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-03-31 19:50:37 +02:00
Andrew Knight
423823dd2d d3dcompiler_qt: Improve shader source structure
The following adjustments are made:
 - A precompiled path, defaulting to a QRC path, is added for looking
   up precompiled shaders
 - The standard service source/binary paths are created if needed, in
   order to avoid fast-fails when the service cannot create the structure
   itself fast enough.

Change-Id: I966e54c0b35bafdaf0b3a32b76eb896308aca6db
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-03-31 19:50:37 +02:00
Laszlo Agocs
c4aabeb2b8 Propagate textureChildSeen properly
even if setParent() is not called afterwards.

Change-Id: Ie54e227c7adda2710fbd46176e9a15252aef2985
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-03-31 19:50:37 +02:00
Friedemann Kleint
ebd8530cbc Make tst_qopengl more verbose.
Add more checks, compare size of converted images.

Task-number: QTBUG-31611

Change-Id: I995071f4be097c08aa2917be03fd7196882ae2c2
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-03-31 19:50:37 +02:00
Mitch Curtis
4f50be8d18 Properly serialize QFont.
Some data was never serialized (styleName, hintingPreference) and
some was incorrectly serialized (styleStrategy). This change also adds
auto tests for every applicable QDataStream version.

[ChangeLog][QtGui][QFont] QFont now serializes its data properly,
without any data loss.

Task-number: QTBUG-22814
Task-number: QTBUG-22946

Change-Id: I34e61b10662b7ad6c57054dacc7e1f522f5b5c5d
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-03-31 17:45:47 +02:00
Mitch Curtis
bd822bedfe Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-03-31 17:45:37 +02:00
Friedemann Kleint
18a444c330 Send touch update events to widget if there is a gesture pending for it.
Otherwise, touch update/end events were ignored and the gestures
were never triggered (unless a native widget was used).

Task-number: QTBUG-37759

Change-Id: I4b0145ffe535065e1458164b67bc8d9e33a4af97
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-03-31 17:30:32 +02:00
Konstantin Ritt
4a46b15514 Make QWindowsMultiFontEngine support deferred fallback families query
This finishes 800232e1d3, which encovered
a tricky issue in QFontEngineMultiQPA::createMultiFontEngine().

Task-number: QTBUG-37836
Change-Id: I6d432e09e755f5d9ded09752c4c092f4857ad224
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-31 17:28:00 +02:00
Konstantin Ritt
5f19e2c8f3 Fix QFontCache::Key comparison for custom font fallbacks case
Just a C&P typo, of course we have to compare lists, not their sizes.

Change-Id: I40542035b87f5bb8d75207cb02c0826cc3a2a413
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-31 17:27:47 +02:00
Konstantin Ritt
5dfe7b5fed Drop dead code
The QFontEngineMulti's `base` font engine always non-null.

Change-Id: I5092b66bc839a6a3216ffa0b0afe55a8b62be620
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-31 17:27:24 +02:00
Paul Olav Tvete
eccf1c51a6 Android: input method fixes for SwiftEdit keyboard
* Report correct pre-edit information when calling updateSelection()
  on endBatchEdit()
* Fix getExtractedText() to report the correct offset and cursor position,
* Fix setSelection() to use the correct cursor position.

Task-number: QTBUG-35689

Change-Id: I7e8427d0f5a18abf18ba2faf9d510756ddf6044b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-03-31 14:01:35 +02:00
Tor Arne Vestbø
e432787ad0 iOS: Share default-FBO for windows between contexts in a share-group
The current implementation of QOpenGLContext sharing assumes that the
contexts form a tree and that leaf-nodes are destroyed before their
parents.

We build on this assumption and keep track of the default FBOs for
windows in the root context of the tree. This allows two shared
contexts to both makeCurrent() on the same window surface without
resulting in two FBOs being set up (which doesn't work on iOS due
to the CEAGLLayer already being tied to another render-buffer).

Change-Id: Ib9f8c597effe488480fe99e10846be22c257f490
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-03-31 13:48:52 +02:00
Marc Mutz
38b66bdcde QNX: use QStringList::join(QChar) overload
Doesn't construct a temporary QString.

Change-Id: I368c5f997f74c1ce6b2930ac4df292c7a6d5c87c
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2014-03-31 13:12:38 +02:00
Kai Koehne
b5731ceef1 Update copyright year in tools output
Change-Id: I9ee9604303b3cb29f89a4252df5af35e729f6249
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2014-03-31 12:46:44 +02:00
Kai Koehne
1bc0df35d1 Updated outdated README for thread examples
Change-Id: I3fa8ac350dc89546793d49a31cc5a152c1f55958
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-03-31 12:46:38 +02:00
Kai Koehne
24ac0efd97 Update copyright year in LICENSE.LGPL
Change-Id: I38c4512751de33d813567bf41b249a7123c9a38a
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2014-03-31 12:36:33 +02:00
aavit
624ac989ce Fix compile for embedded Android
It also has a broken declaration of posix_memalign

Change-Id: Ie8f245564f80b04901425729b46953828204efaf
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
2014-03-31 12:13:15 +02:00
Samuel Gaist
35a11d6fce OS X QSettings auto test/writing check update
This patch aims to provide an updated test that follows changes started
in 10.7: new rule is that only root can access SystemScope settings. It
also disables the sync() workaround code path which is at least not
executed during the tst_QSettings execution and returns wrong value to
the test.

From Apple's documentation:
"Note that modification of some preferences domains (those not
belonging to the “Current User”) requires root privileges (or Admin
privileges prior to OS X v10.6)—see Authorization Services Programming
Guide for information on how to gain suitable privileges"

https://developer.apple.com/library/mac/documentation/CoreFoundation/Reference/CFPreferencesUtils/Reference/reference.html

[ChangeLog][QtCore][QSettings] QSettings now returns the correct value
for isWritable() when using SystemScope settings.

Task-number: QTBUG-9824
Task-number: QTBUG-21062
Task-number: QTBUG-22745

Change-Id: Ib6a1490ec596b99d189ec4de9a0f28ecfd684172
Reviewed-by: Liang Qi <liang.qi@digia.com>
2014-03-31 12:12:21 +02:00
Maurice Kalinowski
0c7241ccf2 Add documentation for WINRT_MANIFEST
Basically a copy of the inline documentation inside the prf file.

Task-number: QTBUG-37788
Change-Id: Ie6df1597297223be778c748aad525f5521232cb7
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2014-03-31 12:09:43 +02:00
Andy Shaw
f2111ff1d7 NSScreen screens may be empty so add the main screen in that case
In some circumstances NSScreen screens can be empty yet there is still a
valid main screen so we prevent any problems arising by ensuring we work
with the main screen in that instance.

Task-number: QTBUG-37876
Change-Id: I5827009a9894eb8c1d4f5addc6c6f59e1c50c3d0
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-03-29 21:23:18 +01:00