Changeset 2189
- Timestamp:
- 07/26/08 11:39:32 (4 months ago)
- Location:
- v2/trunk
- Files:
-
- 1 added
- 93 modified
-
coveragemeter/ui/UITestReport.cpp (modified) (4 diffs)
-
coveragemeter/ui/UITestReport.h (modified) (1 diff)
-
doxygen.config (added)
-
fresh/objects/MonkeyExport.h (modified) (1 diff)
-
fresh/objects/QSingleton.cpp (modified) (1 diff)
-
fresh/objects/QSingleton.h (modified) (5 diffs)
-
fresh/objects/pSettings.cpp (modified) (3 diffs)
-
fresh/objects/pSettings.h (modified) (4 diffs)
-
fresh/widgets/pAction.cpp (modified) (4 diffs)
-
fresh/widgets/pAction.h (modified) (3 diffs)
-
fresh/widgets/pActionManager.cpp (modified) (5 diffs)
-
fresh/widgets/pActionManager.h (modified) (3 diffs)
-
fresh/widgets/pDockToolBar.cpp (modified) (12 diffs)
-
fresh/widgets/pDockToolBar.h (modified) (5 diffs)
-
fresh/widgets/pDockToolBarManager.cpp (modified) (9 diffs)
-
fresh/widgets/pDockToolBarManager.h (modified) (4 diffs)
-
fresh/widgets/pDockWidget.cpp (modified) (3 diffs)
-
fresh/widgets/pDockWidget.h (modified) (3 diffs)
-
fresh/widgets/pExtendedWorkspace.cpp (modified) (16 diffs)
-
fresh/widgets/pExtendedWorkspace.h (modified) (7 diffs)
-
fresh/widgets/pFileListEditor.cpp (modified) (3 diffs)
-
fresh/widgets/pFileListEditor.h (modified) (3 diffs)
-
fresh/widgets/pFilesListWidget.cpp (modified) (5 diffs)
-
fresh/widgets/pFilesListWidget.h (modified) (4 diffs)
-
fresh/widgets/pKeySequenceInput.cpp (modified) (5 diffs)
-
fresh/widgets/pKeySequenceInput.h (modified) (3 diffs)
-
fresh/widgets/pMainWindow.cpp (modified) (4 diffs)
-
fresh/widgets/pMainWindow.h (modified) (4 diffs)
-
fresh/widgets/pMenuBar.cpp (modified) (9 diffs)
-
fresh/widgets/pMenuBar.h (modified) (5 diffs)
-
fresh/widgets/pPathListEditor.cpp (modified) (2 diffs)
-
fresh/widgets/pPathListEditor.h (modified) (2 diffs)
-
fresh/widgets/pQueuedMessageWidget.cpp (modified) (7 diffs)
-
fresh/widgets/pQueuedMessageWidget.h (modified) (3 diffs)
-
fresh/widgets/pShortcutsEditor.cpp (modified) (1 diff)
-
fresh/widgets/pShortcutsEditor.h (modified) (1 diff)
-
fresh/widgets/pStringListEditor.cpp (modified) (5 diffs)
-
fresh/widgets/pStringListEditor.h (modified) (3 diffs)
-
fresh/widgets/pTabBar.cpp (modified) (1 diff)
-
fresh/widgets/pTabBar.h (modified) (1 diff)
-
fresh/widgets/pTabbedMainWindow.cpp (modified) (1 diff)
-
fresh/widgets/pTabbedMainWindow.h (modified) (1 diff)
-
fresh/widgets/pTabbedWorkspace.cpp (modified) (1 diff)
-
fresh/widgets/pTabbedWorkspace.h (modified) (1 diff)
-
fresh/widgets/pTabbedWorkspaceCorner.cpp (modified) (1 diff)
-
fresh/widgets/pTabbedWorkspaceCorner.h (modified) (1 diff)
-
fresh/widgets/pTabbedWorkspaceCornerButton.cpp (modified) (4 diffs)
-
fresh/widgets/pTabbedWorkspaceCornerButton.h (modified) (1 diff)
-
fresh/widgets/pTabbedWorkspaceRightCorner.cpp (modified) (1 diff)
-
fresh/widgets/pTabbedWorkspaceRightCorner.h (modified) (1 diff)
-
monkey/src/consolemanager/pCommand.h (modified) (1 diff)
-
monkey/src/ctagsmanager/Ctags.cpp (modified) (7 diffs)
-
monkey/src/ctagsmanager/Ctags.h (modified) (3 diffs)
-
monkey/src/main.cpp (modified) (1 diff)
-
monkey/src/pluginsmanager/PluginsManager.cpp (modified) (1 diff)
-
monkey/src/templatesmanager/pTemplatesManager.cpp (modified) (11 diffs)
-
monkey/src/templatesmanager/pTemplatesManager.h (modified) (3 diffs)
-
monkey/src/variablesmanager/VariablesManager.cpp (modified) (5 diffs)
-
monkey/src/variablesmanager/VariablesManager.h (modified) (3 diffs)
-
monkey/src/workspace/pWorkspace.cpp (modified) (3 diffs)
-
plugins/debugger/GNUDebugger2/GNUDebugger2.pro (modified) (5 diffs)
-
plugins/debugger/GNUDebugger2/file/gdbparsing.txt (modified) (previous)
-
plugins/debugger/GNUDebugger2/forme.txt (modified) (2 diffs)
-
plugins/debugger/GNUDebugger2/src/DockGNUDebugger.cpp (modified) (31 diffs)
-
plugins/debugger/GNUDebugger2/src/DockGNUDebugger.h (modified) (6 diffs)
-
plugins/debugger/GNUDebugger2/src/GNUDebugger.cpp (modified) (5 diffs)
-
plugins/debugger/GNUDebugger2/src/GNUDebugger.h (modified) (3 diffs)
-
plugins/debugger/GNUDebugger2/src/addon/gdbBacktrace/gdbBacktrace.cpp (modified) (18 diffs)
-
plugins/debugger/GNUDebugger2/src/addon/gdbBacktrace/gdbBacktrace.h (modified) (5 diffs)
-
plugins/debugger/GNUDebugger2/src/addon/gdbBacktrace/ui/UIGdbBacktrace.cpp (modified) (4 diffs)
-
plugins/debugger/GNUDebugger2/src/addon/gdbBacktrace/ui/UIGdbBacktrace.h (modified) (2 diffs)
-
plugins/debugger/GNUDebugger2/src/addon/gdbBreakpoint/gdbBreakpoint.cpp (modified) (30 diffs)
-
plugins/debugger/GNUDebugger2/src/addon/gdbBreakpoint/gdbBreakpoint.h (modified) (5 diffs)
-
plugins/debugger/GNUDebugger2/src/addon/gdbBreakpoint/gdbBreakpointStruct.h (modified) (1 diff)
-
plugins/debugger/GNUDebugger2/src/addon/gdbBreakpoint/ui/UIBreakpointDelegate.cpp (modified) (2 diffs)
-
plugins/debugger/GNUDebugger2/src/addon/gdbBreakpoint/ui/UIBreakpointDelegate.h (modified) (3 diffs)
-
plugins/debugger/GNUDebugger2/src/addon/gdbBreakpoint/ui/UIGdbBreakpoint.cpp (modified) (1 diff)
-
plugins/debugger/GNUDebugger2/src/addon/gdbBreakpoint/ui/UIGdbBreakpoint.h (modified) (5 diffs)
-
plugins/debugger/GNUDebugger2/src/addon/gdbRegister/gdbRegister.cpp (modified) (9 diffs)
-
plugins/debugger/GNUDebugger2/src/addon/gdbRegister/gdbRegister.h (modified) (4 diffs)
-
plugins/debugger/GNUDebugger2/src/addon/gdbRegister/ui/UIGdbRegister.cpp (modified) (1 diff)
-
plugins/debugger/GNUDebugger2/src/addon/gdbRegister/ui/UIGdbRegister.h (modified) (2 diffs)
-
plugins/debugger/GNUDebugger2/src/kernel/gdbKernelDispatcher.cpp (modified) (11 diffs)
-
plugins/debugger/GNUDebugger2/src/kernel/gdbKernelDispatcher.h (modified) (4 diffs)
-
plugins/debugger/GNUDebugger2/src/resources/GNUDebugger.qrc (modified) (1 diff)
-
plugins/debugger/GNUDebugger2/src/ui/UIGNUDebuggerSetting.cpp (modified) (11 diffs)
-
plugins/debugger/GNUDebugger2/src/ui/UIGNUDebuggerSetting.h (modified) (5 diffs)
-
plugins/debugger/GNUDebugger2/src/ui/UIGNUDebuggerSetting.ui (modified) (8 diffs)
-
plugins/debugger/GNUDebugger2/src/ui/UIManageDelegate.cpp (modified) (5 diffs)
-
plugins/debugger/GNUDebugger2/src/ui/UIManageDelegate.h (modified) (3 diffs)
-
plugins/debugger/GNUDebugger2/src/ui/UIManageParsingFile.cpp (modified) (4 diffs)
-
plugins/debugger/GNUDebugger2/src/ui/UIManageParsingFile.h (modified) (3 diffs)
-
plugins/debugger/debugger.pro (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
v2/trunk/coveragemeter/ui/UITestReport.cpp
r1518 r2189 1 1 /**************************************************************************** 2 ** 3 ** Created using Monkey Studio v1.8.1.0 4 ** Authors : Filipe AZEVEDO aka Nox P@sNox <pasnox@gmail.com> 5 ** Project : Coverage Meter 6 ** FileName : UITestReport.cpp 7 ** Date : 2008-01-14T00:35:51 8 ** License : GPL 9 ** Comment : This header has been automatically generated, if you are the original author, or co-author, fill free to replace/append with your informations. 10 ** Home Page : http://www.monkeystudio.org 11 ** 12 Copyright (C) 2005 - 2008 Filipe AZEVEDO & The Monkey Studio Team 2 Copyright (C) 2005 - 2008 Filipe AZEVEDO & The Monkey Studio Team 13 3 14 This program is free software; you can redistribute it and/or modify15 it under the terms of the GNU General Public License as published by16 the Free Software Foundation; either version 2 of the License, or17 (at your option) any later version.4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 2 of the License, or 7 (at your option) any later version. 18 8 19 This program is distributed in the hope that it will be useful,20 but WITHOUT ANY WARRANTY; without even the implied warranty of21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the22 GNU General Public License for more details.9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 23 13 24 You should have received a copy of the GNU General Public License25 along with this program; if not, write to the Free Software26 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA14 You should have received a copy of the GNU General Public License 15 along with this program; if not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 27 17 ** 28 18 ****************************************************************************/ … … 55 45 QFileInfo coverageFile(BasePlugin::codeCoverageFile()); 56 46 descriptionText = "<HTML><BODY>" 57 "<H1>Test Report Generation for MonkeyStudio</H1>"58 "<P>"59 "Process as follows:"60 "<UL>"61 "<LI>Do some test operations.</LI>"62 "<LI>Press the <TT>PAUSE</TT> key or exit MonkeyStudio. This dialog appears.</LI>"63 "<LI>Enter a title for your test and its state (Passed or Failed).</LI>"64 "<LI>Press OK to save the report.</LI>"65 "</UL>"66 "</P><P>"67 "The report contains code coverage data generated using "68 "<I>CoverageMeter</I> (<TT>http://www.coveragemeter.com</TT>). "69 "This report does not contain any kind of information about "70 "the project developped using MonkeyStudio."71 "</P><P>"72 "When the testing phase is finished, send the contain of the directory "73 "'<TT>"+coverageFile.dir().absolutePath()+"</TT>' "74 "to xxxx@xxx.xx"75 "</P>"76 "</BODY></HTML>";47 "<H1>Test Report Generation for MonkeyStudio</H1>" 48 "<P>" 49 "Process as follows:" 50 "<UL>" 51 "<LI>Do some test operations.</LI>" 52 "<LI>Press the <TT>PAUSE</TT> key or exit MonkeyStudio. This dialog appears.</LI>" 53 "<LI>Enter a title for your test and its state (Passed or Failed).</LI>" 54 "<LI>Press OK to save the report.</LI>" 55 "</UL>" 56 "</P><P>" 57 "The report contains code coverage data generated using " 58 "<I>CoverageMeter</I> (<TT>http://www.coveragemeter.com</TT>). " 59 "This report does not contain any kind of information about " 60 "the project developped using MonkeyStudio." 61 "</P><P>" 62 "When the testing phase is finished, send the contain of the directory " 63 "'<TT>"+coverageFile.dir().absolutePath()+"</TT>' " 64 "to xxxx@xxx.xx" 65 "</P>" 66 "</BODY></HTML>"; 77 67 #endif 78 description->setText(descriptionText);79 //80 connect( ok, SIGNAL( clicked( ) ), this, SLOT( okClicked( ) ) );81 connect( cancel, SIGNAL( clicked( ) ), this, SLOT( cancelClicked( ) ) );68 description->setText(descriptionText); 69 // 70 connect( ok, SIGNAL( clicked( ) ), this, SLOT( okClicked( ) ) ); 71 connect( cancel, SIGNAL( clicked( ) ), this, SLOT( cancelClicked( ) ) ); 82 72 } 83 73 // … … 85 75 { 86 76 #ifdef __COVERAGESCANNER__ 87 QString testState;77 QString testState; 88 78 __coveragescanner_filename( BasePlugin::codeCoverageFile().toAscii() ); 89 79 switch ( status->currentIndex() ) 90 {91 case 1:92 testState = ( "PASSED" );93 break;94 case 2:95 testState = ( "FAILED" );96 break;97 default:98 testState = ( "UNKNOWN" );99 break;100 }101 QString testName=testTitle(title->text());102 QString monkeyTestName=testName+"/MonkeyStudio";103 __coveragescanner_teststate( testState.toAscii() );80 { 81 case 1: 82 testState = ( "PASSED" ); 83 break; 84 case 2: 85 testState = ( "FAILED" ); 86 break; 87 default: 88 testState = ( "UNKNOWN" ); 89 break; 90 } 91 QString testName=testTitle(title->text()); 92 QString monkeyTestName=testName+"/MonkeyStudio"; 93 __coveragescanner_teststate( testState.toAscii() ); 104 94 __coveragescanner_testname( monkeyTestName.toAscii() ); 105 95 __coveragescanner_save(); 106 96 for ( int i = 0; i < PluginsManager::self()->plugins().count(); i++ ) 107 97 { 108 BasePlugin *plg=PluginsManager::self()->plugins().at(i);109 plg->saveCodeCoverage(testName,testState);110 }98 BasePlugin *plg=PluginsManager::self()->plugins().at(i); 99 plg->saveCodeCoverage(testName,testState); 100 } 111 101 #endif 112 102 accept(); … … 132 122 else 133 123 testName += s; 134 return testName;124 return testName; 135 125 } -
v2/trunk/coveragemeter/ui/UITestReport.h
r1518 r2189 1 1 /**************************************************************************** 2 ** 3 ** Created using Monkey Studio v1.8.1.0 4 ** Authors : Filipe AZEVEDO aka Nox P@sNox <pasnox@gmail.com> 5 ** Project : Coverage Meter 6 ** FileName : UITestReport.h 7 ** Date : 2008-01-14T00:35:56 8 ** License : GPL 9 ** Comment : This header has been automatically generated, if you are the original author, or co-author, fill free to replace/append with your informations. 10 ** Home Page : http://www.monkeystudio.org 11 ** 12 Copyright (C) 2005 - 2008 Filipe AZEVEDO & The Monkey Studio Team 2 Copyright (C) 2005 - 2008 Filipe AZEVEDO & The Monkey Studio Team 13 3 14 This program is free software; you can redistribute it and/or modify15 it under the terms of the GNU General Public License as published by16 the Free Software Foundation; either version 2 of the License, or17 (at your option) any later version.4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 2 of the License, or 7 (at your option) any later version. 18 8 19 This program is distributed in the hope that it will be useful,20 but WITHOUT ANY WARRANTY; without even the implied warranty of21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the22 GNU General Public License for more details.9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 23 13 24 You should have received a copy of the GNU General Public License 25 along with this program; if not, write to the Free Software 26 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 27 ** 14 You should have received a copy of the GNU General Public License 15 along with this program; if not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 17 ****************************************************************************/ 18 /*! 19 \file UITestReport.h 20 \date 2008-01-14T00:35:56 21 \author Coverage Meter Team 22 \author Filipe AZEVEDO aka Nox P\@sNox <pasnox@gmail.com> 23 \brief Coverage meter class 24 */ 29 25 #ifndef UITESTREPORT_H 30 26 #define UITESTREPORT_H -
v2/trunk/fresh/objects/MonkeyExport.h
r1518 r2189 1 1 /**************************************************************************** 2 ** 3 ** Created using Monkey Studio v1.8.1.0 4 ** Authors : Filipe AZEVEDO aka Nox P@sNox <pasnox@gmail.com> 5 ** Project : Fresh Framework 6 ** FileName : MonkeyExport.h 7 ** Date : 2008-01-14T00:27:36 8 ** License : GPL 9 ** Comment : This header has been automatically generated, if you are the original author, or co-author, fill free to replace/append with your informations. 10 ** Home Page : http://www.monkeystudio.org 11 ** 12 Copyright (C) 2005 - 2008 Filipe AZEVEDO & The Monkey Studio Team 2 Copyright (C) 2005 - 2008 Filipe AZEVEDO & The Monkey Studio Team 13 3 14 This program is free software; you can redistribute it and/or modify15 it under the terms of the GNU General Public License as published by16 the Free Software Foundation; either version 2 of the License, or17 (at your option) any later version.4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 2 of the License, or 7 (at your option) any later version. 18 8 19 This program is distributed in the hope that it will be useful,20 but WITHOUT ANY WARRANTY; without even the implied warranty of21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the22 GNU General Public License for more details.9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 23 13 24 You should have received a copy of the GNU General Public License 25 along with this program; if not, write to the Free Software 26 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 27 ** 14 You should have received a copy of the GNU General Public License 15 along with this program; if not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 17 ****************************************************************************/ 18 /*! 19 \file MonkeyExport.h 20 \date 2008-01-14T00:27:36 21 \author Filipe AZEVEDO aka Nox P\@sNox <pasnox@gmail.com> 22 \brief Export Symbol Macros 23 */ 29 24 #ifndef MONKEY_EXPORT_H 30 25 #define MONKEY_EXPORT_H 31 26 32 27 #include <qglobal.h> 28 29 /*! 30 \def Q_MONKEY_EXPORT 31 \details This macro allow symbols to be exported/imported for Window OS 32 */ 33 33 34 34 #if defined(MONKEY_CORE_BUILD) -
v2/trunk/fresh/objects/QSingleton.cpp
r1518 r2189 1 1 /**************************************************************************** 2 ** 3 ** Created using Monkey Studio v1.8.1.0 4 ** Authors : Filipe AZEVEDO aka Nox P@sNox <pasnox@gmail.com> 5 ** Project : Fresh Framework 6 ** FileName : QSingleton.cpp 7 ** Date : 2008-01-14T00:27:36 8 ** License : GPL 9 ** Comment : This header has been automatically generated, if you are the original author, or co-author, fill free to replace/append with your informations. 10 ** Home Page : http://www.monkeystudio.org 11 ** 12 Copyright (C) 2005 - 2008 Filipe AZEVEDO & The Monkey Studio Team 2 Copyright (C) 2005 - 2008 Filipe AZEVEDO & The Monkey Studio Team 13 3 14 This program is free software; you can redistribute it and/or modify15 it under the terms of the GNU General Public License as published by16 the Free Software Foundation; either version 2 of the License, or17 (at your option) any later version.4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 2 of the License, or 7 (at your option) any later version. 18 8 19 This program is distributed in the hope that it will be useful,20 but WITHOUT ANY WARRANTY; without even the implied warranty of21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the22 GNU General Public License for more details.9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 23 13 24 You should have received a copy of the GNU General Public License 25 along with this program; if not, write to the Free Software 26 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 27 ** 14 You should have received a copy of the GNU General Public License 15 along with this program; if not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 17 ****************************************************************************/ 29 18 #include "QSingleton.h" -
v2/trunk/fresh/objects/QSingleton.h
r1518 r2189 1 1 /**************************************************************************** 2 ** 3 ** Created using Monkey Studio v1.8.1.0 4 ** Authors : Filipe AZEVEDO aka Nox P@sNox <pasnox@gmail.com> 5 ** Project : Fresh Framework 6 ** FileName : QSingleton.h 7 ** Date : 2008-01-14T00:27:37 8 ** License : GPL 9 ** Comment : This header has been automatically generated, if you are the original author, or co-author, fill free to replace/append with your informations. 10 ** Home Page : http://www.monkeystudio.org 11 ** 12 Copyright (C) 2005 - 2008 Filipe AZEVEDO & The Monkey Studio Team 2 Copyright (C) 2005 - 2008 Filipe AZEVEDO & The Monkey Studio Team 13 3 14 This program is free software; you can redistribute it and/or modify15 it under the terms of the GNU General Public License as published by16 the Free Software Foundation; either version 2 of the License, or17 (at your option) any later version.4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 2 of the License, or 7 (at your option) any later version. 18 8 19 This program is distributed in the hope that it will be useful,20 but WITHOUT ANY WARRANTY; without even the implied warranty of21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the22 GNU General Public License for more details.9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 23 13 24 You should have received a copy of the GNU General Public License 25 along with this program; if not, write to the Free Software 26 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 27 ** 14 You should have received a copy of the GNU General Public License 15 along with this program; if not, write to the Free Software 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 17 ****************************************************************************/ 29 /* 30 How to use : 31 32 // single sur un QPushButton 33 class MyPushButon : public QPushButton, public QSingleton<MyPushButon> 34 { 35 friend class QSingleton<MyPushButon>; 36 37 protected: 38 MyPushButon( QWidget* p ) 39 : QPushButton( p ), QSingleton<MyPushButon>() 40 {}; 41 }; 42 // in cpp 43 MyPushButton* pb = MyPushButton::instance( parentWidget ); // initialise object 44 // then u can retreive it with MyPushButton::instance() or using pb pointer 18 /*! 19 \file QSingleton.h 20 \date 2008-01-14T00:27:37 21 \author Filipe AZEVEDO aka Nox P\@sNox <pasnox@gmail.com> 22 \brief Singletonize your QObject class 45 23 */ 46 24 #ifndef QSINGLETON_H … … 53 31 #include <QApplication> 54 32 33 /*! 34 \brief Internal hash of instances 35 \details This class contains unique instance pointer of singletonized classes 36 */ 55 37 class Q_MONKEY_EXPORT QSingletonExpose 56 38 { … … 59 41 }; 60 42 43 /*! 44 \brief Singletonize your QObject class 45 \details When heriting this template, you self made your class singletonizable ( unique instance ) ( ie: call like youclass::instance() ) 46 */ 61 47 template <class T> 62 48 class QSingleton : public QSingletonExpose … … 69 55 public: 70 56 template <typename P> 71 static T* instance( P* );57 static T* instance( P* pointer ); 72 58 static T* instance(); 73 static bool instanceAvailable() 74 { return mInstances.contains( &T::staticMetaObject ); } 75 static void cleanInstance() 76 { if ( instanceAvailable() ) delete mInstances[ &T::staticMetaObject ]; } 77 59 static bool instanceAvailable(); 60 static void cleanInstance(); 78 61 }; 79 62 63 /*! 64 \details Return an unique instance of the class 65 \param pointer A pointer that is given to constructor of the class 66 */ 80 67 template <class T> 81 68 template <typename P> 82 T* QSingleton<T>::instance( P* p )69 T* QSingleton<T>::instance( P* pointer ) 83 70 { 84 71 T* t = qobject_cast<T*>( mInstances.value( &T::staticMetaObject ) ); 85 72 if ( !t ) 86 mInstances[&T::staticMetaObject] = ( t = new T( p ) );73 mInstances[&T::staticMetaObject] = ( t = new T( pointer ) ); 87 74 return t;
