From 1e60d5513f997ba63a9adfb43d48b194a376bff1 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 30 Jul 2009 17:56:47 +1000 Subject: Sync with master --- src/gui/kernel/qevent.cpp | 41 +--------------------------------------- src/gui/kernel/qevent.h | 5 ----- src/gui/kernel/qevent_p.h | 6 ------ src/gui/painting/qdrawhelper.cpp | 4 ++-- src/gui/painting/qdrawutil.cpp | 2 +- 5 files changed, 4 insertions(+), 54 deletions(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 8046a63..bc3633c 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -49,7 +49,6 @@ #include "qmime.h" #include "qdnd_p.h" #include "qevent_p.h" -#include "qdatetime.h" #include "qgesture.h" QT_BEGIN_NAMESPACE @@ -239,17 +238,6 @@ 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 */ @@ -271,40 +259,13 @@ QPointF QMouseEvent::posF() const return hasExtendedInfo() ? reinterpret_cast(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(this)->timeSet) { - return reinterpret_cast(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), timeSet(false) -{ - d = reinterpret_cast(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) + : QMouseEvent(type, pos.toPoint(), globalPos, button, buttons, modifiers), posF(pos) { d = reinterpret_cast(this); } diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index da73c72..11843cb 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -97,13 +97,8 @@ 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(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 92cd9e4..67441ea 100644 --- a/src/gui/kernel/qevent_p.h +++ b/src/gui/kernel/qevent_p.h @@ -43,7 +43,6 @@ #define QEVENT_P_H #include -#include #include QT_BEGIN_NAMESPACE @@ -84,15 +83,10 @@ 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/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 5d59a44..979390a 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 = qreal(2.31); + const qreal gray_gamma = 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 / qreal(2047.), 1 / gray_gamma) * 255)); + qt_pow_invgamma[i] = uchar(qRound(pow(i / 2047.0, 1 / gray_gamma) * 255)); #endif } diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp index 062c3a9..602b991 100644 --- a/src/gui/painting/qdrawutil.cpp +++ b/src/gui/painting/qdrawutil.cpp @@ -1079,6 +1079,7 @@ void qDrawItem(QPainter *p, Qt::GUIStyle gs, */ /*! + \fn void qDrawBorderPixmap(QPainter *painter, const QRect &target, const QMargins &margins, const QPixmap &pixmap) \since 4.6 \relates QMargins @@ -1175,7 +1176,6 @@ 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 -- cgit v0.12