KMyMoneyWizard Class Reference
#include <kmymoneywizard.h>
Inheritance diagram for KMyMoneyWizard:
Collaboration diagram for KMyMoneyWizard:
[legend]List of all members.
Detailed Description
- Author:
- Thomas Baumgart (C) 2006
This is a base class for implementation of the KMyMoneyWizard. It provides the following layout of a wizard:
+-wizardLayout-----------------------------------------------+
| |
+------------------------------------------------------------+
|+-stepLayout--++-------------------------------------------+|
|| ||+-pageLayout------------------------------+||
|| ||| |||
|| ||| |||
|| ||| |||
|| ||| |||
|| ||| |||
|| ||| |||
|| ||+-----------------------------------------+||
|| |||+-buttonLayout--------------------------+|||
|| |||| ||||
|| |||+---------------------------------------+|||
|| ||+-----------------------------------------+||
|+-------------++-------------------------------------------+|
+------------------------------------------------------------+
The top bar is filled with a KMyMoneyTitleLabel as known from KMyMoney's views. To the left there is an area in the same color as the title bar showing the steps for this wizard. Each such step can consist of one or more wizard pages. At the bottom of this area the text "Step x of y" is shown and updated. To the right of this part, the actual wizard page is shown. At the bottom of the page the class inserts a standard button widget consisting of a Help, Back, Next/Finish and Cancel button.
The wizard serves as container for the wizard pages. In order to access the data filled into the pages, one would have to provide getter methods.
Here is an example how this object could be used. Please also see the example described with the KMyMoneyWizardPage class.
class KNewUserGeneral;
class KNewUserPersonal;
class KNewUserWizard : public KMyMoneyWizard
{
Q_OBJECT
public:
KNewUserWizard(QWidget* parent = 0, const char* name = 0, bool modal = false, WFlags flags = 0);
private:
KNewUserGeneral* m_generalPage;
KNewUserPersonal* m_personalPage;
KNewUserFinal* m_finalPage;
friend class KNewUserGeneral;
friend class KNewUserPersonal;
friend class KNewUserFinal;
};
The implementation is also easy and looks like this:
KNewUserWizard::KNewUserWizard(QWidget* parent, const char* name, bool modal, WFlags flags) :
KMyMoneyWizard(parent, name, modal, flags)
{
setTitle("KMyMoney New User Setup");
addStep("General Data");
addStep("Personal Data");
addStep("Finish");
m_generalPage = new KNewUserGeneral(this);
m_personalPage = new KNewUserPersonal(this);
m_finalPage = new KNewUserFinal(this);
setFirstPage(m_testPage1);
}
Don't forget to call setFirstPage() to get things started.
The code to use this whole structure would then look something like this:
KNewUserWizard* wizard = new KNewUserWizard(this, "NewUserWizard");
int rc = wizard->exec();
The return code of exec() is either QDialog::Accepted or QDialog::Rejected.
- Note:
- The implementation of this class is heavily based on ideas found at http://doc.trolltech.com/4.1/dialogs-complexwizard.html
Constructor & Destructor Documentation
| KMyMoneyWizard::KMyMoneyWizard |
( |
QWidget * |
parent = 0, |
|
|
const char * |
name = 0, |
|
|
bool |
modal = false, |
|
|
WFlags |
f = 0 |
|
) |
[protected] |
|
|
|
Constructor (kept protected, so that one cannot create such an object directly) |
Member Function Documentation
| virtual void KMyMoneyWizard::accept |
( |
void |
|
) |
[protected, virtual, slot] |
|
| void KMyMoneyWizard::addStep |
( |
const QString & |
text |
) |
|
|
|
|
Add step text to the wizard
- Parameters:
-
| text | Text to be shown for this step |
|
| void KMyMoneyWizard::backButtonClicked |
( |
void |
|
) |
[private, slot] |
|
| void KMyMoneyWizard::completeStateChanged |
( |
void |
|
) |
[protected, slot] |
|
| void KMyMoneyWizard::createCategory |
( |
const QString & |
txt, |
|
|
QCString & |
id |
|
) |
[signal] |
|
|
|
This signal is sent out, when a new category needs to be created - See also:
- KMyMoneyCombo::createItem()
- Parameters:
-
| txt | The name of the category to be created |
| id | A connected slot should store the id of the created object in this variable |
|
| void KMyMoneyWizard::createPayee |
( |
const QString & |
txt, |
|
|
QCString & |
id |
|
) |
[signal] |
|
|
|
This signal is sent out, when a new payee needs to be created - See also:
- KMyMoneyCombo::createItem()
- Parameters:
-
| txt | The name of the payee to be created |
| id | A connected slot should store the id of the created object in this variable |
|
| void KMyMoneyWizard::helpButtonClicked |
( |
void |
|
) |
[private, slot] |
|
| void KMyMoneyWizard::nextButtonClicked |
( |
void |
|
) |
[private, slot] |
|
| void KMyMoneyWizard::reselectStep |
( |
void |
|
) |
|
|
|
|
This method repeats selection of the current step in the step frame. This is used to allow changes made to showing and hiding pages to immediately to be reflected in the step frame |
| void KMyMoneyWizard::selectStep |
( |
unsigned int |
step |
) |
[private] |
|
|
|
This method selects the step given by step.
- Parameters:
-
|
|
|
This method sets up the first page after creation of the object
- Parameters:
-
| page | pointer to first page of wizard |
|
| void KMyMoneyWizard::setHelpContext |
( |
const QString & |
ctx |
) |
[inline] |
|
|
|
Setup a global help context for the wizard. It will be used whenever there is no specific help context available for the current page.
- See also:
- KMyMoneyWizardPage::helpContext()
|
| void KMyMoneyWizard::setStepHidden |
( |
unsigned int |
step, |
|
|
bool |
hidden = true |
|
) |
[protected] |
|
|
|
This method allows to hide or show a step.
- Parameters:
-
| step | step to be shown/hidden |
| hidden | hide step if true (the default) or show it if false |
|
| void KMyMoneyWizard::setTitle |
( |
const QString & |
txt |
) |
|
|
|
|
Modify the title of the wizard to be txt.
- Parameters:
-
| txt | The text that should be used as title |
|
|
|
Switch to page which is currently the top of the history stack. oldPage is a pointer to the current page or 0 if no page is shown.
- Parameters:
-
| oldPage | pointer to currently displayed page |
|
| void KMyMoneyWizard::updateStepCount |
( |
void |
|
) |
[private] |
|
Friends And Related Function Documentation
Member Data Documentation
The documentation for this class was generated from the following file:
Generated on Tue Nov 18 12:09:38 2008 for KMyMoney by
1.4.1