Commit Graph

11625 Commits

Author SHA1 Message Date
Pasi Petäjäjärvi
416e73a0fc Check existence of QProcess feature before using it on Qt autotests.
VxWorks does not have QProcess support.

Change-Id: I20ed479125097d468a1aa50afb18c3749f0fbb98
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:59 +01:00
Pasi Petäjäjärvi
2d2da44f63 Use time.h related includes from qfunctions_vxworks.h file.
In VxWorks qfunctions_vxworks.h file includes correct time
related headers and it is included already at file
qplatformdefs.h for all mkspecs targets.

Change-Id: I8677eef8c79cebb445d89203284f3af27abbdd7f
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:58 +01:00
Pasi Petäjäjärvi
2aaffe1800 Fix comments to use pre C99 standard style instead
VxWorks compiler fails to compile *.c file with C99 style comments on it

Change-Id: Ib5c5ff14006c17f9392b77363232b8b7cc112d34
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:57 +01:00
Pasi Petäjäjärvi
eae8faabed Use sched_get_priority_* functions only for SCHED_RR and SCHED_FIFO
In VxWorks set default values for scheduling priority to use
SCHED_FIFO_HIGH_PRI and SCHED_FIFO_LOW_PRI defines for other scheduling
policies than SCHED_RR or SCHED_FIFO.

Change-Id: If78b84cd9ef94d7712206e9442e96cdba727610f
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:56 +01:00
Pasi Petäjäjärvi
00faa09aad Add support getting memory page size to RTP mode on VxWorks.
Change-Id: Id71bf7fd8e7371284076247558cba7edb0307e13
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:55 +01:00
Pasi Petäjäjärvi
49b8e21429 VxWorks process (RTP) mode does not have taskLock/taskUnlock functions
VxWorks does not support to globally lock and unlock the scheduler from
process. In kernel mode (DKM) above functions disable preemption from
requested task and such functionality does not exist for process.

Change-Id: Id41eab4c1973e4181e82539d08707659e0780f99
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:55 +01:00
Pasi Petäjäjärvi
2d8a4c2d3f Use QDir::homePath() for tilde expansion
VxWorks does not have concept of users and therefore has no function
getpwnam. Use QDir::homePath() which returns actually QDir::rootPath()
if there is no HOME env variable set.

Change-Id: I15fe15862c4491b56cfa13bbdb218ef00dfd1f15
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:54 +01:00
Pasi Petäjäjärvi
ae229b9192 Use stub functions getpwuid and getgrgid for VxWorks
VxWorks has no concepts of users and groups, therefore no such functions
exists on VxWorks. Use stub functions from qfunctions_vxworks.h for
those, so we don't need to make major source code changes.

Change-Id: Iaad80ec18441e3d3e9c0f96e92ccc3766b27d976
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:53 +01:00
Pasi Petäjäjärvi
1309d9a9d6 Use stub function gettimeofday for VxWorks
Vxworks does not have gettimeofday function, use function
implementation from qfunctions_vxworks.h/cpp instead.

Change-Id: Iad2a71c8484ba00dd9406706b1c136297260de4b
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:52 +01:00
Pasi Petäjäjärvi
2d44f879a2 Do not define QT_NO_DYNAMIC_LIBRARY for VxWorks process (RTP)
Shared libraries cannot be used in kernel mode (DKM), only at process
mode (RTP).

Change-Id: I8cecc12461aa4417b16577db3bc9cd85a1aa7efa
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:51 +01:00
Pasi Petäjäjärvi
cd5a4279f3 Strip prepending <hostname>: string from currentPath() for VxSim
VxWorks simulator (VxSim) maps SDK rootdir usable as normal directory.
Mapped directory name is either host: or <hostname>: and can be used
without prepending prefix containing colon. Strip prepending string and
colon to get valid native path to host SDK rootdir running VxSim.

Change-Id: I9d2829e32431c2d50fefe55c93780cd37165e565
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:50 +01:00
Pasi Petäjäjärvi
608cd1ad84 Use taskIdSelf() function instead of taskIdCurrent global variable
The uniprocessor taskIdCurrent global variable (declared in taskLib.h)
does not exist in VxWorks SMP, because of concurrent execution on
multiple CPUs. Any uniprocessor code that reads taskIdCurrent should
make calls to taskIdSelf() instead.

Change-Id: I4e0efef32297f339d6121c7d4bca3820e0fc9294
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:49 +01:00
Pasi Petäjäjärvi
baad50e979 VxWorks header only available in DKM mode and not in RTP mode.
Check if _WRS_KERNEL is defined so we are compiling for DKM mode.

Change-Id: I15801b0575d3fe6e543f81a177fd01d015d9085f
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:48 +01:00
Pasi Petäjäjärvi
7e3d5a7207 Use Qt defined gettimeofday for VxWorks and no fallback to X11 version
VxWorks don't have gettimeofday function so we always use the one
implemented in Qt. VxWorks DIAB compiler is not supported building Qt
for VxWorks 6.9.2. Anyone using older VxWorks should also not be
affected so use new defines VXWORKS_DKM and VXWORKS_RTP for VxWorks
version 6.9.2 onward.

Change-Id: I2e9546a101256ea0557b65163b40cd0f28be8519
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:47 +01:00
Thiago Macieira
fb5bbea031 Remove debugging messages from QDBusConnection::registerObject
Qt does not print debugging in released versions. We print warnings in
case of error in using the API, but that's not the case here.

Change-Id: I14d54be5d6a1d4e1f147afd091ba850670972cdf
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-23 07:54:35 +01:00
Thiago Macieira
57aed703d2 Improve the QDBusConnection node children garbage collection
This replaces the implementation from ac9ab9703f.

If the number of active children drops to zero, we know we can simply
delete the vector of children. We know none that might be there are
active.

If the number is not zero, but is considerably smaller than the vector
size, we can shrink the vector by reordering the elements, skipping the
inactive ones.

We use qMove, which expands to std::move on C++11, but a regular copy on
C++98.

Change-Id: I2e74446081f91fbd698425b08910fbda4746d673
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-23 07:54:19 +01:00
Thiago Macieira
3c6bb0ed8b Make the QtDBus object tree keep a count of active children
The new member variable activeChildren shall contain the number of
direct children that are active. This number differs from
children.count() because the vector may contain empty entries that
haven't been garbage-collected yet (obj == NULL and activeChildren ==
0).

When this count drops to zero, we know we can simply erase the vector of
children.

Change-Id: Ia20604d3fac852ea4a6e8862d934fbb936fa5e18
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-23 07:54:00 +01:00
Thiago Macieira
18c7ce5994 Rewrite QDBusConnection::unregisterObject to be recursive
The current implementation is a loop. We need it to be recursive so that
we can execute more operations when unwinding. This will be necessary
in the next commit.

Change-Id: Ia3c98fed0719cede0a0d92d3e343cf016ec7baf2
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-23 07:53:52 +01:00
Thiago Macieira
f8b681deed Don't clear the pointer in QScopedPointer's destructor
It helps in valgrinding applications. It's the difference between:
==17609==  Address 0x38 is not stack'd, malloc'd or (recently) free'd

and
==19789==  Address 0x598f478 is 56 bytes inside a block of size 112 free'd
==19789==    at 0x4A0736C: operator delete(void*) (vg_replace_malloc.c:480)
==19789==    by 0x53A77CD: QObjectPrivate::~QObjectPrivate() (qobject.cpp:239)
==19789==    by 0x53B4EB5: QScopedPointerDeleter<QObjectData>::cleanup(QObjectData*) (qscopedpointer.h:63)
==19789==    by 0x53B3980: QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::~QScopedPointer() (qscopedpointer.h:99)
==19789==    by 0x53A8EEC: QObject::~QObject() (qobject.cpp:750)

Change-Id: If42107c94401a96c05caa511442d6bd010fd4e29
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-23 07:53:34 +01:00
Thiago Macieira
f7eff72517 Add a new Q_GLOBAL_STATIC implementation
Unlike the previous implementation, this implementation is locked:
only one initialisation is ever run at the same time. It is
exception-safe, meaning that a throwing constructor will restart the
process.

Also, start using the thread-safe behaviour that GCC has offered for a
long time and C++11 requires.

Change-Id: I20db44f57d258923df64c0051358fd0d9a5ccd51
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-22 17:15:58 +01:00
Friedemann Kleint
326a5e0bca Fix testlib-selftest for MinGW.
Fix float format and exclude crashing sub-binary.

Task-number: QTBUG-29014
Change-Id: I404f971edeb128263122a194f23e2806d6fd3bd0
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-22 17:15:58 +01:00
Friedemann Kleint
63faa00066 Windows: Introduce pixmap cursor cache.
Cache custom cursors.

Task-number: QTBUG-28879

Change-Id: I8f2b5b9149966399a6173dbd19f6a8e85898924b
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-22 17:15:58 +01:00
Tor Arne Vestbø
f5c6a5d06b Don't build lance as application bundle on Mac OS
Change-Id: I23732b4ec0dc45d9d3a2cc5f21dad2cb33af5830
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-22 14:56:47 +01:00
David Faure
e01b163404 QTestLib: improve output when comparing lists fails.
Only QStringList was handled before, now any QList is handled.
A specialization for QStringList is still needed though, due to the way
template matching works.

Example with QList<int>. Before:
FAIL!  : tst_QTextCodec::threadSafety() Compared values are not the same
   Loc: [../tst_qtextcodec.cpp(2057)]

After:
FAIL!  : tst_QTextCodec::threadSafety() Compared lists differ at index 0.
   Actual   (res2.toList()): '0'
   Expected (mibList): '3'
   Loc: [../tst_qtextcodec.cpp(2057)]

Change-Id: If0fdec3236ddb78a679ee549aba569ef5571c395
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-22 13:29:33 +01:00
Friedemann Kleint
c73dc44606 Fix cleanup of temporary files in test of QFileInfo.
Change-Id: I0d21fc05a7d816acab5f7284f905bf971a5c04da
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-22 13:29:25 +01:00
Friedemann Kleint
267e2bbee4 MinGW: Disable tests in tst_qstring that use unsupported formats.
Task-number: QTBUG-29014

Change-Id: I7dc879c456da8dabe02a2bce07e8628d176ca9d1
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-22 13:29:14 +01:00
Frederik Gladhorn
4ed8356053 Remove some dead code.
Change-Id: Iea86a30d96465bcfe78531c88040b65c6eb9f5b4
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-01-22 09:25:05 +01:00
Friedemann Kleint
c24a7377dd Regression: Fix setting of custom cursors for native widgets.
Currently, there is no concept of not having a cursor set on
a Window. Qt::ArrowCursor is always set instead. This causes
bugs when native child widgets are involved, for example setting
a cursor on the native widget's parent no longer works since
the child's Qt::ArrowCursor applies.

Introduce QWindowPrivate::hasCursor tracking whether a cursor
has been explicitly set and clear in QWindow::unsetCursor().

Handle 0 in QPlatformCursor::changeCursor() to mean
"unsetCursor()":
- Windows: Introduce default constructor for QWindowsWindowCursor
  meaning "0". Search for applicable parent cursor in applyCursor.
- XCB: No big changes required, set XCB_CURSOR_NONE for no cursor.
- Other platforms: Assume Qt::ArrowCursor when cursor = 0 is
  passed for now.

Task-number: QTBUG-28879
Change-Id: Id82722592f3cd5fe577a5b64dcc600c85cfea484
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-21 21:50:45 +01:00
Friedemann Kleint
1029049e1d Fix MinGW-warning about pointer/integer of different sizes (64bit).
Change-Id: I26945bbcd0994e478332ea1250ad7d0bbaa8420f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-21 21:50:15 +01:00
Friedemann Kleint
661c3701f4 Fix Windows native file dialogs for use with QtQuick.
- Correct modality check.
- Allow for properties to be set if there is no native dialog.
- Make dialog thread for non-modal call back into dialog helper
  for exec().
- Introduce QWindowsFileDialogSharedData to contain data to be
  cached while no native dialog exists and to be updated by the
  change notifications of the IFileDialogEvent interface to avoid
  querying the dialog results after the dialog has closed. Reduce
  virtual methods of QWindowsNativeFileDialogBase accordingly.
  This also fixes a bug in the previous implementation causing
  the directory not to reported back since the native API would
  not return the directory after closing the dialog.
- Support nonmodal native dialogs when constructed on a QQuickWindow.
- Delete native dialogs after exec as QtQuick keeps the
  dialog instances around.

Change-Id: Id1169d6657d9476afe12fb9909c36cbd03aa2a40
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-01-21 21:50:07 +01:00
Gabriel de Dietrich
92237b22ea Cocoa: Make QCocoaMenu::showPopup() more robust
Change-Id: Ie4ae5806ea2f23f16597578796be36f2123c05fa
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-01-21 15:31:22 +01:00
Tor Arne Vestbø
b5922c89ba Add support for retina glyph-based text drawing in the GL paint-engine
Instead of always using a non-transformed glyph-cache we now allow a scaled
glyph-cache so that retina-screens can take advantage of this. We take
the cache's scale into account when positioning and drawing the glyphs
so that the scale is not applied twice.

Change-Id: Ia927656f0070df61e78da76e97d2c49de4d856d9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-01-21 12:59:33 +01:00
Friedemann Kleint
04773fe72e Reduce invocations of QFINDTESTDATA in tst_qfileinfo.
Introduce variables for the paths used in the test and
check in initTestCase().

Change-Id: Ie801266e30cd860e5bdf079c1182fe385f9598c7
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-21 12:15:01 +01:00
Friedemann Kleint
52e14e05fa Fix temporary file leak in tst_qfileinfo.
Change-Id: I0d679638d5a9564f612ae5e70717f164b74aefb0
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-21 12:14:53 +01:00
Samuel Rødal
4feadac76e Android-eglfs: Fixed build against Android 4.0.x
The header location for SurfaceComposerClient.h changed between Android
4.0 and 4.1, so we need to select based on the major and minor version.

Change-Id: I7a6408f8ba3c644facca3a7e64b8d68fde9c4472
Reviewed-by: aavit <eirik.aavitsland@digia.com>
Reviewed-by: Rainer Keller <rainer.keller@digia.com>
2013-01-21 09:20:01 +01:00
Giuseppe D'Angelo
12d90d6202 Add a note for merging QString::contains(QRE, QREM) overloads in Qt 6
Change-Id: I19609b192618287dbac0de2e893e3e9b40d6a969
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-20 22:46:32 +01:00
Gerhard Gappmeier
9bbebb9144 Add support for defining properties from member variables.
This associates properties with member variables and
avoids writing getter and setter methods manually.
The metaCall() method directly accesses the member variable,
so additional method calls can be avoided.
The metaCall() setter code also supports NOTIFY signals,
which means the according signal is emitted when the property
gets written.

Task-number: QTBUG-16852

Change-Id: I88a1f237ea53a1e9cf65fc9ef2e207718eb8b6c3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-19 17:36:55 +01:00
Friedemann Kleint
6f225b0b5d Fix MinGW-warnings about comparing signed/unsigned.
Change-Id: I970264e5b096a3d6384b59d0ae0876bb80fd0009
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-18 14:18:34 +01:00
Friedemann Kleint
ced523af7a Fix crashes in tst_qthreadpool on Windows.
Qt 4.8 shows frequent crashes in runMultiple apparently caused
by the QMutex construction in the free functions by different
threads. Use a common QMutex class member instead.

Change-Id: I851d4e2d3637a7b4f404ed843f5360c10caa21f5
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-18 14:16:52 +01:00
Samuel Rødal
01d5c6c949 Android-eglfs: Added support for non-composited rendering.
By using FramebufferNativeWindow Qt can render directly without going
through the SurfaceFlinger compositor.

Change-Id: I0538fca9f2e905c076ff5837dd73589ee9c632ca
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-18 09:16:10 +01:00
Samuel Rødal
d29aabbca9 eglfs: Introduce way of filtering out unwanted EGL configs.
Some times a platform might want to exclude certain configs, for example
based on EGL_NATIVE_VISUAL_ID. This patch introduces a new
QEglConfigChooser class which has a virtual filterConfig() function
which can be re-implemented in a sub-class to give finer control of how
configs are chosen.

Change-Id: I8b684f01be95a47307b1e429857f01337a9a38d8
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-18 09:16:03 +01:00
David Faure
ac9ab9703f QtDBus: Garbage collect deleted objects now and then.
Fixes performance issues in apps which register and deregister objects
very frequently (like nepomukstorage).

Change-Id: Ib4ce8d65868f0e26cd45f1053e4b2f4c13528cfa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:36 +01:00
David Faure
00e0923e60 Output std error from qmake/make when the test fails.
This is intended to make it easier to understand what's happening when
this test is flaky during CI.

Change-Id: I13163c244cb99414d90b5f71c365a4ff2216bc83
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:29 +01:00
David Faure
ff8362d65e QSaveFile autotest: restore permissions using RAII
So that the QTemporaryDir can happen even on error.

Change-Id: I728d49eac8bd65e1919fd314a95387949e134de0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:22 +01:00
David Faure
2d5fe45379 QSaveFile: test the case of an existing, but readonly, target file.
Change-Id: I296d9c2598b8c72e2fd3e6ec80a615364b7eddeb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:16 +01:00
David Faure
e993df8771 Add class QSaveFile.
This QIODevice uses a temporary file for writing, so that in case of
write errors, the writing operation is canceled, without losing any
existing file. It also avoids having a partially-written file visible
by other processes, at the final destination.

Change-Id: I9482df45751cb890b1b6f1382ec2eea3eb980627
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:11 +01:00
Frederik Gladhorn
e3a10e15ff Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-16 23:51:11 +01:00
Friedemann Kleint
34572dadc6 Dialog testing tool: Control life cycle of non-modal file dialogs.
Keep the non-modal file dialog around and delete only on request,
such that one can simulate repeated invocations of show() on
the same dialog for testing native dialogs.

Change-Id: I80d0f1dfafbc02a31be192098121654a01025174
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-01-16 17:06:12 +01:00
Juan Luis Boya García
5d2bb24cc9 Fixed dead keys on MS Windows
Since Qt4, there is a bug which causes Qt to drop dead key modifiers
(like graves and acutes) if the user types enough fast on MS Windows.

This happens because of an extrange behavior of Windows, which drops
dead keys on ToUnicode() calls.

This patch tries to workaround that.

Task-number: QTBUG-8764
Task-number: QTBUG-10032

Change-Id: Ifdde25817743194fd5c0b7533c27f46a7a108ca4
Reviewed-by: Friedemann.Kleint@digia.com
Reviewed-by: oliver.wolff@digia.com
Reviewed-by: marc.mutz@kdab.com
Reviewed-by: bjoern.breitmeyer@kdab.com
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-01-16 08:53:58 +01:00
Frederik Gladhorn
7075e29199 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/widgets/styles/qstyleanimation.cpp

Change-Id: Iae570895be6544de80f9c1ec309d1a08c59daff8
2013-01-16 01:22:45 +01:00