📄 qwhatsthis.3qt
字号:
'\" t.TH QWhatsThis 3qt "24 January 2005" "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 NAMEQWhatsThis \- Simple description of any widget, e.g. answering the question "what's this?".br.PP\fC#include <qwhatsthis.h>\fR.PPInherits Qt..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQWhatsThis\fR ( QWidget * ) ".br.ti -1c.BI "virtual \fB~QWhatsThis\fR () ".br.ti -1c.BI "virtual QString \fBtext\fR ( const QPoint & ) ".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "void \fBadd\fR ( QWidget *, const QString & ) ".br.ti -1c.BI "void \fBremove\fR ( QWidget * ) ".br.ti -1c.BI "QString \fBtextFor\fR ( QWidget *, const QPoint & pos = QPoint ()) ".br.ti -1c.BI "QToolButton* \fBwhatsThisButton\fR ( QWidget * parent ) ".br.ti -1c.BI "void \fBenterWhatsThisMode\fR () ".br.ti -1c.BI "bool \fBinWhatsThisMode\fR () ".br.ti -1c.BI "void \fBleaveWhatsThisMode\fR ( const QString & = QString::null, const QPoint & pos = QCursor::pos ()) ".br.in -1c.SH DESCRIPTIONThe QWhatsThis class provides a simple description of any widget, e.g. answering the question "what's this?".PP\fIWhat's This\fR help is part of an application's online help systems, offering users a level of detail between tool tips and full text browsing windows..PPQWhatsThis provides a single window with a single explanatory text, which pops up quickly when the user asks "what's this?", and goes away as soon as the user does something else..PPTo assign \fIWhat's This?\fR text to a widget, you simply call QWhatsThis::add() for the widget. To assign text to a menu item, call QMenuData::setWhatsThis(), and for a global accelerator key, call QAccel::setWhatsThis()..PPThe text can be either rich text or plain text. If you specify a rich text formatted string, it will be rendered using the default stylesheet. This makes it also possible to embed images. See QStyleSheet::defaultSheet() for details..PPBy default, the user will be able to view the text for a widget by pressing Shift-F1 while the widget has focus. On window systems where a context help button is provided in the window decorations, that button enters \fIWhat's This?\fR mode. In this mode, if the user clicks on a widget, help will be given for the widget. The mode is left when help is given or when the user presses the Escape key..PPAn alternative way to enter \fIWhat's This?\fR mode is to use the ready-made toolbar tool button from QWhatsThis::whatsThisButton(). If you are using QMainWindow, you can also use the QMainWindow::whatsThis() slot to invoke the mode from a menu item..PP.ce 1.B "[Image Omitted]".PPFor more control, you can create a dedicated QWhatsThis object for a special widget. By subclassing and reimplementing QWhatsThis::text() it is possible to have different explanatory texts depending on the position of the mouse click..PPIf your widget needs even more control, see QWidget::customWhatsThis()..PPTo remove added text, you can use QWhatsThis::remove(), but since the text is automatically removed when the widget is destroyed, this is rarely needed..PPSee also QToolTip..SH MEMBER FUNCTION DOCUMENTATION.SH "QWhatsThis::QWhatsThis ( QWidget * widget )"Constructs a dynamic \fIWhat's This\fR object for \fIwidget.\fR.PPWhen the widget is queried by the user, the text() function of this QWhatsThis will be called to provide the appropriate text, rather than using text assigned by add()..SH "QWhatsThis::~QWhatsThis () \fC[virtual]\fR"Destructs the object and frees any allocated resources..SH "void QWhatsThis::add ( QWidget * widget, const QString & text ) \fC[static]\fR"Adds \fItext\fR as \fIWhat's This\fR help for \fIwidget.\fR If the text is rich text formatted (ie. it contains markup), it will be rendered with the default stylesheet QStyleSheet::defaultSheet()..PPThe text is destroyed if the widget is later destroyed and so need not be explicitly removed..PPSee also remove()..SH "void QWhatsThis::enterWhatsThisMode () \fC[static]\fR"Enters \fIWhat's This\fR? mode and returns immediately..PPQt will install a special cursor and take over mouse input until the user clicks somewhere, then show any help available and switch out of \fIWhat's This\fR mode. Finally, Qt removes the special cursor and help window then restores ordinary event processing, at which point the left mouse button is not pressed..PPThe user can also use the Escape key to leave \fIWhat's This\fR? mode..PPSee also inWhatsThisMode() and leaveWhatsThisMode()..SH "bool QWhatsThis::inWhatsThisMode () \fC[static]\fR"Returns whether the application is in \fIWhat's This\fR mode..PPSee also enterWhatsThisMode() and leaveWhatsThisMode()..SH "void QWhatsThis::leaveWhatsThisMode ( const QString & text = QString::null, const QPoint & pos = QCursor::pos ()) \fC[static]\fR"Leaves \fIWhat's This\fR? question mode.PPThis function is used internally by widgets that support QWidget::customWhatsThis(), applications do not usually call it. An example for such a kind of widget is QPopupMenu: Menus still work normally in \fIWhat's This\fR mode, but provide help texts for single menu items instead..PPIf \fItext\fR is not a null string, then a \fIWhat's This\fR help window is displayed at the global screen position \fIpos.\fR.PPSee also inWhatsThisMode() and enterWhatsThisMode()..SH "void QWhatsThis::remove ( QWidget * widget ) \fC[static]\fR"Removes the \fIWhat's This\fR help for \fIwidget.\fR This happens automatically if the widget is destroyed..PPSee also add()..SH "QString QWhatsThis::text ( const QPoint & ) \fC[virtual]\fR"This virtual functions returns the text for position \fIp\fR in the widget that this \fIWhat's This\fR object documents. If there is no \fIWhat's This\fR text for a position, QString::null is returned..PPThe default implementation returns QString::null..SH "QString QWhatsThis::textFor ( QWidget * widget, const QPoint & pos = QPoint ()) \fC[static]\fR"Returns the text for \fIwidget,\fR or a null string if there is no \fIWhat's This\fR help for \fIwidget.\fR.PPSee also add()..SH "QToolButton * QWhatsThis::whatsThisButton ( QWidget * parent ) \fC[static]\fR"Creates a QToolButton pre-configured to enter \fIWhat's This\fR mode when clicked. You will often use this with a toolbar:.PP.nf.br (void)QWhatsThis::whatsThisButton( my_help_tool_bar );.fi.SH "SEE ALSO".BR http://doc.trolltech.com/qwhatsthis.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports make our job much simpler. Thank you..PIn case of content or formattting problems with this manual page, pleasereport them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qwhatsthis.3qt) and the Qtversion (2.3.10).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -