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

📄 qwidget.3qt

📁 tmark1.11:用于生成QT/EMBEDDED应用工程的Markfile文件
💻 3QT
📖 第 1 页 / 共 5 页
字号:
\fBWarning:\fR Grabbing the mouse might lock the terminal..PPIt is almost never necessary to grab the mouse when using Qt since Qt grabs and releases it sensibly. In particular, Qt grabs the mouse when a button is pressed and keeps it until the last button is released..PPSee also: releaseMouse(), grabKeyboard() and releaseKeyboard()..SH "void QWidget::grabMouse ( const QCursor & cursor )"Grabs the mouse input and changes the cursor shape..PPThe cursor will assume shape \fIcursor\fR (for as long as the mouse focus is grabbed) and this widget will be the only one to receive mouse events until releaseMouse() is called()..PP\fBWarning:\fR Grabbing the mouse might lock the terminal..PPSee also: releaseMouse(), grabKeyboard(), releaseKeyboard() and setCursor()..PPExamples:.(lqmag/qmag.cpp.)l.SH "bool QWidget::hasFocus () const"Returns TRUE if this widget (or its focus proxy) has the keyboard input focus, otherwise FALSE..PPEquivalent to \fCqApp->focusWidget() == this\fR..PPSee also: setFocus(), clearFocus(), setFocusPolicy() and QApplication::focusWidget()..SH "bool QWidget::hasMouseTracking () const"Returns TRUE if mouse tracking is enabled for this widget, or FALSE if mouse tracking is disabled..PPSee also: setMouseTracking()..SH "int QWidget::height () const"Returns the height of the widget, excluding the window frame..PPSee also: geometry(), width() and size()..PPExamples:.(lgrapher/grapher.cpp xform/xform.cpp drawdemo/drawdemo.cpp qmag/qmag.cpp.)l.SH "int QWidget::heightForWidth ( int w ) const \fC[virtual]\fR"Returns the preferred height for this widget, given the width \fIw.\fR The default implementation returns 0, indicating that the preferred height does not depend on the width..PP\fBWarning:\fR Does not look at the widget's layout..PPReimplemented in QMenuBar, QLabel and QTextView..SH "void QWidget::hide () \fC[virtual slot]\fR"Hides the widget..PPYou almost never have to reimplement this function. If you need to do something after a widget is hidden, use \\link hideEvent() instead..PPSee also: \\hideEvent(), show(), showMinimized(), isVisible() and close()..PPExamples:.(lxform/xform.cpp popup/popup.cpp progress/progress.cpp scrollview/scrollview.cpp.)l.PPReimplemented in QPopupMenu and QMenuBar..SH "void QWidget::hideEvent ( QHideEvent * ) \fC[virtual protected]\fR"This event handler can be reimplemented in a subclass to receive widget hide events..PPHide events are sent to widgets right after they have been hidden..PPSee also: event() and QHideEvent..SH "const QPixmap * QWidget::icon () const"Returns the widget icon pixmap, or null if no icon has been set..PPSee also: setIcon(), iconText() and caption()..SH "QString QWidget::iconText () const"Returns the widget icon text, or a null string if no icon text has been set..PPSee also: setIconText(), icon() and caption()..SH "bool QWidget::isActiveWindow () const"Returns TRUE if the top-level widget containing this widget is the active window..PPSee also: setActiveWindow() and topLevelWidget()..SH "bool QWidget::isDesktop () const"Returns TRUE if the widget is a desktop widget, otherwise FALSE..PPA desktop widget is also a top-level widget..PPSee also: isTopLevel() and QApplication::desktop()..SH "bool QWidget::isEnabled () const"Returns TRUE if the widget is enabled, or FALSE if it is disabled..PPSee also: setEnabled()..SH "bool QWidget::isEnabledTo ( QWidget * ancestor ) const"Returns TRUE if this widget and every parent up to but excluding \fIancestor\fR is enabled, otherwise returns FALSE..PPSee also: setEnabled() and isEnabled()..SH "bool QWidget::isEnabledToTLW () const"Returns TRUE if this widget and every parent up to the top level widget is enabled, otherwise returns FALSE..PPThis is equivalent to isEnabledTo(0)..PPSee also: setEnabled() and isEnabled()..SH "bool QWidget::isFocusEnabled () const"Returns TRUE if the widget accepts keyboard focus, or FALSE if it does not..PPKeyboard focus is initially disabled (i.e. focusPolicy() == \fCQWidget::NoFocus).\fR.PPYou must enable keyboard focus for a widget if it processes keyboard events. This is normally done from the widget's constructor. For instance, the QLineEdit constructor calls setFocusPolicy(\fCQWidget::StrongFocus).\fR.PPSee also: setFocusPolicy(), focusInEvent(), focusOutEvent(), keyPressEvent(), keyReleaseEvent() and isEnabled()..SH "bool QWidget::isMinimized () const"Returns TRUE if this widget is a top-level widget that is minimized (iconified), or else FALSE..PPSee also: showMinimized(), isVisible(), show(), hide() and showNormal()..SH "bool QWidget::isModal () const"Returns TRUE if the widget is a modal widget, otherwise FALSE..PPA modal widget is also a top-level widget..PPSee also: isTopLevel() and QDialog..SH "bool QWidget::isPopup () const"Returns TRUE if the widget is a popup widget, otherwise FALSE..PPA popup widget is created by specifying the widget flag \fCWType_Popup\fR to the widget constructor..PPA popup widget is also a top-level widget..PPSee also: isTopLevel()..SH "bool QWidget::isTopLevel () const"Returns TRUE if the widget is a top-level widget, otherwise FALSE..PPA top-level widget is a widget which usually has a frame and a caption (title bar). Popup and desktop widgets are also top-level widgets..PPA top-level widgets can have a parent widget. It will then be grouped with its parent: deleted when the parent is deleted, minimized when the parent is minimized etc. If supported by the window manager, it will also have a common taskbar entry with its parent..PPQDialog and QMainWindow widgets are by default top-level, even if a parent widget is specified in the constructor. This behavior is specified by the \fCWType_TopLevel\fR widget flag..PPChild widgets are the opposite of top-level widgets..PPSee also: topLevelWidget(), isModal(), isPopup(), isDesktop() and parentWidget()..SH "bool QWidget::isUpdatesEnabled () const"Returns TRUE if updates are enabled, otherwise FALSE..PPSee also: setUpdatesEnabled()..SH "bool QWidget::isVisible () const"Returns TRUE if the widget itself is set to visible status, or else FALSE. Calling show() sets the widget to visible status; calling hide() sets it to hidden status. Iconified top-level widgets also have hidden status, as well as having isMinimized() return TRUE..PPIf a widget is set to visible status, but its parent widget is set to hidden status, this function returns TRUE. isVisibleToTLW() looks at the visibility status of the parent widgets up to the top level widget..PPThis function returns TRUE if the widget currently is obscured by other windows on the screen, but would be visible if moved..PPSee also: show(), hide(), isVisibleToTLW() and isMinimized()..SH "bool QWidget::isVisibleTo ( QWidget * ancestor ) const"Returns TRUE if this widget and every parent up to but excluding \fIancestor\fR is visible, otherwise returns FALSE..PPThis function returns TRUE if the widget it is obscured by other windows on the screen, but would be visible if moved..PPSee also: show(), hide() and isVisible()..SH "bool QWidget::isVisibleToTLW () const"Returns TRUE if this widget and every parent up to the top level widget is visible, otherwise returns FALSE..PPThis function returns TRUE if the widget it is obscured by other windows on the screen, but would be visible if moved..PPThis is equivalent to isVisibleTo(0)..PPSee also: show(), hide() and isVisible()..SH "void QWidget::keyPressEvent ( QKeyEvent * e ) \fC[virtual protected]\fR"This event handler can be reimplemented in a subclass to receive key press events for the widget..PPA widget must accept focus initially and have focus in order to receive a key press event..PPIf you reimplement this handler, it is very important that you ignore() the press if you do not understand it, so that the widget's parent can interpret it..PPThe default implementation closes popup widgets if you hit escape. Otherwise the event is ignored..PPAs a special case to support applications not utilizing focus, Top-level widgets that have NoFocus policy will receive keyboard events..PPSee also: keyReleaseEvent(), QKeyEvent::ignore(), setFocusPolicy(), focusInEvent(), focusOutEvent(), event() and QKeyEvent..PPReimplemented in QComboBox, QButton, QDial, QTextBrowser, QSlider, QDialog, QMultiLineEdit, QLineEdit, QTextView, QMessageBox, QMenuBar, QListBox, QListView, QPopupMenu, QScrollBar, QFileDialog and QTabBar..SH "void QWidget::keyReleaseEvent ( QKeyEvent * e ) \fC[virtual protected]\fR"This event handler can be reimplemented in a subclass to receive key release events for the widget..PPA widget must accept focus initially and have focus in order to receive a key release event..PPIf you reimplement this handler, it is very important that you ignore() the release if you do not understand it, so that the widget's parent can interpret it..PPThe default implementation ignores the event..PPSee also: keyPressEvent(), QKeyEvent::ignore(), setFocusPolicy(), focusInEvent(), focusOutEvent(), event() and QKeyEvent..SH "QWidget * QWidget::keyboardGrabber () \fC[static]\fR"Returns a pointer to the widget that is currently grabbing the keyboard input..PPIf no widget in this application is currently grabbing the keyboard, 0 is returned..PPSee also: grabMouse() and mouseGrabber()..SH "QLayout* QWidget::layout () const"Returns a pointer to the layout engine that manages the geometry of this widget's children..PPIf the widget does not have a layout, layout() returns a null pointer..PPSee also: sizePolicy()..SH "void QWidget::leaveEvent ( QEvent * ) \fC[virtual protected]\fR"This event handler can be reimplemented in a subclass to receive widget leave events..PPA leave event is sent to the widget when the mouse cursor leaves the widget..PPSee also: enterEvent(), mouseMoveEvent() and event()..PPReimplemented in QToolButton, QMenuBar, QXtWidget, QMultiLineEdit and QLineEdit..SH "void QWidget::lower () \fC[slot]\fR"Lowers the widget to the bottom of the parent widget's stack..PPIf there are siblings of this widget that overlap it on the screen, this widget will be obscured by its siblings afterwards..PPSee also: raise()..SH "QPoint QWidget::mapFromGlobal ( const QPoint & pos ) const"Translates the global screen coordinate \fIpos\fR to widget coordinates..PPSee also: mapToGlobal()..SH "QPoint QWidget::mapFromParent ( const QPoint & p ) const"Translates the parent widget coordinate \fIpos\fR to widget coordinates..PPSame as mapFromGlobal() if the widget has no parent..PPSee also: mapToParent()..SH "QPoint QWidget::mapToGlobal ( const QPoint & pos ) const"Translates the widget coordinate \fIpos\fR to global screen coordinates. For example,.PP.nf.br mapToGlobal(QPoint(0,0)).fiwould give the global coordinates of the top-left pixel of the widget..PPSee also: mapFromGlobal()..PPExamples:.(lpopup/popup.cpp.)l.SH "QPoint QWidget::mapToParent ( const QPoint & p ) const"Translates the widget coordinate \fIpos\fR to a coordinate in the parent widget..PPSame as mapToGlobal() if the widget has no parent..PPSee also: mapFromParent()..SH "int QWidget::maximumHeight () const"Returns the widget's maximum height..PPSee also: maximumSize() and maximumWidth()..SH "QSize QWidget::maximumSize () const"Returns the maximum widget size..PPThe widget cannot be resized to a larger size than the maximum widget size..PPSee also: maximumWidth(), maximumHeight(), setMaximumSize(), minimumSize() and sizeIncrement()..SH "int QWidget::maximumWidth () const"Returns the widget's maximum width..PPSee also: maximumSize() and maximumHeight()..SH "int QWidget::metric ( int m ) const \fC[virtual protected]\fR"Internal implementation of the virtual QPaintDevice::metric() function..PPUse the QPaintDeviceMetrics class instead..PPReimplemented from QPaintDevice..SH "int QWidget::minimumHeight () const"Returns the widget's minimum height..PPSee also: minimumSize() and minimumWidth()..SH "QSize QWidget::minimumSize () const"Returns the minimum widget size..PPThe widget cannot be resized to a smaller size than the minimum widget size..PPIf the returned minimum size equals (0,0) then it means that there are no constraints on the minimum size. However, Qt does nevertheless not allow you to shrink widgets to less than 1 pixel width/height..PPSee also: maximumWidth(), maximumHeight(), setMinimumSize(), maximumSize() and sizeIncrement()..SH "QSize QWidget::minimumSizeHint () const \fC[virtual]\fR"Returns a recommended minimum size for the widget, or an invalid size if no minimum size is recommended..PPThe default implementation returns an invalid size if there is no layout for this widget, the layout's minimum size otherwise..PPSee also: QSize::isValid(), resize(), setMinimumSize() and sizePolicy()..PPReimplemented in QWidgetStack, QSplitter, QLineEdit, QMultiLineEdit, QSlider, QProgressBar, QTabWidget, QListBox, QListView and QScrollView..SH "int QWidget::minimumWidth () const"Returns the widget's minimum width..PPSee also: minimumSize() and minimumHeight()..SH "void QWidget::mouseDoubleClickEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"This event handler can be reimplemented in a subclass to receive mouse double click events for the widget..PPThe default implementation generates a normal mouse press event..PPNote that the widgets gets a mousePressEvent() and a mouseReleaseEvent() before the mouseDoubleClickEvent()..PPSee also: mousePressEvent(), mouseReleaseEvent(), mouseMoveEvent(), event() and QMouseEvent..PPReimplemented in QComboBox, QMultiLineEdit, QLineEdit and QListBox..SH "QWidget * QWidget::mouseGrabber () \fC[static]\fR"Returns a pointer to the widget that is currently grabbing the mouse input..PPIf no widget in this application is currently grabbing the mouse, 0 is returned..PPSee also: grabMouse() and keyboardGrabber()..SH "void QWidget::mouseMoveEvent ( QMouseEvent * ) \fC[virtual protected]\fR"This event handler can be reimplemented in a subclass to receive mouse move events for the widget..PPIf mouse tracking is switched off, mouse move events only occur if a mouse button is down while the mouse is being moved. If mouse tracking is switched on, mouse move events occur even if no mouse button is down..PPQMouseEvent::pos() reports the position of the mouse cursor, relative to this widget. For press and release events, the position is usually the same as the position of the last mouse move event, but it might be different if the user moves and clicks the mouse fast. This is a feature of the underlying window system, not Qt..PPSee also: setMouseTracking(), mousePressEvent(), mouseReleaseEvent(), mouseDoubleClickEvent(), event() and QMouseEvent..PPReimplemented in QMenuBar, QDial, QListBox, QSlider, QScrollBar, QButton, QPopupMenu, QMultiLineEdit, QSizeGrip, QLineEdit and QComboBox..SH "void QWidget::mousePressEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"This event handler can be reimplemented in a subclass to receive mouse press events for the widget..PPIf you create new widgets in the mousePressEvent() the mouseReleaseEvent() may not end up where you expect, depending on the underlying window system (or X11 window manager), the widgets' location and maybe more..PPThe default implementation implements the closing of popup widgets when you click outside the window. For other widget types it does nothing..PPSee also: mouseReleaseEvent(), mouseDo

⌨️ 快捷键说明

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