Public Slots | Signals | Public Member Functions | Private Slots | Private Attributes | List of all members
Wizard Class Reference

#include <wizard.h>

Inheritance diagram for Wizard:

Public Slots

void refresh ()
 

Signals

void done ()
 

Public Member Functions

 Wizard (const QHash< QString, Input * > &modelData, QWidget *parent=0)
 
 ~Wizard ()
 

Private Slots

void activateTopic (QTreeWidgetItem *item, QTreeWidgetItem *)
 
void nextTopic ()
 
void prevTopic ()
 

Private Attributes

const QHash< QString, Input * > & m_modelData
 
QTreeWidget * m_treeWidget
 
QStackedWidget * m_topicStack
 
Step1m_step1
 
Step2m_step2
 
Step3m_step3
 
Step4m_step4
 
QPushButton * m_next
 
QPushButton * m_prev
 

Detailed Description

Definition at line 226 of file wizard.h.

Constructor & Destructor Documentation

Wizard::Wizard ( const QHash< QString, Input * > &  modelData,
QWidget *  parent = 0 
)

Definition at line 1236 of file wizard.cpp.

1236  :
1237  QSplitter(parent), m_modelData(modelData)
1238 {
1239  m_treeWidget = new QTreeWidget;
1240  m_treeWidget->setColumnCount(1);
1241  m_treeWidget->setHeaderLabels(QStringList() << QString::fromLatin1("Topics"));
1243  items.append(new QTreeWidgetItem((QTreeWidget*)0,QStringList(tr("Project"))));
1244  items.append(new QTreeWidgetItem((QTreeWidget*)0,QStringList(tr("Mode"))));
1245  items.append(new QTreeWidgetItem((QTreeWidget*)0,QStringList(tr("Output"))));
1246  items.append(new QTreeWidgetItem((QTreeWidget*)0,QStringList(tr("Diagrams"))));
1247  m_treeWidget->insertTopLevelItems(0,items);
1248 
1249  m_topicStack = new QStackedWidget;
1250  m_step1 = new Step1(this,modelData);
1251  m_step2 = new Step2(this,modelData);
1252  m_step3 = new Step3(this,modelData);
1253  m_step4 = new Step4(this,modelData);
1254  m_topicStack->addWidget(m_step1);
1255  m_topicStack->addWidget(m_step2);
1256  m_topicStack->addWidget(m_step3);
1257  m_topicStack->addWidget(m_step4);
1258 
1259  QWidget *rightSide = new QWidget;
1260  QGridLayout *grid = new QGridLayout(rightSide);
1261  m_prev = new QPushButton(tr("Previous"));
1262  m_prev->setEnabled(false);
1263  m_next = new QPushButton(tr("Next"));
1264  grid->addWidget(m_topicStack,0,0,1,2);
1265  grid->addWidget(m_prev,1,0,Qt::AlignLeft);
1266  grid->addWidget(m_next,1,1,Qt::AlignRight);
1267  grid->setColumnStretch(0,1);
1268  grid->setRowStretch(0,1);
1269  addWidget(m_treeWidget);
1270  addWidget(rightSide);
1271 
1273  SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)),
1274  SLOT(activateTopic(QTreeWidgetItem *,QTreeWidgetItem *)));
1275  connect(m_next,SIGNAL(clicked()),SLOT(nextTopic()));
1276  connect(m_prev,SIGNAL(clicked()),SLOT(prevTopic()));
1277 
1278  refresh();
1279 }
Definition: wizard.h:158
Step4 * m_step4
Definition: wizard.h:251
void activateTopic(QTreeWidgetItem *item, QTreeWidgetItem *)
Definition: wizard.cpp:1285
void append(const type *d)
Definition: qlist.h:73
const QHash< QString, Input * > & m_modelData
Definition: wizard.h:245
QPushButton * m_next
Definition: wizard.h:252
void refresh()
Definition: wizard.cpp:1341
static QString fromLatin1(const char *, int len=-1)
Definition: qstring.cpp:14539
void prevTopic()
Definition: wizard.cpp:1333
def connect(nxgraph, k1, k2, p1=0, p2=0, kwds)
Definition: graph.py:30
Step1 * m_step1
Definition: wizard.h:248
Step2 * m_step2
Definition: wizard.h:249
QPushButton * m_prev
Definition: wizard.h:253
A list of strings.
Definition: qstringlist.h:51
QTreeWidget * m_treeWidget
Definition: wizard.h:246
Definition: wizard.h:136
void nextTopic()
Definition: wizard.cpp:1318
Definition: wizard.h:193
Definition: wizard.h:103
QStackedWidget * m_topicStack
Definition: wizard.h:247
Step3 * m_step3
Definition: wizard.h:250
def parent(G, child, parent_type)
Definition: graph.py:67
Definition: qlist.h:54
Wizard::~Wizard ( )

Definition at line 1281 of file wizard.cpp.

1282 {
1283 }

Member Function Documentation

void Wizard::activateTopic ( QTreeWidgetItem *  item,
QTreeWidgetItem *   
)
privateslot

Definition at line 1285 of file wizard.cpp.

1286 {
1287  if (item)
1288  {
1289 
1290  QString label = item->text(0);
1291  if (label==tr("Project"))
1292  {
1293  m_topicStack->setCurrentWidget(m_step1);
1294  m_prev->setEnabled(false);
1295  m_next->setEnabled(true);
1296  }
1297  else if (label==tr("Mode"))
1298  {
1299  m_topicStack->setCurrentWidget(m_step2);
1300  m_prev->setEnabled(true);
1301  m_next->setEnabled(true);
1302  }
1303  else if (label==tr("Output"))
1304  {
1305  m_topicStack->setCurrentWidget(m_step3);
1306  m_prev->setEnabled(true);
1307  m_next->setEnabled(true);
1308  }
1309  else if (label==tr("Diagrams"))
1310  {
1311  m_topicStack->setCurrentWidget(m_step4);
1312  m_prev->setEnabled(true);
1313  m_next->setEnabled(true);
1314  }
1315  }
1316 }
Step4 * m_step4
Definition: wizard.h:251
QPushButton * m_next
Definition: wizard.h:252
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
Step1 * m_step1
Definition: wizard.h:248
Step2 * m_step2
Definition: wizard.h:249
QPushButton * m_prev
Definition: wizard.h:253
QStackedWidget * m_topicStack
Definition: wizard.h:247
Step3 * m_step3
Definition: wizard.h:250
void Wizard::done ( )
signal
void Wizard::nextTopic ( )
privateslot

Definition at line 1318 of file wizard.cpp.

1319 {
1320  if (m_topicStack->currentIndex()+1==m_topicStack->count()) // last topic
1321  {
1322  done();
1323  }
1324  else
1325  {
1326  m_topicStack->setCurrentIndex(m_topicStack->currentIndex()+1);
1327  m_next->setEnabled(m_topicStack->count()!=m_topicStack->currentIndex()+1);
1328  m_prev->setEnabled(m_topicStack->currentIndex()!=0);
1329  m_treeWidget->setCurrentItem(m_treeWidget->invisibleRootItem()->child(m_topicStack->currentIndex()));
1330  }
1331 }
QPushButton * m_next
Definition: wizard.h:252
void done()
QPushButton * m_prev
Definition: wizard.h:253
QTreeWidget * m_treeWidget
Definition: wizard.h:246
QStackedWidget * m_topicStack
Definition: wizard.h:247
void Wizard::prevTopic ( )
privateslot

Definition at line 1333 of file wizard.cpp.

1334 {
1335  m_topicStack->setCurrentIndex(m_topicStack->currentIndex()-1);
1336  m_next->setEnabled(m_topicStack->count()!=m_topicStack->currentIndex()+1);
1337  m_prev->setEnabled(m_topicStack->currentIndex()!=0);
1338  m_treeWidget->setCurrentItem(m_treeWidget->invisibleRootItem()->child(m_topicStack->currentIndex()));
1339 }
QPushButton * m_next
Definition: wizard.h:252
QPushButton * m_prev
Definition: wizard.h:253
QTreeWidget * m_treeWidget
Definition: wizard.h:246
QStackedWidget * m_topicStack
Definition: wizard.h:247
void Wizard::refresh ( )
slot

Definition at line 1341 of file wizard.cpp.

1342 {
1343  m_treeWidget->setCurrentItem(m_treeWidget->invisibleRootItem()->child(0));
1344  m_step1->init();
1345  m_step2->init();
1346  m_step3->init();
1347  m_step4->init();
1348 }
Step4 * m_step4
Definition: wizard.h:251
Step1 * m_step1
Definition: wizard.h:248
Step2 * m_step2
Definition: wizard.h:249
QTreeWidget * m_treeWidget
Definition: wizard.h:246
void init()
Definition: wizard.cpp:1211
void init()
Definition: wizard.cpp:861
void init()
Definition: wizard.cpp:692
void init()
Definition: wizard.cpp:1048
Step3 * m_step3
Definition: wizard.h:250

Member Data Documentation

const QHash<QString,Input *>& Wizard::m_modelData
private

Definition at line 245 of file wizard.h.

QPushButton* Wizard::m_next
private

Definition at line 252 of file wizard.h.

QPushButton* Wizard::m_prev
private

Definition at line 253 of file wizard.h.

Step1* Wizard::m_step1
private

Definition at line 248 of file wizard.h.

Step2* Wizard::m_step2
private

Definition at line 249 of file wizard.h.

Step3* Wizard::m_step3
private

Definition at line 250 of file wizard.h.

Step4* Wizard::m_step4
private

Definition at line 251 of file wizard.h.

QStackedWidget* Wizard::m_topicStack
private

Definition at line 247 of file wizard.h.

QTreeWidget* Wizard::m_treeWidget
private

Definition at line 246 of file wizard.h.


The documentation for this class was generated from the following files: