diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.h | 1 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicslayout.h | 2 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicslayoutitem.h | 2 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicswidget.cpp | 54 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicswidget.h | 1 | ||||
-rw-r--r-- | src/gui/kernel/qaction.h | 30 | ||||
-rw-r--r-- | src/gui/kernel/qevent.cpp | 41 | ||||
-rw-r--r-- | src/gui/kernel/qevent.h | 5 | ||||
-rw-r--r-- | src/gui/kernel/qevent_p.h | 6 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 4 | ||||
-rw-r--r-- | src/gui/math3d/qgenericmatrix.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 4 | ||||
-rw-r--r-- | src/gui/painting/qdrawutil.cpp | 39 | ||||
-rw-r--r-- | src/gui/painting/qpainterpath.cpp | 2 | ||||
-rw-r--r-- | src/gui/styles/qstyle.cpp | 1 | ||||
-rw-r--r-- | src/gui/text/qtextcontrol_p.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/qbuttongroup.cpp | 13 |
17 files changed, 170 insertions, 39 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h index f6ee197..e398dcf 100644 --- a/src/gui/graphicsview/qgraphicsitem.h +++ b/src/gui/graphicsview/qgraphicsitem.h @@ -436,6 +436,7 @@ private: }; Q_DECLARE_OPERATORS_FOR_FLAGS(QGraphicsItem::GraphicsItemFlags) +Q_DECLARE_INTERFACE(QGraphicsItem, "com.trolltech.Qt.QGraphicsItem") inline void QGraphicsItem::setPos(qreal ax, qreal ay) { setPos(QPointF(ax, ay)); } diff --git a/src/gui/graphicsview/qgraphicslayout.h b/src/gui/graphicsview/qgraphicslayout.h index fad6c3bb..a5f2884 100644 --- a/src/gui/graphicsview/qgraphicslayout.h +++ b/src/gui/graphicsview/qgraphicslayout.h @@ -85,6 +85,8 @@ private: friend class QGraphicsWidget; }; +Q_DECLARE_INTERFACE(QGraphicsLayout, "com.trolltech.Qt.QGraphicsLayout") + #endif QT_END_NAMESPACE diff --git a/src/gui/graphicsview/qgraphicslayoutitem.h b/src/gui/graphicsview/qgraphicslayoutitem.h index 31f5d90..0ff3acc 100644 --- a/src/gui/graphicsview/qgraphicslayoutitem.h +++ b/src/gui/graphicsview/qgraphicslayoutitem.h @@ -121,6 +121,8 @@ private: friend class QGraphicsLayout; }; +Q_DECLARE_INTERFACE(QGraphicsLayoutItem, "com.trolltech.Qt.QGraphicsLayoutItem") + inline void QGraphicsLayoutItem::setMinimumSize(qreal aw, qreal ah) { setMinimumSize(QSizeF(aw, ah)); } inline void QGraphicsLayoutItem::setPreferredSize(qreal aw, qreal ah) diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp index 3296aee..8d6d880 100644 --- a/src/gui/graphicsview/qgraphicswidget.cpp +++ b/src/gui/graphicsview/qgraphicswidget.cpp @@ -170,14 +170,54 @@ QT_BEGIN_NAMESPACE */ /*! - \property QGraphicsWidget::enabled - \brief whether the item is enabled or not + \property QGraphicsWidget::xScale + \brief the x scale factor - This property is declared in QGraphicsItem. + This property is declared in QGraphicsItem. + \sa QGraphicsItem::xScale(), QGraphicsItem::setXScale() + */ - By default, this property is true. +/*! + \property QGraphicsWidget::yScale + \brief the y scale factor + + This property is declared in QGraphicsItem. + \sa QGraphicsItem::yScale(), QGraphicsItem::setYScale() +*/ + +/*! + \property QGraphicsWidget::zRotation + \brief the z rotation angle + + This property is declared in QGraphicsItem. + \sa QGraphicsItem::zRotation(), QGraphicsItem::setZRotation() +*/ + +/*! + \property QGraphicsWidget::xRotation + \brief the x rotation angle + + This property is declared in QGraphicsItem. + \sa QGraphicsItem::xRotation(), QGraphicsItem::setXRotation() +*/ + +/*! + \property QGraphicsWidget::yRotation + \brief the y rotation angle. + + This property is declared in QGraphicsItem. + \sa QGraphicsItem::yRotation(), QGraphicsItem::setYRotation() +*/ + +/*! + \property QGraphicsWidget::enabled + \brief whether the item is enabled or not + + This property is declared in QGraphicsItem. + + By default, this property is true. - \sa QGraphicsItem::isEnabled(), QGraphicsItem::setEnabled() + \sa QGraphicsItem::isEnabled(), QGraphicsItem::setEnabled() */ /*! @@ -339,7 +379,7 @@ QGraphicsWidget::~QGraphicsWidget() //we check if we have a layout previously if (d->layout) { - delete d->layout; + QGraphicsLayout *temp = d->layout; foreach (QGraphicsItem * item, childItems()) { // In case of a custom layout which doesn't remove and delete items, we ensure that // the parent layout item does not point to the deleted layout. This code is here to @@ -350,6 +390,8 @@ QGraphicsWidget::~QGraphicsWidget() widget->setParentLayoutItem(0); } } + d->layout = 0; + delete temp; } // Remove this graphics widget from widgetStyles diff --git a/src/gui/graphicsview/qgraphicswidget.h b/src/gui/graphicsview/qgraphicswidget.h index a5c9068..1a835df 100644 --- a/src/gui/graphicsview/qgraphicswidget.h +++ b/src/gui/graphicsview/qgraphicswidget.h @@ -69,6 +69,7 @@ class QGraphicsWidgetPrivate; class Q_GUI_EXPORT QGraphicsWidget : public QObject, public QGraphicsItem, public QGraphicsLayoutItem { Q_OBJECT + Q_INTERFACES(QGraphicsItem QGraphicsLayoutItem) Q_PROPERTY(QPalette palette READ palette WRITE setPalette) Q_PROPERTY(QFont font READ font WRITE setFont) Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection RESET unsetLayoutDirection) diff --git a/src/gui/kernel/qaction.h b/src/gui/kernel/qaction.h index d7bf8c3..ffc6fe8 100644 --- a/src/gui/kernel/qaction.h +++ b/src/gui/kernel/qaction.h @@ -67,24 +67,24 @@ class Q_GUI_EXPORT QAction : public QObject Q_DECLARE_PRIVATE(QAction) Q_ENUMS(MenuRole) - Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable) + Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable NOTIFY changed) Q_PROPERTY(bool checked READ isChecked WRITE setChecked DESIGNABLE isCheckable NOTIFY toggled) - Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled) - Q_PROPERTY(QIcon icon READ icon WRITE setIcon) - Q_PROPERTY(QString text READ text WRITE setText) - Q_PROPERTY(QString iconText READ iconText WRITE setIconText) - Q_PROPERTY(QString toolTip READ toolTip WRITE setToolTip) - Q_PROPERTY(QString statusTip READ statusTip WRITE setStatusTip) - Q_PROPERTY(QString whatsThis READ whatsThis WRITE setWhatsThis) - Q_PROPERTY(QFont font READ font WRITE setFont) + Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY changed) + Q_PROPERTY(QIcon icon READ icon WRITE setIcon NOTIFY changed) + Q_PROPERTY(QString text READ text WRITE setText NOTIFY changed) + Q_PROPERTY(QString iconText READ iconText WRITE setIconText NOTIFY changed) + Q_PROPERTY(QString toolTip READ toolTip WRITE setToolTip NOTIFY changed) + Q_PROPERTY(QString statusTip READ statusTip WRITE setStatusTip NOTIFY changed) + Q_PROPERTY(QString whatsThis READ whatsThis WRITE setWhatsThis NOTIFY changed) + Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY changed) #ifndef QT_NO_SHORTCUT - Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut) - Q_PROPERTY(Qt::ShortcutContext shortcutContext READ shortcutContext WRITE setShortcutContext) - Q_PROPERTY(bool autoRepeat READ autoRepeat WRITE setAutoRepeat) + Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut NOTIFY changed) + Q_PROPERTY(Qt::ShortcutContext shortcutContext READ shortcutContext WRITE setShortcutContext NOTIFY changed) + Q_PROPERTY(bool autoRepeat READ autoRepeat WRITE setAutoRepeat NOTIFY changed) #endif - Q_PROPERTY(bool visible READ isVisible WRITE setVisible) - Q_PROPERTY(MenuRole menuRole READ menuRole WRITE setMenuRole) - Q_PROPERTY(bool iconVisibleInMenu READ isIconVisibleInMenu WRITE setIconVisibleInMenu) + Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY changed) + Q_PROPERTY(MenuRole menuRole READ menuRole WRITE setMenuRole NOTIFY changed) + Q_PROPERTY(bool iconVisibleInMenu READ isIconVisibleInMenu WRITE setIconVisibleInMenu NOTIFY changed) public: enum MenuRole { NoRole, TextHeuristicRole, ApplicationSpecificRole, AboutQtRole, diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index a59e870..8c8911e 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -49,6 +49,7 @@ #include "qmime.h" #include "qdnd_p.h" #include "qevent_p.h" +#include "qdatetime.h" QT_BEGIN_NAMESPACE @@ -226,6 +227,17 @@ QMouseEvent *QMouseEvent::createExtendedMouseEvent(Type type, const QPointF &pos } /*! + \internal +*/ +QMouseEvent *QMouseEvent::createExtendedMouseEvent(Type type, const QPointF &pos, + const QPoint &globalPos, Qt::MouseButton button, + Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, + const QDateTime &eventTime) +{ + return new QMouseEventEx(type, pos, globalPos, button, buttons, modifiers, eventTime); +} + +/*! \fn bool QMouseEvent::hasExtendedInfo() const \internal */ @@ -247,13 +259,40 @@ QPointF QMouseEvent::posF() const return hasExtendedInfo() ? reinterpret_cast<const QMouseEventEx *>(this)->posF : QPointF(pos()); } +/*! + \since 4.6 + + Returns the time the mouse event occurred. On many systems and platforms + this is equivalent to QDateTime::currentDateTime(). +*/ +QDateTime QMouseEvent::eventDateTime() const +{ + if(hasExtendedInfo() && reinterpret_cast<const QMouseEventEx *>(this)->timeSet) { + return reinterpret_cast<const QMouseEventEx *>(this)->time; + } else { + return QDateTime::currentDateTime(); + } +} + /*! \internal */ QMouseEventEx::QMouseEventEx(Type type, const QPointF &pos, const QPoint &globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers) - : QMouseEvent(type, pos.toPoint(), globalPos, button, buttons, modifiers), posF(pos) + : QMouseEvent(type, pos.toPoint(), globalPos, button, buttons, modifiers), posF(pos), timeSet(false) +{ + d = reinterpret_cast<QEventPrivate *>(this); +} + +/*! + \internal +*/ +QMouseEventEx::QMouseEventEx(Type type, const QPointF &pos, const QPoint &globalPos, + Qt::MouseButton button, Qt::MouseButtons buttons, + Qt::KeyboardModifiers modifiers, + const QDateTime &eventTime) + : QMouseEvent(type, pos.toPoint(), globalPos, button, buttons, modifiers), posF(pos), timeSet(true), time(eventTime) { d = reinterpret_cast<QEventPrivate *>(this); } diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 449730d..150e139 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -93,8 +93,13 @@ public: static QMouseEvent *createExtendedMouseEvent(Type type, const QPointF &pos, const QPoint &globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers); + static QMouseEvent *createExtendedMouseEvent(Type type, const QPointF &pos, + const QPoint &globalPos, Qt::MouseButton button, + Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, + const QDateTime &eventTime); inline bool hasExtendedInfo() const { return reinterpret_cast<const QMouseEvent *>(d) == this; } QPointF posF() const; + QDateTime eventDateTime() const; #ifdef QT3_SUPPORT QT3_SUPPORT_CONSTRUCTOR QMouseEvent(Type type, const QPoint &pos, Qt::ButtonState button, int state); diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h index 8e762d6..484f335 100644 --- a/src/gui/kernel/qevent_p.h +++ b/src/gui/kernel/qevent_p.h @@ -43,6 +43,7 @@ #define QEVENT_P_H #include <QtCore/qglobal.h> +#include <QtCore/qdatetime.h> QT_BEGIN_NAMESPACE @@ -82,10 +83,15 @@ public: QMouseEventEx(Type type, const QPointF &pos, const QPoint &globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers); + QMouseEventEx(Type type, const QPointF &pos, const QPoint &globalPos, + Qt::MouseButton button, Qt::MouseButtons buttons, + Qt::KeyboardModifiers modifiers, const QDateTime &eventTime); ~QMouseEventEx(); protected: QPointF posF; + bool timeSet:1; + QDateTime time; friend class QMouseEvent; }; diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 6026821..71c2f2b 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -5857,7 +5857,7 @@ QWidget *QWidget::focusWidget() const /*! Returns the next widget in this widget's focus chain. - \sa previousInFocusChain + \sa previousInFocusChain() */ QWidget *QWidget::nextInFocusChain() const { @@ -5867,7 +5867,7 @@ QWidget *QWidget::nextInFocusChain() const /*! Returns the previous widget in this widget's focus chain. - \sa nextInFocusChain + \sa nextInFocusChain() \since 4.6 */ diff --git a/src/gui/math3d/qgenericmatrix.cpp b/src/gui/math3d/qgenericmatrix.cpp index 6ecd878..61df367 100644 --- a/src/gui/math3d/qgenericmatrix.cpp +++ b/src/gui/math3d/qgenericmatrix.cpp @@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE But they can be different if the user wants to store elements internally in a fixed-point format for the underlying hardware. - \sa QMatrix4x4, QFixedPt + \sa QMatrix4x4 */ /*! diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 0d1da54..4983b12 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -6958,11 +6958,11 @@ void qt_build_pow_tables() { #endif #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) - const qreal gray_gamma = 2.31; + const qreal gray_gamma = qreal(2.31); for (int i=0; i<256; ++i) qt_pow_gamma[i] = uint(qRound(pow(i / qreal(255.), gray_gamma) * 2047)); for (int i=0; i<2048; ++i) - qt_pow_invgamma[i] = uchar(qRound(pow(i / 2047.0, 1 / gray_gamma) * 255)); + qt_pow_invgamma[i] = uchar(qRound(pow(i / qreal(2047.), 1 / gray_gamma) * 255)); #endif } diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp index 230d30b..f4acd5f 100644 --- a/src/gui/painting/qdrawutil.cpp +++ b/src/gui/painting/qdrawutil.cpp @@ -1039,28 +1039,58 @@ void qDrawItem(QPainter *p, Qt::GUIStyle gs, #endif /*! - \struct QMargins + \class QMargins \since 4.6 Holds the borders used to split a pixmap into nine segments in order to draw it, similar to \l{http://www.w3.org/TR/css3-background/} {CSS3 border-images}. - \sa qDrawBorderPixmap, Qt::TileRule, QTileRules + \sa qDrawBorderPixmap(), Qt::TileRule, QTileRules */ /*! - \struct QTileRules + \fn QMargins::QMargins(int margin) + + Constructs an instance of QMargins setting all four + margins to \a margin. + */ + +/*! + \fn QMargins::QMargins(int topMargin, int leftMargin, int bottomMargin, int rightMargin) + + Constructs an instance of QMargins setting the four + margins to \a topMargin, \a leftMargin, \a bottomMargin, + and \a rightMargin. + */ + +/*! + \class QTileRules \since 4.6 Holds the rules used to draw a pixmap or image split into nine segments, similar to \l{http://www.w3.org/TR/css3-background/}{CSS3 border-images}. - \sa qDrawBorderPixmap, Qt::TileRule, QMargins + \sa qDrawBorderPixmap(), Qt::TileRule, QMargins +*/ + +/*! + \fn QTileRules::QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule) + + Constructs an instance of QTileRules from the \a horizontalRule + and the \a verticalRule. +*/ + +/*! + \fn QTileRules::QTileRules(Qt::TileRule rule) + + Constructs an instance of QTileRules setting both the + horizontal and vertical rules to \a rule. */ /*! \fn qDrawBorderPixmap(QPainter *painter, const QRect &target, const QMargins &margins, const QPixmap &pixmap) + \relates QMargins \since 4.6 Draws the given \a pixmap into the given \a target rectangle, using the @@ -1150,6 +1180,7 @@ static inline void qDrawHorizontallyRoundedPixmap(QPainter *painter, const QRect /*! \since 4.6 + \relates QMargins Draws the indicated \a sourceRect rectangle from the given \a pixmap into the given \a targetRect rectangle, using the given \a painter. The pixmap diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index e1bb317..986770d 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -2049,7 +2049,7 @@ QPainterPath QPainterPath::translated(qreal dx, qreal dy) const } /*! - \fn void QPainterPath::translated(const QPointF &offset) + \fn void QPainterPath::translated(const QPointF &offset) const \overload \since 4.6 diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp index 3fab682..45be9a8 100644 --- a/src/gui/styles/qstyle.cpp +++ b/src/gui/styles/qstyle.cpp @@ -1179,6 +1179,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value SC_All Special value that matches all sub-controls. \omitvalue SC_Q3ListViewBranch + \omitvalue SC_CustomBase \sa ComplexControl */ diff --git a/src/gui/text/qtextcontrol_p.h b/src/gui/text/qtextcontrol_p.h index 4dac4f7..e50540a 100644 --- a/src/gui/text/qtextcontrol_p.h +++ b/src/gui/text/qtextcontrol_p.h @@ -83,7 +83,7 @@ class QAbstractScrollArea; class QEvent; class QTimerEvent; -class Q_AUTOTEST_EXPORT QTextControl : public QObject +class Q_GUI_EXPORT QTextControl : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QTextControl) diff --git a/src/gui/widgets/qbuttongroup.cpp b/src/gui/widgets/qbuttongroup.cpp index ebfafe3..8da97bb 100644 --- a/src/gui/widgets/qbuttongroup.cpp +++ b/src/gui/widgets/qbuttongroup.cpp @@ -178,10 +178,11 @@ /*! \fn void QButtonGroup::addButton(QAbstractButton *button); - Adds the given \a button to the end of the group's internal list of buttons. - An \a id will be assigned to the button by this QButtonGroup. Automatically - assigned ids are guaranteed to be negative, starting with -2. If you are also - assigning your own ids, use positive values to avoid conflicts. + Adds the given \a button to the end of the group's internal list + of buttons. An id will be assigned to the button by this + QButtonGroup. Automatically assigned ids are guaranteed to be + negative, starting with -2. If you are also assigning your own + ids, use positive values to avoid conflicts. \sa removeButton() buttons() */ @@ -189,8 +190,8 @@ /*! \fn void QButtonGroup::addButton(QAbstractButton *button, int id); - Adds the given \a button to the button group, with the given \a - id. It is recommended to assign only positive ids. + Adds the given \a button to the button group, with the given + \a id. It is recommended to assign only positive ids. \sa removeButton() buttons() */ |