summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* WindowSystemInterface::sendWindowSystemEvents(): Remove unused parameter.Friedemann Kleint2012-07-231-3/+3
| | | | | | | | No need to pass the dispatcher. Get rid of Windows logic to maintain a stack of dispatcher associated with flags. Change-Id: Ic2daad4b6762a46fac3274937effc188af436c9a Reviewed-by: David Faure <faure@kde.org>
* Split QWidgetsVariant tests into a separate testcase.Stephen Kelly2012-07-238-218/+514
| | | | | | | This allows building the QVariant tests without the QtWidgets module. Change-Id: I7cd7e78a60c7bc7614ec16df1abe1e93e45d4923 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Exclude the delayed resource file test on Windows.Stephen Kelly2012-07-231-1/+5
| | | | | | | The feature does not work there. Change-Id: I4c19577d3882b5ea01d20f4a67a512c1e6bc803e Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add a test for all QtBase modules.Stephen Kelly2012-07-233-0/+123
| | | | | Change-Id: Ib87e56f063603d474e232a137246ab6a60f63a23 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix typo: delyed -> delayedStephen Kelly2012-07-204-9/+9
| | | | | Change-Id: I1e9c17a85a52f15f252392426fa0b30c101c7c30 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Provide public API for native event filtering, moved up from QPA.David Faure2012-07-203-10/+28
| | | | | | | | | | | | | | | | | | The previous API was hard to use (global function, no type safety, manual chaining), and confusing (app vs dispatcher split only made sense on Windows). Installing and removing out of order would have the risk of setting back a dangling pointer (crash). Meanwhile QPA added type safety, and this new API models the QObject::installEventFilter API for ease of use. The virtual method is in a new interface, QAbstractNativeEventFilter. QPA was even calling the dispatcher event filter with QPA-private event classes, which made no sense (refactoring leftover from when the code was in the dispatcher). Now the QPA plugins trigger the qcoreapp event filters with the actual native events directly. Change-Id: Ie35e47c59c862383bcaf857b28d54f7c72547882 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Tests: Replace deprecated QPixmap::grabWidget() by QWidget::grab().Friedemann Kleint2012-07-205-23/+23
| | | | | Change-Id: I5018cf5dd51c1781e7f17c7d205f3f60de7945be Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* Activate native window tests of QMdiArea.Friedemann Kleint2012-07-201-5/+6
| | | | | Change-Id: Ic272b5e28256e454a3186d4407d009c9331b292b Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
* Implement waitForWindowExposed and friends for widget windows.Friedemann Kleint2012-07-2040-526/+278
| | | | | | | | | | | | | | - Implement waitForWindowExposed() for toplevel windows. - Implement waitForWindowShown(QWidget *) and mark as deprecated in line with waitForWindowShown(QWindow*). - Use in tests. - Simplify tests (collapse waitForExposed, setActive into setActiveWindow, waitForActive), remove most hard-coded timeouts. - Stabilize graphicsview tests by using waitForWindowActive. Change-Id: Ic7c061e2745b36f71a715ee4e47c0346b11a91e8 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* QWidget/Win: fix restoreGeometry() from fullscreen modeJoerg Bornemann2012-07-191-3/+0
| | | | | | | | | | | | | | | When turning off fullscreen mode and restoring the widget's geometry we must inform the QWindow about the geometry change synchronously. Otherwise QWidget::geometry() will return the old value. Using the same technique for the state transition to fullscreen mode without sending a separate resize event. Autotest: tst_QWidget::saveRestoreGeometry Task-number: QTBUG-26421 Change-Id: I869e36cd302d9a94e398f48949ab3cb7ee9cdf51 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove the test tst_qdialog::throwInExec().Friedemann Kleint2012-07-191-54/+0
| | | | | | | | QtWidgets and QtGui are currently compiled without exceptions, which causes a crash with gcc 4.6.3. Change-Id: I8f872f3bec6266444adf08d51a6678150c5fae8e Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add another directory to the private INCLUDE_DIRS list.Stephen Kelly2012-07-191-0/+5
| | | | | | | | | | It should be possible to include both: * <QtGui/private/qfoo.h> * <private/qfoo.h> Change-Id: I83ed5bba633b4a6b9bd38e315c987d78beecfb1b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Dereference so we can be sure the type is not forward declared.Stephen Kelly2012-07-191-1/+3
| | | | | Change-Id: I4d67a08dc645649e767153f3aa0dc57b15d50a84 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Track window state in manual test windowflags.Friedemann Kleint2012-07-182-15/+39
| | | | | Change-Id: Ief6cd4b29ddcc946e1ccac75b352da80bbf647d0 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Fix rendering glitches when using native widgets in MDI subwindowsMiikka Heikkinen2012-07-181-6/+0
| | | | | | | | | | | | | | | | | | | | When mixing native and regular widgets in same QMdiArea, some subwindows didn't properly get set native. This was because when a native parentless widget was given a parent, it wouldn't enforce native window on the new parent and its ancestors. This happened because window flags were adjusted too late in relation to createWinId() call in setParent_sys(). Fixed by moving the createWinId() call to its proper place. Also removed some old Q_WS_* ifdeffing in QWidget::setParent() that masked some native enforcement code. Additionally removed few QEXPECT_FAILs from QWidget autotest now that those cases work correctly. Task-number: QTBUG-26424 Change-Id: Ib6f9d0531e5c7299e2c307734d49c81f1ffa9713 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Windows: Do not return short path names for QDir::tempPath().Friedemann Kleint2012-07-171-0/+2
| | | | | | | | WinAPI GetTempPath() sometimes returns short names for C:/Users/<user>/AppData/Local/Temp. Change-Id: I33f991acc06e652ccd484d36a5a384eb776f8395 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Fix error when inserting to tables with datetime fields with QODBCThiago A. Correa2012-07-161-1/+27
| | | | | | | | | | | | | SQL Server 10 introduced stricter rules for TIMESTAMP validation, making it necessary to specify the decimal digits. Other databases might do the same as well, so this patch introduces a check for the TIMESTAMP column size and adjusts the decimal digits parameter as needed. Task-number: QTBUG-2192 Change-Id: If6d798c6c928ebda75bc474e49a07fbbfbe5816c Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Replace Q_WS_ in tests by Q_OS_ or check platform names.Friedemann Kleint2012-07-1610-30/+25
| | | | | Change-Id: Ica445cf1e83bfaab870ac344d6c02766f047a5cc Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* tst_qwidget: check widget geometry in fullscreen modeJoerg Bornemann2012-07-161-0/+10
| | | | | Change-Id: Idc45c6d18decf3c71c6736742434ad9d0cccd2d2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove #ifdef Q_WS_ / include / #endif conditionals.Friedemann Kleint2012-07-166-22/+0
| | | | | Change-Id: I734490ddcb5501e620370e50ef06180ab5e23393 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Fix applicationName() being empty in QApplication.David Faure2012-07-162-15/+26
| | | | | | | | | | | | | | | A virtual method was reimplemented to return an always-empty string, probably a leftover from a refactoring. This fix showed that tst_qwidget_window was buggy: between Qt4 and Qt5, a "Before" became "After", which made "Before" unused, and was masking the fact that the app name was empty by default. In addition, the earlier Qt5 change that made the app name default to argv[0] now requires updating this test, now that it's actually working. Change-Id: I5360026821a9b95bedd0ff09dba3d51a22e542b7 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* statemachine: Move RestorePolicy enum to QState classKent Hansen2012-07-161-21/+21
| | | | | | | | | | This makes it possible to add API for setting the restore policy per state, or even per property assignment (QTBUG-17861). This change is fully source compatible with Qt4. Change-Id: I53628546b070f6fc84891f86e7ad7bd8ef5ba285 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Add QStateMachine constructor that takes a ChildModeKent Hansen2012-07-161-0/+42
| | | | | | | | | | | | Back when QStateMachine was changed to inherit QState, this constructor was conveniently left out because setting the state machine (root state) to be a parallel state group didn't actually work. But as of commit d281aa6936ad01e28dacabb41bd9eb59891f85a1, it does work, so add the missing constructor. Task-number: QTBUG-15430 Change-Id: I68c599baa0ef1bfc869195140cf5daf645e75b8b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* fix object file name clashOswald Buddenhagen2012-07-163-0/+3
| | | | | | | under extremely rare circumstances this would have actually failed Change-Id: I4132d0f82e9f924e92e9e96f6d34451c94a67201 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Test QVariant copy with a user type instead of a QtNetwork type.Stephen Kelly2012-07-152-9/+19
| | | | | Change-Id: I78acc8a843eb12a2606f491d1a29e1bcd408d60f Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Run QIcon related crash test with the other QtGui types.Stephen Kelly2012-07-141-2/+2
| | | | | Change-Id: I475cfc5a91a046951feecb425f8235ad37f1ba44 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Don't declare built-in metatypes as metatypes again.Stephen Kelly2012-07-141-23/+0
| | | | | Change-Id: Iba9804299e8f6e2db10965fdc719ee26f197758e Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add some tests to note that private signals can't be overloads.Stephen Kelly2012-07-131-0/+88
| | | | | | | | | This is just for completeness of the understanding of the limitations of private signals. There are no private signals in Qt which have overloads. Change-Id: Ic34c555aea360ee34beec796e597657888573da9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Relax the reqirement in which order events are delivered.Jan-Arve Saether2012-07-131-7/+11
| | | | | | | | | | | | | | | | | When the pushbutton is shown, it will generate both a ShowEvent and a StateChange with active=1 (because it is a top level window). This patch relaxes the reqirement in which order events are delivered. Ideally the order should also relied on, but I'm not sure if that is feasible due to differences among window managers across all platforms. This got provoked by codereview.qt-project.org/#change,26014 Change-Id: I96159fbb1b64f0ca8d13833d8a4c6799c655afc2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* statemachine: Make signal transition registration thread-safeKent Hansen2012-07-131-0/+50
| | | | | | | | Since Qt's connections are thread-safe, QStateMachine's plumbing around them should be thread-safe too. Change-Id: I8ae91c2edc2d32ca4ed4258b71e5da22de30ed91 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* statemachine: Fix signal transition handling in multi-threaded setupKent Hansen2012-07-131-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, QStateMachine lazily registers signal transitions (i.e., connects to the signal) when the transition's source state is entered. The connections are established in Qt::AutoConnection mode, which means that if the sender object lives in a different thread, the signal processing will be queued. But if a sender object's signal is used in an out-going transition of the target state of the queued transition, it's possible that a second signal emission on the sender object's thread will be "missed" by the state machine; before the machine gets around to processing the first queued emission (and registering the transitions of the new state), a sender object on the other thread could have emitted a new signal. The solution employed here is to eagerly register any signal transition whose sender object is on a different thread; that is, register it regardless of whether the transition's source state is active. Conversely, when a machine's transitions are unregistered (i.e., because the machine finished), signal transitions with sender objects on other threads should be left as-is, in case the machine will be run again. This doesn't solve the case where the sender object is moved to a different thread _after_ the transition has been initialized. Theoretically, we could catch that by installing an event filter on every sender object and handle the ThreadChange events, but that would be very expensive, and likely useless in most cases. So let's just say that that case isn't supported for now. Task-number: QTBUG-19789 Change-Id: Ibc87bfbf2ed83217ac61ae9401fe4f179ef26c24 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* statemachine: Fix dynamic transition registration edge casesKent Hansen2012-07-131-0/+86
| | | | | | | | | | | | Some of the transition constructors didn't call the maybeRegister() function, causing the transitions to be ignored if they were created when the state machine was running and the transition's source state was active. Added tests that cover all possible cases. Change-Id: If1b593b127bd719e3be4e5a2e6949a780c4e97c3 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* statemachine: Set correct signal index when signal is non-normalizedKent Hansen2012-07-131-22/+77
| | | | | | | | | | | | The originalSignalIndex member was not set if the signature had to be normalized. This caused the SignalEvent passed to onTransition() to report a signal index of -1. Improve the signal transition tests so they check both the event passed to eventTest() and onTransition(). Change-Id: I5331fd1944d53310b6d11eb2fd8713b80faa53a1 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Make it possible to connect to QAbstract{State,Transtion} private signals.Stephen Kelly2012-07-131-0/+121
| | | | | | | Use the same trick as used for private signals in the models. Change-Id: I4235788490cae0e3d554565621d145652dc5b0ca Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make it possible to use new syntax to connect to model signals.Stephen Kelly2012-07-131-0/+107
| | | | | | | | | The private signals can not be used as function pointers, as required by the new syntax, so we introduce a parameter which can only be created privately. Change-Id: I3d7bb8a163e764d685e8007cba831fb77e3c6855 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Create a way to inform moc about private signals.Stephen Kelly2012-07-131-0/+370
| | | | | | | | | | | | | | | | | | Moc checks for the use of the QPrivateSignal struct, which is part of the Q_OBJECT macro and is private to each class that uses it. Moc then generates a name of the signal which does not include the private struct, and generates code to invoke such signals with an instance of the private struct. This way we can mark private signals as such and prevent them from being emitted from subclasses or from outside of the class entirely. The drawback to this is that it only works if the private signal has no default arguments. However, at least in Qt, there are no such signals. Change-Id: Id16eadaa8d3c36a2c3b265077877f3e1d8304c84 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Test for QMetaType binary breakage.Jędrzej Nowacki2012-07-133-0/+46
| | | | | | | Type traits can not be changed durring Qt5 life time. Change-Id: If69f65ff2113c901580afee91b11ae1b11c13a4f Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* tst_QMimeDatabase: use QFutureSynchronizerMarc Mutz2012-07-131-12/+11
| | | | | | | | Replace a list of QFuture<void>s and a loop that calls waitForFinished() on each of them with a QFutureSynchronizer<void>, which does exactly that. Change-Id: I1f2e90169a5b2949bd8cb9d1009a5a7af1500139 Reviewed-by: David Faure <faure@kde.org>
* statemachine: Fix state entry bug for parallel state groupsKent Hansen2012-07-121-0/+39
| | | | | | | | | | | | | | | | | | The SCXML spec had a bug that would cause the initial state of a compound state within a parallel state group to be entered even if the transition specified another (non-initial) state of the compound state as its target. This only happened if the transition had multiple target states. The bug has been fixed in recent revisions of the SCXML spec. This commit implements the fix, which is to walk the ancestors of the transition's target states only after all the target states themselves have been added, so that the default initial states are correctly overridden/ignored. Task-number: QTBUG-25958 Change-Id: Iac532047678c483a4a3996e24dacf30e00f6bbe0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fix small problems with tst_QProcessThiago Macieira2012-07-121-3/+4
| | | | | | | | | | | | | | Remember to register the metatype where we use it, so we don't depend on another test being run previously. And skip the setWorkingDirectory test completely on Unix. I don't know why it needs to be skipped, but if we're not going to verify anything, don't even try to do anything. This saves us one memory leak at least. Change-Id: I22e151cc3fa7b4e976972aca8978b88b263d9bee Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Enable modularization of translation files.Jan-Arve Saether2012-07-123-0/+47
| | | | | | | | | | | | | | | | | This is accomplished by introducing dependencies to catalogs. This requires one API change: QTranslator::load(const uchar *, int); changes to QTranslator::load(const uchar*, int len, const QString &directory = QString()); Since now, even the load from memory might need a directory if the memory block contains a qm file with dependencies. Change-Id: I781f333d07f53bb431d0a7b5fa1abe282dc4d338 Task-number: QTBUG-26138 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix crash when column is inserted before rowspanned cellEskil Abrahamsen Blomfeldt2012-07-121-0/+29
| | | | | | | | | | | | | | When you're inserting a column in front of a rowspanned cell and this cell is not the first in the rowspan, we would get the wrong logical index of the new cell (putting it in front of the initial cell with the rowspan). If the cell does not span all rows, the table will get into a broken state and trigger asserts in update(). To fix this, we search for the first cell after the insertion point which has a logical index higher than the cell directly before the insertion point. Change-Id: I42e91a20d77b2ba9c5607f6cab23f51ed888cbd3 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* test behavior of $${absolute,relative}_path() with empty 1st argumentOswald Buddenhagen2012-07-121-0/+2
| | | | | Change-Id: I76c0853a9d397979f2ae5eb780374d2380c989f1 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Implement qWaitForWindowShown using qWaitForWindowExposed.Friedemann Kleint2012-07-121-1/+1
| | | | | | | Deprecate qWaitForWindowShown for Qt 6 as it is just a wrapper. Change-Id: I0f8195679679120bd402e273fed4d331dc926708 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Tests: Fix printsupport profiles.Friedemann Kleint2012-07-122-2/+2
| | | | | | | | | Fix reversed conditions, breakage introduced by 32db7de2079967fe1c333c562b742318c50321a4. Change-Id: I6fca399376cd1fa9bffea0a686b56c4d5ec26605 Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Write qHash functions for QDate, QTime and QDateTime.Mitch Curtis2012-07-123-1/+8
| | | | | | | | These functions didn't exist - this patch implements them. Task-number: QTBUG-23079 Change-Id: I9eb6e238531d5cda878f5f2cdd27bab30aa60669 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add unary operator+ to QPoint and QPointF.Mitch Curtis2012-07-122-0/+30
| | | | | | | | | | | | | As requested by Winfried Schenke: "QPoint should have an unary operator+ (the unary operator- exists). Classes with arithmetic operators should provide a complete set of operators, because some template code relies on it." Task-number: QTBUG-22913 Change-Id: Ib0c5105975f56c15f00bb48d83c8d911f5a204ac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Improve windowflags, windowgeometry manual tests.Friedemann Kleint2012-07-118-21/+62
| | | | | | | | | | - Make them compile with 4.8 for comparison - Add Active to WindowStates control - Add -layout option to windowgeometry Change-Id: I052330eb8689883c104a0552708ea700c7cd790a Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
* Fix some spelling errorsSergio Ahumada2012-07-1110-11/+11
| | | | | | Change-Id: I19d3b2e9a5180b13deb828b55195404ef20be295 Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Improve QPoint and QPointF auto tests.Mitch Curtis2012-07-114-72/+679
| | | | | | | | Improve test coverage for QPoint and QPointF. Separate QPointF tests into their own project. Change-Id: Id28dc5b85aba9fc179d87b2bca1d99854f27a5ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>