本文整理汇总了C++中QToolButton::setUsesTextLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ QToolButton::setUsesTextLabel方法的具体用法?C++ QToolButton::setUsesTextLabel怎么用?C++ QToolButton::setUsesTextLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QToolButton
的用法示例。
在下文中一共展示了QToolButton::setUsesTextLabel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QButtonGroup
QWidget *Frame::createCategoryPage( CategoryInterface *c )
{
QButtonGroup *g = new QButtonGroup( 1, Horizontal, toolBox );
g->setFrameStyle( QFrame::NoFrame );
g->setEraseColor(green);
g->setBackgroundMode(PaletteBase);
for ( int i = 0; i < c->numCategories(); ++i ) {
QToolButton *b = new QToolButton( g );
b->setBackgroundMode(PaletteBase);
b->setTextLabel( c->categoryName( i ) );
b->setIconSet( c->categoryIcon( i ) );
b->setAutoRaise( TRUE );
b->setTextPosition( QToolButton::Right );
b->setUsesTextLabel( TRUE );
g->insert( b, i + c->categoryOffset() );
connect( g, SIGNAL( clicked( int ) ), c, SLOT( setCurrentCategory( int ) ) );
}
return g;
}
示例2: KDialogBase
DelegateDialog::DelegateDialog(QWidget *parent)
: KDialogBase(parent, "", true, "", Ok | Cancel, Ok, true)
{
QWidget *page = new QWidget(this);
QGridLayout *layout = new QGridLayout(page, 5, 3, 11, 6);
QLabel *label = new QLabel(i18n("User:"), page);
layout->addWidget(label, 0, 0);
mEmail = new QLineEdit(page);
layout->addWidget(mEmail, 0, 1);
QToolButton *emailSelector = new QToolButton(page);
emailSelector->setUsesTextLabel(true);
emailSelector->setTextLabel(i18n("..."));
layout->addWidget(emailSelector, 0, 2);
QValueList<Scalix::DelegateTypes> types;
types << Scalix::SendOnBehalfOf;
types << Scalix::SeePrivate;
types << Scalix::GetMeetings;
types << Scalix::InsteadOfMe;
int row = 1;
for(uint i = 0; i < types.count(); ++i)
{
QCheckBox *box = new QCheckBox(Scalix::Delegate::rightsAsString(types[ i ]), page);
layout->addMultiCellWidget(box, row, row, 1, 2);
mRights.insert(types[ i ], box);
row++;
}
connect(emailSelector, SIGNAL(clicked()), SLOT(selectEmail()));
setMainWidget(page);
}
示例3: QMainWindow
MainWindow::MainWindow(QWidget *parent):
QMainWindow(parent)
{
d_plot = new Plot(this);
setCentralWidget(d_plot);
QToolBar *toolBar = new QToolBar(this);
QToolButton *btnSpectrogram = new QToolButton(toolBar);
QToolButton *btnContour = new QToolButton(toolBar);
QToolButton *btnPrint = new QToolButton(toolBar);
#if QT_VERSION >= 0x040000
btnSpectrogram->setText("Spectrogram");
//btnSpectrogram->setIcon(QIcon());
btnSpectrogram->setCheckable(true);
btnSpectrogram->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
toolBar->addWidget(btnSpectrogram);
btnContour->setText("Contour");
//btnContour->setIcon(QIcon());
btnContour->setCheckable(true);
btnContour->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
toolBar->addWidget(btnContour);
btnPrint->setText("Print");
btnPrint->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
toolBar->addWidget(btnPrint);
#else
btnSpectrogram->setTextLabel("Spectrogram");
//btnSpectrogram->setPixmap(zoom_xpm);
btnSpectrogram->setToggleButton(true);
btnSpectrogram->setUsesTextLabel(true);
btnContour->setTextLabel("Contour");
//btnContour->setPixmap(zoom_xpm);
btnContour->setToggleButton(true);
btnContour->setUsesTextLabel(true);
btnPrint->setTextLabel("Print");
btnPrint->setUsesTextLabel(true);
#endif
addToolBar(toolBar);
connect(btnSpectrogram, SIGNAL(toggled(bool)),
d_plot, SLOT(showSpectrogram(bool)));
connect(btnContour, SIGNAL(toggled(bool)),
d_plot, SLOT(showContour(bool)));
connect(btnPrint, SIGNAL(clicked()),
d_plot, SLOT(printPlot()) );
#if QT_VERSION >= 0x040000
btnSpectrogram->setChecked(true);
btnContour->setChecked(false);
#else
btnSpectrogram->setOn(true);
btnContour->setOn(false);
#endif
}