QMetaType used to register a typeName and factory functions for
creation/destruction of objects. While it would be possible for a single
type name to be registered matching different actual types and memory
layouts, there was little that could be done about it.
Now that QMetaType is tracking type information with a direct impact on
data layout and ABI (size and type flags) it is important that we check
and detect binary incompatibilities as early as possible.
[Such incompatibilities could arise from type name re-use (technically,
ODR violations) or, more commonly, as version mismatch between different
shared libraries or plugins.]
Only type size and flags are checked as function pointers to inline and
template or otherwise non-exported functions could trivially differ
across translation units and shared libraries.
When registering typedef types, a check is made to ensure the same name
doesn't get registered as different types.
Change-Id: I8211c3de75d4854ce8fafdb620d3a931c206e0c3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
The function hasn't been working properly. It was not well tested, for
example it is undefined how QVariant should behave if it contains an
instance of an unregistered type.
Concept of unregistering types was inspired by plug-in system, but in
most supported platforms we do not unload plug-ins.
Idea of type unregistering may block optimizations in meta object
system, because it would be not possible to cache a type id.
QMetaType::type() could return different ids for the same name.
Currently QMetaType::unregisterType() is not used in Qt.
Change-Id: I878b6e8d91de99f9bcefeab73af2e2ba0bd0cba0
Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
There is no point in keeping separate values which should mean the
same.
QVariant::UserType was used also to construct a valid, null QVariant,
containing an instance of unknown custom type. The concept was strange
and useless as there was no operation that could be done on such
QVariant. Therefore it was dropped.
Please note that the patch slightly changes behavior of different
functions accepting a type id as parameter. Before QVariant::UserType
was an invalid type from QMetaType perspective (id 127 was not assigned
to any built-in type), but QMetaType::User points to the first registered
custom type.
Change-Id: I5c7d541a9affdcdacf53a4eda2272bdafaa87b71
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Andrew Stanley-Jones <andrew.stanley-jones@nokia.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
The QNetworkReply finished signal does not have a bool parameter.
Change-Id: I87bd0410545f7a2fc2ab63cca90548f0585bf7a0
Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
QTest::ignoreMessage() cannot be called when creating test data rows,
but rather must be called when executing a row.
Change-Id: Ic958c4e5c15dd53a48479099b6b07803af6cb789
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
QTest::ignoreMessage() cannot be called when creating test data rows,
but rather must be called when executing a row.
Change-Id: Ifceaff4c5a7f1b6408ec57196298e3f3038910c9
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Remove the #if 0'd blocks and instead add these headers to
sync.profile's @ignore_for_include_check, as documented at
http://wiki.qt-project.org/Creating_a_new_module_or_tool_for_Qt#other_fields
Change-Id: I3bd6e8cb21eca139fdca10fe970eeaf2e4e77c24
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
When closing a window, destroy() ensures a setVisible(false) call only
for the window itself, not for other windows parented to it. With the
new quit lock ref feature this breaks code that creates a fake root
window parented to the main, visible window. (for example the
xcomposite backends of qtwayland do this)
Such apps do not anymore exit after closing their window because the
children do not receive a deref due to setVisible not getting called.
(At that point. It would get called after exiting the event loop but
that never happens due to the refcounting)
Change-Id: I124737c80ad59600ddc79261100f3904af0f410d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
The code was hard-wired to use QFSFileEngine to determine platform
preference for file system case sensitivity. In this case it is cheaper
to use private API and directly access the information in
QFileSystemEngine.
This change is also necessary because file engines are being dropped
from the public API.
Change-Id: I5015d5fdb3979af9ff2d114084053ad06220d834
Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
As far as Qt is concerned, this information is static and depends only
on the platform. By moving the definition to the header we allow the
information to be directly used by the compiler, forgoing the need to
export the function to interested users.
Change-Id: I43de585391d41204d3c3560ac6e65e5a88aee11c
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
Delete QFontEngineBox object in QFontDatabase::load() if the object can not
be used.
Change-Id: Ifb055809703fb6be92f41fd56658198df30837fd
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Since we may use distance field text rendering in raster, these
functions need to be moved from declarative to QtGui.
Change-Id: I158bc3bae02b5590ae812f06ad7a78a5914bcb9e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Most of these headers are either forwarding headers, or we explicitly
stop syncqt so that it doesn't generate class includes for the atomic
implementation. Either way, syncqt doesn't see the QT_END_* (and
sometimes not QT_BEGIN_*), which this commit fixes.
Change-Id: Icc8da6f384f38b1ff4eb265c731ce2f2ed92a1a3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This silences the warning from syncqt:
QtCore: WARNING: qtbase/src/corelib/global/qglobal.h includes qlogging.h
when it should include QtCore/qlogging.h
Change-Id: I64bd92898190031eb0d3d1dfa5ba5bc56db01c00
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qcompilerdetection.h is included from qglobal.h, and does all Q_CC_*
and compiler feature detection.
Change-Id: Idd06054e172ef6fa73774e26fa38753996c4161b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qsystemdetection.h is included from qglobal.h, and does all Q_OS_*
detection
A side-effect of this change is that QT_BEGIN_HEADER and QT_END_HEADER
started being defined on Mac OS X, which ends up breaking the build
in some cases. Since QT_BEGIN_HEADER and QT_END_HEADER have been
defined to nothing in the past, even on Mac OS X, change these 2
to be unconditionally defined to nothing.
Change-Id: Ibc8a0aa2207664741c25627d7621e006c2ce80d3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Exclude invisible top level dialogs for whom a native
dialog is being shown from top-level search.
Change-Id: Ia94599905457d81d342c14d09ad0b0fc89ec4ab1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Also cleanup (reduce) all implementations of navigate() in order
to make the final removal of navigate smoother.
Change-Id: I2c216db8f5b2e40afcce8f859fc775053adc2fe3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
Forward ported from Qt 4.
This is used to mark the role of VTs, terminal emulators.
Needed in order to know about the special editing behavior.
In order to make for example KDE's Konsole accessible this is required.
reviewed-by: jan-arve sæther <jan-arve.saether@nokia.com>
(cherry picked from commit 8ca33c6f1643ab5e89699fbf8b80bfaae108b1e5)
Change-Id: Ic7beb2ae2ee70f2c526c7ec5bf982bec7ba9feda
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Use the available geometry as a maximized window would fit on the
desktop in the available area (some space is used up by task bar,
system menu, etc.) as opposed to the fullscreen geometry which
would be the entire screen.
Change-Id: Ifa7046c5b13e162727a9b3a54178690c631cc969
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Anselmo L. S. Melo <anselmo.melo@openbossa.org>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit adds basic gesture support to WEC7 Qt builds, which
enables developer to create custom gesture recognizers based on mouse
events.
Note that QTouchEvents are not yet generated in WEC7 Qt builds, so
recognizers based on those cannot be created.
Task-number: QTBUG-22517
Change-Id: Ic6218500b28b78ca8edec3edebd00d84c308a182
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Disable optimization for getProjectUUID() as it triggers
ASSERT: "&other != this" at qstring.h:720 with -O2.
Change-Id: I51b31d4318ba9be187c186623099171d8f48235b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-move logic out of switch statement
-clear cache more clearly for OnFieldChange
-call setValue() in one place instead of two
-eliminate extra return path
Existing idiosyncracies have been kept for the time
being.
Change-Id: Ia4c5a5fd3e374b53e3c4d870f2ee9d37b5090917
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
-Do not use setData()
We're using ModifiedRow now so it makes sense to buffer the changes
and submit the row at once. This improves readability and
encourages further haromonization of the editing strategies.
-No longer need temporary change to OnRowChange
Previously, the strategy was temporarily changed from OnFieldChange
to OnRowChange in order to obtain the desired behavior from setData().
Now, since we don't use setData(), we can program the desired behavior
here and don't need this trick.
-Comment historical idiosyncracies/bugs
Change-Id: I6d9e2a69e1571a74c630ad1392e15b60fc0ad3f2
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Previously ModifiedRow was used only for OnManualSubmit and
a seperate buffer and utility methods were used for OnFieldChange
and OnRowChange.
Also, initialization of the edit buffer is done by ModifiedRow
instead of a helper function.
Change-Id: I3316498e5bb10c416138ca14c3a7f8b143c8e544
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
As discussed on list and approved by Lars and Thiago.
Make QSystemLocale private to give us time and space to change it to a
better implementation.
Change-Id: Ifd806972f3996c43a876f544f78c6557ad71cd75
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
As discussed on list and approved by Lars and Thiago.
Remove the option to use QLocale to convert strings to non-decimal
numbers as they are not localised and the api is available in QString.
Change-Id: Ib810505ba86fb08ad23571b39f1520e86fde6787
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Ensure consistent conversions by not using the system default locale.
Change-Id: I60db9fc4f465c0254f3213419e57d7879aaddd65
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
QByteArray is declared as movable but it was not tested before.
Change-Id: I4fb636f8705c3fd792a768872206203ee5fd4ddb
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
QModelIndex doesn't have data stream operators loading or saving this
type should gracefully fail.
Change-Id: I6a1a3bab3f83ff4921369a07fdb54ac462eff554
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
New implementation is using QMetaTypeSwitcher, which should reduce
maintenance costs.
Change-Id: Ibb7bb4b9de0e19c081c087d9eebf0c709118d3b4
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
We need to hang onto the internal state of the utf16 converter
object whenever converting a long string to unicode. This was
failing with the text stream class -- the first read was okay,
but subsequent reads could not be correctly converted to unicode.
Change-Id: I9e2d445d51c9009591bfa7a1765ea2d09ae634a2
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Convert QDate to only use Gregorian calendar and not Julian calendar
before 1582. In future the Julian can be used via proper calendar
classes.
Change-Id: I547a3550332057a0ab1be616706630b6afaceffc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Store the QDate Julian Day number as an qint64 instead of uint32 to
enable support for dates before 2 January 4713 BCE. This changes the
possible date range to be approx 2.5 Quadrillion BC to 2.5 Quadrillion
AD. A qint32 was not used as it only covers 5 million BCE to 5 million
CE which does include Geological or Astronomical time.
The effective supported date range is currently 4800 BCE to 1.4 million
CE due to restrictions in existing conversion formulas. The effective
range will be extended later with new formulas.
Change-Id: Ib4345369455b31d4edae8c933b7721e76414e914
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Recent commits in src/corelib/arch have removed empty directories,
which cause configure to assume that the architecture is not supported.
This assumption is wrong, due to changes in
src/corelib/thread/qbasicatomic.h to include the correct QAtomic*
implementation based on compiler pre-defined macros instead of the
architecture found by configure.
Change-Id: I026958fb9af8af62e295e68a4643c37ac9395dc6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
- Special #define to access HB seems no longer necessary
(it was causing about mismatching DLL import attributes).
Change-Id: I57cc7d57b12a67c1d549b053db81e1f198f87786
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Some configure tests try to link programs, which when compiling against
a sysroot _does_ require the --sysroot= argument in order to find crt0.o.
This patch uses the existing pattern of using the export SYSROOT_FLAG
in the missing linking tests.
Change-Id: I063849c814f393d5f88de1b486ce9035b9f7bf65
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
qmetaobjectbuilder should generate meta-objects of the same version
as moc; in the future, when the moc version is bumped, QMOB has to
be adapted at the same time.
QMOB was generating version 4 meta-objects. This patch makes it
generate version 6 (the current version). This also fixes a bug with
using qt_static_metacall with QMOB (setStaticMetacallFunction()); it
was already using the version 6 qt_static_metacall signature, which
isn't compatible with version 4.
Also add tests that ensure that the QMOB-generated meta-object works
with real objects; in particular we want to test the codepaths in Qt
that check for version >= 4.
Change-Id: I64a151ea5c947a6f8b7a00e85a39866446c735e9
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Commit 00c8984b4e changed other parts
of Qt to use QMetaType::QVariant, not 0xff, as the type for QVariant
properties. QtDBus should check for that type, and also use it for
QDBusVariant properties.
Change-Id: I21d81b59754ae44889766877a4c5066466b46d86
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QtDBus's meta-object generator should generate objects of the same
version as moc; in the future, when the moc version is bumped,
QtDBus's meta-object generator has to be adapted at the same time.
Since QMetaObjectPrivate and related flags reside in qmetaobject_p.h,
QtDBus can just include the header instead of duplicating code.
qmetaobject_p.h also defines the meta-object revision QtDBus should
be targeting.
QtDBus was generating version 3 meta-objects. This patch makes it
generate version 6 (the current version). Since a new field was
added to QMetaObjectPrivate in revision 4 (signalCount), the
generator had to be adapted. In particular, the signal definitions
need to come before other methods (as they do with moc), since
there are functions in QObject that rely on that (e.g.
computeOffsets()).
Change-Id: I37f102d8c1be372ef6cfaf013baa87f9abb0fd5e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>