本文整理汇总了C++中QTabBar::setCurrentTab方法的典型用法代码示例。如果您正苦于以下问题:C++ QTabBar::setCurrentTab方法的具体用法?C++ QTabBar::setCurrentTab怎么用?C++ QTabBar::setCurrentTab使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTabBar
的用法示例。
在下文中一共展示了QTabBar::setCurrentTab方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupWidgets
void managementWidget::setupWidgets()
{
QTab t;
top = new QBoxLayout(this,QBoxLayout::TopToBottom);
vPan = new QSplitter(QSplitter::Horizontal, this);
top->addWidget(vPan);
// the left panel
leftpanel = new QFrame(vPan);
leftbox = new QBoxLayout(leftpanel,QBoxLayout::TopToBottom);
QTabBar *ltab = new QTabBar(leftpanel);
treeList = new KpTreeList(leftpanel);
for (int i = 0; i < 4; i++) {
QTab *t = new QTab();
t->setText( tType[i] );
ltab->addTab(t);
}
// Quick Search Bar
searchToolBar = new KToolBar( leftpanel, "search toolbar");
QToolButton *clearSearch = new QToolButton(searchToolBar);
clearSearch->setTextLabel(i18n("Clear Search"), true);
clearSearch->setIconSet(SmallIconSet(QApplication::reverseLayout() ? "clear_left"
: "locationbar_erase"));
(void) new QLabel(i18n("Search: "),searchToolBar);
searchLine = new KpListViewSearchLine(searchToolBar, treeList);
// searchLine->setKeepParentsVisible(false);
connect( clearSearch, SIGNAL( pressed() ), searchLine, SLOT( clear() ));
QValueList<int> clist; clist.append(0); clist.append(2);
searchLine->setSearchColumns(clist);
searchToolBar->setStretchableWidget( searchLine );
connect( treeList, SIGNAL( cleared() ), searchLine, SLOT( clear() ));
connect(ltab,SIGNAL(selected (int)),SLOT(tabChanged(int)));
ltab->setCurrentTab(treeList->treeType);
leftbox->addWidget(ltab,10);
leftbox->addWidget(searchToolBar,10);
leftbox->addWidget(treeList,10);
leftbox->addStretch();
lbuttons = new QBoxLayout(QBoxLayout::LeftToRight);
luinstButton = new QPushButton(i18n("Uninstall Marked"),leftpanel);
luinstButton->setEnabled(FALSE);
connect(luinstButton,SIGNAL(clicked()),
SLOT(uninstallMultClicked()));
linstButton = new QPushButton(i18n("Install Marked"),leftpanel);
linstButton->setEnabled(FALSE);
connect(linstButton,SIGNAL(clicked()),
SLOT(installMultClicked()));
leftbox->addLayout(lbuttons,0); // top level layout as child
// Setup the `buttons' layout
lbuttons->addWidget(linstButton,1,AlignBottom);
lbuttons->addWidget(luinstButton,1,AlignBottom);
lbuttons->addStretch(1);
connect(treeList, SIGNAL(selectionChanged(QListViewItem *)),
SLOT(packageHighlighted(QListViewItem *)));
// the right panel
rightpanel = new QFrame(vPan);
rightbox = new QBoxLayout(rightpanel,QBoxLayout::TopToBottom);
packageDisplay = new packageDisplayWidget(rightpanel);
// connect(this, SIGNAL(changePackage(packageInfo *)),
// packageDisplay, SLOT(changePackage(packageInfo *)));
rbuttons = new QBoxLayout(QBoxLayout::LeftToRight);
uinstButton = new QPushButton(i18n("Uninstall"),rightpanel);
uinstButton->setEnabled(FALSE);
connect(uinstButton,SIGNAL(clicked()),
SLOT(uninstallSingleClicked()));
instButton = new QPushButton(i18n("Install"),rightpanel);
instButton->setEnabled(FALSE);
connect(instButton,SIGNAL(clicked()),
SLOT(installSingleClicked()));
// Setup the `right panel' layout
rightbox->addWidget(packageDisplay,10);
rightbox->addLayout(rbuttons,0); // top level layout as child
// Setup the `buttons' layout
rbuttons->addWidget(instButton,1);
rbuttons->addWidget(uinstButton,1);
rbuttons->addStretch(1);
//.........这里部分代码省略.........