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

📄 qwidget.h

📁 奇趣公司比较新的qt/emd版本
💻 H
📖 第 1 页 / 共 3 页
字号:
/******************************************************************************** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.**** This file is part of the QtGui module of the Qt Toolkit.**** This file may be used under the terms of the GNU General Public** License version 2.0 as published by the Free Software Foundation** and appearing in the file LICENSE.GPL included in the packaging of** this file.  Please review the following information to ensure GNU** General Public Licensing requirements will be met:** http://trolltech.com/products/qt/licenses/licensing/opensource/**** If you are unsure which license is appropriate for your use, please** review the following information:** http://trolltech.com/products/qt/licenses/licensing/licensingoverview** or contact the sales department at sales@trolltech.com.**** In addition, as a special exception, Trolltech gives you certain** additional rights. These rights are described in the Trolltech GPL** Exception version 1.0, which can be found at** http://www.trolltech.com/products/qt/gplexception/ and in the file** GPL_EXCEPTION.txt in this package.**** In addition, as a special exception, Trolltech, as the sole copyright** holder for Qt Designer, grants users of the Qt/Eclipse Integration** plug-in the right for the Qt/Eclipse Integration to link to** functionality provided by Qt Designer and its related libraries.**** Trolltech reserves all rights not expressly granted herein.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.******************************************************************************/#ifndef QWIDGET_H#define QWIDGET_H#include <QtGui/qwindowdefs.h>#include <QtCore/qobject.h>#include <QtGui/qpaintdevice.h>#include <QtGui/qpalette.h>#include <QtGui/qfont.h>#include <QtGui/qfontmetrics.h>#include <QtGui/qfontinfo.h>#include <QtGui/qsizepolicy.h>#include <QtGui/qregion.h>#include <QtGui/qbrush.h>#include <QtGui/qcursor.h>#include <QtGui/qkeysequence.h>#ifdef QT_INCLUDE_COMPAT#include <QtGui/qevent.h>#endifQT_BEGIN_HEADERQT_MODULE(Gui)class QLayout;class QWSRegionManager;class QStyle;class QAction;class QVariant;class QActionEvent;class QMouseEvent;class QWheelEvent;class QHoverEvent;class QKeyEvent;class QFocusEvent;class QPaintEvent;class QMoveEvent;class QResizeEvent;class QCloseEvent;class QContextMenuEvent;class QInputMethodEvent;class QTabletEvent;class QDragEnterEvent;class QDragMoveEvent;class QDragLeaveEvent;class QDropEvent;class QShowEvent;class QHideEvent;class QInputContext;class QIcon;class QWindowSurface;class QLocale;#if defined(Q_WS_X11)class QX11Info;#endifclass QWidgetData{public:    WId winid;    uint widget_attributes;    Qt::WindowFlags window_flags;    uint window_state : 4;    uint focus_policy : 4;    uint sizehint_forced :1;    uint is_closing :1;    uint in_show : 1;    uint in_set_window_state : 1;    mutable uint fstrut_dirty : 1;    uint context_menu_policy : 3;    uint window_modality : 2;    uint in_destructor : 1;    uint unused : 13;    QRect crect;    mutable QPalette pal;    QFont fnt;#if defined(Q_WS_QWS)//    QRegion req_region;                 // Requested region//     mutable QRegion paintable_region;   // Paintable region//     mutable bool paintable_region_dirty;// needs to be recalculated//     mutable QRegion alloc_region;       // Allocated region//     mutable bool alloc_region_dirty;    // needs to be recalculated//     mutable int overlapping_children;   // Handle overlapping children    int alloc_region_index;//    int alloc_region_revision;#endif    QRect wrect;};class QWidgetPrivate;class Q_GUI_EXPORT QWidget : public QObject, public QPaintDevice{    Q_OBJECT    Q_DECLARE_PRIVATE(QWidget)    Q_PROPERTY(bool modal READ isModal)    Q_PROPERTY(Qt::WindowModality windowModality READ windowModality WRITE setWindowModality)    Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled)    Q_PROPERTY(QRect geometry READ geometry WRITE setGeometry)    Q_PROPERTY(QRect frameGeometry READ frameGeometry)    Q_PROPERTY(QRect normalGeometry READ normalGeometry)    Q_PROPERTY(int x READ x)    Q_PROPERTY(int y READ y)    Q_PROPERTY(QPoint pos READ pos WRITE move DESIGNABLE false STORED false)    Q_PROPERTY(QSize frameSize READ frameSize)    Q_PROPERTY(QSize size READ size WRITE resize DESIGNABLE false STORED false)    Q_PROPERTY(int width READ width)    Q_PROPERTY(int height READ height)    Q_PROPERTY(QRect rect READ rect)    Q_PROPERTY(QRect childrenRect READ childrenRect)    Q_PROPERTY(QRegion childrenRegion READ childrenRegion)    Q_PROPERTY(QSizePolicy sizePolicy READ sizePolicy WRITE setSizePolicy)    Q_PROPERTY(QSize minimumSize READ minimumSize WRITE setMinimumSize)    Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)    Q_PROPERTY(int minimumWidth READ minimumWidth WRITE setMinimumWidth STORED false DESIGNABLE false)    Q_PROPERTY(int minimumHeight READ minimumHeight WRITE setMinimumHeight STORED false DESIGNABLE false)    Q_PROPERTY(int maximumWidth READ maximumWidth WRITE setMaximumWidth STORED false DESIGNABLE false)    Q_PROPERTY(int maximumHeight READ maximumHeight WRITE setMaximumHeight STORED false DESIGNABLE false)    Q_PROPERTY(QSize sizeIncrement READ sizeIncrement WRITE setSizeIncrement)    Q_PROPERTY(QSize baseSize READ baseSize WRITE setBaseSize)    Q_PROPERTY(QPalette palette READ palette WRITE setPalette)    Q_PROPERTY(QFont font READ font WRITE setFont)#ifndef QT_NO_CURSOR    Q_PROPERTY(QCursor cursor READ cursor WRITE setCursor RESET unsetCursor)#endif    Q_PROPERTY(bool mouseTracking READ hasMouseTracking WRITE setMouseTracking)    Q_PROPERTY(bool isActiveWindow READ isActiveWindow)    Q_PROPERTY(Qt::FocusPolicy focusPolicy READ focusPolicy WRITE setFocusPolicy)    Q_PROPERTY(bool focus READ hasFocus)    Q_PROPERTY(Qt::ContextMenuPolicy contextMenuPolicy READ contextMenuPolicy WRITE setContextMenuPolicy)    Q_PROPERTY(bool updatesEnabled READ updatesEnabled WRITE setUpdatesEnabled DESIGNABLE false)    Q_PROPERTY(bool visible READ isVisible WRITE setVisible DESIGNABLE false)    Q_PROPERTY(bool minimized READ isMinimized)    Q_PROPERTY(bool maximized READ isMaximized)    Q_PROPERTY(bool fullScreen READ isFullScreen)    Q_PROPERTY(QSize sizeHint READ sizeHint)    Q_PROPERTY(QSize minimumSizeHint READ minimumSizeHint)    Q_PROPERTY(bool acceptDrops READ acceptDrops WRITE setAcceptDrops)    Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle DESIGNABLE isWindow)    Q_PROPERTY(QIcon windowIcon READ windowIcon WRITE setWindowIcon DESIGNABLE isWindow)    Q_PROPERTY(QString windowIconText READ windowIconText WRITE setWindowIconText DESIGNABLE isWindow)    Q_PROPERTY(double windowOpacity READ windowOpacity WRITE setWindowOpacity DESIGNABLE isWindow)    Q_PROPERTY(bool windowModified READ isWindowModified WRITE setWindowModified DESIGNABLE isWindow)#ifndef QT_NO_TOOLTIP    Q_PROPERTY(QString toolTip READ toolTip WRITE setToolTip)#endif#ifndef QT_NO_STATUSTIP    Q_PROPERTY(QString statusTip READ statusTip WRITE setStatusTip)#endif#ifndef QT_NO_WHATSTHIS    Q_PROPERTY(QString whatsThis READ whatsThis WRITE setWhatsThis)#endif#ifndef QT_NO_ACCESSIBILITY    Q_PROPERTY(QString accessibleName READ accessibleName WRITE setAccessibleName)    Q_PROPERTY(QString accessibleDescription READ accessibleDescription WRITE setAccessibleDescription)#endif    Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection RESET unsetLayoutDirection)    QDOC_PROPERTY(Qt::WindowFlags windowFlags READ windowFlags WRITE setWindowFlags)    Q_PROPERTY(bool autoFillBackground READ autoFillBackground WRITE setAutoFillBackground)#ifndef QT_NO_STYLE_STYLESHEET    Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)#endif    Q_PROPERTY(QLocale locale READ locale WRITE setLocale RESET unsetLocale)public:    enum RenderFlag {        DrawWindowBackground = 0x1,        DrawChildren = 0x2,        IgnoreMask = 0x4    };    Q_DECLARE_FLAGS(RenderFlags, RenderFlag)    explicit QWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);#ifdef QT3_SUPPORT    QT3_SUPPORT_CONSTRUCTOR QWidget(QWidget* parent, const char *name, Qt::WindowFlags f = 0);#endif    ~QWidget();    int devType() const;    WId winId() const;    void createWinId(); // internal, going away    inline WId internalWinId() const { return data->winid; }    // GUI style setting    QStyle *style() const;    void setStyle(QStyle *);    // Widget types and states    bool isTopLevel() const;    bool isWindow() const;    bool isModal() const;    Qt::WindowModality windowModality() const;    void setWindowModality(Qt::WindowModality windowModality);    bool isEnabled() const;    bool isEnabledTo(QWidget*) const;    bool isEnabledToTLW() const;public Q_SLOTS:    void setEnabled(bool);    void setDisabled(bool);    void setWindowModified(bool);    // Widget coordinatespublic:    QRect frameGeometry() const;    const QRect &geometry() const;    QRect normalGeometry() const;    int x() const;    int y() const;    QPoint pos() const;    QSize frameSize() const;    QSize size() const;    inline int width() const;    inline int height() const;    inline QRect rect() const;    QRect childrenRect() const;    QRegion childrenRegion() const;    QSize minimumSize() const;    QSize maximumSize() const;    int minimumWidth() const;    int minimumHeight() const;    int maximumWidth() const;    int maximumHeight() const;    void setMinimumSize(const QSize &);    void setMinimumSize(int minw, int minh);    void setMaximumSize(const QSize &);    void setMaximumSize(int maxw, int maxh);    void setMinimumWidth(int minw);    void setMinimumHeight(int minh);    void setMaximumWidth(int maxw);    void setMaximumHeight(int maxh);    QSize sizeIncrement() const;    void setSizeIncrement(const QSize &);    void setSizeIncrement(int w, int h);    QSize baseSize() const;    void setBaseSize(const QSize &);    void setBaseSize(int basew, int baseh);    void setFixedSize(const QSize &);    void setFixedSize(int w, int h);    void setFixedWidth(int w);    void setFixedHeight(int h);    // Widget coordinate mapping    QPoint mapToGlobal(const QPoint &) const;    QPoint mapFromGlobal(const QPoint &) const;    QPoint mapToParent(const QPoint &) const;    QPoint mapFromParent(const QPoint &) const;    QPoint mapTo(QWidget *, const QPoint &) const;    QPoint mapFrom(QWidget *, const QPoint &) const;    QWidget *window() const;    inline QWidget *topLevelWidget() const { return window(); }    // Widget appearance functions    const QPalette &palette() const;    void setPalette(const QPalette &);    void setBackgroundRole(QPalette::ColorRole);    QPalette::ColorRole backgroundRole() const;    void setForegroundRole(QPalette::ColorRole);    QPalette::ColorRole foregroundRole() const;    const QFont &font() const;    void setFont(const QFont &);    QFontMetrics fontMetrics() const;    QFontInfo fontInfo() const;#ifndef QT_NO_CURSOR    QCursor cursor() const;    void setCursor(const QCursor &);    void unsetCursor();#endif    void setMouseTracking(bool enable);    bool hasMouseTracking() const;    bool underMouse() const;    void setMask(const QBitmap &);    void setMask(const QRegion &);    QRegion mask() const;    void clearMask();    void render(QPaintDevice *target, const QPoint &targetOffset = QPoint(),                const QRegion &sourceRegion = QRegion(),                RenderFlags renderFlags = RenderFlags(DrawWindowBackground | DrawChildren));public Q_SLOTS:    void setWindowTitle(const QString &);

⌨️ 快捷键说明

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