⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qtabdialog.3qt

📁 Linux 下的图形编程环境。
💻 3QT
📖 第 1 页 / 共 2 页
字号:
'\" t.TH QTabDialog 3qt "5 March 2001" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQTabDialog \- Stack of tabbed widgets.br.PP\fC#include <qtabdialog.h>\fR.PPInherits QDialog..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQTabDialog\fR ( QWidget * " "parent" "=0, const char * " "name" "=0, bool " "modal" "=FALSE, WFlags " "f" "=0 ) ".br.ti -1c.BI "\fB~QTabDialog\fR () ".br.ti -1c.BI "virtual void \fBsetFont\fR ( const QFont & font ) ".br.ti -1c.BI "void \fBaddTab\fR ( QWidget *, const QString & ) ".br.ti -1c.BI "void \fBaddTab\fR ( QWidget * " "child" ", const QIconSet & " "iconset" ", const QString & label ) ".br.ti -1c.BI "void \fBaddTab\fR ( QWidget *, QTab * ) ".br.ti -1c.BI "void \fBinsertTab\fR ( QWidget *, const QString &, int " "index" " = -1 ) ".br.ti -1c.BI "void \fBinsertTab\fR ( QWidget * " "child" ", const QIconSet & " "iconset" ", const QString & " "label" ", int " "index" " = -1 ) ".br.ti -1c.BI "void \fBinsertTab\fR ( QWidget *, QTab *, int " "index" " = -1 ) ".br.ti -1c.BI "void \fBchangeTab\fR ( QWidget *, const QString & ) ".br.ti -1c.BI "void \fBchangeTab\fR ( QWidget * " "child" ", const QIconSet & " "iconset" ", const QString & label ) ".br.ti -1c.BI "bool \fBisTabEnabled\fR ( QWidget * ) const".br.ti -1c.BI "void \fBsetTabEnabled\fR ( QWidget *, bool ) ".br.ti -1c.BI "bool isTabEnabled ( const char * ) const \fI(obsolete)\fR".br.ti -1c.BI "void setTabEnabled ( const char *, bool ) \fI(obsolete)\fR".br.ti -1c.BI "void \fBshowPage\fR ( QWidget * ) ".br.ti -1c.BI "void \fBremovePage\fR ( QWidget * ) ".br.ti -1c.BI "QString \fBtabLabel\fR ( QWidget * ) ".br.ti -1c.BI "QWidget* \fBcurrentPage\fR () const".br.ti -1c.BI "void \fBsetDefaultButton\fR ( const QString & text ) ".br.ti -1c.BI "void \fBsetDefaultButton\fR () ".br.ti -1c.BI "bool \fBhasDefaultButton\fR () const".br.ti -1c.BI "void \fBsetHelpButton\fR ( const QString & text ) ".br.ti -1c.BI "void \fBsetHelpButton\fR () ".br.ti -1c.BI "bool \fBhasHelpButton\fR () const".br.ti -1c.BI "void \fBsetCancelButton\fR ( const QString & text ) ".br.ti -1c.BI "void \fBsetCancelButton\fR () ".br.ti -1c.BI "bool \fBhasCancelButton\fR () const".br.ti -1c.BI "void \fBsetApplyButton\fR ( const QString & text ) ".br.ti -1c.BI "void \fBsetApplyButton\fR () ".br.ti -1c.BI "bool \fBhasApplyButton\fR () const".br.ti -1c.BI "void \fBsetOkButton\fR ( const QString & text ) ".br.ti -1c.BI "void \fBsetOkButton\fR () ".br.ti -1c.BI "bool \fBhasOkButton\fR () const".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBaboutToShow\fR () ".br.ti -1c.BI "void \fBapplyButtonPressed\fR () ".br.ti -1c.BI "void \fBcancelButtonPressed\fR () ".br.ti -1c.BI "void \fBdefaultButtonPressed\fR () ".br.ti -1c.BI "void \fBhelpButtonPressed\fR () ".br.ti -1c.BI "void \fBcurrentChanged\fR ( QWidget * ) ".br.ti -1c.BI "void selected ( const QString & ) \fI(obsolete)\fR".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "void \fBsetTabBar\fR ( QTabBar * ) ".br.ti -1c.BI "QTabBar* \fBtabBar\fR () const".br.in -1c.SH DESCRIPTIONThe QTabDialog class provides a stack of tabbed widgets..PPA tabbed dialog is one in which several "pages" are available, and the user selects which page to see and use by clicking on its tab, or by pressing the indicated Alt-(letter) key combination..PPQTabDialog does not provide more than one row of tabs, and does not provide tabs along the sides or bottom of the pages. It also does not offer any way to find out which page is currently visible or to set the visible page..PPQTabDialog provides an OK button and optionally Apply, Cancel, Defaults, and Help buttons..PPThe normal way to use QTabDialog is to do the following in the constructor: .IP 1Create a QTabDialog. .IP 2Create a QWidget for each of the pages in the tab dialog, insert children into it, set up geometry management for it, and use addTab() to set up a tab and keyboard accelerator for it. .IP 3Set up the buttons for the tab dialog (Apply, Cancel and so on). .IP 4Connect to the signals and slots. .PPIf you don't call addTab(), the page you have created will not be visible. Please don't confuse the object name you supply to the QWidget constructor and the tab label you supply to addTab(): addTab() takes a name which indicates an accelerator and is meaningful and descriptive to the user, while the widget name is used primarily for debugging..PPAlmost all applications have to connect the applyButtonPressed() signal to something. applyButtonPressed() is emitted when either OK or Apply is clicked, and your slot must copy the dialog's state into the application..PPThere are also several other signals which may be useful. .TPcancelButtonPressed() is emitted when the user clicks Cancel. .TPdefaultButtonPressed() is emitted when the user clicks Defaults;.TPhelpButtonPressed() is emitted when the user clicks Help; the slot it is connected to should reset the state of the dialog to the application defaults. .TPaboutToShow() is emitted at the start of show(); if there is any chance that the state of the application may change between the creation of the tab dialog and the time it show() is called, you must connect this signal to a slot which resets the state of the dialog. .TPcurrentChanged() is emitted when the user selects some page. .PPEach tab is either enabled or disabled at any given time. If a tab is enabled, the tab text is drawn in black and the user can select that tab. If it is disabled, the tab is drawn in a different way and the user can not select that tab. Note that even though a tab is disabled, the page can still be visible, for example if all of the tabs happen to be disabled..PPWhile tab dialogs can be a very good way to split up a complex dialog, it's also very easy to make a royal mess out of a tab dialog. Here is some advice. For more, see e.g. the UIE web page on tab dialogs..IP 1Make sure that each page forms a logical whole which is adequately described by the label on the tab..IPIf two related functions are on different pages, users will often not find one of the functions, or will spend far too long searching for it..IP 2Do not join several independent dialogs into one tab dialog. Several aspects of one complex dialog is acceptable (such as the various aspects of "preferences") but a tab dialog is no substitute for a pop-up menu leading to several smaller dialogs..IPThe OK button (and the other buttons) apply to the \fIentire\fR dialog. If the tab dialog is really several independent smaller dialogs, users often press Cancel to cancel just the changes he/she has made on the current page: Many users will treat that page as independent of the other pages..IP 3Do not use tab dialogs for frequent operations. The tab dialog is probably the most complex widget in common use at the moment, and subjecting the user to this complexity during his/her normal use of your application is most often a bad idea..IPThe tab dialog is good for complex operations which have to be performed seldom, like Preferences dialogs. Not for common operations, like setting left/right alignment in a word processor. (Often, these common operations are actually independent dialogs and should be treated as such.).IPThe tab dialog is not a navigational aid, it is an organizational aid. It is a good way to organize aspects of a complex operation (such as setting up caching and proxies in a web browser), but a bad way to navigate towards a simple operation (such as emptying the cache in a web browser - emptying the cache is \fInot\fR part of setting up the cache, it is a separate and independent operation)..IP 4The changes should take effect when the user presses Apply or OK. Not before..IPProviding Apply, Cancel or OK buttons on the individual pages is likely to weaken the users' mental model of how tab dialogs work. If you think a page needs its own buttons, consider making it a separate dialog..IP 5There should be no implicit ordering of the pages. If there is, it is probably better to use a wizard dialog..IPIf some of the pages seem to be ordered and others not, perhaps they ought not to be joined in a tab dialog..IP.PPMost of the functionality in QTabDialog is provided by a QTabWidget..PP.ce 1.B "[Image Omitted]".PP.ce 1.B "[Image Omitted]".PPSee also QDialog..SH MEMBER FUNCTION DOCUMENTATION.SH "QTabDialog::QTabDialog ( QWidget * parent=0, const char * name=0, bool modal=FALSE, WFlags f=0 )"Constructs a QTabDialog with only an Ok button..SH "QTabDialog::~QTabDialog ()"Destructs the tab dialog..SH "void QTabDialog::aboutToShow () \fC[signal]\fR"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..PPThis applies mainly to QTabDialog objects that are kept around hidden rather than being created, show()n and deleted afterwards..PPSee also applyButtonPressed(), show() and cancelButtonPressed()..SH "void QTabDialog::addTab ( QWidget * child, QTab * tab )"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..SH "void QTabDialog::addTab ( QWidget * child, const QIconSet & iconset, const QString & label )"Adds another tab and page to the tab view..PPThis function is the same as addTab() but with an additional iconset..SH "void QTabDialog::addTab ( QWidget * child, const QString & label )"Adds another tab and page to the tab view..PPThe tab will be labelled \fIlabel\fR and \fIchild\fR 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..PP

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -