本文整理汇总了C++中QTabWidget::setCurrentPage方法的典型用法代码示例。如果您正苦于以下问题:C++ QTabWidget::setCurrentPage方法的具体用法?C++ QTabWidget::setCurrentPage怎么用?C++ QTabWidget::setCurrentPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTabWidget
的用法示例。
在下文中一共展示了QTabWidget::setCurrentPage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PresentationWidget
/** 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() ) );
}
示例2: raisePhoneBook
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);
}