summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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
* | 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
* | export QStateMachinePrivate symbolsKent Hansen2009-08-031-6/+2
| | | | | | | | | | 1) it's needed for the Declarative UI integration and 2) it hopefully fixes the build on Windows.
* | remove constructors that are not usefulKent Hansen2009-08-038-82/+8
| | | | | | | | | | | | | | The constructors that take a list of target states produce hard-to-read code, and they're rarely useful in practice since 99% of transitions take a single target state; so it's better to enforce that setTarget{State,States}() be used instead.
* | Export symbol used in QtGui.Volker Hilsheimer2009-07-311-1/+5
| | | | | | | | Reviewed-by: Kent Hansen
* | Doc: fix warnings.Volker Hilsheimer2009-07-311-1/+1
| |
* | compileKent Hansen2009-07-311-1/+1
| | | | | | | | | | Broke on WinCE since QStateMachinePrivate is now using Q_AUTOTEST_EXPORT.
* | Fix compilation: add #include <new> if placement new is usedThiago Macieira2009-07-311-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | I'm not sure this is the proper fix, though. xlC 7 complains with: "/usr/vacpp/include/new", line 97.10: 1540-1298 (I) "void *operator new(size_t, void *) throw()" needs to be declared in the containing scope to be found by name lookup. Also add some calculations to the padding in the data structure. Reviewed-by: Trust Me
* | add private goToState() function to state machineKent Hansen2009-07-312-7/+97
| | | | | | | | Needed for Declarative UI integration.
* | remove const from QSignalEvent::sender*Kent Hansen2009-07-313-6/+6
| | | | | | | | | | QObject::sender() does not return const QObject*, so neither should this API; it just forces you to const_cast for no good reason.
* | Compile on HP-UXiBradley T. Hughes2009-07-312-3/+4
| | | | | | | | | | | | | | | | | | | | There is no monotonic clock support on HP-UXi at all, and the _POSIX_MONOTONIC_CLOCK macro is not defined at all (not even to -1). We handle this in the event dispatcher, but not in qcore_unix.cpp. Since the monotonic clock time code has moved, the define of _POSIX_MONOTONIC_CLOCK to -1 should also move. Reviewed-by: thiago
* | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qtAaron Kennedy2009-07-311-1/+1
|\ \
| * | Doc: there is no group of explicitly shared classes, only one class uses this.Volker Hilsheimer2009-07-301-1/+1
| | | | | | | | | | | | | | | Explain the implications in the QWebHistoryItem documentation, and get rid of the "group".
* | | Update QAbstractItemModel following reviewAaron Kennedy2009-07-311-2/+2
| | | | | | | | | | | | Reviewed-by: mbm
* | | Remove isDynamic property flagAaron Kennedy2009-07-312-14/+1
| | | | | | | | | | | | Reviewed-by: Roberto Raggi
* | | Reorder flag values in ascending orderAaron Kennedy2009-07-311-4/+4
| | | | | | | | | | | | Reviewed-by: Roberto Raggi
* | | Dynamic meta object supportAaron Kennedy2009-07-315-19/+56
| | | | | | | | | | | | | | | | | | | | | This is an internal API used by declarative. Authored-by: mae Reviewed-by: Aaron Kennedy