summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-07-29 06:45:10 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-07-29 06:45:10 (GMT)
commit77bd318b2892ad2a6beefee84c8e1436f4f7f386 (patch)
tree0de55e09200679501da73babed5cce1d4b558781 /src/gui
parent7eba68adc4a7862d9474179592e5c8393a7acdbb (diff)
parentd22d08f3f8a70edfc66c0f6c2fd952688b64fcc2 (diff)
downloadQt-77bd318b2892ad2a6beefee84c8e1436f4f7f386.zip
Qt-77bd318b2892ad2a6beefee84c8e1436f4f7f386.tar.gz
Qt-77bd318b2892ad2a6beefee84c8e1436f4f7f386.tar.bz2
Merge commit 'qt/master-stable'
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp45
-rw-r--r--src/gui/image/qbitmap.cpp3
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm20
-rw-r--r--src/gui/kernel/qcocoaview_mac_p.h1
-rw-r--r--src/gui/kernel/qevent.cpp20
-rw-r--r--src/gui/kernel/qt_cocoa_helpers_mac.mm11
-rw-r--r--src/gui/kernel/qt_cocoa_helpers_mac_p.h1
-rw-r--r--src/gui/painting/qmatrix.cpp1
-rw-r--r--src/gui/painting/qpainter.cpp98
-rw-r--r--src/gui/painting/qtransform.cpp4
-rw-r--r--src/gui/styles/qstyleoption.cpp4
-rw-r--r--src/gui/styles/qwindowsvistastyle.cpp5
-rw-r--r--src/gui/text/qfontmetrics.cpp12
-rw-r--r--src/gui/widgets/qtabbar.cpp10
14 files changed, 146 insertions, 89 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index c4ff7c6..5b769ab 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -2465,10 +2465,10 @@ void QGraphicsItem::setHandlesChildEvents(bool enabled)
}
/*!
- Returns true if this item has keyboard input focus; otherwise, returns
- false.
+ Returns true if this item or its \l{focusProxy()}{focus proxy} has keyboard
+ input focus; otherwise, returns false.
- \sa QGraphicsScene::focusItem(), setFocus(), QGraphicsScene::setFocusItem()
+ \sa focusItem(), setFocus(), QGraphicsScene::setFocusItem()
*/
bool QGraphicsItem::hasFocus() const
{
@@ -2479,8 +2479,8 @@ bool QGraphicsItem::hasFocus() const
/*!
Gives keyboard input focus to this item. The \a focusReason argument will
- be passed into any focus event generated by this function; it is used to
- give an explanation of what caused the item to get focus.
+ be passed into any \l{QFocusEvent}{focus event} generated by this function;
+ it is used to give an explanation of what caused the item to get focus.
Only enabled items that set the ItemIsFocusable flag can accept keyboard
focus.
@@ -2489,12 +2489,12 @@ bool QGraphicsItem::hasFocus() const
gain immediate input focus. However, it will be registered as the preferred
focus item for its subtree of items, should it later become visible.
- As a result of calling this function, this item will receive a focus in
- event with \a focusReason. If another item already has focus, that item
- will first receive a focus out event indicating that it has lost input
- focus.
+ As a result of calling this function, this item will receive a
+ \l{focusInEvent()}{focus in event} with \a focusReason. If another item
+ already has focus, that item will first receive a \l{focusOutEvent()}
+ {focus out event} indicating that it has lost input focus.
- \sa clearFocus(), hasFocus(), focusItem()
+ \sa clearFocus(), hasFocus(), focusItem(), focusProxy()
*/
void QGraphicsItem::setFocus(Qt::FocusReason focusReason)
{
@@ -2527,13 +2527,13 @@ void QGraphicsItem::setFocus(Qt::FocusReason focusReason)
/*!
Takes keyboard input focus from the item.
- If it has focus, a focus out event is sent to this item to tell it that it
- is about to lose the focus.
+ If it has focus, a \l{focusOutEvent()}{focus out event} is sent to this item
+ to tell it that it is about to lose the focus.
Only items that set the ItemIsFocusable flag, or widgets that set an
appropriate focus policy, can accept keyboard focus.
- \sa setFocus(), QGraphicsWidget::focusPolicy
+ \sa setFocus(), hasFocus(), QGraphicsWidget::focusPolicy
*/
void QGraphicsItem::clearFocus()
{
@@ -2550,10 +2550,10 @@ void QGraphicsItem::clearFocus()
/*!
\since 4.6
- Returns this item's focus proxy, or 0 if the item
- does not have any focus proxy.
+ Returns this item's focus proxy, or 0 if this item has no
+ focus proxy.
- \sa setFocusProxy()
+ \sa setFocusProxy(), ItemAutoDetectsFocusProxy, setFocus(), hasFocus()
*/
QGraphicsItem *QGraphicsItem::focusProxy() const
{
@@ -2574,7 +2574,10 @@ QGraphicsItem *QGraphicsItem::focusProxy() const
such case, keyboard input will be handled by the outermost
focus proxy.
- \sa focusProxy()
+ The focus proxy \a item must belong to the same scene as
+ this item.
+
+ \sa focusProxy(), ItemAutoDetectsFocusProxy, setFocus(), hasFocus()
*/
void QGraphicsItem::setFocusProxy(QGraphicsItem *item)
{
@@ -2608,11 +2611,13 @@ void QGraphicsItem::setFocusProxy(QGraphicsItem *item)
}
/*!
+ \since 4.6
+
If this item, a child or descendant of this item currently has input
focus, this function will return a pointer to that item. If
no descendant has input focus, 0 is returned.
- \sa QWidget::focusWidget()
+ \sa hasFocus(), setFocus(), QWidget::focusWidget()
*/
QGraphicsItem *QGraphicsItem::focusItem() const
{
@@ -6102,7 +6107,7 @@ void QGraphicsItem::dropEvent(QGraphicsSceneDragDropEvent *event)
focus in events for this item. The default implementation calls
ensureVisible().
- \sa focusOutEvent(), sceneEvent()
+ \sa focusOutEvent(), sceneEvent(), setFocus()
*/
void QGraphicsItem::focusInEvent(QFocusEvent *event)
{
@@ -6113,7 +6118,7 @@ void QGraphicsItem::focusInEvent(QFocusEvent *event)
This event handler, for event \a event, can be reimplemented to receive
focus out events for this item. The default implementation does nothing.
- \sa focusInEvent(), sceneEvent()
+ \sa focusInEvent(), sceneEvent(), setFocus()
*/
void QGraphicsItem::focusOutEvent(QFocusEvent *event)
{
diff --git a/src/gui/image/qbitmap.cpp b/src/gui/image/qbitmap.cpp
index 6bca504..78c3396 100644
--- a/src/gui/image/qbitmap.cpp
+++ b/src/gui/image/qbitmap.cpp
@@ -78,7 +78,7 @@ QT_BEGIN_NAMESPACE
0 for black and 1 for white.
The QBitmap class provides the transformed() function returning a
- transformed copy of the bitmap; use the QMatrix argument to
+ transformed copy of the bitmap; use the QTransform argument to
translate, scale, shear, and rotate the bitmap. In addition,
QBitmap provides the static fromData() function which returns a
bitmap constructed from the given \c uchar data, and the static
@@ -318,6 +318,7 @@ QBitmap QBitmap::transformed(const QTransform &matrix) const
/*!
\overload
+ \obsolete
This convenience function converts the \a matrix to a QTransform
and calls the overloaded function.
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 3bc348c..57c9117 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -200,6 +200,7 @@ extern "C" {
composingText = new QString();
composing = false;
sendKeyEvents = true;
+ inKeyDown = false;
currentCustomTypes = 0;
[self setHidden:YES];
return self;
@@ -983,6 +984,7 @@ extern "C" {
- (void)keyDown:(NSEvent *)theEvent
{
+ inKeyDown = true;
sendKeyEvents = true;
QWidget *widgetToGetKey = qwidget;
@@ -1002,6 +1004,7 @@ extern "C" {
if (!keyOK && !sendToPopup)
[super keyDown:theEvent];
}
+ inKeyDown = false;
}
@@ -1039,14 +1042,23 @@ extern "C" {
- (void) insertText:(id)aString
{
- if ([aString length] && composing) {
- // Send the commit string to the widget.
- QString commitText;
+ QString commitText;
+ if ([aString length]) {
if ([aString isKindOfClass:[NSAttributedString class]]) {
- commitText = QCFString::toQString(reinterpret_cast<CFStringRef>([aString string]));
+ commitText = QCFString::toQString(reinterpret_cast<CFStringRef>([aString string]));
} else {
commitText = QCFString::toQString(reinterpret_cast<CFStringRef>(aString));
};
+ }
+
+ if ([aString length] && !inKeyDown) {
+ // Handle the case where insertText is called from somewhere else than the keyDown
+ // implementation, for example when inserting text from the character palette.
+ QInputMethodEvent e;
+ e.setCommitString(commitText);
+ qt_sendSpontaneousEvent(qwidget, &e);
+ } else if ([aString length] && composing) {
+ // Send the commit string to the widget.
composing = false;
sendKeyEvents = false;
QInputMethodEvent e;
diff --git a/src/gui/kernel/qcocoaview_mac_p.h b/src/gui/kernel/qcocoaview_mac_p.h
index 4762b17..932c6ca 100644
--- a/src/gui/kernel/qcocoaview_mac_p.h
+++ b/src/gui/kernel/qcocoaview_mac_p.h
@@ -85,6 +85,7 @@ Q_GUI_EXPORT
bool composing;
int composingLength;
bool sendKeyEvents;
+ bool inKeyDown;
QString *composingText;
QStringList *currentCustomTypes;
NSInteger dragEnterSequence;
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index a6a87b7..2a91181 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -675,8 +675,9 @@ QWheelEvent::QWheelEvent(const QPoint &pos, const QPoint& globalPos, int delta,
The QWidget::setEnable() function can be used to enable or disable
mouse and keyboard events for a widget.
- The event handlers QWidget::keyPressEvent() and
- QWidget::keyReleaseEvent() receive key events.
+ The event handlers QWidget::keyPressEvent(), QWidget::keyReleaseEvent(),
+ QGraphicsItem::keyPressEvent() and QGraphicsItem::keyReleaseEvent()
+ receive key events.
\sa QFocusEvent, QWidget::grabKeyboard()
*/
@@ -992,8 +993,9 @@ bool QKeyEvent::matches(QKeySequence::StandardKey matchKey) const
The reason for a particular focus event is returned by reason()
in the appropriate event handler.
- The event handlers QWidget::focusInEvent() and
- QWidget::focusOutEvent() receive focus events.
+ The event handlers QWidget::focusInEvent(),
+ QWidget::focusOutEvent(), QGraphicsItem::focusInEvent and
+ QGraphicsItem::focusOutEvent() receive focus events.
\sa QWidget::setFocus(), QWidget::setFocusPolicy(), {Keyboard Focus}
*/
@@ -1611,12 +1613,14 @@ Qt::ButtonState QContextMenuEvent::state() const
string is controlled by the widget only). The AttributeType enum
describes the different attributes that can be set.
- A class implementing QWidget::inputMethodEvent() should at least
- understand and honor the \l TextFormat and \l Cursor attributes.
+ A class implementing QWidget::inputMethodEvent() or
+ QGraphicsItem::inputMethodEvent() should at least understand and
+ honor the \l TextFormat and \l Cursor attributes.
Since input methods need to be able to query certain properties
- from the widget, the widget must also implement
- QWidget::inputMethodQuery().
+ from the widget or graphics item, subclasses must also implement
+ QWidget::inputMethodQuery() and QGraphicsItem::inputMethodQuery(),
+ respectively.
When receiving an input method event, the text widget has to performs the
following steps:
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm
index 3d4164a..1c4177e 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac.mm
+++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm
@@ -1069,6 +1069,17 @@ void qt_mac_updateContentBorderMetricts(void * /*OSWindowRef */window, const ::H
#endif
}
+void qt_mac_showBaseLineSeparator(void * /*OSWindowRef */window, bool show)
+{
+#if QT_MAC_USE_COCOA
+ QMacCocoaAutoReleasePool pool;
+ OSWindowRef theWindow = static_cast<OSWindowRef>(window);
+ NSToolbar *macToolbar = [theWindow toolbar];
+ if (macToolbar)
+ [macToolbar setShowsBaselineSeparator: show];
+#endif
+}
+
QStringList qt_mac_NSArrayToQStringList(void *nsarray)
{
QStringList result;
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac_p.h b/src/gui/kernel/qt_cocoa_helpers_mac_p.h
index 2cc7dee..741edd6 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac_p.h
+++ b/src/gui/kernel/qt_cocoa_helpers_mac_p.h
@@ -125,6 +125,7 @@ void macWindowSetHasShadow( void * /*OSWindowRef*/ window, bool hasShadow );
void macWindowFlush(void * /*OSWindowRef*/ window);
void macSendToolbarChangeEvent(QWidget *widget);
void qt_mac_updateContentBorderMetricts(void * /*OSWindowRef */window, const ::HIContentBorderMetrics &metrics);
+void qt_mac_showBaseLineSeparator(void * /*OSWindowRef */window, bool show);
void * /*NSImage */qt_mac_create_nsimage(const QPixmap &pm);
void qt_mac_update_mouseTracking(QWidget *widget);
OSStatus qt_mac_drawCGImage(CGContextRef cg, const CGRect *inbounds, CGImageRef);
diff --git a/src/gui/painting/qmatrix.cpp b/src/gui/painting/qmatrix.cpp
index bc08235..39f4d95 100644
--- a/src/gui/painting/qmatrix.cpp
+++ b/src/gui/painting/qmatrix.cpp
@@ -55,6 +55,7 @@ QT_BEGIN_NAMESPACE
\class QMatrix
\brief The QMatrix class specifies 2D transformations of a
coordinate system.
+ \obsolete
\ingroup multimedia
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 1b128bd..76e2fcc 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -1020,7 +1020,7 @@ void QPainterPrivate::updateState(QPainterState *newState)
\o brushOrigin() defines the origin of the tiled brushes, normally
the origin of widget's background.
- \o viewport(), window(), worldMatrix() make up the painter's coordinate
+ \o viewport(), window(), worldTransform() make up the painter's coordinate
transformation system. For more information, see the \l
{Coordinate Transformations} section and the \l {The Coordinate
System} documentation.
@@ -1227,15 +1227,15 @@ void QPainterPrivate::updateState(QPainterState *newState)
\endtable
All the tranformation operations operate on the transformation
- worldMatrix(). A matrix transforms a point in the plane to another
+ worldTransform(). A matrix transforms a point in the plane to another
point. For more information about the transformation matrix, see
- the \l {The Coordinate System} and QMatrix documentation.
+ the \l {The Coordinate System} and QTransform documentation.
- The setWorldMatrix() function can replace or add to the currently
- set worldMatrix(). The resetMatrix() function resets any
+ The setWorldTransform() function can replace or add to the currently
+ set worldTransform(). The resetTransform() function resets any
transformations that were made using translate(), scale(),
- shear(), rotate(), setWorldMatrix(), setViewport() and setWindow()
- functions. The deviceMatrix() returns the matrix that transforms
+ shear(), rotate(), setWorldTransform(), setViewport() and setWindow()
+ functions. The deviceTransform() returns the matrix that transforms
from logical coordinates to device coordinates of the platform
dependent paint device. The latter function is only needed when
using platform painting commands on the platform dependent handle,
@@ -1244,11 +1244,11 @@ void QPainterPrivate::updateState(QPainterState *newState)
When drawing with QPainter, we specify points using logical
coordinates which then are converted into the physical coordinates
of the paint device. The mapping of the logical coordinates to the
- physical coordinates are handled by QPainter's combinedMatrix(), a
- combination of viewport() and window() and worldMatrix(). The
+ physical coordinates are handled by QPainter's combinedTransform(), a
+ combination of viewport() and window() and worldTransform(). The
viewport() represents the physical coordinates specifying an
arbitrary rectangle, the window() describes the same rectangle in
- logical coordinates, and the worldMatrix() is identical with the
+ logical coordinates, and the worldTransform() is identical with the
transformation matrix.
See also \l {The Coordinate System} documentation.
@@ -2694,6 +2694,7 @@ void QPainter::setClipRegion(const QRegion &r, Qt::ClipOperation op)
/*!
\since 4.2
+ \obsolete
Sets the transformation matrix to \a matrix and enables transformations.
@@ -2732,7 +2733,7 @@ void QPainter::setClipRegion(const QRegion &r, Qt::ClipOperation op)
and window-viewport conversion, see \l {The Coordinate System}
documentation.
- \sa worldMatrixEnabled(), QMatrix
+ \sa setWorldTransform(), QTransform
*/
void QPainter::setWorldMatrix(const QMatrix &matrix, bool combine)
@@ -2742,6 +2743,7 @@ void QPainter::setWorldMatrix(const QMatrix &matrix, bool combine)
/*!
\since 4.2
+ \obsolete
Returns the world transformation matrix.
@@ -2791,6 +2793,7 @@ const QMatrix &QPainter::matrix() const
/*!
\since 4.2
+ \obsolete
Returns the transformation matrix combining the current
window/viewport and world transformation.
@@ -2798,7 +2801,7 @@ const QMatrix &QPainter::matrix() const
It is advisable to use combinedTransform() instead of this
function to preserve the properties of perspective transformations.
- \sa setWorldMatrix(), setWindow(), setViewport()
+ \sa setWorldTransform(), setWindow(), setViewport()
*/
QMatrix QPainter::combinedMatrix() const
{
@@ -2807,6 +2810,8 @@ QMatrix QPainter::combinedMatrix() const
/*!
+ \obsolete
+
Returns the matrix that transforms from logical coordinates to
device coordinates of the platform dependent paint device.
@@ -2834,6 +2839,8 @@ const QMatrix &QPainter::deviceMatrix() const
}
/*!
+ \obsolete
+
Resets any transformations that were made using translate(), scale(),
shear(), rotate(), setWorldMatrix(), setViewport() and
setWindow().
@@ -2858,7 +2865,7 @@ void QPainter::resetMatrix()
transformations if \a enable is false. The world transformation
matrix is not changed.
- \sa worldMatrixEnabled(), worldMatrix(), {QPainter#Coordinate
+ \sa worldMatrixEnabled(), worldTransform(), {QPainter#Coordinate
Transformations}{Coordinate Transformations}
*/
@@ -2887,7 +2894,7 @@ void QPainter::setWorldMatrixEnabled(bool enable)
Returns true if world transformation is enabled; otherwise returns
false.
- \sa setWorldMatrixEnabled(), worldMatrix(), {The Coordinate System}
+ \sa setWorldMatrixEnabled(), worldTransform(), {The Coordinate System}
*/
bool QPainter::worldMatrixEnabled() const
@@ -2929,7 +2936,7 @@ bool QPainter::matrixEnabled() const
/*!
Scales the coordinate system by (\a{sx}, \a{sy}).
- \sa setWorldMatrix() {QPainter#Coordinate Transformations}{Coordinate
+ \sa setWorldTransform() {QPainter#Coordinate Transformations}{Coordinate
Transformations}
*/
@@ -2953,7 +2960,7 @@ void QPainter::scale(qreal sx, qreal sy)
/*!
Shears the coordinate system by (\a{sh}, \a{sv}).
- \sa setWorldMatrix(), {QPainter#Coordinate Transformations}{Coordinate
+ \sa setWorldTransform(), {QPainter#Coordinate Transformations}{Coordinate
Transformations}
*/
@@ -2979,7 +2986,7 @@ void QPainter::shear(qreal sh, qreal sv)
Rotates the coordinate system the given \a angle clockwise.
- \sa setWorldMatrix(), {QPainter#Coordinate Transformations}{Coordinate
+ \sa setWorldTransform(), {QPainter#Coordinate Transformations}{Coordinate
Transformations}
*/
@@ -3004,7 +3011,7 @@ void QPainter::rotate(qreal a)
Translates the coordinate system by the given \a offset; i.e. the
given \a offset is added to points.
- \sa setWorldMatrix(), {QPainter#Coordinate Transformations}{Coordinate
+ \sa setWorldTransform(), {QPainter#Coordinate Transformations}{Coordinate
Transformations}
*/
void QPainter::translate(const QPointF &offset)
@@ -6785,7 +6792,7 @@ QPainter::RenderHints QPainter::renderHints() const
Returns true if view transformation is enabled; otherwise returns
false.
- \sa setViewTransformEnabled(), worldMatrix()
+ \sa setViewTransformEnabled(), worldTransform()
*/
bool QPainter::viewTransformEnabled() const
@@ -6941,7 +6948,7 @@ QRect QPainter::viewport() const
/*! \fn void QPainter::resetXForm()
\compat
- Use resetMatrix() instead.
+ Use resetTransform() instead.
*/
/*! \fn void QPainter::setViewXForm(bool enabled)
@@ -6987,14 +6994,16 @@ void QPainter::setViewTransformEnabled(bool enable)
#ifdef QT3_SUPPORT
/*!
- Use the worldMatrix() combined with QMatrix::dx() instead.
+ \obsolete
+
+ Use the worldTransform() combined with QTransform::dx() instead.
\oldcode
QPainter painter(this);
qreal x = painter.translationX();
\newcode
QPainter painter(this);
- qreal x = painter.worldMatrix().dx();
+ qreal x = painter.worldTransform().dx();
\endcode
*/
qreal QPainter::translationX() const
@@ -7008,14 +7017,16 @@ qreal QPainter::translationX() const
}
/*!
- Use the worldMatrix() combined with QMatrix::dy() instead.
+ \obsolete
+
+ Use the worldTransform() combined with QTransform::dy() instead.
\oldcode
QPainter painter(this);
qreal y = painter.translationY();
\newcode
QPainter painter(this);
- qreal y = painter.worldMatrix().dy();
+ qreal y = painter.worldTransform().dy();
\endcode
*/
qreal QPainter::translationY() const
@@ -7113,7 +7124,7 @@ QPolygon QPainter::xForm(const QPolygon &a) const
QPolygon transformed = painter.xForm(polygon, index, count)
\newcode
QPainter painter(this);
- QPolygon transformed = polygon.mid(index, count) * painter.combinedMatrix();
+ QPolygon transformed = polygon.mid(index, count) * painter.combinedTransform();
\endcode
*/
@@ -7128,15 +7139,16 @@ QPolygon QPainter::xForm(const QPolygon &av, int index, int npoints) const
/*!
\fn QPoint QPainter::xFormDev(const QPoint &point) const
\overload
+ \obsolete
- Use combinedTransform() combined with QMatrix::inverted() instead.
+ Use combinedTransform() combined with QTransform::inverted() instead.
\oldcode
QPainter painter(this);
QPoint transformed = painter.xFormDev(point);
\newcode
QPainter painter(this);
- QPoint transformed = point * painter.combinedMatrix().inverted();
+ QPoint transformed = point * painter.combinedTransform().inverted();
\endcode
*/
@@ -7155,15 +7167,16 @@ QPoint QPainter::xFormDev(const QPoint &p) const
/*!
\fn QRect QPainter::xFormDev(const QRect &rectangle) const
\overload
+ \obsolete
- Use mapRect() combined with QMatrix::inverted() instead.
+ Use combinedTransform() combined with QTransform::inverted() instead.
\oldcode
QPainter painter(this);
QRect transformed = painter.xFormDev(rectangle);
\newcode
QPainter painter(this);
- QRect transformed = painter.combinedMatrix().inverted(rectangle);
+ QRect transformed = painter.combinedTransform().inverted(rectangle);
\endcode
*/
@@ -7183,16 +7196,16 @@ QRect QPainter::xFormDev(const QRect &r) const
\overload
\fn QPoint QPainter::xFormDev(const QPolygon &polygon) const
- \overload
+ \obsolete
- Use combinedMatrix() combined with QMatrix::inverted() instead.
+ Use combinedTransform() combined with QTransform::inverted() instead.
\oldcode
QPainter painter(this);
QPolygon transformed = painter.xFormDev(rectangle);
\newcode
QPainter painter(this);
- QPolygon transformed = polygon * painter.combinedMatrix().inverted();
+ QPolygon transformed = polygon * painter.combinedTransform().inverted();
\endcode
*/
@@ -7211,15 +7224,16 @@ QPolygon QPainter::xFormDev(const QPolygon &a) const
/*!
\fn QPolygon QPainter::xFormDev(const QPolygon &polygon, int index, int count) const
\overload
+ \obsolete
- Use combinedMatrix() combined with QPolygon::mid() and QMatrix::inverted() instead.
+ Use combinedTransform() combined with QPolygon::mid() and QTransform::inverted() instead.
\oldcode
QPainter painter(this);
QPolygon transformed = painter.xFormDev(polygon, index, count);
\newcode
QPainter painter(this);
- QPolygon transformed = polygon.mid(index, count) * painter.combinedMatrix().inverted();
+ QPolygon transformed = polygon.mid(index, count) * painter.combinedTransform().inverted();
\endcode
*/
@@ -8136,7 +8150,7 @@ void bitBlt(QPaintDevice *dst, int dx, int dy,
\row \o QPaintEngine::DirtyClipRegion \o clipRegion()
\row \o QPaintEngine::DirtyCompositionMode \o compositionMode()
\row \o QPaintEngine::DirtyFont \o font()
- \row \o QPaintEngine::DirtyTransform \o matrix()
+ \row \o QPaintEngine::DirtyTransform \o transform()
\row \o QPaintEngine::DirtyClipEnabled \o isClipEnabled()
\row \o QPaintEngine::DirtyPen \o pen()
\row \o QPaintEngine::DirtyHints \o renderHints()
@@ -8255,10 +8269,14 @@ QFont QPaintEngineState::font() const
/*!
\since 4.2
+ \obsolete
Returns the matrix in the current paint engine
state.
+ \note It is advisable to use transform() instead of this function to
+ preserve the properties of perspective transformations.
+
This variable should only be used when the state() returns a
combination which includes the QPaintEngine::DirtyTransform flag.
@@ -8439,11 +8457,7 @@ qreal QPaintEngineState::opacity() const
If \a combine is true, the specified \a transform is combined with
the current matrix; otherwise it replaces the current matrix.
- This function has been added for compatibility with setMatrix(),
- but as with setMatrix() the preferred method of setting a
- transformation on the painter is through setWorldTransform().
-
- \sa transform()
+ \sa transform() setWorldTransform()
*/
void QPainter::setTransform(const QTransform &transform, bool combine )
@@ -8453,6 +8467,8 @@ void QPainter::setTransform(const QTransform &transform, bool combine )
/*!
Returns the world transformation matrix.
+
+ \sa worldTransform()
*/
const QTransform & QPainter::transform() const
@@ -8563,7 +8579,7 @@ const QTransform & QPainter::worldTransform() const
Returns the transformation matrix combining the current
window/viewport and world transformation.
- \sa setWorldMatrix(), setWindow(), setViewport()
+ \sa setWorldTransform(), setWindow(), setViewport()
*/
QTransform QPainter::combinedTransform() const
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index f0b2351..45939c1 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -52,7 +52,9 @@ QT_BEGIN_NAMESPACE
#define Q_NEAR_CLIP 0.000001
-
+#ifdef MAP
+# undef MAP
+#endif
#define MAP(x, y, nx, ny) \
do { \
qreal FX_ = x; \
diff --git a/src/gui/styles/qstyleoption.cpp b/src/gui/styles/qstyleoption.cpp
index 0ff1ccf..7547dda 100644
--- a/src/gui/styles/qstyleoption.cpp
+++ b/src/gui/styles/qstyleoption.cpp
@@ -657,7 +657,7 @@ QStyleOptionFrameV2 &QStyleOptionFrameV2::operator=(const QStyleOptionFrame &oth
/*!
\enum QStyleOptionFrameV2::FrameFeature
- This enum describles the different types of features a frame can have.
+ This enum describes the different types of features a frame can have.
\value None Indicates a normal frame.
\value Flat Indicates a flat frame.
@@ -899,7 +899,7 @@ QStyleOptionViewItemV2 &QStyleOptionViewItemV2::operator=(const QStyleOptionView
/*!
\enum QStyleOptionViewItemV2::ViewItemFeature
- This enum describles the different types of features an item can have.
+ This enum describes the different types of features an item can have.
\value None Indicates a normal item.
\value WrapText Indicates an item with wrapped text.
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp
index f3d0f04..6f3017a 100644
--- a/src/gui/styles/qwindowsvistastyle.cpp
+++ b/src/gui/styles/qwindowsvistastyle.cpp
@@ -364,7 +364,8 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
w->setProperty("_q_stylestate", (int)option->state);
w->setProperty("_q_stylerect", w->rect());
- bool doTransition = ((state & State_Sunken) != (oldState & State_Sunken) ||
+ bool doTransition = oldState &&
+ ((state & State_Sunken) != (oldState & State_Sunken) ||
(state & State_On) != (oldState & State_On) ||
(state & State_MouseOver) != (oldState & State_MouseOver));
@@ -2229,7 +2230,7 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt
rect = cb->rect;
break;
case SC_ComboBoxArrow:
- rect.setRect(cb->editable ? xpos : 0, y , wi - xpos, he);
+ rect.setRect(xpos, y , wi - xpos, he);
break;
case SC_ComboBoxEditField:
rect.setRect(x + margin, y + margin, wi - 2 * margin - 16, he - 2 * margin);
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 9f19fd9..2f3a791 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -557,11 +557,10 @@ int QFontMetrics::width(const QString &text, int len) const
\warning This function will produce incorrect results for Arabic
characters or non-spacing marks in the middle of a string, as the
glyph shaping and positioning of marks that happens when
- processing strings cannot be taken into account. Use charWidth()
- instead if you aren't looking for the width of isolated
- characters.
+ processing strings cannot be taken into account. When implementing
+ an interactive text control, use QTextLayout instead.
- \sa boundingRect(), charWidth()
+ \sa boundingRect()
*/
int QFontMetrics::width(QChar ch) const
{
@@ -1386,9 +1385,8 @@ qreal QFontMetricsF::width(const QString &text) const
\warning This function will produce incorrect results for Arabic
characters or non-spacing marks in the middle of a string, as the
glyph shaping and positioning of marks that happens when
- processing strings cannot be taken into account. Use charWidth()
- instead if you aren't looking for the width of isolated
- characters.
+ processing strings cannot be taken into account. When implementing
+ an interactive text control, use QTextLayout instead.
\sa boundingRect()
*/
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp
index 690e624..6b027b1 100644
--- a/src/gui/widgets/qtabbar.cpp
+++ b/src/gui/widgets/qtabbar.cpp
@@ -87,13 +87,17 @@ void QTabBarPrivate::updateMacBorderMetrics()
// TODO: get metrics to preserve the bottom value
// TODO: test tab bar position
- // push the black line at the bottom of the menu bar down to the client are so we can paint over it
+ OSWindowRef window = qt_mac_window_for(q);
+
+ // push base line separator down to the client are so we can paint over it (Carbon)
metrics.top = (documentMode && q->isVisible()) ? 1 : 0;
metrics.bottom = 0;
metrics.left = 0;
metrics.right = 0;
-
- qt_mac_updateContentBorderMetricts(qt_mac_window_for(q), metrics);
+ qt_mac_updateContentBorderMetricts(window, metrics);
+
+ // hide the base line separator if the tabs have docuemnt mode enabled (Cocoa)
+ qt_mac_showBaseLineSeparator(window, !documentMode);
}
#endif
}