Commit Graph

4330 Commits

Author SHA1 Message Date
Matt Broadstone
d6d7624796 Added constructor to QJsonValue for const char *
For convenience, it reads more easily (and is somewhat expected) to
be able to add a string to a QJsonArray like you might with a
QVariantList: QJsonArray() << "string". Previously, QJsonValue provided
a private void* ctor to explicitly deny this case because it would
implicitly convert to a boolean. This ctor provides a const char* ctor
(much like QVariant) that interprets the incoming text as utf8 and
creates a String type QJsonValue.

[ChangeLog][QtCore][QJsonValue] Added constructor to QJsonValue for const char *

Change-Id: Icafa954d3da1fb264f9d0fd7cd1a1d2fbbe15095
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-01-16 21:49:26 +01:00
Matt Broadstone
13806e6787 Added convenience methods to QJsonArray for appending QJsonValues
operators for +, +=, and << were added to QJsonArray to make
it easier to work with, and more closely resemble the Qt
container classes

[ChangeLog][QtCore][QJsonArray] Added convenience methods to QJsonArray for appending QJsonValues

Change-Id: I96e0a43015f7c0f980cbbef7f20bd2085ee04795
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-01-16 21:49:18 +01:00
Joerg Bornemann
5ca6039b77 remove qt_windows.h from qwinoverlappedionotifier_p.h
Preparation for making QWinOverlappedIoNotifier public.

Change-Id: Id443514a134b5c13e64d4d89450a7912ab38d40f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-01-15 18:43:20 +01:00
Konstantin Ritt
edfce46a6c Update the Unicode Data and Algorithms up to Unicode 6.3.0
* Mongolian and Phags-pa characters have been given a Joining_Type
  classification for contextual shaping. As a part of these additions,
  one Phags-pa character has the Joining_Type value of L (Left Joining),
  which no character had been assigned before.
* The unassigned code points in the Currency Symbols block have been
  given the Bidi_Class property value ET and the Line_Break property
  value PR, to help implementations support new currency symbols,
  when they are encoded.
* Hebrew letters and basic punctuation marks have been assigned
  the newly introduced Word_Break property values Hebrew_Letter,
  Single_Quote, and Double_Quote.
* The Bidi_Class property has been extended with four new values
  for directional isolates.
For more details, see http://www.unicode.org/versions/Unicode6.3.0/

Change-Id: Iad62d02edc58a8497898dcd6d6c70d5aece317ea
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-01-14 15:38:57 +01:00
Konstantin Ritt
a6046be428 Update UCD source files up to Unicode 6.3.0
Change-Id: I9ab58a659af1e758b172a24aa95bce1fea89c33d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-01-14 15:38:43 +01:00
Oswald Buddenhagen
882bf3475c expand tabs and related whitespace fixes in *.{cpp,h,qdoc}
the diff -w for this commit is empty.

Started-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-13 22:46:50 +01:00
Konstantin Ritt
4f8f0f16d0 Update the internal CLDR tables up to v.24
Change-Id: I9c0b110e36dd80c6a0b7275aa13bc548419aca9c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: John Layt <jlayt@kde.org>
Reviewed-by: Mehdi Fekari <mfekari@blackberry.com>
2014-01-13 19:02:10 +01:00
Frederik Gladhorn
019588f307 Testlib: Add test duration to xml output
[ChangeLog][QtTest] Added test duration to xml output.
When running tests with xml output a new tag of the form
<duration msecs="123"/> is added to each test function and the test as a
whole.

Change-Id: Ibc4db066b6acf5fac6c578f5e5ca5ce4b5d8ea8e
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2014-01-13 07:13:17 +01:00
Frederik Gladhorn
7917dfbf1c Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I99af0bef7f1c931533a324ebcfb27c40ee871a5e
2014-01-10 18:27:49 +01:00
Thiago Macieira
eaedc04d90 Autotest: Fix QDateTime failure if the test got run West of Greenwich
There was a comment about the test failing for max() because of an
overflow. That happens if you're at UTC or ahead of it (to the East of
the Prime Meridian), which is how this test usually gets run (UTC,
Europe/Oslo, Europe/Helsinki, Pacific/Auckland). But if you're behind
UTC (to the West of the Prime Meridian), then the overflow happens for
min().

Change-Id: Iebba49d1303e9f18f5038f5cf23c77bf83e5fd4b
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2014-01-09 22:49:23 +01:00
Thiago Macieira
cd750c86d6 Use the new UTF-8 codec in QJsonDocument
The encoder is in qjsonwriter.cpp, which requires special handling for
ASCII due to the use of escape sequences. The decoder is in
qjsonparser.cpp, which only scan one character at a time.

As a side-effect, the JSON parser now reports the UTF-8 error in the
first character with error, instead of the last. This is probably what
should have been expected.

Change-Id: I52e5bc30d71466b6a36098b4150c61b2e385d8e9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-09 22:34:54 +01:00
Thiago Macieira
8dd47e34b9 Add a new UTF-8 decoder, similar to the encoder we've just added
Like before, this is taken from the existing QUrl code and is optimized for
ASCII handling (for the same reasons). And like previously, make
QString::fromUtf8 use a stateless version of the codec, which is faster.

There's a small change in behavior in the decoding: we insert a U+FFFD for
each byte that cannot be decoded properly. Previously, it would "eat" all bad
high-bit bytes and replace them all with one single U+FFFD. Either behavior is
allowed by the UTF-8 specifications, even though this new behavior will cause
misalignment in the Bradley Kuhn sample UTF-8 text.

Change-Id: Ib1b1f0b4291293bab345acaf376e00204ed87565
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-09 22:34:54 +01:00
Christian Loose
955d0df873 Add option NoCancelButtonOnLastPage to QWizard
Add support to hide the cancel button on the last page of a wizard. This
is useful for wizards where the last page is used as a summary page that
should not be cancelled.

[ChangeLog][QtWidgets][QWizard] Added NoCancelButtonOnLastPage option.

Task-number: QTBUG-7484
Change-Id: I282bda55a8dec9cde6439a9285d79e0a5c6df96a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-01-09 21:03:25 +01:00
Jan Arve Saether
0efc6e92d8 Use the default height (not 0) if only width is specified
If width was specified, but not height (or vice versa) the actual
window size was not as expected:
* The window width was not the width specified.
* The window height became 0.
This was unexpected, since if both width and height was not specified
it would fallback to becoming 160x160 (on Windows).

However, with the advent of https://codereview.qt-project.org/71999
both width and height might receive sensible defaults based on the
content of the ApplicationWindow, which would mean that it might be
reasonable to expect that you only need to specify one size component
of the window.

This also fixes an assertion in file
..\..\..\3rdparty\angle\src\libGLESv2\renderer\SwapChain9.cpp, line 81
The assertion happened when a window was created with 0 height (but
valid width), and then its height got increased, causing it to become
visible.

Change-Id: Ia9e730418e35d679907bdcc59b00c3c988216c32
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-01-09 19:27:32 +01:00
hjk
48f1ebc040 Add QVarLengthArray::{indexOf,lastIndexOf,contains} functions
[ChangeLog][QtCore][QVarLengthArray] Added the indexOf, lastIndexOf and
contains functions to QVarLengthArray.  These functions make the class
more similar to QVector.

Change-Id: I9bd2b22bd8b7151c2d17aede36e5f2126570600b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-01-09 17:42:22 +01:00
Tomasz Olszak
3867bc5a10 Send DynamicPropertyChange event only when value is changed.
According to docs DynamicPropertyChange event should be sent from
setProperty function only when property is added, removed or
changed.

Change-Id: I080a27a4119a63580b03172f4b5b367338c6f440
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-01-09 12:14:42 +01:00
Allan Sandfeld Jensen
b28764c641 Inplace versions of QImage rgbSwapped() and mirrored() for rvalue refs
Adds inplace version of QImage::rgbSwapped() and QImage::mirrored() that
can be used on temporary QImage objects when supported by the compiler.

[ChangeLog][QtGui][QImage]Rvalue qualified mirrored and rgbSwapped methods for inline conversions
Change-Id: I4ffb658bf620dfc472d9db14c1aa70291c1fd842
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-01-08 18:08:47 +01:00
Frederik Gladhorn
8f80ff338e Make output when failing a test for diff in line numbers more verbose
Change-Id: I536ffddffe40f9f6bbcd75f312a5f902763e1131
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2014-01-07 19:21:45 +01:00
Frederik Gladhorn
15ff120b02 Update testlib selftest units
The units that were supposed to have variance were completely off in the
test leading to all benchmarks with slight variance being completely
flaky.

Change-Id: Ib76593813974adee462b3f03be9370d2248d770c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2014-01-07 19:21:34 +01:00
Frederik Gladhorn
8059541199 Stabilize one function in tst_qpauseanimation.cpp
Under load the timing may go wrong.

Change-Id: Iaa947fb9adcfccd2568337adbb17094996cce827
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-01-07 19:21:16 +01:00
Liang Qi
35f2a61426 QKeySequence: return Qt::Key_unknown with invalid modifiers on OS X
This also fixes the auto test, tst_QKeySequence::parseString() with
Win+A and Simon+G.

[ChangeLog][QtGui][OS X][QKeySequence] return Qt::Key_unknown with
invalid modifiers on OS X

Task-number: QTBUG-24406
Change-Id: Ie90393c9691f443c7c359cb3a487609a9691bc44
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-01-07 18:55:10 +01:00
Liang Qi
dbaff44ff1 test: fix tst_QPushButton::sizeHint() with Mac style on Mac OS X
The style name should be macintosh, not mac.

This also reverts commit 2f46ea9fd6.

Task-number: QTBUG-23680
Change-Id: I7fd06da165ca5bc99801c13af13fdb3d35119566
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-01-07 18:55:07 +01:00
Liang Qi
3b2143bdf7 Revert "Skip tst_QMenu::QTBUG_10735_crashWithDialog() on Mac OS X"
This test doesn't fail any more.

This reverts commit 6f21509ac0.

Task-number: QTBUG-23677
Change-Id: Idc094ce0c90b8d3ba0a75d93ccef8da4801605c7
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-01-07 18:55:04 +01:00
Laszlo Agocs
dcbb16a452 Add takeTexture() to QOpenGLFramebufferObject
Add an API that allows to retrieve and detach the texture from the
framebuffer object. The next bind() call will then create and attach a
new texture.

[ChangeLog][QtGui][QOpenGLFramebufferObject] Added takeTexture() for
retrieving and detaching the texture from the framebuffer object.

Task-number: QTBUG-35881
Change-Id: I2cca37f5872c1685b1238047f8b912e6534ab781
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-01-07 13:04:18 +01:00
Andrew Knight
a90972e8f8 WinRT: Enable accessibility by default
While there is no implementation for accessibility yet, enabling it allows
the interfaces to be used and an accessibility plugin to be developed
for this platform.

IAccessible2 and MSAA bridge autotests are disabled for this platform.

Change-Id: I2bfd07f6b21ca469b27d88ef11df723ac8ff8202
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-01-07 10:55:30 +01:00
Laszlo Agocs
bd5cea5ba8 Resurrect QGLWidget::renderPixmap()
This function has been completely broken since Qt 5.0. Unfortunately
the autotest's verification steps were somewhat faulty so returning
a null pixmap from renderPixmap() did not trigger a failure.

The implementation is now done with framebuffer objects and pixel
readback. This is not ideal performance-wise, but is the only option.
In Qt 4 pixmaps were often backed by platform dependent native pixmaps
that could be used as rendering targets for OpenGL content. This is not
an option anymore since pixmaps are raster backed on all the major platforms.

Task-number: QTBUG-33186
Change-Id: I8f558e33bf7967ac3be439fd5a3eac07b6444be5
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-01-06 12:57:20 +01:00
Frederik Gladhorn
a34f37cc71 Add a way to reproduce testlib selftest data
This makes testlib a lot more hackable since when the output is changed
in a defined way we can regenerate the expected output (eg adding the
test duration which will be a follow-up patch).

Note that the script does not work properly on Windows and not all
benchmarks work, but at least it reduces the work of adapting files to a few lines.

Change-Id: I910387cd92ff82aa629747a3a3033dae17fbd711
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-01-06 12:51:16 +01:00
Frederik Gladhorn
4d5906989a Update tests to normalizes the paths by using script.
The newly added generate_expected_output.py was used to get the expected
output into a more reproducible state.

Change-Id: I1ca75c8e0c5778d25c1df531bd298007aac0ff4a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-01-06 12:50:47 +01:00
Liang Qi
bdd3ead827 OSX: support fake fullscreen and etc
* Fix QCocoaWindow::setGeometry() to respect WindowFrameInclusive
* Support fake fullscreen on 10.6 or WindowFullscreenButtonHint was not set on
10.7 and later
* Fix tst_qwindow on 10.6 and later

Task-number: QTBUG-23059
Task-number: QTBUG-34629
Change-Id: I6e032ca55b45674388b00506a424d3bd7ece429f
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-01-03 15:27:38 +01:00
Simon Hausmann
b5ab7ee0d7 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Id13badc270db98806048753fd7fb658aa17f1ede
2014-01-03 14:30:21 +01:00
Frederik Gladhorn
954bb6c35f Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-12-24 10:25:50 +01:00
Simon Hausmann
2b287c7c21 Fix regression in property handling with enums from gadgets
When declaring a Q_PROPERTY(SomeType::SomeEnum foo ...) and SomeType is not a
QObject but a gadget, then we must still include SomeType's meta object in the
list of related meta objects.

Task-number: QTBUG-35657
Change-Id: I46195140cb5d180c4f03bb1fe06a876e3fe11267
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-12-24 08:10:16 +01:00
Jian Liang
8fcab70408 Avoid crash due to accessing deleted QWidgetWindow object
Change childWidget->windowHandle() to childWidget->internalWinId() in
q_createNativeChildrenAndSetParent() to determine whether should we call
childWidget->winId().
This is because in some circumstances Qt will crash due to accessing
deleted QWidgetWindow object if we use windowHandle(). Think about the
following scenario:

1) create a widget A without parent and add two child widgets B and C to A

2) create a native widget D as the child of B, note that when we set
Qt::WA_NativeWindow attribute to it, its QWidgetWindow will be created
which means its windowHandle() is not null.

3) create a top level widget E as the child of C and show it. This will
make Qt call createWinId() to A and then
q_createNativeChildrenAndSetParent() will be called to create A's native
children recursively and finally make D's QWidgetWindow object become a
child of A's QWidgetWindow object. Please note here that B will not become
a native widget just because at that moment windowHandle() of D is not
null and Qt will not call winId() to its parent B

4) Set A's parent to another widget which has been shown, setParent_sys()
will be called to A and then Qt will call destroy() to A. in destroy() Qt
will try to call destroy() to its children recursively with a condition that
the child has Qt::WA_NativeWindow been set. But D's parent B is not a native
widget right now so B and D is not destroyed. Qt will then deleted the
QWidgetWindow object of A, since E's QWidgetWindow object is a child of
A's QWidgetWindow object, it will also be deleted. Now E hold a deleted
pointer of QWidgetWindow object. This is the source of crash later.

Task-number: QTBUG-35600

Change-Id: I97a20a68e626ee62b15bb4eae580e26f8948923b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2013-12-24 02:56:41 +01:00
Frederik Gladhorn
f0fbff4c90 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I2defae1904154283446b069d151c3ef57302ec7b
2013-12-24 00:56:59 +01:00
Simon Hausmann
d776937df9 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-12-23 22:44:13 +01:00
Marcel Krems
106316198d Enable QSqlError to handle alphanumeric error codes.
Some database systems (like PostgreSQL) use alphanumeric error codes.
Introduce a new method nativeErrorCode() which replaces number().
If the error code cannot be converted to int, number() will return 0.

Task-number: QTBUG-142
Change-Id: Ic7fba841737674b75c0c01c2263f51d2041da497
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-20 16:27:41 +01:00
David Faure
13c246ee11 QAbstractSocket: fix setReadBufferSize from readyRead slot.
In a slot connected to readyRead, if the app detects that the
buffer size is too small and increases it, it expects that
readyRead() will be emitted again.

setReadBufferSize() doesn't re-enable the socket notifier when
calling from within readyRead, and readyRead itself was missing
the code to do it.

Change-Id: Ia00a3066ad3ba09d5cfae0716adc5691ae96c3fa
Done-with: Thiago
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-12-20 09:30:05 +01:00
Andrew Knight
863810eb28 d3dcompiler_qt: Remove directory creation inside the proxy library
Use of mkpath/mkdir is removed in order to make the proxy less
invasive when there is no compiler service running. Creation of the
directory structure is fully the service's responsibility.
Service availability is now only checked once, at the first invocation of
D3DCompile, as it is expected to be started before the application.

Change-Id: Ib8c4f062c418497c2253daf524654e1db30dae47
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-12-19 21:23:48 +01:00
Thiago Macieira
68ff352906 Use the short time format of the current locale on Windows
Windows 7 and later have LOCALE_SSHORTTIME, which is what we need.

Task-number: QTBUG-33718
Change-Id: I4c3f113d17102a37fb752de56f06b312f27c7887
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-12-16 22:26:37 +01:00
Frederik Gladhorn
3f3be55835 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/gui/kernel/qplatformtheme.h
	tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
	tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp

Change-Id: Iecd3343d6a050b8764f78d809c4a1532aeba69e5
2013-12-16 16:59:33 +01:00
Frederik Gladhorn
f28ef6a308 Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2013-12-16 15:35:30 +01:00
Israel Lins Albuquerque
5193c14536 fix parsing of bound SQL statements for PostgreSQL
PostgreSQL allows bound variables inside square braces.

Task-number: QTBUG-34541

Change-Id: I4f069b3f1078d4cdf172fbac9e0d7d23d20d167a
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-16 15:35:30 +01:00
Peter Hartmann
ae293c1cb2 QNetworkCookie: allow cookies for IPv6 domains
For IPv6 addresses don't call toAce as it returns the empty string.
We should reflect the behavior of browsers here, which all accept
cookies from IPv6 addresses.

Original-patch-by: David Tapuska <dtapuska@blackberry.com>

Task-number: QTBUG-35022

Change-Id: Ic00369e923d044ec459822b2405865c13e4185b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-12-13 09:44:25 +01:00
Peter Hartmann
746dddeb9f QNetworkCookie: allow cookies for IPv4 domains
If the domain is an IP address, we should not do any magic regarding
leading dots etc.

Task-number: QTBUG-35022

Change-Id: I7722de4e6027666dde27e9e37b6353e3da775d94
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-12-13 09:44:13 +01:00
Thiago Macieira
ee7536876c Add the UTF16-to-Latin1 in-place converter
This is only possible for two important reasons:

1) QString and QByteArray d pointers are both done with QArrayData and
   that class does not care that the alignof(T) changes from 2 to 1,
   so we can give the pointer from QString to QByteArray
   (after adapting the allocated size, which is now double)

2) conversion from UTF16 to Latin1 always has fewer bytes (exactly half)

Change-Id: I17b2690c910f3de8db55156c6d6b5f55be06d827
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-12-13 09:30:04 +01:00
Friedemann Kleint
c0b899b3df tst_qlinedit: Create a new test widget on demand for each test.
The test used a member testWidget that was cleared and reset after each
test, which caused focus fights and side effects. The widget is now
created and shown only when necessary.

Change-Id: I0dc635e9d4cdf4f899994b88206bb0125526f6df
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-12-12 23:21:21 +01:00
Simon Hausmann
54f0733e7d Fix erroneous exclusion of classes from related meta objects in moc
Assume an unrelated class that declares an enum and uses Q_ENUMS. Consider
then a class that uses UnrelatedClass::Enum as a Q_PROPERTY. We used to
include UnrelatedClass in the primary class's related meta objects, in order
to support use-cases like
    obj->setProperty("enumProperty", "ValueOfEnumAsString");

If however moc happens to see Q_DECLARE_METATYPE(UnrelatedClass::Enum), then it
would exclude it from the related meta objects, which would silently break the
string based enum value conversion. This was meant as an optimization, but it
isn't apparent to the developer why sometimes the string conversion would
work and sometimes not (depending on whether somebody declares that macro).
This also becomes visible in QML, which relies on the same embedded type
information for enum assignments.

This patch removes that check in moc's code generator and cleans up the code a
little. However always including the prefix of Q_PROPERTY(SomePrefix::Enum ...)
is not correct either, because it may be that SomePrefix is a namespace, which
would cause compilation issues. Therefore we limit the inclusion of related
meta objects only to Q_OBJECT decorated classes the moc has seen, and for these
we save the fully qualified name in the related meta objects array (for QTBUG-2151).

While this patch makes the previous workaround for namespace issues by using a
Q_DECLARE_METATYPE not workable anymore, by saving the fully qualified name we
are making a hopefully sufficient effort to not require a workaround in the
first place. There's always the new workaround of fully qualifying the type in
Q_PROPERTY.

One side-effect of this change is that in the autoPropertyMetaTypeRegistration
test of tst_moc, the CustomQObject for Q_PROPERTY(CustomQObject::Number
enumValue ...) is now a related meta object, and therefore when querying for
the type of this property via QMetaProperty::userType(), we are now aware of
this being an enum and try to resolve CustomQObject::Number via
QMetaType::type(qualfiedName). As there is no guarantee for this to succeed, we
must now also do what is done in the non-enum code path in ::userType(), which
is to call the moc generated type registration function.

Task-number: QTBUG-33577
Task-number: QTBUG-2151
Change-Id: Ibf20e7421cba464c558a25c76a7e1eef002c6cff
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-12-12 22:57:19 +01:00
Frederik Gladhorn
63611cff87 Merge remote-tracking branch 'origin/release' into stable
Change-Id: I0cd3b1b33e6d9bec729d941b06aeeb3d21851820
2013-12-12 18:01:28 +01:00
ABBAPOH
4d8a12904a Check if device is opened before trying to create image handler.
Change-Id: I60f1f6890fdd73e489da4aab9928370163f55f58
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: aavit <eirik.aavitsland@digia.com>
2013-12-12 12:02:29 +01:00
J-P Nurmi
a2666d3391 QLineEdit: hide placeholder text when h-centered & focused
[ChangeLog][QtWidgets][QLineEdit] A blinking cursor in the middle
over horizontally centered placeholder text looks bad. Thus,
horizontally centered content is now considered as an exception
and the placeholder text is hidden when the line edit is focused.

Task-number: QTBUG-31669
Change-Id: I17aa1e6656673f81545a8437f90814b188ad484a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-12-11 19:21:27 +01:00