Source Code (Use browser search to find items of interest.)
Class Index
qt'QTabDialog (./qt-2.1.0/src/dialogs/qtabdialog.h:40)
class Q_EXPORT QTabDialog : public QDialog
{
Q_OBJECT
public:
QTabDialog( QWidget *parent=0, const char *name=0, bool modal=FALSE,
WFlags f=0 );
~QTabDialog();
void show();
void setFont( const QFont & font );
void addTab( QWidget *, const QString &);
void addTab( QWidget *child, const QIconSet& iconset, const QString &label);
void addTab( QWidget *, QTab* );
void insertTab( QWidget *, const QString &, int index = -1);
void insertTab( QWidget *child, const QIconSet& iconset, const QString &label, int index = -1);
void insertTab( QWidget *, QTab*, int index = -1 );
void changeTab( QWidget *, const QString &);
void changeTab( QWidget *child, const QIconSet& iconset, const QString &label);
bool isTabEnabled( QWidget * ) const;
void setTabEnabled( QWidget *, bool );
bool isTabEnabled( const char* ) const; // compatibility
void setTabEnabled( const char*, bool ); // compatibility
void showPage( QWidget * );
void removePage( QWidget * );
QString tabLabel( QWidget * );
QWidget * currentPage() const;
void setDefaultButton( const QString &text );
void setDefaultButton();
bool hasDefaultButton() const;
void setHelpButton( const QString &text );
void setHelpButton();
bool hasHelpButton() const;
void setCancelButton( const QString &text );
void setCancelButton();
bool hasCancelButton() const;
void setApplyButton( const QString &text );
void setApplyButton();
bool hasApplyButton() const;
#if 1 // OBSOLETE
void setOKButton( const QString &text = QString::null );
#endif
void setOkButton( const QString &text );
void setOkButton();
bool hasOkButton() const;
protected:
void paintEvent( QPaintEvent * );
void resizeEvent( QResizeEvent * );
void styleChange( QStyle& );
void setTabBar( QTabBar* );
QTabBar* tabBar() const;
signals:
void aboutToShow();
void applyButtonPressed();
void cancelButtonPressed();
void defaultButtonPressed();
void helpButtonPressed();
void selected( const QString& );
private slots:
void showTab( int i );
private:
void setSizes();
void setUpLayout();
QTabPrivate *d;
private: // Disabled copy constructor and operator=
#if defined(Q_DISABLE_COPY)
QTabDialog( const QTabDialog & );
QTabDialog& operator=( const QTabDialog & );
#endif
};
qt'QTabDialog::QTabDialog() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:202)
QTabDialog::QTabDialog( QWidget *parent, const char *name, bool modal,
WFlags f )
: QDialog( parent, name, modal, f )
{
d = new QTabPrivate;
CHECK_PTR( d );
d->tw = new QTabWidget( this, "tab widget" );
connect ( d->tw, SIGNAL ( selected( const QString& ) ), this, SIGNAL( selected( const QString& ) ) );
d->ok = new QPushButton( this, "ok" );
CHECK_PTR( d->ok );
d->ok->setText( tr("OK") );
d->ok->setDefault( TRUE );
connect( d->ok, SIGNAL(clicked()),
this, SIGNAL(applyButtonPressed()) );
connect( d->ok, SIGNAL(clicked()),
this, SLOT(accept()) );
}
/*!
Destructs the tab dialog.
*/
qt'QTabDialog::~QTabDialog() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:227)
QTabDialog::~QTabDialog()
{
delete d;
}
/*!
Sets the font for the tabs to \e font.
If the widget is visible, the display is updated with the new font
immediately. There may be some geometry changes, depending on the
size of the old and new fonts.
*/
qt'QTabDialog::setFont() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:241)
void QTabDialog::setFont( const QFont & font )
{
QDialog::setFont( font );
setSizes();
}
/*!
\fn void QTabDialog::applyButtonPressed();
This signal is emitted when the Apply or OK buttons are clicked.
It should be connected to a slot (or several slots) which change the
application's state according to the state of the dialog.
\sa cancelButtonPressed() defaultButtonPressed() setApplyButton()
*/
/*!
Returns TRUE if the tab dialog has a Defaults button, FALSE if not.
\sa setDefaultButton() defaultButtonPressed() hasApplyButton()
hasCancelButton()
*/
qt'QTabDialog::hasDefaultButton() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:267)
bool QTabDialog::hasDefaultButton() const
{
return d->db != 0;
}
/*!
Returns TRUE if the tab dialog has a Help button, FALSE if not.
\sa setHelpButton() helpButtonPressed() hasApplyButton()
hasCancelButton()
*/
qt'QTabDialog::hasHelpButton() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:280)
bool QTabDialog::hasHelpButton() const
{
return d->hb != 0;
}
/*!
\fn void QTabDialog::cancelButtonPressed();
This signal is emitted when the Cancel button is clicked. It is
automatically connected to QDialog::reject(), which will hide the
dialog.
The Cancel button should not change the application's state in any
way, so generally you should not need to connect it to any slot.
\sa applyButtonPressed() defaultButtonPressed() setCancelButton()
*/
/*!
Returns TRUE if the tab dialog has a Cancel button, FALSE if not.
\sa setCancelButton() cancelButtonPressed() hasApplyButton()
hasDefaultButton()
*/
qt'QTabDialog::hasCancelButton() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:307)
bool QTabDialog::hasCancelButton() const
{
return d->cb != 0;
}
/*!
\fn void QTabDialog::defaultButtonPressed();
This signal is emitted when the Defaults button is pressed. It
should reset the dialog (but not the application) to the "factory
defaults."
The application's state should not be changed until the user clicks
Apply or OK.
\sa applyButtonPressed() cancelButtonPressed() setDefaultButton()
*/
/*!
\fn void QTabDialog::helpButtonPressed();
This signal is emitted when the Help button is pressed. It
should give instructions about how to use the dialog.
\sa applyButtonPressed() cancelButtonPressed() setHelpButton()
*/
/*!
Returns TRUE if the tab dialog has an Apply button, FALSE if not.
\sa setApplyButton() applyButtonPressed() hasCancelButton()
hasDefaultButton()
*/
qt'QTabDialog::hasApplyButton() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:344)
bool QTabDialog::hasApplyButton() const
{
return d->ab != 0;
}
/*!
Returns TRUE if the tab dialog has an OK button, FALSE if not.
\sa setOkButton() hasApplyButton() hasCancelButton()
hasDefaultButton()
*/
qt'QTabDialog::hasOkButton() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:357)
bool QTabDialog::hasOkButton() const
{
return d->ok != 0;
}
/*!
\fn void QTabDialog::aboutToShow()
This signal is emitted by show() when it's time to set the state of
the dialog's contents. The dialog should reflect the current state
of the application when if appears; if there is any chance that the
state of the application can change between the time you call
QTabDialog::QTabDialog() and QTabDialog::show(), you should set the
dialog's state in a slot and connect this signal to it.
This applies mainly to QTabDialog objects that are kept around
hidden rather than being created, show()n and deleted afterwards.
\sa applyButtonPressed(), show(), cancelButtonPressed()
*/
/*!\reimp
*/
qt'QTabDialog::show() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:382)
void QTabDialog::show()
{
// Reimplemented in order to delay show()'ing of every page
// except the initially visible one, and in order to emit the
// aboutToShow() signal.
if ( topLevelWidget() == this )
d->tw->setFocus();
emit aboutToShow();
setSizes();
setUpLayout();
QDialog::show();
}
/*!
Ensures that the selected tab's page is visible and appropriately sized.
*/
qt'QTabDialog::showTab() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:400)
void QTabDialog::showTab( int i )
{
d->tw->showTab( i );
}
/*!
Adds another tab and page to the tab view.
The tab will be labelled \a label and \a child constitutes the new
page. Note the difference between the widget name (which you supply
to widget constructors and to e.g. setTabEnabled()) and the tab
label: The name is internal to the program and invariant, while the
label is shown on screen and may vary according to e.g. language.
\a label is written in the QButton style, where &P makes Qt create
an accelerator key on Alt-P for this page. For example:
\code
td->addTab( graphicsPane, "&Graphics" );
td->addTab( soundPane, "&Sound" );
\endcode
If the user presses Alt-S the sound page of the tab dialog is shown,
if the user presses Alt-P the graphics page is shown.
If you call addTab() after show(), the screen will flicker and the
user will be confused.
*/
qt'QTabDialog::addTab() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:430)
void QTabDialog::addTab( QWidget * child, const QString &label )
{
d->tw->addTab( child, label );
}
/*!
Adds another tab and page to the tab view.
This function is the same as addTab() but with an additional
iconset.
*/
qt'QTabDialog::addTab() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:443)
void QTabDialog::addTab( QWidget *child, const QIconSet& iconset, const QString &label)
{
d->tw->addTab( child, iconset, label );
}
/*!
This is a lower-level method for adding tabs, similar to the other
addTab() method. It is useful if you are using setTabBar() to set a
QTabBar subclass with an overridden QTabBar::paint() routine for a
subclass of QTab.
*/
qt'QTabDialog::addTab() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:454)
void QTabDialog::addTab( QWidget * child, QTab* tab )
{
d->tw->addTab( child, tab );
}
/*!
Inserts another tab and page to the tab view.
The tab will be labelled \a label and \a child constitutes the new
page. Note the difference between the widget name (which you supply
to widget constructors and to e.g. setTabEnabled()) and the tab
label: The name is internal to the program and invariant, while the
label is shown on screen and may vary according to e.g. language.
\a label is written in the QButton style, where &P makes Qt create
an accelerator key on Alt-P for this page. For example:
\code
td->insertTab( graphicsPane, "&Graphics" );
td->insertTab( soundPane, "&Sound" );
\endcode
If \a index is not specified, the tab is simply added. Otherwise
it's inserted at the specified position.
If the user presses Alt-S the sound page of the tab dialog is shown,
if the user presses Alt-P the graphics page is shown.
If you call insertTab() after show(), the screen will flicker and the
user will be confused.
*/
qt'QTabDialog::insertTab() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:486)
void QTabDialog::insertTab( QWidget * child, const QString &label, int index )
{
d->tw->insertTab( child, label, index );
}
/*!
Inserts another tab and page to the tab view.
This function is the same as insertTab() but with an additional
iconset.
*/
qt'QTabDialog::insertTab() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:498)
void QTabDialog::insertTab( QWidget *child, const QIconSet& iconset, const QString &label, int index)
{
d->tw->insertTab( child, iconset, label, index );
}
/*!
This is a lower-level method for inserting tabs, similar to the other
insertTab() method. It is useful if you are using setTabBar() to set a
QTabBar subclass with an overridden QTabBar::paint() routine for a
subclass of QTab.
*/
qt'QTabDialog::insertTab() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:509)
void QTabDialog::insertTab( QWidget * child, QTab* tab, int index )
{
d->tw->insertTab( child, tab, index );
}
/*!
Replaces the QTabBar heading the dialog by the given tab bar.
Note that this must be called \e before any tabs have been added,
or the behavior is undefined.
\sa tabBar()
*/
qt'QTabDialog::setTabBar() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:520)
void QTabDialog::setTabBar( QTabBar* tb )
{
d->tw->setTabBar( tb );
setUpLayout();
}
/*!
Returns the currently set QTabBar.
\sa setTabBar()
*/
qt'QTabDialog::tabBar() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:530)
QTabBar* QTabDialog::tabBar() const
{
return d->tw->tabBar();
}
/*! Ensures that \a w is shown. This is useful mainly for accelerators.
\warning Used carelessly, this function can easily surprise or
confuse the user.
\sa QTabBar::setCurrentTab()
*/
qt'QTabDialog::showPage() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:543)
void QTabDialog::showPage( QWidget * w )
{
d->tw->showPage( w );
}
/*! \obsolete
Returns TRUE if the page with object name \a name is enabled, and
false if it is disabled.
If \a name is 0 or not the name of any of the pages, isTabEnabled()
returns FALSE.
\sa setTabEnabled(), QWidget::isEnabled()
*/
qt'QTabDialog::isTabEnabled() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:559)
bool QTabDialog::isTabEnabled( const char* name ) const
{
if ( !name )
return FALSE;
QObjectList * l
= ((QTabDialog *)this)->queryList( "QWidget", name, FALSE, TRUE );
if ( l && l->first() ) {
QWidget * w;
while( l->current() ) {
while( l->current() && !l->current()->isWidgetType() )
l->next();
w = (QWidget *)(l->current());
if ( w ) {
return d->tw->isTabEnabled( w );
}
}
}
return FALSE;
}
/*!\obsolete
Finds the page with object name \a name, enables/disables it
according to the value of \a enable, and redraws the page's tab
appropriately.
QTabDialog uses QWidget::setEnabled() internally, rather than keep a
separate flag.
Note that even a disabled tab/page may be visible. If the page is
visible already, QTabDialog will not hide it, and if all the pages
are disabled, QTabDialog will show one of them.
The object name is used (rather than the tab label) because the tab
text may not be invariant in multi-language applications.
\sa isTabEnabled(), QWidget::setEnabled()
*/
qt'QTabDialog::setTabEnabled() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:599)
void QTabDialog::setTabEnabled( const char* name, bool enable )
{
if ( !name )
return;
QObjectList * l
= ((QTabDialog *)this)->queryList( "QWidget", name, FALSE, TRUE );
if ( l && l->first() ) {
QObjectListIt it(*l);
QObject *o;
while( (o = it.current()) ) {
++it;
if( o->isWidgetType() )
d->tw->setTabEnabled( (QWidget*)o, enable );
}
}
}
/* ### SHOULD THIS BE HERE?
Adds an Apply button to the dialog. The button's text is set to \e
text (and defaults to "Apply").
The Apply button should apply the current settings in the dialog box
to the application, while keeping the dialog visible.
When Apply is clicked, the applyButtonPressed() signal is emitted.
If \a text is a
\link QString::operator!() null string\endlink,
no button is shown.
\sa setCancelButton() setDefaultButton() applyButtonPressed()
*/
/*!
Returns TRUE if the page \a w is enabled, and
false if it is disabled.
\sa setTabEnabled(), QWidget::isEnabled()
*/
qt'QTabDialog::isTabEnabled() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:641)
bool QTabDialog::isTabEnabled( QWidget* w ) const
{
return d->tw->isTabEnabled( w );
}
/*!
Enables/disables page \a w according to the value of \a enable, and
redraws the page's tab appropriately.
QTabWidget uses QWidget::setEnabled() internally, rather than keep a
separate flag.
Note that even a disabled tab/page may be visible. If the page is
visible already, QTabWidget will not hide it, and if all the pages
are disabled, QTabWidget will show one of them.
\sa isTabEnabled(), QWidget::setEnabled()
*/
qt'QTabDialog::setTabEnabled() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:660)
void QTabDialog::setTabEnabled( QWidget* w, bool enable)
{
d->tw->setTabEnabled( w, enable );
}
/*!
Add an Apply button to the dialog. The button's text is set to \e
text.
The Apply button should apply the current settings in the dialog box
to the application, while keeping the dialog visible.
When Apply is clicked, the applyButtonPressed() signal is emitted.
\sa setCancelButton() setDefaultButton() applyButtonPressed()
*/
qt'QTabDialog::setApplyButton() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:677)
void QTabDialog::setApplyButton( const QString &text )
{
if ( !text && d->ab ) {
delete d->ab;
d->ab = 0;
setSizes();
} else {
if ( !d->ab ) {
d->ab = new QPushButton( this, "apply settings" );
connect( d->ab, SIGNAL(clicked()),
this, SIGNAL(applyButtonPressed()) );
setUpLayout();
}
d->ab->setText( text );
setSizes();
//d->ab->show();
}
}
/*!
Adds an Apply button to the dialog. The button's text is set to
a localizable "Apply".
*/
qt'QTabDialog::setApplyButton() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:700)
void QTabDialog::setApplyButton()
{
setApplyButton( tr("Apply") );
}
/*!
Adds a Help button to the dialog. The button's text is set to \e
text.
When Help is clicked, the helpButtonPressed() signal is emitted.
If \a text is a
\link QString::operator!() null string\endlink,
no button is shown.
\sa setApplyButton() setCancelButton() helpButtonPressed()
*/
qt'QTabDialog::setHelpButton() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:719)
void QTabDialog::setHelpButton( const QString &text )
{
if ( !text ) {
delete d->hb;
d->hb = 0;
setSizes();
} else {
if ( !d->hb ) {
d->hb = new QPushButton( this, "give help" );
connect( d->hb, SIGNAL(clicked()),
this, SIGNAL(helpButtonPressed()) );
setUpLayout();
}
d->hb->setText( text );
setSizes();
//d->hb->show();
}
}
/*!
Adds a Help button to the dialog. The button's text is set to
a localizable "Help".
*/
qt'QTabDialog::setHelpButton() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:743)
void QTabDialog::setHelpButton()
{
setHelpButton( tr("Help") );
}
/*!
Adds a Defaults button to the dialog. The button's text is set to \e
text.
The Defaults button should set the dialog (but not the application)
back to the application defaults.
When Defaults is clicked, the defaultButtonPressed() signal is emitted.
If \a text is a
\link QString::operator!() null string\endlink,
no button is shown.
\sa setApplyButton() setCancelButton() defaultButtonPressed()
*/
qt'QTabDialog::setDefaultButton() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:764)
void QTabDialog::setDefaultButton( const QString &text )
{
if ( !text ) {
delete d->db;
d->db = 0;
setSizes();
} else {
if ( !d->db ) {
d->db = new QPushButton( this, "back to default" );
connect( d->db, SIGNAL(clicked()),
this, SIGNAL(defaultButtonPressed()) );
setUpLayout();
}
d->db->setText( text );
setSizes();
//d->db->show();
}
}
/*!
Adds a Defaults button to the dialog. The button's text is set to
a localizable "Defaults".
*/
qt'QTabDialog::setDefaultButton() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:788)
void QTabDialog::setDefaultButton()
{
setDefaultButton( tr("Defaults") );
}
/*!
Adds a Cancel button to the dialog. The button's text is set to \e
text.
The cancel button should always return the application to the state
it was in before the tab view popped up, or if the user has clicked
Apply, back the the state immediately after the last Apply.
When Cancel is clicked, the cancelButtonPressed() signal is emitted.
The dialog is closed at the same time.
If \a text is a
\link QString::operator!() null string\endlink,
no button is shown.
\sa setApplyButton() setDefaultButton() cancelButtonPressed()
*/
qt'QTabDialog::setCancelButton() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:811)
void QTabDialog::setCancelButton( const QString &text )
{
if ( !text ) {
delete d->cb;
d->cb = 0;
setSizes();
} else {
if ( !d->cb ) {
d->cb = new QPushButton( this, "cancel dialog" );
connect( d->cb, SIGNAL(clicked()),
this, SIGNAL(cancelButtonPressed()) );
connect( d->cb, SIGNAL(clicked()),
this, SLOT(reject()) );
setUpLayout();
}
d->cb->setText( text );
setSizes();
//d->cb->show();
}
}
/*!
Adds a Cancel button to the dialog. The button's text is set to
a localizable "Cancel".
*/
qt'QTabDialog::setCancelButton() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:838)
void QTabDialog::setCancelButton()
{
setCancelButton( tr("Cancel") );
}
/*! Sets up the layout manager for the tab dialog.
\sa setSizes() setApplyButton() setCancelButton() setDefaultButton()
*/
qt'QTabDialog::setUpLayout() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:849)
void QTabDialog::setUpLayout()
{
// the next four are probably the same, really?
const int topMargin = 6;
const int leftMargin = 6;
const int rightMargin = 6;
const int bottomMargin = 6;
const int betweenButtonsMargin = 7;
const int aboveButtonsMargin = 8;
delete d->tll;
d->tll = new QBoxLayout( this, QBoxLayout::Down );
// top margin
d->tll->addSpacing( topMargin );
QBoxLayout * tmp = new QBoxLayout( QBoxLayout::LeftToRight );
d->tll->addLayout( tmp, 1 );
tmp->addSpacing( leftMargin );
tmp->addWidget( d->tw, 1);
tmp->addSpacing( rightMargin + 2 );
d->tll->addSpacing( aboveButtonsMargin + 2 );
QBoxLayout * buttonRow = new QBoxLayout( QBoxLayout::RightToLeft );
d->tll->addLayout( buttonRow, 0 );
d->tll->addSpacing( bottomMargin );
buttonRow->addSpacing( rightMargin );
if ( d->cb ) {
buttonRow->addWidget( d->cb, 0 );
buttonRow->addSpacing( betweenButtonsMargin );
}
if ( d->ab ) {
buttonRow->addWidget( d->ab, 0 );
buttonRow->addSpacing( betweenButtonsMargin );
}
if ( d->db ) {
buttonRow->addWidget( d->db, 0 );
buttonRow->addSpacing( betweenButtonsMargin );
}
if ( d->hb ) {
buttonRow->addWidget( d->hb, 0 );
buttonRow->addSpacing( betweenButtonsMargin );
}
if ( d->ok ) {
buttonRow->addWidget( d->ok, 0 );
buttonRow->addSpacing( betweenButtonsMargin );
}
// add one custom widget here
buttonRow->addStretch( 1 );
// add another custom widget here
d->tll->activate();
}
/*! Sets up the minimum and maximum sizes for each child widget.
\sa setUpLayout() setFont()
*/
qt'QTabDialog::setSizes() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:915)
void QTabDialog::setSizes()
{
// compute largest button size
QSize s( 0, 0 );
int bw = s.width();
int bh = s.height();
if ( d->ok ) {
s = d->ok->sizeHint();
if ( s.width() > bw )
bw = s.width();
if ( s.height() > bh )
bh = s.height();
}
if ( d->ab ) {
s = d->ab->sizeHint();
if ( s.width() > bw )
bw = s.width();
if ( s.height() > bh )
bh = s.height();
}
if ( d->db ) {
s = d->db->sizeHint();
if ( s.width() > bw )
bw = s.width();
if ( s.height() > bh )
bh = s.height();
}
if ( d->hb ) {
s = d->hb->sizeHint();
if ( s.width() > bw )
bw = s.width();
if ( s.height() > bh )
bh = s.height();
}
if ( d->cb ) {
s = d->cb->sizeHint();
if ( s.width() > bw )
bw = s.width();
if ( s.height() > bh )
bh = s.height();
}
if ( style() == WindowsStyle && bw < 75 )
bw = 75;
// and set all the buttons to that size
if ( d->ok )
d->ok->setFixedSize( bw, bh );
if ( d->ab )
d->ab->setFixedSize( bw, bh );
if ( d->db )
d->db->setFixedSize( bw, bh );
if ( d->hb )
d->hb->setFixedSize( bw, bh );
if ( d->cb )
d->cb->setFixedSize( bw, bh );
// fiddle the tab chain so the buttons are in their natural order
QWidget * w = d->ok;
if ( d->hb ) {
if ( w )
setTabOrder( w, d->hb );
w = d->hb;
}
if ( d->db ) {
if ( w )
setTabOrder( w, d->db );
w = d->db;
}
if ( d->ab ) {
if ( w )
setTabOrder( w, d->ab );
w = d->ab;
}
if ( d->cb ) {
if ( w )
setTabOrder( w, d->cb );
w = d->cb;
}
setTabOrder( w, d->tw );
}
/*!\reimp
*/
qt'QTabDialog::resizeEvent() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:1005)
void QTabDialog::resizeEvent( QResizeEvent * e )
{
QDialog::resizeEvent( e );
}
/*!\reimp
*/
qt'QTabDialog::paintEvent() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:1013)
void QTabDialog::paintEvent( QPaintEvent * )
{
}
/*!
Set the OK button's text to \a text.
When the OK button is clicked, the applyButtonPressed() signal is emitted,
and the current settings in the dialog box should be applied to
the application. Then the dialog closes.
If \a text is a
\link QString::operator!() null string\endlink,
no button is shown.
\sa setCancelButton() setDefaultButton() applyButtonPressed()
*/
qt'QTabDialog::setOkButton() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:1032)
void QTabDialog::setOkButton( const QString &text )
{
if ( !text ) {
delete d->ok;
d->ok = 0;
setSizes();
} else {
if ( !d->ok ) {
d->ok = new QPushButton( this, "ok" );
connect( d->ok, SIGNAL(clicked()),
this, SIGNAL(applyButtonPressed()) );
setUpLayout();
}
d->ok->setText( text );
setSizes();
//d->ok->show();
}
}
/*!
Adds an OK to the dialog. The button's text is set to
a localizable "OK".
*/
qt'QTabDialog::setOkButton() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:1055)
void QTabDialog::setOkButton()
{
setOkButton( tr("OK") );
}
/*!
Old version of setOkButton(), provided for backward compatibility.
*/
qt'QTabDialog::setOKButton() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:1064)
void QTabDialog::setOKButton( const QString &text )
{
// Ugle workaround for original "OK" default argument
QString newText( text );
if ( text.isNull() )
newText = QString::fromLatin1( "OK" );
setOkButton( newText );
}
/*! Returns the text in the tab for page \a w.
*/
qt'QTabDialog::tabLabel() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:1077)
QString QTabDialog::tabLabel( QWidget * w )
{
return d->tw->tabLabel( w );
}
/*! \reimp
*/
qt'QTabDialog::styleChange() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:1085)
void QTabDialog::styleChange( QStyle& s )
{
QDialog::styleChange( s );
setSizes();
}
/*! Returns a pointer to the page currently being displayed by the
tab dialog. The tab dialog does its best to make sure that this value
is never 0, but if you try hard enough it can be.
*/
qt'QTabDialog::currentPage() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:1097)
QWidget * QTabDialog::currentPage() const
{
return d->tw->currentPage();
}
/*!
Defines a new label for the tab of page \w
*/
qt'QTabDialog::changeTab() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:1105)
void QTabDialog::changeTab( QWidget *w, const QString &label)
{
d->tw->changeTab( w, label );
}
/*!
Defines a new \a iconset and a new \a label for the tab of page \w
*/
qt'QTabDialog::changeTab() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:1113)
void QTabDialog::changeTab( QWidget *w, const QIconSet& iconset, const QString &label)
{
d->tw->changeTab( w, iconset, label );
}
/*! Removes page \a w from this stack of widgets. Does not
delete \a w.
\sa showPage(), QTabWidget::removePage(), QWidgetStack::removeWidget()
*/
qt'QTabDialog::removePage() (./qt-2.1.0/src/dialogs/qtabdialog.cpp:1122)
void QTabDialog::removePage( QWidget * w )
{
d->tw->removePage( w );
}