📄 qwidget_p.h
字号:
QRegion getOpaqueRegion() const; QRegion getOpaqueChildren() const; void setDirtyOpaqueRegion();#if defined(Q_WIDGET_USE_DIRTYLIST) || (QT_VERSION >= 0x040400) QRegion getOpaqueSiblings() const;#endif QRegion opaqueChildren; bool dirtyOpaqueChildren;#endif enum CloseMode { CloseNoEvent, CloseWithEvent, CloseWithSpontaneousEvent }; bool close_helper(CloseMode mode); bool compositeEvent(QEvent *e); void setWindowIcon_helper(); void setWindowIcon_sys(bool forceReset = false); void focusInputContext();#if defined(Q_WS_X11) void setWindowRole(const char *role); void sendStartupMessage(const char *message) const;#endif#if defined (Q_WS_WIN) void reparentChildren();#endif void scrollChildren(int dx, int dy);#ifndef Q_WS_MAC void dirtyWidget_sys(const QRegion &rgn); void cleanWidget_sys(const QRegion& rgn); void moveRect(const QRect &, int dx, int dy); void scrollRect(const QRect &, int dx, int dy); void invalidateBuffer(const QRegion &); bool isOverlapped(const QRect&) const;# if defined(Q_WS_X11) || (defined(Q_WS_WIN) && defined(Q_WIN_USE_QT_UPDATE_EVENT)) QRegion dirtyOnScreen;# endif#endif void reparentFocusWidgets(QWidget *oldtlw); static int pointToRect(const QPoint &p, const QRect &r); QRect fromOrToLayoutItemRect(const QRect &rect, int sign) const; void setWinId(WId); void showChildren(bool spontaneous); void hideChildren(bool spontaneous); void setParent_sys(QWidget *parent, Qt::WindowFlags); void scroll_sys(int dx, int dy); void scroll_sys(int dx, int dy, const QRect &r); void deactivateWidgetCleanup(); void setGeometry_sys(int, int, int, int, bool);#ifdef Q_WS_MAC void setGeometry_sys_helper(int, int, int, int, bool);#endif void show_recursive(); void show_helper(); void show_sys(); void hide_sys(); void hide_helper(); void _q_showIfNotHidden(); void setEnabled_helper(bool); void registerDropSite(bool); static void adjustFlags(Qt::WindowFlags &flags, QWidget *w = 0); void updateFrameStrut(); QRect frameStrut() const; void setWindowIconText_sys(const QString &cap); void setWindowIconText_helper(const QString &cap); void setWindowTitle_sys(const QString &cap);#ifdef Q_OS_WIN void grabMouseWhileInWindow();#endif#ifndef QT_NO_CURSOR void setCursor_sys(const QCursor &cursor); void unsetCursor_sys();#endif#ifdef Q_WS_MAC void setWindowModified_sys(bool b); void createWindow_sys(); void determineWindowClass(); void initWindowPtr(); void transferChildren();#endif void setWindowTitle_helper(const QString &cap); bool setMinimumSize_helper(int &minw, int &minh); bool setMaximumSize_helper(int &maxw, int &maxh); void setConstraints_sys(); void updateGeometry_helper(bool forceUpdate); void getLayoutItemMargins(int *left, int *top, int *right, int *bottom) const; void setLayoutItemMargins(int left, int top, int right, int bottom); void setLayoutItemMargins(QStyle::SubElement element, const QStyleOption *opt = 0);#if defined(Q_WS_QWS) void moveSurface(QWindowSurface *surface, const QPoint &offset); QRegion localRequestedRegion() const; QRegion localAllocatedRegion() const; void blitToScreen(const QRegion &globalrgn);#ifndef QT_NO_CURSOR void updateCursor() const;#endif QScreen* getScreen() const; friend class QWSManager; friend class QWSManagerPrivate; friend class QDecoration;#endif static int instanceCounter; // Current number of widget instances static int maxInstances; // Maximum number of widget instances#ifdef QT_KEYPAD_NAVIGATION static QPointer<QWidget> editingWidget;#endif QWidgetData data; QWExtra *extra; QWidget *focus_next; QWidget *focus_prev; QWidget *focus_child;#ifndef QT_NO_ACTION QList<QAction*> actions;#endif QLayout *layout;#if !defined(QT_NO_IM) QPointer<QInputContext> ic;#endif // All widgets are initially added into the uncreatedWidgets set. Once // they receive a window id they are removed and added to the mapper static QWidgetMapper *mapper; static QWidgetSet *uncreatedWidgets; short leftmargin, topmargin, rightmargin, bottommargin; signed char leftLayoutItemMargin; signed char topLayoutItemMargin; signed char rightLayoutItemMargin; signed char bottomLayoutItemMargin; // ### TODO: reorganize private/extra/topextra to save memory QPointer<QWidget> compositeChildGrab;#ifndef QT_NO_TOOLTIP QString toolTip;#endif#ifndef QT_NO_STATUSTIP QString statusTip;#endif#ifndef QT_NOWHATSTHIS QString whatsThis;#endif QString accessibleName, accessibleDescription; QPalette::ColorRole fg_role : 8; QPalette::ColorRole bg_role : 8; uint high_attributes[3]; // the low ones are in QWidget::widget_attributes Qt::HANDLE hd;#ifdef Q_RATE_LIMIT_PAINTING int timerId;#endif#if defined(Q_WIDGET_USE_DIRTYLIST) || defined(Q_RATE_LIMIT_PAINTING) QRegion dirty;#endif#if defined(Q_WS_X11) QX11Info xinfo; Qt::HANDLE picture;#endif#if defined(Q_WS_MAC) enum PaintChildrenOPs { PC_None = 0x00, PC_Now = 0x01, PC_NoPaint = 0x04, PC_Later = 0x10 }; EventHandlerRef window_event; bool qt_mac_dnd_event(uint, DragRef); void toggleDrawers(bool); //mac event functions static bool qt_create_root_win(); static void qt_clean_root_win(); static bool qt_recreate_root_win(); static bool qt_mac_update_sizer(QWidget *, int); static OSStatus qt_window_event(EventHandlerCallRef er, EventRef event, void *); static OSStatus qt_widget_event(EventHandlerCallRef er, EventRef event, void *); static bool qt_widget_rgn(QWidget *, short, RgnHandle, bool); // Each wiget keeps a list of all its child and grandchild OpeGL widgets. // This list is used to update the gl context whenever a parent and a granparent // moves, and also to check for intersections with gl widgets within the window // when a widget moves. struct GlWidgetInfo { GlWidgetInfo(QWidget *widget) : widget(widget), lastUpdateWidget(0) { } bool operator==(const GlWidgetInfo &other) const { return (widget == other.widget); } QWidget * widget; QWidget * lastUpdateWidget; }; QList<GlWidgetInfo> glWidgets; //these are here just for code compat (HIViews) QRegion clp; Qt::HANDLE qd_hd; uint clp_serial : 8; inline QRegion clippedRegion(bool = true) { return clp; } inline uint clippedSerial(bool =true) { return clp_serial; } uint needWindowChange : 1; uint isGLWidget : 1;#endif#if defined(Q_WS_X11) || defined (Q_WS_WIN) || defined(Q_WS_MAC) void setWSGeometry(bool dontShow=false); inline QPoint mapToWS(const QPoint &p) const { return p - data.wrect.topLeft(); } inline QPoint mapFromWS(const QPoint &p) const { return p + data.wrect.topLeft(); } inline QRect mapToWS(const QRect &r) const { QRect rr(r); rr.translate(-data.wrect.topLeft()); return rr; } inline QRect mapFromWS(const QRect &r) const { QRect rr(r); rr.translate(data.wrect.topLeft()); return rr; }#endif QPaintEngine *extraPaintEngine; mutable const QMetaObject *polished; void setModal_sys(); QSizePolicy size_policy; QLocale locale;};inline QWExtra *QWidgetPrivate::extraData() const{ return extra;}inline QTLWExtra *QWidgetPrivate::topData() const{ const_cast<QWidgetPrivate *>(this)->createTLExtra(); return extra->topextra;}inline QTLWExtra *QWidgetPrivate::maybeTopData() const{ return extra ? extra->topextra : 0;}#ifndef Q_WS_MACinline QWidgetBackingStore *QWidgetPrivate::maybeBackingStore() const{ Q_Q(const QWidget); QTLWExtra *x = q->window()->d_func()->maybeTopData(); return x ? x->backingStore : 0;}#endif#endif // QWIDGET_P_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -