qt界面基类

2018/08/07 14:25
阅读数 47
QWidgets

所有用户界面对象的基类。
Header: #include
qmake: QT += widgets

内容 函数名
窗口函数 show(),hide(),raise()//顶层,lower()//底层,close()
顶层窗口 windowModified, windowTitle, windowIcon, isActiveWindow, activateWindow(), minimized, showMinimized(), maximized, showMaximized(), fullScreen, showFullScreen(), showNormal().
窗口内容 update(), repaint(), scroll().//update()不会立即进行重绘事件,有一个事件循环,不会像repaint()那样发生闪烁
常规 pos, x(), y(), rect, size, width(), height(), move(), resize(), sizePolicy, sizeHint(), minimumSizeHint(), updateGeometry(), layout(), frameGeometry, geometry, childrenRect, childrenRegion, adjustSize(), mapFromGlobal(), mapToGlobal(), mapFromParent(), mapToParent(), maximumSize, minimumSize, sizeIncrement, baseSize, setFixedSize()
模式 visible, isVisibleTo(), enabled, isEnabledTo(), modal, isWindow(), mouseTracking, updatesEnabled, visibleRegion().
style style(), setStyle(), styleSheet, cursor, font, palette, backgroundRole(), setBackgroundRole(), fontInfo(), fontMetrics().
焦点 focus, focusPolicy, setFocus(), clearFocus(), setTabOrder(), setFocusProxy(), focusNextChild(), focusPreviousChild().
事件 event(), mousePressEvent(), mouseReleaseEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), keyPressEvent(), keyReleaseEvent(), focusInEvent(), focusOutEvent(), wheelEvent(), enterEvent(), leaveEvent(), paintEvent(), moveEvent(), resizeEvent(), closeEvent(), dragEnterEvent(), dragMoveEvent(), dragLeaveEvent(), dropEvent(), childEvent(), showEvent(), hideEvent(), customEvent(). changeEvent()
系统函数 parentWidget(), window(), setParent(), winId(), find(), metric().
提示 setToolTip(), setWhatsThis()
slots
bool    close()
void    hide()
void    lower()
void    raise()
void    repaint()
void    setDisabled(bool disable)
void    setEnabled(bool)
void    setFocus()
void    setHidden(bool hidden)
void    setStyleSheet(const QString &styleSheet)
virtual void    setVisible(bool visible)
void    setWindowModified(bool)
void    setWindowTitle(const QString &)
void    show()
void    showFullScreen()
void    showMaximized()
void    showMinimized()
void    showNormal()
void    update()
protect function大部分可重写virtual
virtual void    actionEvent(QActionEvent *event)
virtual void    changeEvent(QEvent *event)
virtual void    closeEvent(QCloseEvent *event)
virtual void    contextMenuEvent(QContextMenuEvent *event)
void    create(WId window = 0, 
void    destroy(bool destroyWindow = true, bool destroySubWindows = true)
virtual void    dragEnterEvent(QDragEnterEvent *event)
virtual void    dragLeaveEvent(QDragLeaveEvent *event)
virtual void    dragMoveEvent(QDragMoveEvent *event)
virtual void    dropEvent(QDropEvent *event)
virtual void    enterEvent(QEvent *event)
virtual void    focusInEvent(QFocusEvent *event)
virtual bool    focusNextPrevChild(bool next)
virtual void    focusOutEvent(QFocusEvent *event)
bool    focusPreviousChild()
virtual void    hideEvent(QHideEvent *event)
virtual void    inputMethodEvent(QInputMethodEvent *event)
virtual void    keyPressEvent(QKeyEvent *event)
virtual void    keyReleaseEvent(QKeyEvent *event)
virtual void    leaveEvent(QEvent *event)
virtual void    mouseDoubleClickEvent(QMouseEvent *event)
virtual void    mouseMoveEvent(QMouseEvent *event)
virtual void    mousePressEvent(QMouseEvent *event)
virtual void    mouseReleaseEvent(QMouseEvent *event)
virtual void    moveEvent(QMoveEvent *event)
virtual bool    nativeEvent(const QByteArray &eventType, void *message, long *result)
virtual void    paintEvent(QPaintEvent *event)
virtual void    resizeEvent(QResizeEvent *event)
virtual void    showEvent(QShowEvent *event)
virtual void    tabletEvent(QTabletEvent *event)
virtual void    wheelEvent(QWheelEvent *event)
QDialog

对话窗口的基类
Header: #include
qmake: QT += widgets

public Types
enum    DialogCode { Accepted, Rejected }
Public Functions
QDialog(QWidget *parent = nullptr, Qt::WindowFlags f = ...)
virtual ~QDialog()
bool    isSizeGripEnabled() const
int result() const
void    setModal(bool modal)
void    setResult(int i)
void    setSizeGripEnabled(bool)
Public Slots
virtual void    accept()
virtual void    done(int r)
virtual int exec()
virtual void    open()
virtual void    reject()
Signals
void    accepted()
void    finished(int result)
void    rejected()
QWindow

Header: #include
qmake: QT += gui

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部