summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit 'qt/master-stable'Jason Barron2009-08-108-56/+146
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qobject.cpp src/corelib/tools/qsharedpointer_impl.h src/gui/widgets/qdatetimeedit.cpp src/gui/widgets/qlinecontrol.cpp src/gui/widgets/qlineedit.cpp tests/auto/qcssparser/qcssparser.pro tests/auto/qicoimageformat/tst_qicoimageformat.cpp tests/auto/qmultiscreen/qmultiscreen.pro tests/auto/qresourceengine/qresourceengine.pro tests/auto/qresourceengine/tst_qresourceengine.cpp tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
| * Store QObject*'s in the QVariant data structureAaron Kennedy2009-08-072-3/+14
| | | | | | | | | | | | | | | | Rather than requiring an allocation of the "shared data" region, QObject *'s should be stored directly in the data structure. This very marginally, but measurably, improves QVariant performance. Reviewed-by: Thiago Macieira
| * Fix a bug in QProcess. QProcess was not reentrant on UnixBenjamin Poulain2009-08-061-1/+11
| | | | | | | | | | | | | | | | | | QProcess is supposed to be reentrant but was not on Unix. The constructor of QProcessManager could be exectued several time when QProcess is created. The construction is now protected by a mutex. Task-number: 254246 Reviewed-by: Olivier Goffart
| * Fix warnings on MSVCThierry Bastian2009-08-061-1/+1
| |
| * Fix QObjectRace testOlivier Goffart2009-08-061-1/+1
| | | | | | | | We should not unlock too early, or node might get deleted.
| * Doc: fix qdoc errors in QSharedPointer documentation.Thiago Macieira2009-08-052-2/+3
| | | | | | | | | | | | | | | | | | | | I added the documentation to QWeakPointer::data, but I forgot to declare the class in the qdoc stub. Also, apparently I cannot link to a specific overload of a given function. Reviewed-by: Volker Hilsheimer
| * Restore symmetry between QSharedPointer and QWeakPointer on QObjects.Thiago Macieira2009-08-053-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the previous commit, you could create a QWeakPointer from any QObject-derived object. It's possible because QObject now has a pointer to the QWeakPointer's d-pointer. However, if you did: QSharedPointer<QObject> obj(new QObject); QWeakPointer<QObject> weak1(obj); QWeakPointer<QObject> weak2(obj.data()); Then weak1 would shared d-pointers with QSharedPointer, but weak2 wouldn't. Also, weak1.toStrongRef() would work, but weak2.toStrongRef() wouldn't. This change makes QObject know where the d-pointer created by QSharedPointer is, so weak2 would get the same d-pointer. As a nice side-effect, you can check if a given QObject is shared by trying to promote its QWeakPointer to QSharedPointer. Reviewed-by: Bradley T. Hughes
| * Performance improvements by avoiding creation of temporary QSharedPointers ↵Thiago Macieira2009-08-051-43/+25
| | | | | | | | with d=value=0
| * Add support for using QWeakPointer with QObject, replacing QPointer.Thiago Macieira2009-08-054-5/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem with QPointer is that it's a simple QObject*. So the only way for QPointer to do what it's supposed to do is if the object it's pointing to clears all QPointers when getting deleted. That means the QObject must know each and every QPointer pointing to it. To make matters worse, QPointers can be deleted while the object they're pointing to also gets deleted. So deleting QObjects must do locking. The solution to the QPointer problem is that both QObject and the "QPointer" reference something outside the QObject. This way, QObject doesn't have to lock anything to destroy itself: it's simply setting a volatile integer to zero when it gets deleted. Since the integer is outside the QObject, the integer is also refcounted. It's also O(1), so there's no problem having as many "QPointer". The two-atomic-ints structure is exactly what QSharedPointer and QWeakPointer use internally. We just abuse this structure for QObject needs, setting the strong reference count to -1 to indicate that it's a QObject that cannot be managed by a QSharedPointer. But QWeakPointer can still work and replace QPointer neatly. Reviewed-by: Bradley T. Hughes Reviewed-by: Jarek Kobus
| * Fix compilation for compilers that don't have template friends.Thiago Macieira2009-08-051-1/+0
| | | | | | | | | | | | | | GCC has template friends, so I wasn't seeing the error that d is protected. Thanks to Robert for pointing out. Reviewed-by: Robert Loehning <robert.loehning@nokia.com>
* | Enable symbol visibility when compiling with RVCT.axis2009-08-061-2/+2
| | | | | | | | | | This takes advantage of new functionality in RVCT 2.2, and requires build 683 beta or later.
* | Update license headers according to commit 858c70f768e.axis2009-08-0615-40/+40
| | | | | | | | RevBy: Trust me
* | Replaced $MODULE$ with hardcoded module names.axis2009-08-0611-11/+11
| | | | | | | | RevBy: Trust me
* | Rename Q_DECLARE_SCOPED_PRIVATE back to Q_DECLARE_PRIVATEHarald Fernengel2009-08-0654-62/+62
| | | | | | | | | | | | Rationale: We're using template magic now to get the private pointer in qglobal.h, so no need to have two macros. Also keeps backward compatibility with outside (KDE) code.
* | fixed borked up mergeHarald Fernengel2009-08-061-0/+3
| |
* | Merge commit 'qt/master-stable'Jason Barron2009-08-0619-225/+214
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | Conflicts: configure.exe doc/src/classes/qnamespace.qdoc examples/examples.pro src/corelib/kernel/qcoreevent.cpp src/corelib/kernel/qobject.cpp src/gui/kernel/qapplication.cpp src/gui/kernel/qstandardgestures.h src/gui/kernel/qwidget.cpp
| * Merge AudioServices into mainline.Justin McPherson2009-08-051-0/+14
| |
| * Merge branch '4.5'Bill King2009-08-051-0/+1
| |\ | | | | | | | | | | | | | | | Conflicts: src/gui/graphicsview/qgraphicsitem.cpp
| | * Fix: Gtk native dialogs do not repaint when zero-timers are usedJens Bache-Wiig2009-08-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that our glib timers were given too high priority, effectively starving the Gtk event loop. By assigning our timer source, G_PRIORITY_DEFAULT_IDLE we ensure that all gtk+ events are handled first, thus allowing the native dialogs to respond and repaint properly. Task-number: 258433 Reviewed-by: bhughes
| | * Build on snow leopard.Morten Sorvig2009-08-041-1/+1
| | | | | | | | | | | | | | | | | | Don't error out when building qmake, just let it build a 64-bit binary (even for carbon) RebBy: Richard Moe Gustavsen
| * | Restore the old name for QObjectDeletionNotification.Thiago Macieira2009-08-042-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we're going to do changes to simplify some of the Declarative UI enablers, let's do them all at once. That way, the adaptation necessary happens only once, as opposed to every time we do the changes. I tried not to break by leaving a typedef, but obviously the QObjectPrivate member isn't affected by the typedef... Reviewed-by: Trust Me
| * | Revert "Remove currentChildBeingDeleted from QObjectPrivate."Thiago Macieira2009-08-042-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 128717b171f01c82e5f0fb83f5923d4f7b9cfc10. The change broke Alien because QWidget no longer has the native window handle in its own private. It needs to access the top-level window (or the one with the native handle) in order to perform some operations. The problem is that it needs to do that in the destructor. And we cleared the parent before the destructor was run. Technically speaking, reverting is the correct thing to do, since the parent *still* exists when the child is deleted.
| * | Add QWeakPointer::data, which thread-unsafely returns the tracked pointerThiago Macieira2009-08-042-2/+75
| | | | | | | | | | | | | | | | | | | | | | | | This function allows one to retrieve the pointer out of a QWeakPointer without promoting it to QSharedPointer first. That means there are no guarantees that the object won't get deleted. Reviewed-by: Bradley T. Hughes
| * | Reorganise QObjectPrivate so that it's easier to tell what's in it.Thiago Macieira2009-08-042-66/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also rename QDeclarativeData to QObjectDeletionNotification, since it has no relation to declarative UI. It's just notification of the object's deletion. Make the destructor non-inline and place it in qobject.cpp, so that the virtual table is emitted there and exported from QtCore. Also move the QObjectData destructor to qobject.cpp. This means you cannot create any class deriving directly from QObjectData outside QtCore, which is the intention anyways (it's a private class and only QObjectPrivate derives from it). Reviewed-by: Bradley T. Hughes
| * | Clean up old Jambi code: there's a way of getting the QObject d-pointerThiago Macieira2009-08-041-8/+1
| | |
| * | Don't try to make direct system calls on Linux.Thiago Macieira2009-08-042-98/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Accept that we cannot do everything, so users using outdated toolchains may have threading problems (leaking file descriptors). It's not like this is a recent problem anyway... Reviewed-By: Bradley T. Hughes
| * | Renamed internal WinGesture event to NativeGesture.Denis Dzyubenko2009-08-042-2/+2
| | | | | | | | | | | | | | | | | | | | | It will also be used on Mac, so it doesn't make sense to keep it windows specific. Reviewed-by: trustme
| * | Added input hints to QGraphicsItem.jasplin2009-08-041-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows for input hints to be set on a QGraphicsItem. Input methods use such hints to define its appearance/behavior (e.g. to allow for numerical input only). Reviewed-by: ahanssen Task-number: 254493
| * | QParallelAnimationGroup pause resume fixedThierry Bastian2009-08-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | If you resumed a parallel animation group, it would always restart (ie. stop and start) the animation which would reset its current time to 0 and trigger flickering. autotest included. Task-Number: 259102
| * | Animations: better handling of the timerThierry Bastian2009-08-042-27/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It could be that if you start lots of animations, they would not be started at the same time and even have their first tick to late. So we needed to only transfer the started animation when receiving the start/stop timer tick. In addition, if the animation timer is already active we don't restart it. This would cause no animation to receive ticks if lots of them are started.
| * | Remove the "preliminary support" warning for 10.6Morten Sorvig2009-08-041-4/+1
| | | | | | | | | | | | | | | Also make the "usupported on > 10.6" error a warning. No need to stop the build, the warning will be printed enough times.
| * | Build on snow leopard.Morten Sorvig2009-08-041-1/+1
| | | | | | | | | | | | | | | | | | Don't error out when building qmake, just let it build a 64-bit binary (even for carbon) RebBy: Richard Moe Gustavsen
| * | Fix incorrect license headers.Jason McDonald2009-08-041-1/+11
| | | | | | | | | | | | Reviewed-by: Trust Me
| * | Fix obsolete license headersJason McDonald2009-08-043-4/+4
| | | | | | | | | | | | Reviewed-by: Trust Me
| * | Doc fixesAaron Kennedy2009-08-042-0/+8
| | | | | | | | | | | | Reviewed-by: TrustMe
* | | Merge commit 'origin/master'Jason Barron2009-08-0484-292/+536
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/corelib/kernel/qmetatype.cpp src/corelib/kernel/qobject.cpp src/corelib/thread/qthread_unix.cpp src/gui/graphicsview/qgraphicssceneevent.h src/gui/itemviews/qheaderview.h src/gui/kernel/qapplication_qws.cpp src/gui/kernel/qgesture.h src/gui/kernel/qgesturerecognizer.h src/gui/painting/qpaintengine_raster.cpp src/network/access/qhttpnetworkreply.cpp src/network/access/qnetworkcookie.h src/network/socket/qnativesocketengine_unix.cpp
| * | | Trailing whitespace and tab/space fixes for src/corelibJanne Anttila2009-08-0414-48/+46
| | | |
| * | | Squashed commit of the topic/exceptions branch.Harald Fernengel2009-08-0379-254/+500
| | | | | | | | | | | | | | | | | | | | Contains some smaller fixes and renaming of macros. Looks big, but isn't scary at all ;)
* | | | Merge commit 'qt/master-stable'Jason Barron2009-08-0459-319/+2097
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/openssl/openssl.pri demos/embedded/embedded.pro examples/itemviews/chart/chart.pro examples/network/network.pro examples/painting/painterpaths/painterpaths.pro examples/threads/mandelbrot/mandelbrot.pro qmake/project.cpp src/3rdparty/libtiff/libtiff/tif_config.h src/corelib/arch/arch.pri src/corelib/global/qglobal.cpp src/corelib/kernel/kernel.pri src/corelib/kernel/qcore_unix_p.h src/corelib/kernel/qobject.cpp src/corelib/thread/qthread_unix.cpp src/corelib/tools/qsharedpointer_impl.h src/corelib/tools/tools.pri src/gui/kernel/qaction.h src/gui/kernel/qapplication.cpp src/gui/painting/qregion.h src/gui/widgets/qlineedit.cpp src/gui/widgets/qlineedit_p.h src/network/socket/qnativesocketengine_unix.cpp tests/auto/qdir/tst_qdir.cpp tests/auto/qdiriterator/tst_qdiriterator.cpp tests/auto/qhttp/qhttp.pro tests/auto/qline/qline.pro tests/auto/qnetworkreply/tst_qnetworkreply.cpp tests/auto/qresourceengine/qresourceengine.pro tests/auto/qsharedpointer/qsharedpointer.pro tests/auto/qstring/qstring.pro tests/auto/qtcpsocket/qtcpsocket.pro tests/auto/qtcpsocket/tst_qtcpsocket.cpp
| * | | Fix deadlock in the fsevents file watcher.Norwegian Rock Cat2009-08-032-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was making an assumption that one could call CFRunLoopStop and expect that the runloop would stop very soon afterwards. This is a bit naive and can result in situations where we end up running past and entering run again before everything is finished. We now make sure that we don't leave stop() until the we really have stopped the other thread. Reviewed-by: mbm
| * | | Ensure that we never increase the strong reference count up from zero.Thiago Macieira2009-08-031-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | Also add some thread stress tests to try and detect doing it wrong. Reviewed-By: Bradley T. Hughes
| * | | Change the pointer-tracking code to work everywhere.Thiago Macieira2009-08-031-10/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if you create a QSharedPointer in code with pointer-tracking, you must ensure it gets deleted in code with pointer-tracking, otherwise the internal safety tracker will be "leaking" objects. The pointers would never get removed. And if any new pointer happened to have the same pointer address (which happens quite often), the tracker code would promptly abort the application. With this change, the untracking of the pointer is scheduled by the same code that creates the tracking. This is done by "abusing" the custom deleter code: - for the QSharedPointer that used ExternalRefCountWithDestroyFn already, we intercept the call to the destroy function and call the untracking function - for a normal QSharedPointer, we use the "normalDeleter" function as custom deleter and chain up above Note: the autotest only *really* works in release mode. Otherwise functions don't get inlined and do get merged by the linker. Reviewed-By: Bradley T. Hughes
| * | | Don't forget to delete the deleter object too in QSharedPointer.Thiago Macieira2009-08-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Destructors have to be run for the subobjects we initialise. Reviewed-By: Bradley T. Hughes
| * | | Cleanup old code in QSharedPointerThiago Macieira2009-08-031-18/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't support MSVC 6.0 or MSVC .NET 2002, so all compilers we support can deal with member templates and partial template specialisation. Remove the #ifdef protecting the code that needed it. Also add some comments indicating the sizes of the structures. There is no padding necessary in most cases. Reviewed-By: Trust Me
| * | | Remove the need for internal API in QSharedPointer.Thiago Macieira2009-08-031-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | That way, this code can be compiled with an earlier version of Qt and should still work in new ones. Reviewed-by: Trust Me
| * | | Autotest: add a way to ensure that there are no safety-check pointers leakingThiago Macieira2009-08-031-1/+22
| | | | | | | | | | | | | | | | | | | | In the future, it would be nice to split the autotest in multiple functions at every check().
| * | | Merge branch '4.5'Thiago Macieira2009-08-031-2/+2
| |\ \ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qsharedpointer.cpp src/corelib/tools/qsharedpointer_impl.h src/gui/dialogs/qcolordialog.cpp src/gui/painting/qwindowsurface_raster.cpp src/network/access/qnetworkaccessmanager.cpp tests/auto/qsharedpointer/externaltests.cpp
| | * | Disable the pointer tracking feature in Qt 4.5.Thiago Macieira2009-07-272-29/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The functionality is broken, since pointers can be released by a QSharedPointer tracking a pointer of different type, which would leave behind pointers in the hash. The fix requires Qt 4.6 because of a new symbol being added.
| | * | Add docs for Windows Server 2008 R2 to QSysInfo::WinVersionBradley T. Hughes2009-07-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Windows Server 2008 R2 is based on kernel 6.1, the same as Windows 7. Reviewed-by: TrustMe
| * | | Remove currentChildBeingDeleted from QObjectPrivate.Thiago Macieira2009-08-032-21/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a child is being deleted by its parent, the child should not notify the parent (of that which it already knows anyway). We did that by keeping a pointer to the child being deleted. Much simpler to simply orphan the child. Reviewed-by: Bradley T. Hughes