[Ktutorial-commits] SF.net SVN: ktutorial:[127] trunk/ktutorial/ktutorial-editor
Status: Alpha
Brought to you by:
danxuliu
|
From: <dan...@us...> - 2010-03-09 03:41:31
|
Revision: 127
http://ktutorial.svn.sourceforge.net/ktutorial/?rev=127&view=rev
Author: danxuliu
Date: 2010-03-09 03:41:25 +0000 (Tue, 09 Mar 2010)
Log Message:
-----------
Add parent argument to TutorialTreeSelectionManager constructor.
Modified Paths:
--------------
trunk/ktutorial/ktutorial-editor/src/view/TutorialTreeSelectionManager.cpp
trunk/ktutorial/ktutorial-editor/src/view/TutorialTreeSelectionManager.h
trunk/ktutorial/ktutorial-editor/tests/unit/view/TutorialTreeSelectionManagerTest.cpp
Modified: trunk/ktutorial/ktutorial-editor/src/view/TutorialTreeSelectionManager.cpp
===================================================================
--- trunk/ktutorial/ktutorial-editor/src/view/TutorialTreeSelectionManager.cpp 2010-03-09 03:01:27 UTC (rev 126)
+++ trunk/ktutorial/ktutorial-editor/src/view/TutorialTreeSelectionManager.cpp 2010-03-09 03:41:25 UTC (rev 127)
@@ -24,7 +24,8 @@
//public:
TutorialTreeSelectionManager::TutorialTreeSelectionManager(
- QItemSelectionModel* itemSelectionModel) {
+ QItemSelectionModel* itemSelectionModel,
+ QObject* parent): QObject(parent) {
connect(itemSelectionModel,
SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
this,
Modified: trunk/ktutorial/ktutorial-editor/src/view/TutorialTreeSelectionManager.h
===================================================================
--- trunk/ktutorial/ktutorial-editor/src/view/TutorialTreeSelectionManager.h 2010-03-09 03:01:27 UTC (rev 126)
+++ trunk/ktutorial/ktutorial-editor/src/view/TutorialTreeSelectionManager.h 2010-03-09 03:41:25 UTC (rev 127)
@@ -42,8 +42,10 @@
*
* @param itemSelectionModel The selection model to watch for changes in the
* selection.
+ * @param parent The parent object.
*/
- TutorialTreeSelectionManager(QItemSelectionModel* itemSelectionModel);
+ TutorialTreeSelectionManager(QItemSelectionModel* itemSelectionModel,
+ QObject* parent = 0);
Q_SIGNALS:
Modified: trunk/ktutorial/ktutorial-editor/tests/unit/view/TutorialTreeSelectionManagerTest.cpp
===================================================================
--- trunk/ktutorial/ktutorial-editor/tests/unit/view/TutorialTreeSelectionManagerTest.cpp 2010-03-09 03:01:27 UTC (rev 126)
+++ trunk/ktutorial/ktutorial-editor/tests/unit/view/TutorialTreeSelectionManagerTest.cpp 2010-03-09 03:41:25 UTC (rev 127)
@@ -35,6 +35,8 @@
void cleanup();
void cleanupTestCase();
+ void testConstructor();
+
void testSelectTutorialOrChildren();
void testSelectStepOrChildrenChangingToOtherItems();
@@ -107,6 +109,14 @@
delete mTutorial;
}
+void TutorialTreeSelectionManagerTest::testConstructor() {
+ QObject parent;
+ TutorialTreeSelectionManager* selectionManager =
+ new TutorialTreeSelectionManager(mSelectionModel, &parent);
+
+ QCOMPARE(selectionManager->parent(), &parent);
+}
+
void TutorialTreeSelectionManagerTest::testSelectTutorialOrChildren() {
//Name
select(mTreeModel->index(0, 0));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|