. |
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
/*!
\property QMainWindow::usesTextLabel
\brief whether text labels for toolbar buttons are enabled
If disabled (the default), the tool buttons will not use text
labels. If enabled, text labels will be used.
Tool buttons and other widgets that wish to respond to this
setting are responsible for reading the correct state on startup,
and for connecting to the main window's widget's
usesTextLabelChanged() signal.
\sa QToolButton::setUsesTextLabel()
*/
bool QMainWindow::usesTextLabel() const
{
return d->utl;
}
void QMainWindow::setUsesTextLabel( bool enable )
{
if ( enable == (bool)d->utl )
return;
d->utl = enable;
emit usesTextLabelChanged( enable );
QObjectList *l = queryList( "QLayout" );
if ( !l || !l->first() ) {
delete l;
return;
}
for ( QLayout *lay = (QLayout*)l->first(); lay; lay = (QLayout*)l->next() )
lay->activate();
delete l;
}
|
?|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
ISFileDialog::ISFileDialog()
: QDialog(qApp->activeWindow(), "dialog", true, WStyle_Customize | WType_TopLevel | WStyle_NormalBorder
| WStyle_Title | WStyle_SysMenu | WShowModal)
{
// Create Widgets which allow easy layouting
QVBoxLayout *pVBox = new QVBoxLayout(this, 10, 5);
......
QHBoxLayout *pHBox3 = new QHBoxLayout(pVBox, 0);
......
QToolBar *pToolbar2 = new QToolBar(0, 0, this);
pToolbar2->setFixedExtentWidth(50);
pToolbar2->setFixedExtentHeight(24);
pToolbar2->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
m_pOpenGroup = new QActionGroup(pToolbar1);
m_pOpenGroup->setMenuText(tr("&Open"));
m_pOpenGroup->setText(tr("Open"));
m_pOpenGroup->setUsesDropDown(true);
m_pOpenGroup->setExclusive(false);
m_pOpenAction = new QAction(tr("&Open"), 0, m_pOpenGroup);
m_pOpenAsCopyAction = new QAction(tr("O&pen as copy"), 0, m_pOpenGroup);
m_pOpenReadOnlyAction = new QAction(tr("Op&en read only"), 0, m_pOpenGroup);
m_pOpenGroup->addTo(pToolbar2);
pHBox3->add(pToolbar2);
......
}
|
|
|
Source code |
1 |
m_pOpenGroup->setText(tr("Open"));
|