summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2009-06-02 08:42:10 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2009-06-02 08:42:10 (GMT)
commita8890b53f544ca7baccf91916b179e63dfbbda50 (patch)
treee419b58ccf2fa47a700990e16f4d1038ce2287e3 /src
parent73e514015e416cb290adc1bb513669bc6f4b4ec9 (diff)
parent43df9b0eaf58fc9fb252919d61189da8b77cfe38 (diff)
downloadQt-a8890b53f544ca7baccf91916b179e63dfbbda50.zip
Qt-a8890b53f544ca7baccf91916b179e63dfbbda50.tar.gz
Qt-a8890b53f544ca7baccf91916b179e63dfbbda50.tar.bz2
Merge branch 'master' of git@scm.dev.troll.no:qt/qt-s60-public
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/phonon/phonon/effectwidget.cpp3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp5
-rw-r--r--src/corelib/arch/qatomic_windows.h14
-rw-r--r--src/corelib/global/qglobal.cpp49
-rw-r--r--src/corelib/io/qdatastream.cpp92
-rw-r--r--src/corelib/io/qsettings.cpp13
-rw-r--r--src/corelib/kernel/qobject.cpp2
-rw-r--r--src/corelib/tools/qcryptographichash.cpp2
-rw-r--r--src/corelib/tools/qlistdata.cpp6
-rw-r--r--src/corelib/tools/qmap.cpp6
-rw-r--r--src/corelib/tools/qstringlist.cpp2
-rw-r--r--src/gui/dialogs/qfiledialog.cpp17
-rw-r--r--src/gui/dialogs/qfilesystemmodel.cpp11
-rw-r--r--src/gui/dialogs/qfilesystemmodel_p.h25
-rw-r--r--src/gui/dialogs/qfontdialog.cpp8
-rw-r--r--src/gui/dialogs/qfontdialog_mac.mm40
-rw-r--r--src/gui/dialogs/qmessagebox.cpp2
-rw-r--r--src/gui/embedded/qkbdtty_qws.cpp4
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp4
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp6
-rw-r--r--src/gui/image/qicon.cpp9
-rw-r--r--src/gui/image/qpixmap.cpp95
-rw-r--r--src/gui/image/qpixmap_qws.cpp14
-rw-r--r--src/gui/image/qpixmap_win.cpp45
-rw-r--r--src/gui/image/qpixmap_x11.cpp28
-rw-r--r--src/gui/itemviews/qheaderview.cpp4
-rw-r--r--src/gui/itemviews/qsortfilterproxymodel.cpp3
-rw-r--r--src/gui/itemviews/qtreeview.cpp8
-rw-r--r--src/gui/kernel/qapplication_win.cpp29
-rw-r--r--src/gui/kernel/qcocoaapplicationdelegate_mac.mm2
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm28
-rw-r--r--src/gui/kernel/qcocoaview_mac_p.h1
-rw-r--r--src/gui/kernel/qcursor.cpp4
-rw-r--r--src/gui/kernel/qkeysequence.cpp2
-rw-r--r--src/gui/kernel/qwidget_x11.cpp3
-rw-r--r--src/gui/painting/qpainterpath.cpp8
-rw-r--r--src/gui/painting/qprinter.cpp32
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp8
-rw-r--r--src/gui/styles/qgtkstyle.cpp65
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp9
-rw-r--r--src/gui/text/qfontengine_win.cpp6
-rw-r--r--src/gui/text/qfontmetrics.cpp12
-rw-r--r--src/gui/widgets/qtabbar.cpp11
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp3
-rw-r--r--src/network/socket/qabstractsocket.cpp28
-rw-r--r--src/network/ssl/qsslcertificate.cpp2
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp25
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp3
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h4
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp191
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp23
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp15
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp42
-rw-r--r--src/svg/qsvggenerator.cpp2
54 files changed, 586 insertions, 489 deletions
diff --git a/src/3rdparty/phonon/phonon/effectwidget.cpp b/src/3rdparty/phonon/phonon/effectwidget.cpp
index da5a51a..d5c6c81 100644
--- a/src/3rdparty/phonon/phonon/effectwidget.cpp
+++ b/src/3rdparty/phonon/phonon/effectwidget.cpp
@@ -165,6 +165,7 @@ void EffectWidgetPrivate::autogenerateUi()
if (minValue == -1. && maxValue == 1.) {
//Special case values between -1 and 1.0 to use a slider for improved usability
QSlider *slider = new QSlider(Qt::Horizontal, q);
+ control = slider;
slider->setRange(-SLIDER_RANGE, +SLIDER_RANGE);
slider->setValue(int(SLIDER_RANGE * value.toDouble()));
slider->setTickPosition(QSlider::TicksBelow);
@@ -188,10 +189,10 @@ void EffectWidgetPrivate::autogenerateUi()
break;
}
+ if (control) {
#ifndef QT_NO_TOOLTIP
control->setToolTip(para.description());
#endif
- if (control) {
#ifndef QT_NO_SHORTCUT
label->setBuddy(control);
#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index 5dc6363..e565476 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -268,7 +268,7 @@ void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object
}
/*!
- Returns the frame's content, converted to HTML.
+ Returns the frame's content as HTML, enclosed in HTML and BODY tags.
\sa setHtml(), toPlainText()
*/
@@ -280,7 +280,8 @@ QString QWebFrame::toHtml() const
}
/*!
- Returns the content of this frame converted to plain text.
+ Returns the content of this frame converted to plain text, completely
+ stripped of all HTML formatting.
\sa toHtml()
*/
diff --git a/src/corelib/arch/qatomic_windows.h b/src/corelib/arch/qatomic_windows.h
index c795ea6..a1a5a7d 100644
--- a/src/corelib/arch/qatomic_windows.h
+++ b/src/corelib/arch/qatomic_windows.h
@@ -220,6 +220,9 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueTo
#if !defined(Q_OS_WINCE) && !defined(Q_CC_MWERKS)
// use compiler intrinsics for all atomic functions
+//those functions need to be define in the global namespace
+QT_END_NAMESPACE
+
extern "C" {
long __cdecl _InterlockedIncrement(volatile long *);
long __cdecl _InterlockedDecrement(volatile long *);
@@ -252,6 +255,9 @@ extern "C" {
# define _InterlockedExchangeAddPointer(a,b) \
_InterlockedExchangeAdd(reinterpret_cast<volatile long *>(a), long(b))
# endif
+
+QT_BEGIN_NAMESPACE
+
inline bool QBasicAtomicInt::ref()
{
return _InterlockedIncrement(reinterpret_cast<volatile long *>(&_q_value)) != 0;
@@ -334,6 +340,8 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueTo
#define Q_ARGUMENT_TYPE
#endif
+QT_END_NAMESPACE
+
extern "C" {
long __cdecl InterlockedIncrement(long Q_ARGUMENT_TYPE * lpAddend);
long __cdecl InterlockedDecrement(long Q_ARGUMENT_TYPE * lpAddend);
@@ -350,6 +358,8 @@ long __cdecl InterlockedExchangeAdd(long Q_ARGUMENT_TYPE * Addend, long Value);
# pragma intrinsic (_InterlockedExchangeAdd)
#endif
+QT_BEGIN_NAMESPACE
+
#endif
@@ -408,6 +418,8 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueTo
// MinGW's definition, such that we pick up variations in the headers.
#ifndef __INTERLOCKED_DECLARED
#define __INTERLOCKED_DECLARED
+QT_END_NAMESPACE
+
extern "C" {
__declspec(dllimport) long __stdcall InterlockedCompareExchange(long *, long, long);
__declspec(dllimport) long __stdcall InterlockedIncrement(long *);
@@ -415,6 +427,8 @@ extern "C" {
__declspec(dllimport) long __stdcall InterlockedExchange(long *, long);
__declspec(dllimport) long __stdcall InterlockedExchangeAdd(long *, long);
}
+
+QT_BEGIN_NAMESPACE
#endif
inline bool QBasicAtomicInt::ref()
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 4538dc4..ca243e7 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -132,7 +132,8 @@ QT_BEGIN_NAMESPACE
If you want to use QFlags for your own enum types, use
the Q_DECLARE_FLAGS() and Q_DECLARE_OPERATORS_FOR_FLAGS().
- For example:
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 1
@@ -449,14 +450,18 @@ QT_BEGIN_NAMESPACE
function. You can retrieve the minimum and maximum of two given
objects using qMin() and qMax() respectively. All these functions
return a corresponding template type; the template types can be
- replaced by any other type. For example:
+ replaced by any other type.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 3
<QtGlobal> also contains functions that generate messages from the
given string argument: qCritical(), qDebug(), qFatal() and
qWarning(). These functions call the message handler with the
- given message. For example:
+ given message.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 4
@@ -701,7 +706,9 @@ QT_BEGIN_NAMESPACE
\relates <QtGlobal>
Wraps the signed 64-bit integer \a literal in a
- platform-independent way. For example:
+ platform-independent way.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 8
@@ -712,7 +719,9 @@ QT_BEGIN_NAMESPACE
\relates <QtGlobal>
Wraps the unsigned 64-bit integer \a literal in a
- platform-independent way. For example:
+ platform-independent way.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 9
@@ -741,7 +750,11 @@ QT_BEGIN_NAMESPACE
/*! \fn const T &qAbs(const T &value)
\relates <QtGlobal>
- Returns the absolute value of \a value. For example:
+ Compares \a value to the 0 of type T and returns the absolute
+ value. Thus if T is \e {double}, then \a value is compared to
+ \e{(double) 0}.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 10
*/
@@ -749,7 +762,9 @@ QT_BEGIN_NAMESPACE
/*! \fn int qRound(qreal value)
\relates <QtGlobal>
- Rounds \a value to the nearest integer. For example:
+ Rounds \a value to the nearest integer.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 11
*/
@@ -757,7 +772,9 @@ QT_BEGIN_NAMESPACE
/*! \fn qint64 qRound64(qreal value)
\relates <QtGlobal>
- Rounds \a value to the nearest 64-bit integer. For example:
+ Rounds \a value to the nearest 64-bit integer.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 12
*/
@@ -765,7 +782,9 @@ QT_BEGIN_NAMESPACE
/*! \fn const T &qMin(const T &value1, const T &value2)
\relates <QtGlobal>
- Returns the minimum of \a value1 and \a value2. For example:
+ Returns the minimum of \a value1 and \a value2.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 13
@@ -775,7 +794,9 @@ QT_BEGIN_NAMESPACE
/*! \fn const T &qMax(const T &value1, const T &value2)
\relates <QtGlobal>
- Returns the maximum of \a value1 and \a value2. For example:
+ Returns the maximum of \a value1 and \a value2.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 14
@@ -786,7 +807,9 @@ QT_BEGIN_NAMESPACE
\relates <QtGlobal>
Returns \a value bounded by \a min and \a max. This is equivalent
- to qMax(\a min, qMin(\a value, \a max)). For example:
+ to qMax(\a min, qMin(\a value, \a max)).
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 15
@@ -932,7 +955,9 @@ QT_BEGIN_NAMESPACE
4.1.2, the QT_VERSION macro will expand to 0x040102.
You can use QT_VERSION to use the latest Qt features where
- available. For example:
+ available.
+
+ Example:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 16
diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp
index b203899..e324ffe 100644
--- a/src/corelib/io/qdatastream.cpp
+++ b/src/corelib/io/qdatastream.cpp
@@ -622,11 +622,16 @@ QDataStream &QDataStream::operator>>(qint16 &i)
setStatus(ReadPastEnd);
}
} else {
- register uchar *p = (uchar *)(&i);
+ union {
+ qint16 val1;
+ char val2[2];
+ } x;
+ char *p = x.val2;
char b[2];
if (dev->read(b, 2) == 2) {
*p++ = b[1];
*p = b[0];
+ i = x.val1;
} else {
setStatus(ReadPastEnd);
}
@@ -660,13 +665,18 @@ QDataStream &QDataStream::operator>>(qint32 &i)
setStatus(ReadPastEnd);
}
} else { // swap bytes
- uchar *p = (uchar *)(&i);
+ union {
+ qint32 val1;
+ char val2[4];
+ } x;
+ char *p = x.val2;
char b[4];
if (dev->read(b, 4) == 4) {
*p++ = b[3];
*p++ = b[2];
*p++ = b[1];
*p = b[0];
+ i = x.val1;
} else {
setStatus(ReadPastEnd);
}
@@ -703,7 +713,12 @@ QDataStream &QDataStream::operator>>(qint64 &i)
setStatus(ReadPastEnd);
}
} else { // swap bytes
- uchar *p = (uchar *)(&i);
+ union {
+ qint64 val1;
+ char val2[8];
+ } x;
+
+ char *p = x.val2;
char b[8];
if (dev->read(b, 8) == 8) {
*p++ = b[7];
@@ -714,6 +729,7 @@ QDataStream &QDataStream::operator>>(qint64 &i)
*p++ = b[2];
*p++ = b[1];
*p = b[0];
+ i = x.val1;
} else {
setStatus(ReadPastEnd);
}
@@ -751,13 +767,19 @@ QDataStream &QDataStream::operator>>(float &f)
setStatus(ReadPastEnd);
}
} else { // swap bytes
- uchar *p = (uchar *)(&f);
+ union {
+ float val1;
+ char val2[4];
+ } x;
+
+ char *p = x.val2;
char b[4];
if (dev->read(b, 4) == 4) {
*p++ = b[3];
*p++ = b[2];
*p++ = b[1];
*p = b[0];
+ f = x.val1;
} else {
setStatus(ReadPastEnd);
}
@@ -788,7 +810,11 @@ QDataStream &QDataStream::operator>>(double &f)
setStatus(ReadPastEnd);
}
} else { // swap bytes
- register uchar *p = (uchar *)(&f);
+ union {
+ double val1;
+ char val2[8];
+ } x;
+ char *p = x.val2;
char b[8];
if (dev->read(b, 8) == 8) {
*p++ = b[7];
@@ -799,13 +825,18 @@ QDataStream &QDataStream::operator>>(double &f)
*p++ = b[2];
*p++ = b[1];
*p = b[0];
+ f = x.val1;
} else {
setStatus(ReadPastEnd);
}
}
#else
//non-standard floating point format
- register uchar *p = (uchar *)(&f);
+ union {
+ double val1;
+ char val2[8];
+ } x;
+ char *p = x.val2;
char b[8];
if (dev->read(b, 8) == 8) {
if (noswap) {
@@ -827,6 +858,7 @@ QDataStream &QDataStream::operator>>(double &f)
*p++ = b[Q_DF(1)];
*p = b[Q_DF(0)];
}
+ f = x.val1;
} else {
setStatus(ReadPastEnd);
}
@@ -970,7 +1002,12 @@ QDataStream &QDataStream::operator<<(qint16 i)
if (noswap) {
dev->write((char *)&i, sizeof(qint16));
} else { // swap bytes
- register uchar *p = (uchar *)(&i);
+ union {
+ qint16 val1;
+ char val2[2];
+ } x;
+ x.val1 = i;
+ char *p = x.val2;
char b[2];
b[1] = *p++;
b[0] = *p;
@@ -992,7 +1029,12 @@ QDataStream &QDataStream::operator<<(qint32 i)
if (noswap) {
dev->write((char *)&i, sizeof(qint32));
} else { // swap bytes
- register uchar *p = (uchar *)(&i);
+ union {
+ qint32 val1;
+ char val2[4];
+ } x;
+ x.val1 = i;
+ char *p = x.val2;
char b[4];
b[3] = *p++;
b[2] = *p++;
@@ -1022,13 +1064,18 @@ QDataStream &QDataStream::operator<<(qint64 i)
{
CHECK_STREAM_PRECOND(*this)
if (version() < 6) {
- quint32 i1 = i & 0xffffffff;
- quint32 i2 = i >> 32;
- *this << i2 << i1;
+ quint32 i1 = i & 0xffffffff;
+ quint32 i2 = i >> 32;
+ *this << i2 << i1;
} else if (noswap) { // no conversion needed
dev->write((char *)&i, sizeof(qint64));
} else { // swap bytes
- register uchar *p = (uchar *)(&i);
+ union {
+ qint64 val1;
+ char val2[8];
+ } x;
+ x.val1 = i;
+ char *p = x.val2;
char b[8];
b[7] = *p++;
b[6] = *p++;
@@ -1077,7 +1124,12 @@ QDataStream &QDataStream::operator<<(float f)
if (noswap) { // no conversion needed
dev->write((char *)&g, sizeof(float));
} else { // swap bytes
- register uchar *p = (uchar *)(&g);
+ union {
+ float val1;
+ char val2[4];
+ } x;
+ x.val1 = f;
+ char *p = x.val2;
char b[4];
b[3] = *p++;
b[2] = *p++;
@@ -1103,7 +1155,12 @@ QDataStream &QDataStream::operator<<(double f)
if (noswap) {
dev->write((char *)&f, sizeof(double));
} else {
- register uchar *p = (uchar *)(&f);
+ union {
+ double val1;
+ char val2[8];
+ } x;
+ x.val1 = f;
+ char *p = x.val2;
char b[8];
b[7] = *p++;
b[6] = *p++;
@@ -1116,7 +1173,12 @@ QDataStream &QDataStream::operator<<(double f)
dev->write(b, 8);
}
#else
- register uchar *p = (uchar *)(&f);
+ union {
+ double val1;
+ char val2[8];
+ } x;
+ x.val1 = f;
+ char *p = x.val2;
char b[8];
if (noswap) {
b[Q_DF(0)] = *p++;
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 14fc2d4..6152518 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -3468,7 +3468,7 @@ void QSettings::setPath(Format format, Scope scope, const QString &path)
\typedef QSettings::SettingsMap
Typedef for QMap<QString, QVariant>.
-
+
\sa registerFormat()
*/
@@ -3479,6 +3479,11 @@ void QSettings::setPath(Format format, Scope scope, const QString &path)
\snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 27
+ \c ReadFunc is used in \c registerFormat() as a pointer to a function
+ that reads a set of key/value pairs. \c ReadFunc should read all the
+ options in one pass, and return all the settings in the \c SettingsMap
+ container, which is initially empty.
+
\sa WriteFunc, registerFormat()
*/
@@ -3489,6 +3494,10 @@ void QSettings::setPath(Format format, Scope scope, const QString &path)
\snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 28
+ \c WriteFunc is used in \c registerFormat() as a pointer to a function
+ that writes a set of key/value pairs. \c WriteFunc is only called once,
+ so you need to output the settings in one go.
+
\sa ReadFunc, registerFormat()
*/
@@ -3504,7 +3513,7 @@ void QSettings::setPath(Format format, Scope scope, const QString &path)
extension associated to the format (without the '.').
The \a readFunc and \a writeFunc parameters are pointers to
- functions that read and write a set of (key, value) pairs. The
+ functions that read and write a set of key/value pairs. The
QIODevice parameter to the read and write functions is always
opened in binary mode (i.e., without the QIODevice::Text flag).
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 6ea2d9f..310bd41 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -2068,7 +2068,7 @@ void QObject::deleteLater()
or
- \tt{/*: ... \starslash}
+ \tt{\begincomment: ... \endcomment}
Examples:
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp
index 9063ae4..917679c 100644
--- a/src/corelib/tools/qcryptographichash.cpp
+++ b/src/corelib/tools/qcryptographichash.cpp
@@ -78,7 +78,7 @@ public:
QCryptographicHash can be used to generate cryptographic hashes of binary or text data.
- Currently MD4, MD5, and SHA1 are supported.
+ Currently MD4, MD5, and SHA-1 are supported.
*/
/*!
diff --git a/src/corelib/tools/qlistdata.cpp b/src/corelib/tools/qlistdata.cpp
index d40b6b6..34a5d80 100644
--- a/src/corelib/tools/qlistdata.cpp
+++ b/src/corelib/tools/qlistdata.cpp
@@ -1173,7 +1173,8 @@ void **QListData::erase(void **xi)
/*! \typedef QList::iterator::iterator_category
- \internal
+ A synonym for \e {std::random_access_iterator_tag} indicating
+ this iterator is a random access iterator.
*/
/*! \typedef QList::iterator::difference_type
@@ -1432,7 +1433,8 @@ void **QListData::erase(void **xi)
/*! \typedef QList::const_iterator::iterator_category
- \internal
+ A synonym for \e {std::random_access_iterator_tag} indicating
+ this iterator is a random access iterator.
*/
/*! \typedef QList::const_iterator::difference_type
diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp
index 0699400..07df28d 100644
--- a/src/corelib/tools/qmap.cpp
+++ b/src/corelib/tools/qmap.cpp
@@ -902,7 +902,8 @@ void QMapData::dump()
/*! \typedef QMap::iterator::iterator_category
- \internal
+ A synonym for \e {std::bidirectional_iterator_tag} indicating
+ this iterator is a bidirectional iterator.
*/
/*! \typedef QMap::iterator::pointer
@@ -1123,7 +1124,8 @@ void QMapData::dump()
/*! \typedef QMap::const_iterator::iterator_category
- \internal
+ A synonym for \e {std::bidirectional_iterator_tag} indicating
+ this iterator is a bidirectional iterator.
*/
/*! \typedef QMap::const_iterator::pointer
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp
index e22f122..cf1bff8 100644
--- a/src/corelib/tools/qstringlist.cpp
+++ b/src/corelib/tools/qstringlist.cpp
@@ -621,8 +621,6 @@ int QtPrivate::QStringList_lastIndexOf(const QStringList *that, QRegExp &rx, int
the list, searching forward from index position \a from. Returns
-1 if no item matched.
- By default, this function is case sensitive.
-
\sa lastIndexOf(), contains(), QList::indexOf()
*/
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp
index 789b364..7d61eac 100644
--- a/src/gui/dialogs/qfiledialog.cpp
+++ b/src/gui/dialogs/qfiledialog.cpp
@@ -568,8 +568,9 @@ bool QFileDialogPrivate::canBeNativeDialog()
}
/*!
- Sets the given \a option to be enabled if \a on is true;
- otherwise, clears the given \a option.
+ \since 4.5
+ Sets the given \a option to be enabled if \a on is true; otherwise,
+ clears the given \a option.
\sa options, testOption()
*/
@@ -779,6 +780,7 @@ void QFileDialog::selectFile(const QString &filename)
}
QModelIndex index = d->model->index(filename);
+ QString file;
if (!index.isValid()) {
// save as dialog where we want to input a default value
QString text = filename;
@@ -793,13 +795,13 @@ void QFileDialog::selectFile(const QString &filename)
)
text = text.remove(0,1);
}
- if (!isVisible() || !d->lineEdit()->hasFocus())
- d->lineEdit()->setText(text);
+ file = text;
} else {
- d->qFileDialogUi->listView->selectionModel()->clear();
- if (!isVisible() || !d->lineEdit()->hasFocus())
- d->lineEdit()->setText(index.data().toString());
+ file = index.data().toString();
}
+ d->qFileDialogUi->listView->selectionModel()->clear();
+ if (!isVisible() || !d->lineEdit()->hasFocus())
+ d->lineEdit()->setText(file);
}
/**
@@ -2110,6 +2112,7 @@ void QFileDialogPrivate::createWidgets()
#else
model->setNameFilterDisables(false);
#endif
+ model->d_func()->disableRecursiveSort = true;
QFileDialog::connect(model, SIGNAL(fileRenamed(const QString &, const QString &, const QString &)), q, SLOT(_q_fileRenamed(const QString &, const QString &, const QString &)));
QFileDialog::connect(model, SIGNAL(rootPathChanged(const QString &)),
q, SLOT(_q_pathChanged(const QString &)));
diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp
index 49a3f2e..44adc75 100644
--- a/src/gui/dialogs/qfilesystemmodel.cpp
+++ b/src/gui/dialogs/qfilesystemmodel.cpp
@@ -1095,6 +1095,7 @@ private:
*/
void QFileSystemModelPrivate::sortChildren(int column, const QModelIndex &parent)
{
+ Q_Q(QFileSystemModel);
QFileSystemModelPrivate::QFileSystemNode *indexNode = node(parent);
if (indexNode->children.count() == 0)
return;
@@ -1118,6 +1119,16 @@ void QFileSystemModelPrivate::sortChildren(int column, const QModelIndex &parent
indexNode->visibleChildren.append(values.at(i).first->fileName);
values.at(i).first->isVisible = true;
}
+
+ if (!disableRecursiveSort) {
+ for (int i = 0; i < q->rowCount(parent); ++i) {
+ const QModelIndex childIndex = q->index(i, 0, parent);
+ QFileSystemModelPrivate::QFileSystemNode *indexNode = node(childIndex);
+ //Only do a recursive sort on visible nodes
+ if (indexNode->isVisible)
+ sortChildren(column, childIndex);
+ }
+ }
}
/*!
diff --git a/src/gui/dialogs/qfilesystemmodel_p.h b/src/gui/dialogs/qfilesystemmodel_p.h
index 0a1265a..af4fada 100644
--- a/src/gui/dialogs/qfilesystemmodel_p.h
+++ b/src/gui/dialogs/qfilesystemmodel_p.h
@@ -164,9 +164,12 @@ public:
QHash<QString, QFileSystemNode *>::const_iterator iterator;
for(iterator = children.constBegin() ; iterator != children.constEnd() ; ++iterator) {
//On windows the root (My computer) has no path so we don't want to add a / for nothing (e.g. /C:/)
- if (!path.isEmpty())
- iterator.value()->updateIcon(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName);
- else
+ if (!path.isEmpty()) {
+ if (path.endsWith(QLatin1Char('/')))
+ iterator.value()->updateIcon(iconProvider, path + iterator.value()->fileName);
+ else
+ iterator.value()->updateIcon(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName);
+ } else
iterator.value()->updateIcon(iconProvider, iterator.value()->fileName);
}
}
@@ -177,9 +180,12 @@ public:
QHash<QString, QFileSystemNode *>::const_iterator iterator;
for(iterator = children.constBegin() ; iterator != children.constEnd() ; ++iterator) {
//On windows the root (My computer) has no path so we don't want to add a / for nothing (e.g. /C:/)
- if (!path.isEmpty())
- iterator.value()->retranslateStrings(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName);
- else
+ if (!path.isEmpty()) {
+ if (path.endsWith(QLatin1Char('/')))
+ iterator.value()->retranslateStrings(iconProvider, path + iterator.value()->fileName);
+ else
+ iterator.value()->retranslateStrings(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName);
+ } else
iterator.value()->retranslateStrings(iconProvider, iterator.value()->fileName);
}
}
@@ -202,7 +208,8 @@ public:
readOnly(true),
setRootPath(false),
filters(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs),
- nameFilterDisables(true) // false on windows, true on mac and unix
+ nameFilterDisables(true), // false on windows, true on mac and unix
+ disableRecursiveSort(false)
{
delayedSortTimer.setSingleShot(true);
}
@@ -288,6 +295,10 @@ public:
QDir::Filters filters;
QHash<const QFileSystemNode*, bool> bypassFilters;
bool nameFilterDisables;
+ //This flag is an optimization for the QFileDialog
+ //It enable a sort which is not recursive, it means
+ //we sort only what we see.
+ bool disableRecursiveSort;
#ifndef QT_NO_REGEXP
QList<QRegExp> nameFilters;
#endif
diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp
index 4c5bf4f..aa1c553 100644
--- a/src/gui/dialogs/qfontdialog.cpp
+++ b/src/gui/dialogs/qfontdialog.cpp
@@ -337,6 +337,14 @@ void QFontDialogPrivate::init()
QFontDialog::~QFontDialog()
{
+#ifdef Q_WS_MAC
+ Q_D(QFontDialog);
+ if (d->delegate) {
+ QFontDialogPrivate::closeCocoaFontPanel(d->delegate);
+ QFontDialogPrivate::sharedFontPanelAvailable = true;
+ return;
+ }
+#endif
}
/*!
diff --git a/src/gui/dialogs/qfontdialog_mac.mm b/src/gui/dialogs/qfontdialog_mac.mm
index 50917a1..3be53db 100644
--- a/src/gui/dialogs/qfontdialog_mac.mm
+++ b/src/gui/dialogs/qfontdialog_mac.mm
@@ -47,6 +47,7 @@
#include <private/qapplication_p.h>
#include <private/qfont_p.h>
#include <private/qfontengine_p.h>
+#include <private/qt_cocoa_helpers_mac_p.h>
#include <private/qt_mac_p.h>
#include <qdebug.h>
#import <AppKit/AppKit.h>
@@ -123,16 +124,16 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
QFont newFont;
if (cocoaFont) {
int pSize = qRound([cocoaFont pointSize]);
- QString family(QCFString::toQString(reinterpret_cast<CFStringRef>([cocoaFont familyName])));
- QString typeface(QCFString::toQString(reinterpret_cast<CFStringRef>([cocoaFont fontName])));
-// qDebug() << "original family" << family << "typeface" << typeface << "psize" << pSize;
+ QString family(qt_mac_NSStringToQString([cocoaFont familyName]));
+ QString typeface(qt_mac_NSStringToQString([cocoaFont fontName]));
+
int hyphenPos = typeface.indexOf(QLatin1Char('-'));
if (hyphenPos != -1) {
typeface.remove(0, hyphenPos + 1);
} else {
typeface = QLatin1String("Normal");
}
-// qDebug() << " massaged family" << family << "typeface" << typeface << "psize" << pSize;
+
newFont = QFontDatabase().font(family, typeface, pSize);
newFont.setUnderline(resolveFont.underline());
newFont.setStrikeOut(resolveFont.strikeOut());
@@ -566,6 +567,7 @@ void *QFontDialogPrivate::openCocoaFontPanel(const QFont &initial,
void QFontDialogPrivate::closeCocoaFontPanel(void *delegate)
{
+ QMacCocoaAutoReleasePool pool;
QCocoaFontPanelDelegate *theDelegate = static_cast<QCocoaFontPanelDelegate *>(delegate);
NSWindow *ourPanel = [theDelegate actualPanel];
[ourPanel close];
@@ -597,15 +599,37 @@ QFont QFontDialogPrivate::execCocoaFontPanel(bool *ok, const QFont &initial,
}
}
-void QFontDialogPrivate::setFont(void * delegate, const QFont &font)
+void QFontDialogPrivate::setFont(void *delegate, const QFont &font)
{
+ QMacCocoaAutoReleasePool pool;
QFontEngine *fe = font.d->engineForScript(QUnicodeTables::Common);
+ NSFontManager *mgr = [NSFontManager sharedFontManager];
+ NSFont *nsFont = 0;
+
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
if (qstrcmp(fe->name(), "CoreText") == 0) {
- const NSFont *nsFont = reinterpret_cast<const NSFont *>(static_cast<QCoreTextFontEngineMulti *>(fe)->ctfont);
- [[NSFontManager sharedFontManager] setSelectedFont:nsFont isMultiple:NO];
- }
+ nsFont = reinterpret_cast<const NSFont *>(static_cast<QCoreTextFontEngineMulti *>(fe)->ctfont);
+ } else
#endif
+ {
+ int weight = 5;
+ NSFontTraitMask mask = 0;
+ if (font.style() == QFont::StyleItalic) {
+ mask |= NSItalicFontMask;
+ }
+ if (font.weight() == QFont::Bold) {
+ weight = 9;
+ mask |= NSBoldFontMask;
+ }
+
+ NSFontManager *mgr = [NSFontManager sharedFontManager];
+ nsFont = [mgr fontWithFamily:qt_mac_QStringToNSString(font.family())
+ traits:mask
+ weight:weight
+ size:font.pointSize()];
+ }
+
+ [mgr setSelectedFont:nsFont isMultiple:NO];
[static_cast<QCocoaFontPanelDelegate *>(delegate) setQtFont:font];
}
diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp
index 220faa3..00baf01 100644
--- a/src/gui/dialogs/qmessagebox.cpp
+++ b/src/gui/dialogs/qmessagebox.cpp
@@ -1723,7 +1723,7 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
QMessageBox *msgBox = new QMessageBox(parent);
msgBox->setAttribute(Qt::WA_DeleteOnClose);
msgBox->setWindowTitle(title.isEmpty() ? tr("About Qt") : title);
- msgBox->setText(translatedTextAboutQt);
+ msgBox->setInformativeText(translatedTextAboutQt);
QPixmap pm(QLatin1String(":/trolltech/qmessagebox/images/qtlogo-64.png"));
if (!pm.isNull())
diff --git a/src/gui/embedded/qkbdtty_qws.cpp b/src/gui/embedded/qkbdtty_qws.cpp
index b588e55..7c162bc 100644
--- a/src/gui/embedded/qkbdtty_qws.cpp
+++ b/src/gui/embedded/qkbdtty_qws.cpp
@@ -97,6 +97,7 @@ private slots:
private:
QWSPC101KeyboardHandler *handler;
struct termios origTermData;
+ int originalKbdMode;
};
QWSTtyKeyboardHandler::QWSTtyKeyboardHandler(const QString &device)
@@ -156,6 +157,7 @@ QWSTtyKbPrivate::QWSTtyKbPrivate(QWSPC101KeyboardHandler *h, const QString &devi
tcgetattr(kbdFD, &termdata);
#if defined(Q_OS_LINUX)
+ ioctl(kbdFD, KDGKBMODE, &originalKbdMode);
# ifdef QT_QWS_USE_KEYCODES
ioctl(kbdFD, KDSKBMODE, K_MEDIUMRAW);
# else
@@ -202,7 +204,7 @@ QWSTtyKbPrivate::~QWSTtyKbPrivate()
{
if (kbdFD >= 0) {
#if defined(Q_OS_LINUX)
- ioctl(kbdFD, KDSKBMODE, K_XLATE);
+ ioctl(kbdFD, KDSKBMODE, originalKbdMode);
#endif
tcsetattr(kbdFD, TCSANOW, &origTermData);
::close(kbdFD);
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 4908296..e8ace65 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1522,6 +1522,10 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo
if (visible == quint32(newVisible))
return;
+ // Don't show child if parent is not visible
+ if (parent && newVisible && !parent->d_ptr->visible)
+ return;
+
// Modify the property.
const QVariant newVisibleVariant(q_ptr->itemChange(QGraphicsItem::ItemVisibleChange,
quint32(newVisible)));
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index 7f02fb9..7781258 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -1887,8 +1887,10 @@ void QGraphicsWidget::insertAction(QAction *before, QAction *action)
}
d->actions.insert(pos, action);
- QActionPrivate *apriv = action->d_func();
- apriv->graphicsWidgets.append(this);
+ if (index == -1) {
+ QActionPrivate *apriv = action->d_func();
+ apriv->graphicsWidgets.append(this);
+ }
QActionEvent e(QEvent::ActionAdded, action, before);
QApplication::sendEvent(this, &e);
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index a880a13..0799ea7 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -428,10 +428,13 @@ bool QPixmapIconEngine::read(QDataStream &in)
in >> sz;
in >> mode;
in >> state;
- if (pm.isNull())
+ if (pm.isNull()) {
addFile(fileName, sz, QIcon::Mode(mode), QIcon::State(state));
- else
- addPixmap(pm, QIcon::Mode(mode), QIcon::State(state));
+ } else {
+ QPixmapIconEngineEntry pe(fileName, sz, QIcon::Mode(mode), QIcon::State(state));
+ pe.pixmap = pm;
+ pixmaps += pe;
+ }
}
return true;
}
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 3ef5be3..f85e21a 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -2021,4 +2021,99 @@ QPixmapData* QPixmap::pixmapData() const
return data;
}
+/*!
+ \enum QPixmap::HBitmapFormat
+
+ \bold{Win32 only:} This enum defines how the conversion between \c
+ HBITMAP and QPixmap is performed.
+
+ \warning This enum is only available on Windows.
+
+ \value NoAlpha The alpha channel is ignored and always treated as
+ being set to fully opaque. This is preferred if the \c HBITMAP is
+ used with standard GDI calls, such as \c BitBlt().
+
+ \value PremultipliedAlpha The \c HBITMAP is treated as having an
+ alpha channel and premultiplied colors. This is preferred if the
+ \c HBITMAP is accessed through the \c AlphaBlend() GDI function.
+
+ \value Alpha The \c HBITMAP is treated as having a plain alpha
+ channel. This is the preferred format if the \c HBITMAP is going
+ to be used as an application icon or systray icon.
+
+ \sa fromWinHBITMAP(), toWinHBITMAP()
+*/
+
+/*! \fn HBITMAP QPixmap::toWinHBITMAP(HBitmapFormat format) const
+ \bold{Win32 only:} Creates a \c HBITMAP equivalent to the QPixmap,
+ based on the given \a format. Returns the \c HBITMAP handle.
+
+ It is the caller's responsibility to free the \c HBITMAP data
+ after use.
+
+ \warning This function is only available on Windows.
+
+ \sa fromWinHBITMAP()
+*/
+
+/*! \fn QPixmap QPixmap::fromWinHBITMAP(HBITMAP bitmap, HBitmapFormat format)
+ \bold{Win32 only:} Returns a QPixmap that is equivalent to the
+ given \a bitmap. The conversion is based on the specified \a
+ format.
+
+ \warning This function is only available on Windows.
+
+ \sa toWinHBITMAP(), {QPixmap#Pixmap Conversion}{Pixmap Conversion}
+
+*/
+
+/*! \fn const QX11Info &QPixmap::x11Info() const
+ \bold{X11 only:} Returns information about the configuration of
+ the X display used to display the widget.
+
+ \warning This function is only available on X11.
+
+ \sa {QPixmap#Pixmap Information}{Pixmap Information}
+*/
+
+/*! \fn Qt::HANDLE QPixmap::x11PictureHandle() const
+ \bold{X11 only:} Returns the X11 Picture handle of the pixmap for
+ XRender support.
+
+ This function will return 0 if XRender support is not compiled
+ into Qt, if the XRender extension is not supported on the X11
+ display, or if the handle could not be created. Use of this
+ function is not portable.
+
+ \warning This function is only available on X11.
+
+ \sa {QPixmap#Pixmap Information}{Pixmap Information}
+*/
+
+/*! \fn int QPixmap::x11SetDefaultScreen(int screen)
+ \internal
+*/
+
+/*! \fn void QPixmap::x11SetScreen(int screen)
+ \internal
+*/
+
+/*! \fn QRgb* QPixmap::clut() const
+ \internal
+*/
+
+/*! \fn int QPixmap::numCols() const
+ \internal
+*/
+
+/*! \fn const uchar* QPixmap::qwsBits() const
+ \internal
+ \since 4.1
+*/
+
+/*! \fn int QPixmap::qwsBytesPerLine() const
+ \internal
+ \since 4.1
+*/
+
QT_END_NAMESPACE
diff --git a/src/gui/image/qpixmap_qws.cpp b/src/gui/image/qpixmap_qws.cpp
index 6cc7981..7e383ab 100644
--- a/src/gui/image/qpixmap_qws.cpp
+++ b/src/gui/image/qpixmap_qws.cpp
@@ -109,9 +109,6 @@ QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h)
return QPixmap::fromImage(img);
}
-/*!
- \internal
-*/
QRgb* QPixmap::clut() const
{
if (data->classId() == QPixmapData::RasterClass) {
@@ -122,9 +119,6 @@ QRgb* QPixmap::clut() const
return 0;
}
-/*!
- \internal
-*/
int QPixmap::numCols() const
{
if (data->classId() == QPixmapData::RasterClass) {
@@ -135,10 +129,6 @@ int QPixmap::numCols() const
return 0;
}
-/*!
- \internal
- \since 4.1
-*/
const uchar* QPixmap::qwsBits() const
{
if (data->classId() == QPixmapData::RasterClass) {
@@ -149,10 +139,6 @@ const uchar* QPixmap::qwsBits() const
return 0;
}
-/*!
- \internal
- \since 4.1
-*/
int QPixmap::qwsBytesPerLine() const
{
if (data->classId() == QPixmapData::RasterClass) {
diff --git a/src/gui/image/qpixmap_win.cpp b/src/gui/image/qpixmap_win.cpp
index cbe9004..6a8b38a 100644
--- a/src/gui/image/qpixmap_win.cpp
+++ b/src/gui/image/qpixmap_win.cpp
@@ -119,42 +119,6 @@ QPixmap QPixmap::grabWindow(WId winId, int x, int y, int w, int h )
return pixmap;
}
-
-
-/*!
- \enum QPixmap::HBitmapFormat
-
- This enum defines how the conversion between \c HBITMAP
- and QPixmap is performed.
-
- \warning This enum is only available on Windows.
-
- \value NoAlpha The alpha channel is ignored and always treated as
- being set to fully opaque. This is preferred if the \c HBITMAP is
- used with standard GDI calls, such as \c BitBlt().
-
- \value PremultipliedAlpha The \c HBITMAP is treated as having an
- alpha channel and premultiplied colors. This is preferred if the
- \c HBITMAP is accessed through the \c AlphaBlend() GDI function.
-
- \value Alpha The \c HBITMAP is treated as having a plain alpha
- channel. This is the preferred format if the \c HBITMAP is going
- to be used as an application icon or systray icon.
-
- \sa fromWinHBITMAP(), toWinHBITMAP()
-*/
-
-/*!
- Creates a \c HBITMAP equivalent to the QPixmap, based on the given
- \a format. Returns the \c HBITMAP handle.
-
- It is the caller's responsibility to free the \c HBITMAP data
- after use.
-
- \warning This function is only available on Windows.
-
- \sa fromWinHBITMAP()
-*/
HBITMAP QPixmap::toWinHBITMAP(HBitmapFormat format) const
{
HBITMAP bitmap = 0;
@@ -209,15 +173,6 @@ HBITMAP QPixmap::toWinHBITMAP(HBitmapFormat format) const
return bitmap;
}
-/*!
- Returns a QPixmap that is equivalent to the given \a bitmap. The
- conversion is based on the specified \a format.
-
- \warning This function is only available on Windows.
-
- \sa toWinHBITMAP(), {QPixmap#Pixmap Conversion}{Pixmap Conversion}
-
-*/
QPixmap QPixmap::fromWinHBITMAP(HBITMAP bitmap, HBitmapFormat format)
{
// Verify size
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
index 38916c7..d2e8d84 100644
--- a/src/gui/image/qpixmap_x11.cpp
+++ b/src/gui/image/qpixmap_x11.cpp
@@ -1914,9 +1914,6 @@ QPixmap QX11PixmapData::transformed(const QTransform &transform,
}
}
-/*!
- \internal
-*/
int QPixmap::x11SetDefaultScreen(int screen)
{
int old = defaultScreen;
@@ -1924,9 +1921,6 @@ int QPixmap::x11SetDefaultScreen(int screen)
return old;
}
-/*!
- \internal
-*/
void QPixmap::x11SetScreen(int screen)
{
if (paintingActive()) {
@@ -2034,14 +2028,6 @@ bool QX11PixmapData::hasAlphaChannel() const
return d == 32;
}
-/*!
- Returns information about the configuration of the X display used to display
- the widget.
-
- \warning This function is only available on X11.
-
- \sa {QPixmap#Pixmap Information}{Pixmap Information}
-*/
const QX11Info &QPixmap::x11Info() const
{
if (data->classId() == QPixmapData::X11Class)
@@ -2098,20 +2084,6 @@ QPaintEngine* QX11PixmapData::paintEngine() const
return that->pengine;
}
-/*!
- Returns the X11 Picture handle of the pixmap for XRender
- support.
-
- This function will return 0 if XRender support is not compiled
- into Qt, if the XRender extension is not supported on the X11
- display, or if the handle could not be created. Use of this
- function is not portable.
-
- \warning This function is only available on X11.
-
- \sa {QPixmap#Pixmap Information}{Pixmap Information}
-*/
-
Qt::HANDLE QPixmap::x11PictureHandle() const
{
#ifndef QT_NO_XRENDER
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp
index d373163..f888f5f 100644
--- a/src/gui/itemviews/qheaderview.cpp
+++ b/src/gui/itemviews/qheaderview.cpp
@@ -1267,8 +1267,10 @@ void QHeaderView::setSortIndicator(int logicalIndex, Qt::SortOrder order)
d->sortIndicatorSection = logicalIndex;
d->sortIndicatorOrder = order;
- if (logicalIndex >= d->sectionCount)
+ if (logicalIndex >= d->sectionCount) {
+ emit sortIndicatorChanged(logicalIndex, order);
return; // nothing to do
+ }
if (old != logicalIndex
&& ((logicalIndex >= 0 && resizeMode(logicalIndex) == ResizeToContents)
diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp
index 43feda8..92dfd19 100644
--- a/src/gui/itemviews/qsortfilterproxymodel.cpp
+++ b/src/gui/itemviews/qsortfilterproxymodel.cpp
@@ -1518,7 +1518,8 @@ void QSortFilterProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
d->clear_mapping();
reset();
- d->update_source_sort_column();
+ if (d->update_source_sort_column() && d->dynamic_sortfilter)
+ d->sort();
}
/*!
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index 62c1277..1070648 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -246,7 +246,7 @@ void QTreeView::setModel(QAbstractItemModel *model)
connect(d->model, SIGNAL(modelAboutToBeReset()), SLOT(_q_modelAboutToBeReset()));
if (d->sortingEnabled)
- sortByColumn(header()->sortIndicatorSection(), header()->sortIndicatorOrder());
+ d->_q_sortIndicatorChanged(header()->sortIndicatorSection(), header()->sortIndicatorOrder());
}
/*!
@@ -846,17 +846,19 @@ void QTreeView::setExpanded(const QModelIndex &index, bool expanded)
void QTreeView::setSortingEnabled(bool enable)
{
Q_D(QTreeView);
- d->sortingEnabled = enable;
header()->setSortIndicatorShown(enable);
header()->setClickable(enable);
if (enable) {
+ //sortByColumn has to be called before we connect or set the sortingEnabled flag
+ // because otherwise it will not call sort on the model.
+ sortByColumn(header()->sortIndicatorSection(), header()->sortIndicatorOrder());
connect(header(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)),
this, SLOT(_q_sortIndicatorChanged(int, Qt::SortOrder)));
- sortByColumn(header()->sortIndicatorSection(), header()->sortIndicatorOrder());
} else {
disconnect(header(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)),
this, SLOT(_q_sortIndicatorChanged(int, Qt::SortOrder)));
}
+ d->sortingEnabled = enable;
}
bool QTreeView::isSortingEnabled() const
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index f14ad6f..239ee14 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -1675,20 +1675,23 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
// send the context menu event is a different one
if (!alienWidget->testAttribute(Qt::WA_NativeWindow) && !alienWidget->testAttribute(Qt::WA_PaintOnScreen)) {
alienWidget = QApplication::widgetAt(globalPos);
- pos = alienWidget->mapFromGlobal(globalPos);
+ if (alienWidget)
+ pos = alienWidget->mapFromGlobal(globalPos);
}
- SHRGINFO shrg;
- shrg.cbSize = sizeof(shrg);
- shrg.hwndClient = hwnd;
- shrg.ptDown.x = GET_X_LPARAM(lParam);
- shrg.ptDown.y = GET_Y_LPARAM(lParam);
- shrg.dwFlags = SHRG_RETURNCMD | SHRG_NOANIMATION;
- resolveAygLibs();
- if (ptrRecognizeGesture && (ptrRecognizeGesture(&shrg) == GN_CONTEXTMENU)) {
- if (qApp->activePopupWidget())
- qApp->activePopupWidget()->close();
- QContextMenuEvent e(QContextMenuEvent::Mouse, pos, globalPos);
- result = qt_sendSpontaneousEvent(alienWidget, &e);
+ if (alienWidget) {
+ SHRGINFO shrg;
+ shrg.cbSize = sizeof(shrg);
+ shrg.hwndClient = hwnd;
+ shrg.ptDown.x = GET_X_LPARAM(lParam);
+ shrg.ptDown.y = GET_Y_LPARAM(lParam);
+ shrg.dwFlags = SHRG_RETURNCMD | SHRG_NOANIMATION;
+ resolveAygLibs();
+ if (ptrRecognizeGesture && (ptrRecognizeGesture(&shrg) == GN_CONTEXTMENU)) {
+ if (qApp->activePopupWidget())
+ qApp->activePopupWidget()->close();
+ QContextMenuEvent e(QContextMenuEvent::Mouse, pos, globalPos);
+ result = qt_sendSpontaneousEvent(alienWidget, &e);
+ }
}
}
}
diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
index 9a24645..2ca6a3d 100644
--- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
+++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
@@ -90,6 +90,7 @@
QT_BEGIN_NAMESPACE
extern void onApplicationChangedActivation(bool); // qapplication_mac.mm
+extern void qt_release_apple_event_handler(); //qapplication_mac.mm
QT_END_NAMESPACE
QT_FORWARD_DECLARE_CLASS(QDesktopWidgetImplementation)
@@ -207,7 +208,6 @@ static void cleanupCocoaApplicationDelegate()
{
Q_UNUSED(aNotification);
inLaunch = false;
- extern void qt_release_apple_event_handler(); //qapplication_mac.mm
qt_release_apple_event_handler();
}
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 4ceae3f..f1a7f39 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -789,10 +789,22 @@ extern "C" {
bool wheelOK = false;
Qt::KeyboardModifiers keyMods = qt_cocoaModifiers2QtModifiers([theEvent modifierFlags]);
+ QWidget *widgetToGetMouse = qwidget;
+ if (widgetToGetMouse->testAttribute(Qt::WA_TransparentForMouseEvents)) {
+ // Simulate passing the event through since Cocoa doesn't do that for us.
+ // Start by building a tree up.
+ NSView *candidateView = [self viewUnderTransparentForMouseView:self
+ widget:widgetToGetMouse
+ withWindowPoint:windowPoint];
+ if (candidateView != nil) {
+ widgetToGetMouse = QWidget::find(WId(candidateView));
+ }
+ }
+
// Mouse wheel deltas seem to tick in at increments of 0.1. Qt widgets
- // expect the delta to be a multiple of 120.
+ // expect the delta to be a multiple of 120.
const int ScrollFactor = 10 * 120;
- // The qMax(...) factor reduces the
+ // The qMax(...) factor reduces the
// acceleration for large wheel deltas.
int deltaX = [theEvent deltaX] * ScrollFactor * qMax(0.6, 1.1 - qAbs([theEvent deltaX]));
int deltaY = [theEvent deltaY] * ScrollFactor * qMax(0.6, 1.1 - qAbs([theEvent deltaY]));
@@ -800,10 +812,10 @@ extern "C" {
if (deltaX != 0) {
QWheelEvent qwe(qlocal, qglobal, deltaX, buttons, keyMods, Qt::Horizontal);
- qt_sendSpontaneousEvent(qwidget, &qwe);
+ qt_sendSpontaneousEvent(widgetToGetMouse, &qwe);
wheelOK = qwe.isAccepted();
if (!wheelOK && QApplicationPrivate::focus_widget
- && QApplicationPrivate::focus_widget != qwidget) {
+ && QApplicationPrivate::focus_widget != widgetToGetMouse) {
QWheelEvent qwe2(QApplicationPrivate::focus_widget->mapFromGlobal(qglobal), qglobal,
deltaX, buttons, keyMods, Qt::Horizontal);
qt_sendSpontaneousEvent(QApplicationPrivate::focus_widget, &qwe2);
@@ -813,10 +825,10 @@ extern "C" {
if (deltaY) {
QWheelEvent qwe(qlocal, qglobal, deltaY, buttons, keyMods, Qt::Vertical);
- qt_sendSpontaneousEvent(qwidget, &qwe);
+ qt_sendSpontaneousEvent(widgetToGetMouse, &qwe);
wheelOK = qwe.isAccepted();
if (!wheelOK && QApplicationPrivate::focus_widget
- && QApplicationPrivate::focus_widget != qwidget) {
+ && QApplicationPrivate::focus_widget != widgetToGetMouse) {
QWheelEvent qwe2(QApplicationPrivate::focus_widget->mapFromGlobal(qglobal), qglobal,
deltaY, buttons, keyMods, Qt::Vertical);
qt_sendSpontaneousEvent(QApplicationPrivate::focus_widget, &qwe2);
@@ -828,10 +840,10 @@ extern "C" {
// Qt doesn't explicitly support wheels with a Z component. In a misguided attempt to
// try to be ahead of the pack, I'm adding this extra value.
QWheelEvent qwe(qlocal, qglobal, deltaZ, buttons, keyMods, (Qt::Orientation)3);
- qt_sendSpontaneousEvent(qwidget, &qwe);
+ qt_sendSpontaneousEvent(widgetToGetMouse, &qwe);
wheelOK = qwe.isAccepted();
if (!wheelOK && QApplicationPrivate::focus_widget
- && QApplicationPrivate::focus_widget != qwidget) {
+ && QApplicationPrivate::focus_widget != widgetToGetMouse) {
QWheelEvent qwe2(QApplicationPrivate::focus_widget->mapFromGlobal(qglobal), qglobal,
deltaZ, buttons, keyMods, (Qt::Orientation)3);
qt_sendSpontaneousEvent(QApplicationPrivate::focus_widget, &qwe2);
diff --git a/src/gui/kernel/qcocoaview_mac_p.h b/src/gui/kernel/qcocoaview_mac_p.h
index 983c762..527b1a6 100644
--- a/src/gui/kernel/qcocoaview_mac_p.h
+++ b/src/gui/kernel/qcocoaview_mac_p.h
@@ -59,6 +59,7 @@ QT_FORWARD_DECLARE_CLASS(QWidgetPrivate);
QT_FORWARD_DECLARE_CLASS(QWidget);
QT_FORWARD_DECLARE_CLASS(QEvent);
QT_FORWARD_DECLARE_CLASS(QCocoaDropData);
+QT_FORWARD_DECLARE_CLASS(QStringList);
QT_BEGIN_NAMESPACE
struct DnDParams
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp
index c24abc4..21a4287 100644
--- a/src/gui/kernel/qcursor.cpp
+++ b/src/gui/kernel/qcursor.cpp
@@ -375,7 +375,9 @@ void QCursorData::cleanup()
return;
for (int shape = 0; shape <= Qt::LastCursor; ++shape) {
- delete qt_cursorTable[shape];
+ // In case someone has a static QCursor defined with this shape
+ if (!qt_cursorTable[shape]->ref.deref())
+ delete qt_cursorTable[shape];
qt_cursorTable[shape] = 0;
}
QCursorData::initialized = false;
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 352d26a..3bcf9e3 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -629,8 +629,6 @@ const uint QKeySequencePrivate::numberOfKeyBindings = sizeof(QKeySequencePrivate
This enum represent standard key bindings. They can be used to
assign platform dependent keyboard shortcuts to a QAction.
- QKeyEvent also provides the function QKeyEvent::standardKey() to
- query if it matches an existing key binding.
Note that the key bindings are platform dependent. The currently
bound shortcuts can be queried using keyBindings().
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 6202b35..6250fb77 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -1509,7 +1509,6 @@ QWidget *QWidget::keyboardGrabber()
void QWidget::activateWindow()
{
- Q_D(QWidget);
QWidget *tlw = window();
if (tlw->isVisible() && !tlw->d_func()->topData()->embedded && !X11->deferred_map.contains(tlw)) {
if (X11->userTime == 0)
@@ -2487,6 +2486,8 @@ void QWidgetPrivate::scroll_sys(int dx, int dy, const QRect &r)
QRect sr = valid_rect ? r : clipRect();
if (just_update)
q->update();
+ else if (!valid_rect)
+ dirty.translate(dx, dy);
int x1, y1, x2, y2, w = sr.width(), h = sr.height();
if (dx > 0) {
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index 9ce16d3..1b2c4e3 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -2695,7 +2695,7 @@ qreal QPainterPath::length() const
/*!
Returns percentage of the whole path at the specified length \a len.
- Note that similarly to other percent methods, the percentage measurment
+ Note that similarly to other percent methods, the percentage measurement
is not linear with regards to the length, if curves are present
in the path. When curves are present the percentage argument is mapped
to the t parameter of the Bezier equations.
@@ -2812,7 +2812,7 @@ static inline QBezier bezierAtT(const QPainterPath &path, qreal t, qreal *starti
Returns the point at at the percentage \a t of the current path.
The argument \a t has to be between 0 and 1.
- Note that similarly to other percent methods, the percentage measurment
+ Note that similarly to other percent methods, the percentage measurement
is not linear with regards to the length, if curves are present
in the path. When curves are present the percentage argument is mapped
to the t parameter of the Bezier equations.
@@ -2843,7 +2843,7 @@ QPointF QPainterPath::pointAtPercent(qreal t) const
Positive values for the angles mean counter-clockwise while negative values
mean the clockwise direction. Zero degrees is at the 3 o'clock position.
- Note that similarly to the other percent methods, the percentage measurment
+ Note that similarly to the other percent methods, the percentage measurement
is not linear with regards to the length if curves are present
in the path. When curves are present the percentage argument is mapped
to the t parameter of the Bezier equations.
@@ -2875,7 +2875,7 @@ qreal QPainterPath::angleAtPercent(qreal t) const
Returns the slope of the path at the percentage \a t. The
argument \a t has to be between 0 and 1.
- Note that similarly to other percent methods, the percentage measurment
+ Note that similarly to other percent methods, the percentage measurement
is not linear with regards to the length, if curves are present
in the path. When curves are present the percentage argument is mapped
to the t parameter of the Bezier equations.
diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp
index 5090b3a..ed72077 100644
--- a/src/gui/painting/qprinter.cpp
+++ b/src/gui/painting/qprinter.cpp
@@ -480,26 +480,26 @@ void QPrinterPrivate::addToManualSetList(QPrintEngine::PrintEnginePropertyKey ke
\value A7 74 x 105 mm
\value A8 52 x 74 mm
\value A9 37 x 52 mm
- \value B0 1030 x 1456 mm
- \value B1 728 x 1030 mm
- \value B10 32 x 45 mm
- \value B2 515 x 728 mm
- \value B3 364 x 515 mm
- \value B4 257 x 364 mm
- \value B5 182 x 257 mm, 7.17 x 10.13 inches
- \value B6 128 x 182 mm
- \value B7 91 x 128 mm
- \value B8 64 x 91 mm
- \value B9 45 x 64 mm
+ \value B0 1000 x 1414 mm
+ \value B1 707 x 1000 mm
+ \value B2 500 x 707 mm
+ \value B3 353 x 500 mm
+ \value B4 250 x 353 mm
+ \value B5 176 x 250 mm, 6.93 x 9.84 inches
+ \value B6 125 x 176 mm
+ \value B7 88 x 125 mm
+ \value B8 62 x 88 mm
+ \value B9 33 x 62 mm
+ \value B10 31 x 44 mm
\value C5E 163 x 229 mm
\value Comm10E 105 x 241 mm, U.S. Common 10 Envelope
\value DLE 110 x 220 mm
- \value Executive 7.5 x 10 inches, 191 x 254 mm
+ \value Executive 7.5 x 10 inches, 190.5 x 254 mm
\value Folio 210 x 330 mm
- \value Ledger 432 x 279 mm
- \value Legal 8.5 x 14 inches, 216 x 356 mm
- \value Letter 8.5 x 11 inches, 216 x 279 mm
- \value Tabloid 279 x 432 mm
+ \value Ledger 431.8 x 279.4 mm
+ \value Legal 8.5 x 14 inches, 215.9 x 355.6 mm
+ \value Letter 8.5 x 11 inches, 215.9 x 279.4 mm
+ \value Tabloid 279.4 x 431.8 mm
\value Custom Unknown, or a user defined size.
With setFullPage(false) (the default), the metrics will be a bit
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 3fd1ffb..89df869 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -92,8 +92,8 @@ void QTextureGlyphCache::populate(const QTextItemInt &ti,
int glyph_height = metrics.height.ceil().toInt();
if (glyph_height == 0 || glyph_width == 0)
continue;
- glyph_width += margin * 2 + 2;
- glyph_height += margin * 2 + 2;
+ glyph_width += margin * 2 + 4;
+ glyph_height += margin * 2 + 4;
// align to 8-bit boundary
if (m_type == QFontEngineGlyphCache::Raster_Mono)
glyph_width = (glyph_width+7)&~7;
@@ -189,7 +189,11 @@ void QImageTextureGlyphCache::createTextureData(int width, int height)
int QImageTextureGlyphCache::glyphMargin() const
{
+#ifdef Q_WS_MAC
return 2;
+#else
+ return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0;
+#endif
}
void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g)
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index 86653df..0e54af8 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -940,10 +940,6 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
case PE_FrameLineEdit: {
GtkWidget *gtkEntry = QGtk::gtkWidget(QLS("GtkEntry"));
- if (option->state & State_HasFocus)
- GTK_WIDGET_SET_FLAGS(gtkEntry, GTK_HAS_FOCUS);
- else
- GTK_WIDGET_UNSET_FLAGS(gtkEntry, GTK_HAS_FOCUS);
gboolean interior_focus;
gint focus_line_width;
@@ -957,6 +953,9 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
if (!interior_focus && option->state & State_HasFocus)
rect.adjust(focus_line_width, focus_line_width, -focus_line_width, -focus_line_width);
+
+ if (option->state & State_HasFocus)
+ GTK_WIDGET_SET_FLAGS(gtkEntry, GTK_HAS_FOCUS);
gtkPainter.paintShadow(gtkEntry, "entry", rect, option->state & State_Enabled ?
GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE,
GTK_SHADOW_IN, gtkEntry->style,
@@ -965,6 +964,9 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
gtkPainter.paintShadow(gtkEntry, "entry", option->rect, option->state & State_Enabled ?
GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE,
GTK_SHADOW_IN, gtkEntry->style, QLS("GtkEntryShadowIn"));
+
+ if (option->state & State_HasFocus)
+ GTK_WIDGET_UNSET_FLAGS(gtkEntry, GTK_HAS_FOCUS);
}
break;
@@ -1050,17 +1052,13 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
GTK_WIDGET_SET_FLAGS(gtkButton, GTK_HAS_DEFAULT);
gtkPainter.paintBox(gtkButton, "buttondefault", buttonRect, state, GTK_SHADOW_IN,
style, isDefault ? QLS("d") : QString());
- } else
- GTK_WIDGET_UNSET_FLAGS(gtkButton, GTK_HAS_DEFAULT);
+ }
bool hasFocus = option->state & State_HasFocus;
if (hasFocus) {
key += QLS("def");
GTK_WIDGET_SET_FLAGS(gtkButton, GTK_HAS_FOCUS);
-
- } else {
- GTK_WIDGET_UNSET_FLAGS(gtkButton, GTK_HAS_FOCUS);
}
if (!interiorFocus)
@@ -1071,6 +1069,10 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
gtkPainter.paintBox(gtkButton, "button", buttonRect, state, shadow,
style, key);
+ if (isDefault)
+ GTK_WIDGET_UNSET_FLAGS(gtkButton, GTK_HAS_DEFAULT);
+ if (hasFocus)
+ GTK_WIDGET_UNSET_FLAGS(gtkButton, GTK_HAS_FOCUS);
}
break;
@@ -1334,6 +1336,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
GtkWidget *gtkToggleButton = QGtk::gtkWidget(buttonPath);
QGtk::gtk_widget_set_direction(gtkToggleButton, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
if (gtkToggleButton && (appears_as_list || comboBox->editable)) {
+ if (focus)
+ GTK_WIDGET_SET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
// Draw the combo box as a line edit with a button next to it
if (comboBox->editable || appears_as_list) {
GtkStateType frameState = (state == GTK_STATE_PRELIGHT) ? GTK_STATE_NORMAL : state;
@@ -1347,22 +1351,16 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
else
frameRect.setRight(arrowButtonRect.left());
- // Required for inner blue highlight with clearlooks
- if (focus) {
- GTK_WIDGET_SET_FLAGS(gtkEntry, GTK_HAS_FOCUS);
- GTK_WIDGET_SET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
-
- } else {
- GTK_WIDGET_UNSET_FLAGS(gtkEntry, GTK_HAS_FOCUS);
- GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
- }
-
// Fill the line edit background
// We could have used flat_box with "entry_bg" but that is probably not worth the overhead
uint resolve_mask = option->palette.resolve();
int xt = gtkEntry->style->xthickness;
int yt = gtkEntry->style->ythickness;
QRect contentRect = frameRect.adjusted(xt, yt, -xt, -yt);
+ // Required for inner blue highlight with clearlooks
+ if (focus)
+ GTK_WIDGET_SET_FLAGS(gtkEntry, GTK_HAS_FOCUS);
+
if (widget && widget->testAttribute(Qt::WA_SetPalette) &&
resolve_mask & (1 << QPalette::Base)) // Palette overridden by user
p->fillRect(contentRect, option->palette.base().color());
@@ -1376,6 +1374,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
GTK_SHADOW_IN, gtkEntry->style, entryPath +
QString::number(focus) + QString::number(comboBox->editable) +
QString::number(option->direction));
+ if (focus)
+ GTK_WIDGET_UNSET_FLAGS(gtkEntry, GTK_HAS_FOCUS);
}
GtkStateType buttonState = GTK_STATE_NORMAL;
@@ -1394,22 +1394,21 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
gtkCachedPainter.paintBox( gtkToggleButton, "button", arrowButtonRect, buttonState,
shadow, gtkToggleButton->style, buttonPath +
QString::number(focus) + QString::number(option->direction));
-
+ if (focus)
+ GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
} else {
// Draw combo box as a button
QRect buttonRect = option->rect;
- if (focus) { // Clearlooks actually check the widget for the default state
+ if (focus) // Clearlooks actually check the widget for the default state
GTK_WIDGET_SET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
-
- } else {
- GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
- }
-
gtkCachedPainter.paintBox(gtkToggleButton, "button",
buttonRect, state,
shadow, gtkToggleButton->style,
buttonPath + QString::number(focus));
+ if (focus)
+ GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
+
// Draw the separator between label and arrows
QString vSeparatorPath = buttonPath + QLS(".GtkHBox.GtkVSeparator");
@@ -1775,15 +1774,12 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
shadow = GTK_SHADOW_IN;
style = gtkPainter.getStyle(gtkSpinButton);
- if (option->state & State_HasFocus)
- GTK_WIDGET_SET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS);
- else
- GTK_WIDGET_UNSET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS);
QString key;
-
- if (option->state & State_HasFocus)
+ if (option->state & State_HasFocus) {
key = QLS("f");
+ GTK_WIDGET_SET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS);
+ }
uint resolve_mask = option->palette.resolve();
@@ -1816,6 +1812,9 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, style, key);
else
gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, style, key);
+
+ if (option->state & State_HasFocus)
+ GTK_WIDGET_UNSET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS);
}
if (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) {
@@ -2344,7 +2343,7 @@ void QGtkStyle::drawControl(ControlElement element,
case CE_SizeGrip: {
GtkWidget *gtkStatusbar = QGtk::gtkWidget(QLS("GtkStatusbar.GtkFrame"));
QRect gripRect = option->rect.adjusted(0, 0, -gtkStatusbar->style->xthickness, -gtkStatusbar->style->ythickness);
- gtkPainter.paintResizeGrip( gtkStatusbar, "window", gripRect, GTK_STATE_NORMAL,
+ gtkPainter.paintResizeGrip( gtkStatusbar, "statusbar", gripRect, GTK_STATE_NORMAL,
GTK_SHADOW_OUT, QApplication::isRightToLeft() ?
GDK_WINDOW_EDGE_SOUTH_WEST : GDK_WINDOW_EDGE_SOUTH_EAST,
gtkStatusbar->style);
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index 714b8c5..bd80bb6 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -5252,9 +5252,12 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi
#ifndef QT_NO_COMBOBOX
if (qobject_cast<const QComboBox *>(w)) {
QAbstractItemView *view = qFindChild<QAbstractItemView *>(w);
- QRenderRule subRule = renderRule(view, PseudoElement_None);
- if (subRule.hasBox() || !subRule.hasNativeBorder())
- return QFrame::NoFrame;
+ if (view) {
+ view->ensurePolished();
+ QRenderRule subRule = renderRule(view, PseudoElement_None);
+ if (subRule.hasBox() || !subRule.hasNativeBorder())
+ return QFrame::NoFrame;
+ }
}
#endif // QT_NO_COMBOBOX
break;
diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp
index bf3a176..7341665 100644
--- a/src/gui/text/qfontengine_win.cpp
+++ b/src/gui/text/qfontengine_win.cpp
@@ -1406,8 +1406,8 @@ QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin
#endif
#endif
- QNativeImage *ni = new QNativeImage(iw + 2 * margin + 2,
- ih + 2 * margin + 2,
+ QNativeImage *ni = new QNativeImage(iw + 2 * margin + 4,
+ ih + 2 * margin + 4,
QNativeImage::systemFormat(), true);
ni->image.fill(0xffffffff);
@@ -1449,7 +1449,7 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform)
font = CreateFontIndirectW(&lf);
}
- QNativeImage *mask = drawGDIGlyph(font, glyph, 2, xform);
+ QNativeImage *mask = drawGDIGlyph(font, glyph, 0, xform);
if (mask == 0)
return QImage();
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 88d0610..87da628 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -670,8 +670,8 @@ QRect QFontMetrics::boundingRect(const QString &text) const
Returns the rectangle that is covered by ink if character \a ch
were to be drawn at the origin of the coordinate system.
- Note that the bounding rectangle may extend to the left of (0, 0),
- e.g. for italicized fonts, and that the text output may cover \e
+ Note that the bounding rectangle may extend to the left of (0, 0)
+ (e.g., for italicized fonts), and that the text output may cover \e
all pixels in the bounding rectangle. For a space character the rectangle
will usually be empty.
@@ -724,7 +724,7 @@ QRect QFontMetrics::boundingRect(QChar ch) const
\o Qt::AlignCenter (== \c{Qt::AlignHCenter | Qt::AlignVCenter})
\o Qt::TextSingleLine ignores newline characters in the text.
\o Qt::TextExpandTabs expands tabs (see below)
- \o Qt::TextShowMnemonic interprets "&amp;x" as \underline{x}, i.e. underlined.
+ \o Qt::TextShowMnemonic interprets "&x" as \underline{x}; i.e., underlined.
\o Qt::TextWordWrap breaks the text to fit the rectangle.
\endlist
@@ -781,7 +781,7 @@ QRect QFontMetrics::boundingRect(const QRect &rect, int flags, const QString &te
\list
\o Qt::TextSingleLine ignores newline characters.
\o Qt::TextExpandTabs expands tabs (see below)
- \o Qt::TextShowMnemonic interprets "&amp;x" as \underline{x}, i.e. underlined.
+ \o Qt::TextShowMnemonic interprets "&x" as \underline{x}; i.e., underlined.
\o Qt::TextWordBreak breaks the text to fit the rectangle.
\endlist
@@ -1500,7 +1500,7 @@ QRectF QFontMetricsF::boundingRect(QChar ch) const
\o Qt::AlignCenter (== \c{Qt::AlignHCenter | Qt::AlignVCenter})
\o Qt::TextSingleLine ignores newline characters in the text.
\o Qt::TextExpandTabs expands tabs (see below)
- \o Qt::TextShowMnemonic interprets "&amp;x" as \underline{x}, i.e. underlined.
+ \o Qt::TextShowMnemonic interprets "&x" as \underline{x}; i.e., underlined.
\o Qt::TextWordWrap breaks the text to fit the rectangle.
\endlist
@@ -1559,7 +1559,7 @@ QRectF QFontMetricsF::boundingRect(const QRectF &rect, int flags, const QString&
\list
\o Qt::TextSingleLine ignores newline characters.
\o Qt::TextExpandTabs expands tabs (see below)
- \o Qt::TextShowMnemonic interprets "&amp;x" as \underline{x}, i.e. underlined.
+ \o Qt::TextShowMnemonic interprets "&x" as \underline{x}; i.e., underlined.
\o Qt::TextWordBreak breaks the text to fit the rectangle.
\endlist
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp
index 69221ba..785d772 100644
--- a/src/gui/widgets/qtabbar.cpp
+++ b/src/gui/widgets/qtabbar.cpp
@@ -1536,9 +1536,10 @@ void QTabBar::paintEvent(QPaintEvent *)
}
if (!d->dragInProgress)
p.drawControl(QStyle::CE_TabBarTab, tab);
- else
- d->movingTab->setGeometry(tab.rect);
-
+ else {
+ int taboverlap = style()->pixelMetric(QStyle::PM_TabBarTabOverlap, 0, this);
+ d->movingTab->setGeometry(tab.rect.adjusted(-taboverlap, 0, taboverlap, 0));
+ }
}
// Only draw the tear indicator if necessary. Most of the time we don't need too.
@@ -1805,7 +1806,9 @@ void QTabBarPrivate::setupMovableTab()
if (!movingTab)
movingTab = new QWidget(q);
+ int taboverlap = q->style()->pixelMetric(QStyle::PM_TabBarTabOverlap, 0 ,q);
QRect grabRect = q->tabRect(pressedIndex);
+ grabRect.adjust(-taboverlap, 0, taboverlap, 0);
QPixmap grabImage(grabRect.size());
grabImage.fill(Qt::transparent);
@@ -1813,7 +1816,7 @@ void QTabBarPrivate::setupMovableTab()
QStyleOptionTabV3 tab;
q->initStyleOption(&tab, pressedIndex);
- tab.rect.moveTopLeft(QPoint(0, 0));
+ tab.rect.moveTopLeft(QPoint(taboverlap, 0));
p.drawControl(QStyle::CE_TabBarTab, tab);
p.end();
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index 79c3d1a..6f715e5 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -382,7 +382,8 @@ void QNetworkReplyImplPrivate::feed(const QByteArray &data)
void QNetworkReplyImplPrivate::feed(QIODevice *data)
{
Q_Q(QNetworkReplyImpl);
- Q_ASSERT(q->isOpen());
+ if (!q->isOpen())
+ return;
// read until EOF from data
if (copyDevice) {
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 768cafb..b6f91e4 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -99,7 +99,7 @@
the client has read the data). Note that Qt does not limit the
write buffer size. You can monitor its size by listening to this
signal.
-
+
The readyRead() signal is emitted every time a new chunk of data
has arrived. bytesAvailable() then returns the number of bytes
that are available for reading. Typically, you would connect the
@@ -199,9 +199,10 @@
parameter describes the type of error that occurred.
QAbstractSocket::SocketError is not a registered metatype, so for queued
- connections, you will have to register it with Q_REGISTER_METATYPE.
+ connections, you will have to register it with Q_DECLARE_METATYPE() and
+ qRegisterMetaType().
- \sa error(), errorString()
+ \sa error(), errorString(), {Creating Custom Qt Types}
*/
/*!
@@ -211,9 +212,10 @@
The \a socketState parameter is the new state.
QAbstractSocket::SocketState is not a registered metatype, so for queued
- connections, you will have to register it with Q_REGISTER_METATYPE.
+ connections, you will have to register it with Q_REGISTER_METATYPE() and
+ qRegisterMetaType().
- \sa state()
+ \sa state(), {Creating Custom Qt Types}
*/
/*!
@@ -1865,9 +1867,9 @@ bool QAbstractSocket::waitForDisconnected(int msecs)
}
/*!
- Aborts the current connection and resets the socket. Unlike
- disconnectFromHost(), this function immediately closes the socket, discarding
- any pending data in the write buffer.
+ Aborts the current connection and resets the socket. Unlike disconnectFromHost(),
+ this function immediately closes the socket, discarding any pending data in the
+ write buffer.
\sa disconnectFromHost(), close()
*/
@@ -2164,7 +2166,12 @@ void QAbstractSocket::setPeerName(const QString &name)
}
/*!
- Disconnects the socket's connection with the host.
+ Closes the I/O device for the socket, disconnects the socket's connection with the
+ host, closes the socket, and resets the name, address, port number and underlying
+ socket descriptor.
+
+ See QIODevice::close() for a description of the actions that occur when an I/O
+ device is closed.
\sa abort()
*/
@@ -2457,7 +2464,8 @@ QNetworkProxy QAbstractSocket::proxy() const
#endif // QT_NO_NETWORKPROXY
#ifdef QT3_SUPPORT
-/*! \enum QAbstractSocket::Error
+/*!
+ \enum QAbstractSocket::Error
\compat
Use QAbstractSocket::SocketError instead.
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index a2ba644..7b554dc 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -267,7 +267,7 @@ QByteArray QSslCertificate::serialNumber() const
/*!
Returns a cryptographic digest of this certificate. By default,
- and MD5 digest will be generated, but you can also specify a
+ an MD5 digest will be generated, but you can also specify a
custom \a algorithm.
*/
QByteArray QSslCertificate::digest(QCryptographicHash::Algorithm algorithm) const
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 6f8cf42..cb101af 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -482,30 +482,7 @@ void QSslSocketPrivate::resetDefaultCiphers()
QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
{
-#ifdef QQ_OS_UNIX
- // Check known locations for the system's default bundle. ### On Windows,
- // we should use CAPI to find the bundle, and not rely on default unix
- // locations.
- const char *standardLocations[] = {"/etc/ssl/certs/",
-#if 0
- // KDE uses KConfig for its SSL store,
- // but it also stores the bundle at
- // this location
- "$HOME/.kde/share/apps/kssl/ca-bundle.crt",
-#endif
- 0};
- const char **it = standardLocations;
- QStringList nameFilter;
- nameFilter << QLatin1String("*.pem") << QLatin1String("*.crt");
- while (*it) {
- if (QDirIterator(QLatin1String(*it), nameFilter).hasNext())
- return certificatesFromPath(QLatin1String(*it));
- ++it;
- }
-#endif
-
- // Qt provides a default bundle when we cannot detect the system's default
- // bundle.
+ // Qt provides a default bundle of certificates
QFile caBundle(QLatin1String(":/trolltech/network/ssl/qt-ca-bundle.crt"));
if (caBundle.open(QIODevice::ReadOnly | QIODevice::Text))
return QSslCertificate::fromDevice(&caBundle);
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index a74f044..beb4da6 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -926,6 +926,9 @@ void QGL2PaintEngineEx::drawCachedGlyphs(const QPointF &p, const QTextItemInt &t
const QImage &image = cache->image();
int margin = cache->glyphMargin();
+ if (image.isNull())
+ return;
+
glActiveTexture(QT_BRUSH_TEXTURE_UNIT);
d->ctx->d_func()->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, true);
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
index 13f0a8f..180acaf 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
@@ -61,8 +61,6 @@ public:
void lockDirectFB(uint flags);
void unlockDirectFB();
- inline bool forceRasterPrimitives() const { return forceRaster; }
-
// Reimplemented from QCustomRasterPaintDevice:
void* memory() const;
QImage::Format format() const;
@@ -77,7 +75,6 @@ protected:
dfbSurface(0),
lockedImage(0),
screen(scr),
- forceRaster(false),
lock(0),
mem(0)
{}
@@ -95,7 +92,6 @@ protected:
QImage *lockedImage;
QDirectFBScreen *screen;
int bpl;
- bool forceRaster;
uint lock;
uchar *mem;
private:
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index a68bc8f..2fb533a 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -81,7 +81,7 @@ template <> inline const bool* ptr<bool>(const bool &) { return 0; }
template <typename device, typename T1, typename T2, typename T3>
static void rasterFallbackWarn(const char *msg, const char *func, const device *dev,
int scale, bool matrixRotShear, bool simplePen,
- bool dfbHandledClip, bool forceRasterPrimitives,
+ bool dfbHandledClip,
const char *nameOne, const T1 &one,
const char *nameTwo, const T2 &two,
const char *nameThree, const T3 &three)
@@ -98,8 +98,7 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device *
dbg << "scale" << scale
<< "matrixRotShear" << matrixRotShear
<< "simplePen" << simplePen
- << "dfbHandledClip" << dfbHandledClip
- << "forceRasterPrimitives" << forceRasterPrimitives;
+ << "dfbHandledClip" << dfbHandledClip;
const T1 *t1 = ptr(one);
const T2 *t2 = ptr(two);
@@ -125,7 +124,6 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device *
__FUNCTION__, state()->painter->device(), \
d_func()->scale, d_func()->matrixRotShear, \
d_func()->simplePen, d_func()->dfbCanHandleClip(), \
- d_func()->forceRasterPrimitives, \
#one, one, #two, two, #three, three); \
if (op & (QT_DIRECTFB_DISABLE_RASTERFALLBACKS)) \
return;
@@ -140,7 +138,6 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device *
__FUNCTION__, state()->painter->device(), \
d_func()->scale, d_func()->matrixRotShear, \
d_func()->simplePen, d_func()->dfbCanHandleClip(), \
- d_func()->forceRasterPrimitives, \
#one, one, #two, two, #three, three);
#else
#define RASTERFALLBACK(op, one, two, three)
@@ -218,8 +215,8 @@ public:
void setTransform(const QTransform &m);
void setPen(const QPen &pen);
- void setCompositionMode(QPainter::CompositionMode mode);
- void setOpacity(quint8 value);
+ inline void setCompositionMode(QPainter::CompositionMode mode);
+ inline void setOpacity(quint8 value);
void setRenderHints(QPainter::RenderHints hints);
inline void setDFBColor(const QColor &color);
@@ -263,7 +260,6 @@ private:
QPen pen;
bool antialiased;
- bool forceRasterPrimitives;
bool simplePen;
@@ -280,14 +276,12 @@ private:
quint8 opacity;
- quint32 drawFlagsFromCompositionMode, blitFlagsFromCompositionMode;
- DFBSurfacePorterDuffRule porterDuffRule;
-
bool dirtyClip;
bool dfbHandledClip;
bool ignoreSystemClip;
QDirectFBPaintDevice *dfbDevice;
void *lockedMemory;
+ bool unsupportedCompositionMode;
QDirectFBPaintEngine *q;
friend class QDirectFBPaintEngine;
@@ -407,9 +401,8 @@ void QDirectFBPaintEngine::drawRects(const QRect *rects, int rectCount)
Q_D(QDirectFBPaintEngine);
d->updateClip();
const QBrush &brush = state()->brush;
- if (!d->dfbCanHandleClip() || d->matrixRotShear
- || !d->simplePen || d->forceRasterPrimitives
- || !d->isSimpleBrush(brush)) {
+ if (d->unsupportedCompositionMode || !d->dfbCanHandleClip() || d->matrixRotShear
+ || !d->simplePen || !d->isSimpleBrush(brush)) {
RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG());
d->lock();
QRasterPaintEngine::drawRects(rects, rectCount);
@@ -433,9 +426,8 @@ void QDirectFBPaintEngine::drawRects(const QRectF *rects, int rectCount)
Q_D(QDirectFBPaintEngine);
d->updateClip();
const QBrush &brush = state()->brush;
- if (!d->dfbCanHandleClip() || d->matrixRotShear
- || !d->simplePen || d->forceRasterPrimitives
- || !d->isSimpleBrush(brush)) {
+ if (d->unsupportedCompositionMode || !d->dfbCanHandleClip() || d->matrixRotShear
+ || !d->simplePen || !d->isSimpleBrush(brush)) {
RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG());
d->lock();
QRasterPaintEngine::drawRects(rects, rectCount);
@@ -458,7 +450,7 @@ void QDirectFBPaintEngine::drawLines(const QLine *lines, int lineCount)
{
Q_D(QDirectFBPaintEngine);
d->updateClip();
- if (!d->simplePen || !d->dfbCanHandleClip() || d->forceRasterPrimitives) {
+ if (d->unsupportedCompositionMode || !d->simplePen || !d->dfbCanHandleClip()) {
RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG());
d->lock();
QRasterPaintEngine::drawLines(lines, lineCount);
@@ -476,7 +468,7 @@ void QDirectFBPaintEngine::drawLines(const QLineF *lines, int lineCount)
{
Q_D(QDirectFBPaintEngine);
d->updateClip();
- if (!d->simplePen || !d->dfbCanHandleClip() || d->forceRasterPrimitives) {
+ if (d->unsupportedCompositionMode || !d->simplePen || !d->dfbCanHandleClip()) {
RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG());
d->lock();
QRasterPaintEngine::drawLines(lines, lineCount);
@@ -516,7 +508,8 @@ void QDirectFBPaintEngine::drawImage(const QRectF &r, const QImage &image,
d->updateClip();
#if !defined QT_NO_DIRECTFB_PREALLOCATED || defined QT_DIRECTFB_IMAGECACHE
- if (d->matrixRotShear
+ if (d->unsupportedCompositionMode
+ || d->matrixRotShear
|| d->scale == QDirectFBPaintEnginePrivate::NegativeScale
|| !d->dfbCanHandleClip(r)
#ifndef QT_DIRECTFB_IMAGECACHE
@@ -560,7 +553,7 @@ void QDirectFBPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap,
RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr);
d->lock();
QRasterPaintEngine::drawPixmap(r, pixmap, sr);
- } else if (!d->dfbCanHandleClip(r) || d->matrixRotShear
+ } else if (d->unsupportedCompositionMode || !d->dfbCanHandleClip(r) || d->matrixRotShear
|| d->scale == QDirectFBPaintEnginePrivate::NegativeScale) {
RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr);
const QImage *img = static_cast<QDirectFBPixmapData*>(pixmap.pixmapData())->buffer(DSLF_READ);
@@ -592,7 +585,7 @@ void QDirectFBPaintEngine::drawTiledPixmap(const QRectF &r,
RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), sp);
d->lock();
QRasterPaintEngine::drawTiledPixmap(r, pixmap, sp);
- } else if (!d->dfbCanHandleClip(r) || d->matrixRotShear || !sp.isNull()
+ } else if (d->unsupportedCompositionMode || !d->dfbCanHandleClip(r) || d->matrixRotShear || !sp.isNull()
|| d->scale == QDirectFBPaintEnginePrivate::NegativeScale) {
RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), sp);
const QImage *img = static_cast<QDirectFBPixmapData*>(pixmap.pixmapData())->buffer(DSLF_READ);
@@ -688,11 +681,9 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush)
{
Q_D(QDirectFBPaintEngine);
d->updateClip();
- if (d->dfbCanHandleClip(rect) && !d->matrixRotShear) {
+ if (!d->unsupportedCompositionMode && d->dfbCanHandleClip(rect) && !d->matrixRotShear) {
switch (brush.style()) {
case Qt::SolidPattern: {
- if (d->forceRasterPrimitives)
- break;
d->unlock();
d->setDFBColor(brush.color());
const QRect r = d->transform.mapRect(rect).toRect();
@@ -720,7 +711,7 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QColor &color)
{
Q_D(QDirectFBPaintEngine);
d->updateClip();
- if (!d->dfbCanHandleClip() || d->matrixRotShear || d->forceRasterPrimitives) {
+ if (d->unsupportedCompositionMode || !d->dfbCanHandleClip() || d->matrixRotShear) {
RASTERFALLBACK(FILL_RECT, rect, color, VOID_ARG());
d->lock();
QRasterPaintEngine::fillRect(rect, color);
@@ -737,38 +728,32 @@ void QDirectFBPaintEngine::drawColorSpans(const QSpan *spans, int count,
uint color)
{
Q_D(QDirectFBPaintEngine);
- if (d->forceRasterPrimitives) {
- RASTERFALLBACK(DRAW_COLORSPANS, count, color, VOID_ARG());
- d->lock();
- QRasterPaintEngine::drawColorSpans(spans, count, color);
- } else {
- color = INV_PREMUL(color);
-
- QVarLengthArray<DFBRegion> lines(count);
- int j = 0;
- for (int i = 0; i < count; ++i) {
- if (spans[i].coverage == 255) {
- lines[j].x1 = spans[i].x;
- lines[j].y1 = spans[i].y;
- lines[j].x2 = spans[i].x + spans[i].len - 1;
- lines[j].y2 = spans[i].y;
- ++j;
- } else {
- DFBSpan span = { spans[i].x, spans[i].len };
- uint c = BYTE_MUL(color, spans[i].coverage);
- // ### how does this play with setDFBColor
- d->surface->SetColor(d->surface,
- qRed(c), qGreen(c), qBlue(c), qAlpha(c));
- d->surface->FillSpans(d->surface, spans[i].y, &span, 1);
- }
- }
- if (j > 0) {
+ color = INV_PREMUL(color);
+
+ QVarLengthArray<DFBRegion> lines(count);
+ int j = 0;
+ for (int i = 0; i < count; ++i) {
+ if (spans[i].coverage == 255) {
+ lines[j].x1 = spans[i].x;
+ lines[j].y1 = spans[i].y;
+ lines[j].x2 = spans[i].x + spans[i].len - 1;
+ lines[j].y2 = spans[i].y;
+ ++j;
+ } else {
+ DFBSpan span = { spans[i].x, spans[i].len };
+ uint c = BYTE_MUL(color, spans[i].coverage);
+ // ### how does this play with setDFBColor
d->surface->SetColor(d->surface,
- qRed(color), qGreen(color), qBlue(color),
- qAlpha(color));
- d->surface->DrawLines(d->surface, lines.data(), j);
+ qRed(c), qGreen(c), qBlue(c), qAlpha(c));
+ d->surface->FillSpans(d->surface, spans[i].y, &span, 1);
}
}
+ if (j > 0) {
+ d->surface->SetColor(d->surface,
+ qRed(color), qGreen(color), qBlue(color),
+ qAlpha(color));
+ d->surface->DrawLines(d->surface, lines.data(), j);
+ }
}
void QDirectFBPaintEngine::drawBufferSpan(const uint *buffer, int bufsize,
@@ -803,11 +788,11 @@ void QDirectFBPaintEngine::initImageCache(int size)
QDirectFBPaintEnginePrivate::QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p)
- : surface(0), antialiased(false), forceRasterPrimitives(false), simplePen(false),
+ : surface(0), antialiased(false), simplePen(false),
matrixRotShear(false), scale(NoScale), lastLockedHeight(-1),
- fbWidth(-1), fbHeight(-1), opacity(255), drawFlagsFromCompositionMode(0),
- blitFlagsFromCompositionMode(0), porterDuffRule(DSPD_SRC_OVER), dirtyClip(true),
- dfbHandledClip(false), dfbDevice(0), lockedMemory(0), q(p)
+ fbWidth(-1), fbHeight(-1), opacity(255), dirtyClip(true),
+ dfbHandledClip(false), dfbDevice(0), lockedMemory(0),
+ unsupportedCompositionMode(false), q(p)
{
fb = QDirectFBScreen::instance()->dfb();
ignoreSystemClip = QDirectFBScreen::instance()->directFBFlags() & QDirectFBScreen::IgnoreSystemClip;
@@ -896,13 +881,12 @@ void QDirectFBPaintEnginePrivate::begin(QPaintDevice *device)
device->devType());
}
lockedMemory = 0;
- forceRasterPrimitives = dfbDevice->forceRasterPrimitives();
surface->GetSize(surface, &fbWidth, &fbHeight);
setTransform(QTransform());
antialiased = false;
- opacity = 255;
+ setOpacity(255);
setCompositionMode(q->state()->compositionMode());
dirtyClip = true;
setPen(q->state()->pen);
@@ -930,72 +914,13 @@ void QDirectFBPaintEnginePrivate::setPen(const QPen &p)
void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode mode)
{
- blitFlagsFromCompositionMode = DSBLIT_NOFX;
- drawFlagsFromCompositionMode = DSDRAW_NOFX;
-
- bool blend = true;
- switch (mode) {
- case QPainter::CompositionMode_SourceOver:
- porterDuffRule = DSPD_SRC_OVER;
- break;
- case QPainter::CompositionMode_DestinationOver:
- porterDuffRule = DSPD_DST_OVER;
- break;
- case QPainter::CompositionMode_Clear:
- porterDuffRule = DSPD_CLEAR;
- blend = false;
- break;
- case QPainter::CompositionMode_Source:
- porterDuffRule = DSPD_SRC;
- blend = false;
- break;
- case QPainter::CompositionMode_Destination:
- porterDuffRule = DSPD_NONE; // ### need to double check this
- blend = false;
- return;
- case QPainter::CompositionMode_SourceIn:
- porterDuffRule = DSPD_SRC_IN;
- break;
- case QPainter::CompositionMode_DestinationIn:
- porterDuffRule = DSPD_DST_IN;
- break;
- case QPainter::CompositionMode_SourceOut:
- porterDuffRule = DSPD_SRC_OUT;
- break;
- case QPainter::CompositionMode_DestinationOut:
- porterDuffRule = DSPD_DST_OUT;
- break;
- case QPainter::CompositionMode_Xor:
- porterDuffRule = DSPD_XOR;
- blitFlagsFromCompositionMode |= DSBLIT_XOR;
- drawFlagsFromCompositionMode |= DSDRAW_XOR;
- break;
-// case QPainter::CompositionMode_Plus: // ???
-// porterDuffRule = DSPD_ADD;
-// break;
- default:
- qWarning("QDirectFBPaintEnginePrivate::setCompositionMode(): "
- "mode %d not implemented", mode);
- return;
- }
- // intentially not comparing with current porterDuffRule. surface might have changed.
- if (blend) {
- blitFlagsFromCompositionMode |= DSBLIT_BLEND_ALPHACHANNEL;
- drawFlagsFromCompositionMode |= DSDRAW_BLEND;
- }
- if (opacity != 255) {
- setOpacity(opacity);
- }
+ unsupportedCompositionMode = (mode != QPainter::CompositionMode_SourceOver);
}
+
void QDirectFBPaintEnginePrivate::setOpacity(quint8 op)
{
opacity = op;
- if (opacity == 255) {
- blitFlagsFromCompositionMode &= ~DSBLIT_BLEND_COLORALPHA;
- } else {
- blitFlagsFromCompositionMode |= DSBLIT_BLEND_COLORALPHA;
- }
}
void QDirectFBPaintEnginePrivate::setRenderHints(QPainter::RenderHints hints)
@@ -1009,15 +934,9 @@ void QDirectFBPaintEnginePrivate::setRenderHints(QPainter::RenderHints hints)
void QDirectFBPaintEnginePrivate::prepareForBlit(bool alpha)
{
- quint32 blittingFlags = blitFlagsFromCompositionMode;
- if (alpha) {
- surface->SetPorterDuff(surface,
- (blittingFlags & DSBLIT_BLEND_COLORALPHA)
- ? DSPD_NONE
- : porterDuffRule);
- } else {
- blittingFlags &= ~DSBLIT_BLEND_ALPHACHANNEL;
- surface->SetPorterDuff(surface, DSPD_NONE);
+ quint32 blittingFlags = alpha ? DSBLIT_BLEND_ALPHACHANNEL : DSBLIT_NOFX;
+ if (opacity != 255) {
+ blittingFlags |= DSBLIT_BLEND_COLORALPHA;
}
surface->SetColor(surface, 0xff, 0xff, 0xff, opacity);
surface->SetBlittingFlags(surface, DFBSurfaceBlittingFlags(blittingFlags));
@@ -1028,15 +947,9 @@ void QDirectFBPaintEnginePrivate::setDFBColor(const QColor &color)
Q_ASSERT(surface);
const quint8 alpha = (opacity == 255 ?
color.alpha() : ALPHA_MUL(color.alpha(), opacity));
- surface->SetColor(surface,
- color.red(), color.green(), color.blue(), alpha);
- quint32 drawingFlags = drawFlagsFromCompositionMode;
- if (alpha == 255) {
- drawingFlags &= ~DSDRAW_BLEND;
- }
+ surface->SetColor(surface, color.red(), color.green(), color.blue(), alpha);
surface->SetPorterDuff(surface, DSPD_NONE);
- // PorterDuff messes up alpha values for primitives
- surface->SetDrawingFlags(surface, DFBSurfaceDrawingFlags(drawingFlags));
+ surface->SetDrawingFlags(surface, alpha == 255 ? DSDRAW_NOFX : DSDRAW_BLEND);
}
void QDirectFBPaintEnginePrivate::drawLines(const QLine *lines, int n)
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index c9b676a..dba1b51 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -76,7 +76,6 @@ void QDirectFBPixmapData::resize(int width, int height)
format,
QDirectFBScreen::TrackSurface);
alpha = false;
- forceRaster = (format == QImage::Format_RGB32);
if (!dfbSurface) {
invalidate();
qWarning("QDirectFBPixmapData::resize(): Unable to allocate surface");
@@ -187,7 +186,6 @@ void QDirectFBPixmapData::fromImage(const QImage &i,
}
dfbSurface = screen->copyToDFBSurface(img, format,
QDirectFBScreen::TrackSurface);
- forceRaster = (format == QImage::Format_RGB32);
if (!dfbSurface) {
qWarning("QDirectFBPixmapData::fromImage()");
invalidate();
@@ -216,7 +214,6 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect)
invalidate();
return;
}
- forceRaster = (format == QImage::Format_RGB32);
if (hasAlpha) {
dfbSurface->Clear(dfbSurface, 0, 0, 0, 0);
@@ -268,7 +265,6 @@ void QDirectFBPixmapData::fill(const QColor &color)
screen->releaseDFBSurface(dfbSurface);
format = screen->alphaPixmapFormat();
dfbSurface = screen->createDFBSurface(size, screen->alphaPixmapFormat(), QDirectFBScreen::TrackSurface);
- forceRaster = false;
setSerialNumber(++global_ser_no);
if (!dfbSurface) {
qWarning("QDirectFBPixmapData::fill()");
@@ -277,24 +273,7 @@ void QDirectFBPixmapData::fill(const QColor &color)
}
}
- if (forceRaster) {
- // in DSPF_RGB32 all dfb drawing causes the Alpha byte to be
- // set to 0. This causes issues for the raster engine.
- uchar *mem = QDirectFBScreen::lockSurface(dfbSurface, DSLF_WRITE, &bpl);
- if (mem) {
- const int h = QPixmapData::height();
- const int w = QPixmapData::width() * 4; // 4 bytes per 32 bit pixel
- const int c = color.rgba();
- for (int i = 0; i < h; ++i) {
- memset(mem, c, w);
- mem += bpl;
- }
- dfbSurface->Unlock(dfbSurface);
- }
- } else {
- dfbSurface->Clear(dfbSurface, color.red(), color.green(), color.blue(),
- color.alpha());
- }
+ dfbSurface->Clear(dfbSurface, color.red(), color.green(), color.blue(), color.alpha());
}
QPixmap QDirectFBPixmapData::transformed(const QTransform &transform,
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index 98e32ed..9e35a66 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -958,9 +958,6 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
return false;
}
- if (displayArgs.contains(QLatin1String("debug"), Qt::CaseInsensitive))
- printDirectFBInfo(d_ptr->dfb, d_ptr->dfbSurface);
-
// Work out what format we're going to use for surfaces with an alpha channel
d_ptr->alphaPixmapFormat = QDirectFBScreen::getImageFormat(d_ptr->dfbSurface);
setPixelFormat(d_ptr->alphaPixmapFormat);
@@ -971,12 +968,17 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
case QImage::Format_RGB444:
d_ptr->alphaPixmapFormat = QImage::Format_ARGB4444_Premultiplied;
break;
+ case QImage::Format_RGB32:
+ qWarning("QDirectFBScreen::connect(). Qt/DirectFB does not work with the RGB32 pixelformat. "
+ "We recommmend using ARGB instead");
+ return false;
+ case QImage::Format_Indexed8:
+ qWarning("QDirectFBScreen::connect(). Qt/DirectFB does not work with the LUT8 pixelformat.");
+ return false;
case QImage::NImageFormats:
case QImage::Format_Invalid:
case QImage::Format_Mono:
case QImage::Format_MonoLSB:
- case QImage::Format_Indexed8:
- case QImage::Format_RGB32:
case QImage::Format_RGB888:
case QImage::Format_RGB16:
case QImage::Format_RGB555:
@@ -1037,6 +1039,9 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
setGraphicsSystem(d_ptr);
+ if (displayArgs.contains(QLatin1String("debug"), Qt::CaseInsensitive))
+ printDirectFBInfo(d_ptr->dfb, d_ptr->dfbSurface);
+
return true;
}
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
index cd8796b..330eb88 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
@@ -127,7 +127,6 @@ void QDirectFBWindowSurface::createWindow()
dfbSurface->Release(dfbSurface);
dfbWindow->GetSurface(dfbWindow, &dfbSurface);
- forceRaster = (format == QImage::Format_RGB32);
#endif
}
#endif // QT_NO_DIRECTFB_WM
@@ -164,7 +163,6 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect, const QRegion &mask)
rect.width(), rect.height() };
result = primarySurface->GetSubSurface(primarySurface, &r, &dfbSurface);
}
- forceRaster = (dfbSurface && QDirectFBScreen::getImageFormat(dfbSurface) == QImage::Format_RGB32);
} else {
const bool isResize = rect.size() != geometry().size();
#ifdef QT_NO_DIRECTFB_WM
@@ -179,7 +177,6 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect, const QRegion &mask)
}
dfbSurface = screen->createDFBSurface(rect.size(), screen->pixelFormat(), QDirectFBScreen::DontTrackSurface);
- forceRaster = (dfbSurface && QDirectFBScreen::getImageFormat(dfbSurface) == QImage::Format_RGB32);
} else {
Q_ASSERT(dfbSurface);
}
@@ -242,31 +239,28 @@ void QDirectFBWindowSurface::setPermanentState(const QByteArray &state)
#endif
}
-bool QDirectFBWindowSurface::scroll(const QRegion &region, int dx, int dy)
+static inline void scrollSurface(IDirectFBSurface *surface, const QRect &r, int dx, int dy)
{
- if (!dfbSurface || !(flipFlags & DSFLIP_BLIT))
- return false;
-
- const QVector<QRect> rects = region.rects();
- const int n = rects.size();
-
- QVarLengthArray<DFBRectangle, 8> dfbRects(n);
- QVarLengthArray<DFBPoint, 8> dfbPoints(n);
+ surface->SetBlittingFlags(surface, DSBLIT_NOFX);
+ const DFBRectangle rect = { r.x(), r.y(), r.width(), r.height() };
+ surface->Blit(surface, surface, &rect, r.x() + dx, r.y() + dy);
+}
- for (int i = 0; i < n; ++i) {
- const QRect r = rects.at(i);
- dfbRects[i].x = r.x();
- dfbRects[i].y = r.y();
- dfbRects[i].w = r.width();
- dfbRects[i].h = r.height();
- dfbPoints[i].x = r.x() + dx;
- dfbPoints[i].y = r.y() + dy;
- }
+bool QDirectFBWindowSurface::scroll(const QRegion &region, int dx, int dy)
+{
+ if (!dfbSurface || !(flipFlags & DSFLIP_BLIT) || region.isEmpty())
+ return false;
dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX);
- dfbSurface->BatchBlit(dfbSurface, dfbSurface,
- dfbRects.data(), dfbPoints.data(), n);
- dfbSurface->ReleaseSource(dfbSurface);
+ if (region.numRects() == 1) {
+ ::scrollSurface(dfbSurface, region.boundingRect(), dx, dy);
+ } else {
+ const QVector<QRect> rects = region.rects();
+ const int n = rects.size();
+ for (int i=0; i<n; ++i) {
+ ::scrollSurface(dfbSurface, rects.at(i), dx, dy);
+ }
+ }
return true;
}
diff --git a/src/svg/qsvggenerator.cpp b/src/svg/qsvggenerator.cpp
index e822da5..fd4c875 100644
--- a/src/svg/qsvggenerator.cpp
+++ b/src/svg/qsvggenerator.cpp
@@ -261,7 +261,7 @@ public:
constantAlpha &= (stops.at(i).second.alpha() == alpha);
if (!constantAlpha) {
- const qreal spacing = 0.02;
+ const qreal spacing = qreal(0.02);
QGradientStops newStops;
QRgb fromColor = PREMUL(stops.at(0).second.rgba());
QRgb toColor;