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

📄 qwidget.3qt

📁 tmark1.11:用于生成QT/EMBEDDED应用工程的Markfile文件
💻 3QT
📖 第 1 页 / 共 5 页
字号:
The default implementation calls update().PPSee also: setBackgroundPixmap(), backgroundPixmap(), repaint() and update()..SH "QSize QWidget::baseSize () const"Returns the widget base size.PPThe base size is used to calculate a proper widget size in case the widget defines sizeIncrement()..PPSee also: setBaseSize() and setSizeIncrement()..SH "QString QWidget::caption () const"Returns the widget caption, or a null string if no caption has been set..PPSee also: setCaption(), icon() and iconText()..SH "QRect QWidget::childrenRect () const"Returns the bounding rectangle of the widget's children..SH "QRegion QWidget::childrenRegion () const"Returns the combined region of the widget's children geometry()..SH "void QWidget::clearFocus () \fC[slot]\fR"Takes keyboard input focus from the widget..PPIf the widget has active focus, a focus out event is sent to this widget to tell it that it is about to loose the focus..PPThis widget must enable focus setting in order to get the keyboard input focus, i.e. it must call setFocusPolicy()..PPSee also: hasFocus(), setFocus(), focusInEvent(), focusOutEvent(), setFocusPolicy() and QApplication::focusWidget()..SH "void QWidget::clearMask ()"Removes any mask set by setMask()..PPSee also: setMask()..SH "void QWidget::clearWFlags ( WFlags f ) \fC[protected]\fR"For internal use only..SH "void QWidget::clearWState ( uint n ) \fC[protected]\fR"For internal use only..SH "bool QWidget::close () \fC[slot]\fR"Closes this widget. Returns TRUE if the widget was closed, otherwise FALSE..PPFirst it sends the widget a QCloseEvent. The widget is hidden if it accepts the close event. The default implementation of QWidget::closeEvent() accepts the close event..PPThe QApplication::lastWindowClosed() signal is emitted when the last visible top level widget is closed..PPSee also: close(bool)..PPExamples:.(lpopup/popup.cpp.)l.SH "bool QWidget::close ( bool alsoDelete ) \fC[virtual]\fR"Closes this widget. Returns TRUE if the widget was closed, otherwise FALSE..PPIf \fIalsoDelete\fR is TRUE or the widget has the \fCWDestructiveClose\fR widget flag, the widget is also deleted. Otherwise, the widget can prevent itself from being closed by rejecting the QCloseEvent it gets..PPThe QApplication::lastWindowClosed() signal is emitted when the last visible top level widget is closed..PPNote that closing the QApplication::mainWidget() terminates the application..PPSee also: closeEvent(), QCloseEvent, hide(), QApplication::quit(), QApplication::setMainWidget() and QApplication::lastWindowClosed()..SH "void QWidget::closeEvent ( QCloseEvent * e ) \fC[virtual protected]\fR"This event handler can be reimplemented in a subclass to receive widget close events..PPThe default implementation calls e->accept(), which hides this widget. See the QCloseEvent documentation for more details..PPSee also: event(), hide(), close() and QCloseEvent..PPReimplemented in QPopupMenu, QDialog and QProgressDialog..SH "const QColorGroup & QWidget::colorGroup () const"Returns the current color group of the widget palette..PPThe color group is determined by the state of the widget..PPA disabled widget returns the QPalette::disabled() color group, a widget in focus returns the QPalette::active() color group and a normal widget returns the QPalette::normal() color group..PPSee also: palette() and setPalette()..SH "void QWidget::create ( WId window = 0, bool initializeWindow = TRUE, bool destroyOldWindow = TRUE ) \fC[virtual protected]\fR"Creates a new widget window if \fIwindow\fR is null, otherwise sets the widget's window to \fIwindow.\fR.PPInitializes the window (sets the geometry etc.) if \fIinitializeWindow\fR is TRUE. If \fIinitializeWindow\fR is FALSE, no initialization is performed. This parameter makes only sense if \fIwindow\fR is a valid window..PPDestroys the old window if \fIdestroyOldWindow\fR is TRUE. If \fIdestroyOldWindow\fR is FALSE, you are responsible for destroying the window yourself (using platform native code)..PPThe QWidget constructor calls create(0,TRUE,TRUE) to create a window for this widget..SH "const QCursor & QWidget::cursor () const"Returns the widget cursor. If no cursor has been set the parent widget's cursor is returned..PPSee also: setCursor() and unsetCursor();..SH "void QWidget::customEvent ( QCustomEvent * ) \fC[virtual protected]\fR"This event handler can be reimplemented in a subclass to receive custom events..PPQCustomEvent is a user-defined event type which contains a \fCvoid*..PP\fBWarning:\fR\fR This event class is internally used to implement Qt enhancements. It is not advisable to use QCustomEvent in normal applications, where other event types and the signal/slot mechanism can do the job..PPSee also: event() and QCustomEvent..SH "bool QWidget::customWhatsThis () const \fC[virtual]\fR"Returns whether the widget wants to handle What's This help manually. The default implementation returns FALSE, which means the widget will not receive any events in Whats This mode..PPThe widget may leave Whats This mode by calling QWhatsThis::leaveWhatsThisMode(), with or without actually displaying any help text..PPYou may also reimplement customWhatsThis() if your widget is a so-called "passive interactor" that is supposed to work under all circumstances. Simply never call QWhatsThis::leaveWhatsThisMode() in that case..PPSee also: QWhatsThis::inWhatsThisMode() and QWhatsThis::leaveWhatsThisMode()..PPReimplemented in QMenuBar and QPopupMenu..SH "void QWidget::destroy ( bool destroyWindow = TRUE, bool destroySubWindows = TRUE ) \fC[virtual protected]\fR"Frees up window system resources. Destroys the widget window if \fIdestroyWindow\fR is TRUE..PPdestroy() calls itself recursively for all the child widgets, passing \fIdestroySubWindows\fR for the \fIdestroyWindow\fR parameter. To have more control over destruction of subwidgets, destroy subwidgets selectively first..PPThis function is usually called from the QWidget destructor..SH "void QWidget::dragEnterEvent ( QDragEnterEvent * ) \fC[virtual protected]\fR"This event handler is called when a drag is in progress and the mouse enters this widget..PPSee the Drag-and-drop documentation for an overview of how to provide drag-and-drop in your application..PPSee also: QTextDrag, QImageDrag and QDragEnterEvent..SH "void QWidget::dragLeaveEvent ( QDragLeaveEvent * ) \fC[virtual protected]\fR"This event handler is called when a drag is in progress and the mouse leaves this widget..PPSee the Drag-and-drop documentation for an overview of how to provide drag-and-drop in your application..PPSee also: QTextDrag, QImageDrag and QDragLeaveEvent..PPReimplemented in QMultiLineEdit..SH "void QWidget::dragMoveEvent ( QDragMoveEvent * ) \fC[virtual protected]\fR"This event handler is called when a drag is in progress and the mouse enters this widget, and whenever it moves within the widget..PPSee the Drag-and-drop documentation for an overview of how to provide drag-and-drop in your application..PPSee also: QTextDrag, QImageDrag and QDragMoveEvent..PPReimplemented in QMultiLineEdit..SH "void QWidget::drawText ( int x, int y, const QString & str )"Writes \fIstr\fR at position \fIx,y.\fR.PPThe \fIy\fR position is the base line position of the text. The text is drawn using the default font and the default foreground color..PPThis function is provided for convenience. You will generally get more flexible results and often higher speed by using a a painter instead..PPSee also: setFont(), foregroundColor() and QPainter::drawText()..SH "void QWidget::drawText ( const QPoint & pos, const QString & str )"This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts..SH "void QWidget::dropEvent ( QDropEvent * ) \fC[virtual protected]\fR"This event handler is called when the drag is dropped on this widget..PPSee the Drag-and-drop documentation for an overview of how to provide drag-and-drop in your application..PPSee also: QTextDrag, QImageDrag and QDropEvent..PPReimplemented in QMultiLineEdit..SH "void QWidget::enabledChange ( bool oldEnabled ) \fC[virtual protected]\fR"This virtual function is called from setEnabled(). \fIoldEnabled\fR is the previous setting; you can get the new setting from isEnabled()..PPReimplement this function if your widget needs to know when it becomes enabled or disabled. You will almost certainly need to update the widget using either repaint(TRUE) or update()..PPThe default implementation repaints the visible part of the widget..PPSee also: setEnabled(), isEnabled(), repaint(), update() and visibleRect()..PPReimplemented in QListView and QButton..SH "void QWidget::enterEvent ( QEvent * ) \fC[virtual protected]\fR"This event handler can be reimplemented in a subclass to receive widget enter events..PPAn event is sent to the widget when the mouse cursor enters the widget..PPSee also: leaveEvent(), mouseMoveEvent() and event()..PPReimplemented in QToolButton and QXtWidget..SH "void QWidget::erase ( const QRegion & reg )"Erases the area defined by \fIreg,\fR without generating a paint event..PPChild widgets are not affected..PPExamples:.(ldrawlines/connect.cpp.)l.SH "void QWidget::erase ( int x, int y, int w, int h )"Erases the specified area \fI(x,y,w,h)\fR in the widget without generating a paint event..PPIf \fIw\fR is negative, it is replaced with \fCwidth() - x\fR. If \fIh\fR is negative, it is replaced width \fCheight() - y\fR..PPChild widgets are not affected..PPSee also: repaint()..SH "void QWidget::erase ()"This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts..PPThis version erases the entire widget..SH "void QWidget::erase ( const QRect & r )"This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts..SH "bool QWidget::event ( QEvent * e ) \fC[virtual protected]\fR"This is the main event handler. You may reimplement this function in a subclass, but we recommend using one of the specialized event handlers instead..PPThe main event handler first passes an event through all event filters that have been installed. If none of the filters intercept the event, it calls one of the specialized event handlers..PPKey press/release events are treated differently from other events. event() checks for Tab and shift-Tab and tries to move the focus appropriately. If there is no widget to move the focus to (or the key press is not Tab or shift-Tab), event() calls keyPressEvent()..PPThis function returns TRUE if it is able to pass the event over to someone, or FALSE if nobody wanted the event..PPSee also: closeEvent(), focusInEvent(), focusOutEvent(), enterEvent(), keyPressEvent(), keyReleaseEvent(), leaveEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), moveEvent(), paintEvent(), resizeEvent(), QObject::event() and QObject::timerEvent()..PPReimplemented from QObject..SH "QWExtra * QWidget::extraData () \fC[protected]\fR"For internal use only..SH "QWidget * QWidget::find ( WId id ) \fC[static]\fR"Returns a pointer to the widget with window identifer/handle \fIid.\fR.PPThe window identifier type depends by the underlying window system, see qwindowdefs.h for the actual definition. If there is no widget with this identifier, a null pointer is returned..PPSee also: wmapper() and id()..SH "QFocusData * QWidget::focusData () \fC[protected]\fR"Returns a pointer to the focus data for this widget's top-level widget..PPFocus data always belongs to the top-level widget. The focus data list contains all the widgets in this top-level widget that can accept focus, in tab order. An iterator points to the current focus widget (focusWidget() returns a pointer to this widget)..PPThis information is useful for implementing advanced versions of focusNextPrevChild()..SH "void QWidget::focusInEvent ( QFocusEvent * ) \fC[virtual protected]\fR"This event handler can be reimplemented in a subclass to receive keyboard focus events (focus received) for the widget..PPA widget must accept focus initially in order to receive focus events..PPThe default implementation calls repaint() since the widget's color group changes from normal to active. You may want to call repaint(FALSE) to reduce flicker in any reimplementation. It also calls setMicroFocusHint(), hinting any system-specific input tools about the focus of the user's attention..PPAs a special case to support applications not utilizing focus, Top-level widgets that have NoFocus policy will receive focus events and gain keyboard events, but the repaint is not done by default..PPSee also: focusOutEvent(), setFocusPolicy(), keyPressEvent(), keyReleaseEvent(), event() and QFocusEvent..PPReimplemented in QPushButton, QListBox, QButton, QXtWidget, QMultiLineEdit, QLineEdit, QSlider, QComboBox, QDial, QListView and QRadioButton..SH "bool QWidget::focusNextPrevChild ( bool next ) \fC[virtual protected]\fR"Finds a new widget to give the keyboard focus to, as appropriate for Tab/shift-Tab, and returns TRUE if is can find a new widget and FALSE if it can't,.PPIf \fInext\fR is true, this function searches "forwards", if \fInext\fR is FALSE, "backwards"..PPSometimes, you will want to reimplement this function. For example, a web browser might reimplement it to move its "current active link" forwards or backwards, and call QWidget::focusNextPrevChild() only when it reaches the last/first..PPChild widgets call focusNextPrevChild() on their parent widgets, and only the top-level widget will thus make the choice of where to redirect focus. By overriding this method for an object, you thus gain control of focus traversal for all child widgets..PPSee also: focusData()..PPReimplemented in QButton and QScrollView..SH "void QWidget::focusOutEvent ( QFocusEvent * ) \fC[virtual protected]\fR"This event handler can be reimplemented in a subclass to receive keyboard focus events (focus lost) for the widget..PPA widget must accept focus initially in order to receive focus events..PPThe default implementation calls repaint( visibleRect() ) since the widget's color group changes from active to normal. You may want to call repaint( visibleRect(), FALSE) to reduce flicker in any reimplementation..PPSee also: focusInEvent(), setFocusPolicy(), keyPressEvent(), keyReleaseEvent(), event() and QFocusEvent..PPReimplemented in QListBox, QButton, QMenuBar, QMultiLineEdit, QDial, QLineEdit, QPushButton, QSlider, QXtWidget and QListView..SH "QWidget * QWidget::focusProxy () const"Returns a pointer to the focus proxy, or 0 if there is no focus proxy..PPSee also: setFocusProxy()..SH "QWidget * QWidget::focusWidget () const"Returns the focus widget in this widget's window. This is not the same as QApplication::focusWidget(), which returns the focus widget in the currently active window..SH "void QWidget::fontChange ( const QFont & oldFont ) \fC[virtual protected]\fR"This virtual function is called from setFont(). \fIoldFont\fR is the previous font; you can get the new font from font()..PPReimplement this function if your widget needs to know when its font changes. You will almost certainly need to update the widget using either repaint(TRUE) or update()..PPThe default implementation calls update.PPSee also: setFont(), font(), repaint() and update()..PPReimplemented in QMenuBar..SH "QFontInfo QWidget::fontInfo () const"Returns the font info for the widget's current font. Equivalent to QFontInto(widget->font())..PPSee also: font(), fontMetrics() and setFont()..SH "QFontMetrics QWidget::fontMetrics () const"Returns the font metrics for the widget's current font. Equivalent to QFontMetrics(widget->font())..PPSee also: font(), fontInfo() and setFont()..PPExamples:.(lxform/xform.cpp drawdemo/drawdemo.cpp qmag/qmag.cpp.)l.SH "QWidget::PropagationMode QWidget::fontPropagation() const"Returns the font propagation mode of this widget. The default font propagation mode is \fCNoChildren,\fR but you can set it to \fISameFont\fR or \fIAllChildren.\fR.PPSee also: setFontPropagation()..SH "const QColor & QWidget::foregroundColor () const"Returns the foreground color of this widget..PPThe foreground color equals \fCcolorGroup().foreground()\fR..PPSee also: backgroundColor() and colorGroup()..SH "QRect QWidget::frameGeometry () const"Returns the geometry of the widget, relative to its parent and including the window frame..PPSee also: geometry(), x(), y() and pos()..SH "QSize QWidget::frameSize () const"Returns the size of the window system frame (for top level widgets)..SH "const QRect & QWidget::geometry () const"Returns the geometry of the widget, relative to its parent widget and excluding the window frame..PPSee also: frameGeometry(), size() and rect()..PPExamples:.(lqmag/qmag.cpp.)l.SH "WFlags QWidget::getWFlags () const \fC[protected]\fR"For internal use only..SH "uint QWidget::getWState () const \fC[protected]\fR"For internal use only..SH "void QWidget::grabKeyboard ()"Grabs all keyboard input..PPThis widget will receive all keyboard events, independent of the active window..PP\fBWarning:\fR Grabbing the keyboard might lock the terminal..PPSee also: releaseKeyboard(), grabMouse() and releaseMouse()..SH "void QWidget::grabMouse ()"Grabs the mouse input..PPThis widget will be the only one to receive mouse events until releaseMouse() is called..PP

⌨️ 快捷键说明

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