/** add comments here */ LordExchange::LordExchange( QWidget * parent, const char * name ) :QDialog( parent, name, true ) { _lordLeft = 0; _lordRight = 0; _socket = 0; _presentation = new PresentationWidget( this ); QTabWidget * tab = new QTabWidget( this ); _generalities = new DisplayBothGeneralities( this ); _units = new DisplayBothUnits( this ); _artefacts = new DisplayBothArtefacts( this ); _machines = new DisplayBothMachines( this ); tab->insertTab( _generalities, "Generalities" ); tab->insertTab( _units, "Units" ); tab->insertTab( _artefacts, "Artefacts" ); tab->insertTab( _machines, "War Machines" ); tab->setCurrentPage( 0 ); QPushButton * butOk = createButtonOk( this ); QHBoxLayout * layH1 = new QHBoxLayout(); layH1->addStretch( 1 ); layH1->addWidget( butOk ); layH1->addStretch( 1 ); QGridLayout * layout = new QGridLayout( this, 3, 1 ); layout->addWidget( _presentation, 0 , 0 ); layout->setRowStretch( 1, 1 ); layout->addWidget( tab, 1, 0 ); layout->addLayout( layH1, 2, 0 ); layout->activate(); connect( butOk, SIGNAL( clicked() ), SLOT( accept() ) ); }
void ConfigureDialog::raisePhoneBook() { lstBox->setCurrentItem(lstBox->firstChild()); QWidget *w = static_cast<ConfigItem*>(lstBox->currentItem())->widget(); if (w == NULL) return; QObjectList *l = topLevelWidget()->queryList("QTabWidget"); QObjectListIt it( *l ); QTabWidget *tab = static_cast<QTabWidget*>(it.current()); delete l; if (tab == NULL) return; tab->setCurrentPage(2); }