summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | | Add index methods to QMetaProperty and QMetaMethodAaron Kennedy2009-07-312-0/+22
| | | | | | | | | | | | | | | Authored-by: Kent Hansen Reviewed-by: Aaron Kennedy
* | | Add a declarative data ptr to QObjectPrivateAaron Kennedy2009-07-312-1/+19
| | | | | | | | | | | | | | | | | | | | | This data ptr does not increase the size of the QObject, as we take advantage of space otherwise only used during destruction. Reviewed-by: Andreas
* | | Make QAbstractItemModel default rolenames reentrantAaron Kennedy2009-07-311-11/+17
| | | | | | | | | | | | | | | Reviewed-by: Martin Jones Reviewed-by: mbm
* | | Make setRoleNames() protected and improve docs.Aaron Kennedy2009-07-313-1/+50
| | | | | | | | | | | | | | | | | | | | | (cherry picked from commit 15be8a6b259a5cb4f528b1c765bfcddfc9edd044) Authored-by: Martin Jones Reviewed-by: mbm
* | | Fixed missing forward declarations, which made gcc fail to compileErik Verbruggen2009-07-312-2/+9
| | | | | | | | | | | | | | | | | | | | | anything that included qobject.h Reviewed-by: Thomas Hartmann (cherry picked from commit cc287101308fa606eb4de2597b5309c8099654c3)
* | | removing Q_CORE_EXPORT for q_guard_addGuard() and q_guard_removeGuard()Aaron Kennedy2009-07-314-30/+26
| | | | | | | | | | | | | | | | | | | | | | | | I made the functions inline instead and moved them to qobject_p.h Authored-by: Thomas Hartmann Reviewed-by: Aaron Kennedy (cherry picked from commit fd27c5ac9670b56ccd60e8d8f6791237358f3633)
* | | Add non-threadsafe QGuard classAaron Kennedy2009-07-315-3/+200
| | | | | | | | | | | | | | | | | | Cherry pick of 4031c0f0613090d70cd1fcacfc5b8316b12eb14e Reviewed-by: Andreas
* | | Allow retrieval of interface IId from class type.Aaron Kennedy2009-07-311-0/+10
| | | | | | | | | | | | | | | | | | | | | This method is necessary for QML to support Qt interfaces, but probably shouldn't be used otherwise. Reviewed-by: Roberto Raggi
* | | extend the QObjectPrivate::connectedSignals bitfield to make spaceAaron Kennedy2009-07-314-17/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for all the required NOTIFY signals we need for QML bindings. An additional internal function QMetaObject::isConnected() allows to query the bits, or you use connectedSignals[0] if you know that the signal in question has a QMetaObject::indexOfSignal() < 32. Authored-by: mae Reviewed-by: Aaron Kennedy
* | | Add FINAL attribute to Q_PROPERTY()Aaron Kennedy2009-07-312-1/+17
| | | | | | | | | | | | | | | | | | This will be used by the declarative module to optimize property bindings. Reviewed-by: Roberto Raggi
* | | Add CONSTANT attribute to Q_PROPERTY()Aaron Kennedy2009-07-312-1/+30
|/ / | | | | | | | | | | This will be used by the declarative module to determine if a property lacking a NOTIFY signal is truly constant, or just missing a NOTIFY signal. Reviewed-by: Roberto Raggi
* | Remove "no-stl" from the build key and add compatibility for old plugins.Thiago Macieira2009-07-292-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | STL support hasn't had binary compatibility effects for the entire lifetime of Qt 4, so it should never have been there. It is a legacy thing I am now correcting. When inspecting a plugin, remove the "no-stl" from its loaded build key. That indicates a pre-4.6 build, since now Qt no longer adds it to its own build keys. Note that you have to remove the 4.6 plugin cache from $HOME/.config/Trolltech.conf or the registry for this change to work (if you compile Qt with -no-stl). Otherwise, plugins that have already been scanned will fail to load. Reviewed-by: Bradley T. Hughes
* | Move the 'timeval' operators to qcore_unix_p.h.Jason Barron2009-07-293-49/+46
| | | | | | | | | | | | | | | | | | | | Since these operators are also used by qcore_unix.cpp, it makes more sense to have them in qcore_unix_p.h so that these files can be compiled without a dependancy on the unix event dispatcher. Also remove some headers from the unix event dispatcher since the headers are already included in qcore_unix_p.h Reviewed-by: brad <bradley.hughes@nokia.com>
* | Port of Qt to QNXHarald Fernengel2009-07-296-36/+19
| | | | | | | | | | | | | | | | This makes Qt work on QNX 6.4. * no q3support, no phonon * no QSharedMemory, no QSystemSemaphore, no QProcess Reviewed-By: Robert Griebl
* | Port of Qt to VxWorksRobert Griebl2009-07-2928-29/+1334
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes Qt work on VxWorks 6.6+ in native (kernel) mode. * compiles with the WindRiver GNU toolchain (Linux only) * works with QWS (tested with the VNC driver only) * tested on PPC hardware and the x86 VxWorks simulator * no q3support, no phonon, no webkit * no QSharedMemory, no QSystemSemaphore, no QProcess * only one QApplication instance (flat address space) * filesystem support depends heavily on the quality of the native driver * QLibrary is just a dummy to make plugins work at all * qmake transparently creates VxWorks munching rules for static ctors * made auto-test cope with missing OS features A special note regarding the Q_FOREACH patch for dcc: when calling foreach(a,c) with c being a function returning a container, the compiler would generate 5 references to some labels (.LXXXX), which are not there (so the linker complains in the end). Seems like dcc doesn't really like the 'true ? 0 : <function call to get type>' statement Reviewed-By: Harald Fernengel
* | Implement a new pointer-tracking mechanism for QSharedPointer.Thiago Macieira2009-07-282-41/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some compilers don't obey the same rules of "top-of-object" values for casting a pointer from a given class to void *. In any case, that can only work for polymorphic types (with a virtual table). So don't track the pointers by their pointer value, but instead by the d-pointer of the QSharedPointer object. The same cases that were caught before should still be caught. We still won't catch the creating a second QSharedPointer for the same object if the pointer values are different, though (when cast to void*). Reviewed-by: Bradley T. Hughes
* | Fix startDetached: the pipes must be CLOEXEC for them to work.Thiago Macieira2009-07-281-2/+2
| | | | | | | | | | | | | | | | | | In de05f9a40e41deb79daf5c4935b2645d70d7f322 I removed the fcntl that set FD_CLOEXEC because it was supposed to be set by qt_safe_pipe. Turns out that this code didn't call the wrapper function... Reviewed-by: ossi
* | Work around weird issue with Sun CC 5.9: Self was the wrong class.Thiago Macieira2009-07-281-2/+2
| | | | | | | | | | | | I don't know if this was only the debugging symbols or if the compiler was really wrong. But while debugging, Self was ExternalRefCountWithCustomDeleter, which is wrong at this point.
* | Sun CC 5.9 does not support template friendsThiago Macieira2009-07-281-0/+3
| | | | | | | | But I'm told 5.10 does.
* | Work around a Sun CC 5.9 compiler bug: the threadEngine variable isn't found.Thiago Macieira2009-07-271-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QtConcurrent had the following code: template <typename T> class ThreadEngineStarterBase { ... protected: ThreadEngine<T> *threadEngine; }; template <typename T> class ThreadEngineStarter : public ThreadEngineStarterBase<T> { public: ThreadEngineStarter(ThreadEngine<T> *threadEngine) :ThreadEngineStarterBase<T>(threadEngine) {} [...] }; The Sun CC compiler simply didn't parse the parameter declaration in the constructor. Instead of complaining, it silently ignored the problem. Which meant that the constructor simply used the uninitialised member variable from the base class to call the parent constructor, which ended up initialised with itself. You'd think that it's just because the parameter has the same name as a member variable. But it appears to be a compiler bug altogether. If you change the name, then you start getting compile errors. This change is a workaround that worked. Reviewed-By: Bradley T. Hughes
* | Sun CC 5.9 still doesn't support Template-Template ParametersThiago Macieira2009-07-271-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | I had added the version check when we only had CC 5.5 and 5.6, expecting that 5.7 would have the support. And if it didn't, then someone would notice the compile error in QtConcurrent, bumping the version number here. Except that QtConcurrent was never enabled with Sun CC. Which meant that we never got to test TTP support. Reviewed-By: Bradley T. Hughes