summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-02-20 11:50:04 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-02-20 22:08:29 +0100
commitdcb710dd87ab15c3af803133ff2449902dbec036 (patch)
tree1f3ed87165f05e45260ff45fb15d5df96d684abb /src
parent4606ea53958df33fffba680dd75c8b1733ca9f40 (diff)
parente47c2744e6cefa42fc70320e07d534742934f737 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: mkspecs/features/unix/separate_debug_info.prf src/gui/kernel/qwindow_p.h src/plugins/platforms/cocoa/qcocoacursor.mm tests/auto/tools/moc/tst_moc.cpp Change-Id: Ieb57834c00f961a747ffe51e6eb9fc9612cebccf
Diffstat (limited to 'src')
-rw-r--r--src/corelib/doc/src/threads-basics.qdoc3
-rw-r--r--src/corelib/global/qglobal.cpp22
-rw-r--r--src/dbus/qdbusargument.cpp3
-rw-r--r--src/gui/painting/qpagedpaintdevice.h3
-rw-r--r--src/gui/painting/qpainter.cpp4
-rw-r--r--src/network/socket/qabstractsocket.cpp8
-rw-r--r--src/plugins/platforms/cocoa/qcocoacursor.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoacursor.mm9
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp9
-rw-r--r--src/tools/qdoc/doc/qdoc-manual.qdoc81
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp5
-rw-r--r--src/widgets/dialogs/qfontdialog.cpp5
-rw-r--r--src/widgets/kernel/qstackedlayout.cpp27
-rw-r--r--src/widgets/widgets/qdockwidget.cpp14
-rw-r--r--src/widgets/widgets/qmdisubwindow.cpp31
15 files changed, 107 insertions, 118 deletions
diff --git a/src/corelib/doc/src/threads-basics.qdoc b/src/corelib/doc/src/threads-basics.qdoc
index dad41368c6..dd5267f0ba 100644
--- a/src/corelib/doc/src/threads-basics.qdoc
+++ b/src/corelib/doc/src/threads-basics.qdoc
@@ -269,7 +269,8 @@
This is the result of running the code:
- \badcode
+ \code
+ //bad code
hello from GUI thread 3079423696
hello from worker thread 3076111216
\endcode
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 9cd19ccae9..67d26301a4 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -643,11 +643,29 @@ Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n);
*/
/*!
+ \typedef qintptr
+ \relates <QtGlobal>
+
+ Integral type for representing pointers in a signed integer (useful for
+ hashing, etc.).
+
+ Typedef for either qint32 or qint64. This type is guaranteed to
+ be the same size as a pointer on all platforms supported by Qt. On
+ a system with 32-bit pointers, qintptr is a typedef for qint32;
+ on a system with 64-bit pointers, qintptr is a typedef for
+ qint64.
+
+ Note that qintptr is signed. Use quintptr for unsigned values.
+
+ \sa qptrdiff, qint32, qint64
+*/
+
+/*!
\typedef quintptr
\relates <QtGlobal>
- Integral type for representing a pointers (useful for hashing,
- etc.).
+ Integral type for representing pointers in an unsigned integer (useful for
+ hashing, etc.).
Typedef for either quint32 or quint64. This type is guaranteed to
be the same size as a pointer on all platforms supported by Qt. On
diff --git a/src/dbus/qdbusargument.cpp b/src/dbus/qdbusargument.cpp
index 191eb5eea6..dab2daf90f 100644
--- a/src/dbus/qdbusargument.cpp
+++ b/src/dbus/qdbusargument.cpp
@@ -212,7 +212,8 @@ bool QDBusArgumentPrivate::checkReadAndDetach(QDBusArgumentPrivate *&d)
The following example illustrates this wrong usage
in context of a class that may contain invalid data:
- \badcode
+ \code
+ //bad code
// Wrongly marshall the MyTime data into a D-Bus argument
QDBusArgument &operator<<(QDBusArgument &argument, const MyTime &mytime)
{
diff --git a/src/gui/painting/qpagedpaintdevice.h b/src/gui/painting/qpagedpaintdevice.h
index aa8506492f..d44a401184 100644
--- a/src/gui/painting/qpagedpaintdevice.h
+++ b/src/gui/painting/qpagedpaintdevice.h
@@ -46,6 +46,9 @@
QT_BEGIN_NAMESPACE
+#if defined(B0)
+#undef B0 // Terminal hang-up. We assume that you do not want that.
+#endif
class QPagedPaintDevicePrivate;
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index b59a0850e8..c483e93a5f 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -229,7 +229,7 @@ QTransform QPainterPrivate::hidpiScaleTransform() const
{
#ifdef Q_OS_MAC
// Limited feature introduction for Qt 5.0.0, remove ifdef in a later release.
- if (device->physicalDpiX() == 0 || device->logicalDpiX() == 0)
+ if (device->devType() == QInternal::Printer || device->physicalDpiX() == 0 || device->logicalDpiX() == 0)
return QTransform();
const qreal deviceScale = (device->physicalDpiX() / device->logicalDpiX());
if (deviceScale > 1.0)
@@ -1839,7 +1839,7 @@ bool QPainter::begin(QPaintDevice *pd)
#ifdef Q_OS_MAC
// Limited feature introduction for Qt 5.0.0, remove ifdef in a later release.
- const bool isHighDpi = (d->device->physicalDpiX() == 0 || d->device->logicalDpiX() == 0) ?
+ const bool isHighDpi = (pd->devType() == QInternal::Printer || d->device->physicalDpiX() == 0 || d->device->logicalDpiX() == 0) ?
false : (d->device->physicalDpiX() / d->device->logicalDpiX() > 1);
#else
const bool isHighDpi = false;
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 833c07dfe0..c19238d768 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -313,15 +313,15 @@
or the proxy server stopped responding in the authentication phase.
\value ProxyNotFoundError The proxy address set with setProxy() (or the application
proxy) was not found.
- \value ProxyProtocolError The connection negotiation with the proxy server
+ \value ProxyProtocolError The connection negotiation with the proxy server failed,
because the response from the proxy server could not be understood.
\value OperationError An operation was attempted while the socket was in a state that
did not permit it.
- \value SslInternalError The SSL library being used reported a internal error, this is
+ \value SslInternalError The SSL library being used reported an internal error. This is
probably the result of a bad installation or misconfiguration of the library.
- \value SslInvalidUserDataError Invalid data(certificate, key, cypher, etc.) was
+ \value SslInvalidUserDataError Invalid data (certificate, key, cypher, etc.) was
provided and its use resulted in an error in the SSL library.
- \value TemporaryError A temporary error occurred(e.g., operation would block and socket
+ \value TemporaryError A temporary error occurred (e.g., operation would block and socket
is non-blocking).
\value UnknownSocketError An unidentified error occurred.
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.h b/src/plugins/platforms/cocoa/qcocoacursor.h
index f8829c53e6..dfa1fcff81 100644
--- a/src/plugins/platforms/cocoa/qcocoacursor.h
+++ b/src/plugins/platforms/cocoa/qcocoacursor.h
@@ -53,6 +53,7 @@ class QCocoaCursor : public QPlatformCursor
{
public:
QCocoaCursor();
+ ~QCocoaCursor();
virtual void changeCursor(QCursor * widgetCursor, QWindow * widget);
virtual QPoint pos() const;
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm
index 85ac083d3c..12808b7041 100644
--- a/src/plugins/platforms/cocoa/qcocoacursor.mm
+++ b/src/plugins/platforms/cocoa/qcocoacursor.mm
@@ -49,6 +49,10 @@ QT_BEGIN_NAMESPACE
QCocoaCursor::QCocoaCursor()
{
+}
+
+QCocoaCursor::~QCocoaCursor()
+{
// release cursors
QHash<Qt::CursorShape, NSCursor *>::const_iterator i = m_cursors.constBegin();
while (i != m_cursors.constEnd()) {
@@ -97,10 +101,15 @@ void QCocoaCursor::changeCursor(QCursor *cursor, QWindow *window)
break;
case Qt::DragLinkCursor:
[[NSCursor dragLinkCursor] set];
+ break;
default : {
// No suitable OS cursor exist, use cursors provided
// by Qt for the rest. Check for a cached cursor:
NSCursor *cocoaCursor = m_cursors.value(newShape);
+ if (cocoaCursor && cursor->shape() == Qt::BitmapCursor) {
+ [cocoaCursor release];
+ cocoaCursor = 0;
+ }
if (cocoaCursor == 0) {
cocoaCursor = createCursorData(cursor);
if (cocoaCursor == 0) {
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index 2cee666e23..ab9c94772b 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -335,7 +335,11 @@ void QQnxWindow::setBufferSize(const QSize &size)
// Set window buffer size
errno = 0;
- int val[2] = { size.width(), size.height() };
+
+ // libscreen fails when creating empty buffers
+ const QSize nonEmptySize = size.isEmpty() ? QSize(1, 1) : size;
+
+ int val[2] = { nonEmptySize.width(), nonEmptySize.height() };
int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_BUFFER_SIZE, val);
if (result != 0) {
qFatal("QQnxWindow: failed to set window buffer size, errno=%d", errno);
@@ -362,6 +366,7 @@ void QQnxWindow::setBufferSize(const QSize &size)
errno = 0;
result = screen_create_window_buffers(m_window, MAX_BUFFER_COUNT);
if (result != 0) {
+ qWarning() << "QQnxWindow: Buffer size was" << size;
qFatal("QQnxWindow: failed to create window buffers, errno=%d", errno);
}
@@ -380,7 +385,7 @@ void QQnxWindow::setBufferSize(const QSize &size)
}
// Cache new buffer size
- m_bufferSize = size;
+ m_bufferSize = nonEmptySize;
// Buffers were destroyed; reacquire them
m_currentBufferIndex = -1;
diff --git a/src/tools/qdoc/doc/qdoc-manual.qdoc b/src/tools/qdoc/doc/qdoc-manual.qdoc
index 5254c46eb5..4d70faa968 100644
--- a/src/tools/qdoc/doc/qdoc-manual.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual.qdoc
@@ -243,7 +243,6 @@
\li \l {11-qdoc-commands-specialcontent.html#abstract-command} {\\abstract}
\li \l {12-0-qdoc-commands-miscellaneous.html#annotatedlist-command} {\\annotatedlist}
\li \l {04-qdoc-commands-textmarkup.html#b-command} {\\b} \span {class="newStuff"} {(new 5/3/2012)}
- \li \l {06-qdoc-commands-includecodeinline.html#badcode-command} {\\badcode}
\li \l {04-qdoc-commands-textmarkup.html#b-command} {\\bold} {(deprecated, use \\b)}
\li \l {11-qdoc-commands-specialcontent.html#brief-command} {\\brief}
\li \l {04-qdoc-commands-textmarkup.html#c-command} {\\c}
@@ -1175,8 +1174,7 @@
snippets. It renders the code verbatim in a separate paragraph in
the code font.
- When processing any of the \\code, \l {badcode-command}
- {\\badcode}, \l {newcode-command} {\\newcode} or \l
+ When processing any of the \\code, \l {newcode-command} {\\newcode} or \l
{oldcode-command} {\\oldcode} commands, QDoc removes all
indentation that is common for the verbatim code blocks within a
\c{/}\c{*!} ... \c{*}\c{/} comment before it adds the standard
@@ -1225,67 +1223,9 @@
See also \l {c-command} {\\c}, \l
{07-0-qdoc-commands-includingexternalcode.html#quotefromfile-command}
- {\\quotefromfile}, \l {badcode-command} {\\badcode}, \l
- {newcode-command} {\\newcode} and \l {oldcode-command}
+ {\\quotefromfile}, \l{newcode-command} {\\newcode} and \l {oldcode-command}
{\\oldcode}.
- \target badcode-command
- \section1 \\badcode
-
- The \\badcode and \\endcode commands delimit a snippet of code
- that doesn't compile or is wrong for some other reason.
-
- The \\badcode command is similar to the \l {code-command} {\\code}
- command, but it renders the code snippet using a grey font instead
- of black.
-
- Like the \l {code-command} {\\code} command, this command begins
- its code snippet on a new line rendered in the code font and with
- the standard indentation.
-
- \code
- / *!
- The statement below is rendered using the
- regular \\code command:
-
- \code
- statusbar()->message(tr("Host %1 found").arg(hostName));
- \ endcode
-
- While the following statement is rendered using
- the \\badcode command:
-
- \badcode
- statusbar()->message(tr("Host" + hostName + " found"));
- \ endcode
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- The statement below is rendered using the
- regular \\code command:
-
- \code
- statusbar()->message(tr("Host %1 found").arg(hostName));
- \endcode
-
- While the following statement is rendered using
- the \\badcode command:
-
- \badcode
- statusbar()->message(tr("Host" + hostName + " found"));
- \endcode
- \endquotation
-
- Other QDoc commands are disabled within \\badcode... \\endcode,
- and the special character '\\' is accepted and rendered like the
- rest of the code.
-
- See also \l {code-command} {\\code}, \l {newcode-command}
- {\\newcode} and \l {oldcode-command} {\\oldcode}.
-
\target newcode-command
\section1 \\newcode
@@ -1293,14 +1233,12 @@
show how to port a snippet of code to a new version of an API.
The \\newcode command, and its companion the \\oldcode command, is
- a convenience combination of the \l {code-command} {\\code} and \l
- {badcode-command} {\\badcode} commands: The combination provides a
- text relating the two code snippets to each other. The command
- requires a preceding \\oldcode statement.
-
- Like the \l {code-command} {\\code} and \l {badcode-command}
- {\\badcode} commands, the \\newcode command renders its code on a
- new line in the documentation using a typewriter font and the
+ a convenience combination of the \l {code-command} {\\code} commands:
+ The combination provides a text relating the two code snippets to each
+ other. The command requires a preceding \\oldcode statement.
+
+ Like the \l{code-command}{\\code} command, the \\newcode command renders its
+ code on a new line in the documentation using a typewriter font and the
standard indentation.
\code
@@ -1339,7 +1277,7 @@
\\newcode statement; otherwise QDoc fails to parse the command
and emits a warning.
- See also \l {newcode-command} {\\newcode} and \l {badcode-command} {\\badcode}.
+ See also \l {newcode-command} {\\newcode}.
\target qml-command
\section1 \\qml
@@ -8688,7 +8626,6 @@
\li \l {12-0-qdoc-commands-miscellaneous.html#annotatedlist-command} {\\annotatedlist}
\li \l {04-qdoc-commands-textmarkup.html#b-command} {\\b} \span {class="newStuff"} {(new 5/3/2012)}
\li \l { 22-qdoc-configuration-generalvariables.html#basedir-variable} {basedir} \span {class="newStuff"} {(experimental)}
- \li \l {06-qdoc-commands-includecodeinline.html#badcode-command} {\\badcode}
\li \l {04-qdoc-commands-textmarkup.html#b-command} {\\bold} \span {class="newStuff"} {(deprecated, use \\b)}
\li \l {11-qdoc-commands-specialcontent.html#brief-command} {\\brief}
\li \l {04-qdoc-commands-textmarkup.html#c-command} {\\c}
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index 7ba8f60f71..c22258b3d2 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -1735,8 +1735,9 @@ QColor QColorDialog::selectedColor() const
*/
void QColorDialog::setOption(ColorDialogOption option, bool on)
{
- Q_D(QColorDialog);
- d->options->setOption(static_cast<QColorDialogOptions::ColorDialogOption>(option), on);
+ const QColorDialog::ColorDialogOptions previousOptions = options();
+ if (!(previousOptions & option) != !on)
+ setOptions(previousOptions ^ option);
}
/*!
diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp
index 79aab3280f..4036dc80ab 100644
--- a/src/widgets/dialogs/qfontdialog.cpp
+++ b/src/widgets/dialogs/qfontdialog.cpp
@@ -853,8 +853,9 @@ QFont QFontDialog::selectedFont() const
*/
void QFontDialog::setOption(FontDialogOption option, bool on)
{
- Q_D(QFontDialog);
- d->options->setOption(static_cast<QFontDialogOptions::FontDialogOption>(option), on);
+ const QFontDialog::FontDialogOptions previousOptions = options();
+ if (!(previousOptions & option) != !on)
+ setOptions(previousOptions ^ option);
}
/*!
diff --git a/src/widgets/kernel/qstackedlayout.cpp b/src/widgets/kernel/qstackedlayout.cpp
index cb2711c636..f38f0a6f08 100644
--- a/src/widgets/kernel/qstackedlayout.cpp
+++ b/src/widgets/kernel/qstackedlayout.cpp
@@ -300,7 +300,9 @@ void QStackedLayout::setCurrentIndex(int index)
parent->setUpdatesEnabled(false);
}
- QWidget *fw = parent ? parent->window()->focusWidget() : 0;
+ QPointer<QWidget> fw = parent ? parent->window()->focusWidget() : 0;
+ const bool focusWasOnOldPage = fw && (prev && prev->isAncestorOf(fw));
+
if (prev) {
prev->clearFocus();
if (d->stackingMode == StackOne)
@@ -315,24 +317,25 @@ void QStackedLayout::setCurrentIndex(int index)
// was somewhere on the outgoing widget.
if (parent) {
- if (fw && (prev && prev->isAncestorOf(fw))) { // focus was on old page
+ if (focusWasOnOldPage) {
// look for the best focus widget we can find
if (QWidget *nfw = next->focusWidget())
nfw->setFocus();
else {
// second best: first child widget in the focus chain
- QWidget *i = fw;
- while ((i = i->nextInFocusChain()) != fw) {
- if (((i->focusPolicy() & Qt::TabFocus) == Qt::TabFocus)
- && !i->focusProxy() && i->isVisibleTo(next) && i->isEnabled()
- && next->isAncestorOf(i)) {
- i->setFocus();
- break;
+ if (QWidget *i = fw) {
+ while ((i = i->nextInFocusChain()) != fw) {
+ if (((i->focusPolicy() & Qt::TabFocus) == Qt::TabFocus)
+ && !i->focusProxy() && i->isVisibleTo(next) && i->isEnabled()
+ && next->isAncestorOf(i)) {
+ i->setFocus();
+ break;
+ }
}
+ // third best: incoming widget
+ if (i == fw )
+ next->setFocus();
}
- // third best: incoming widget
- if (i == fw )
- next->setFocus();
}
}
}
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp
index c5694d9d8c..a2e363f991 100644
--- a/src/widgets/widgets/qdockwidget.cpp
+++ b/src/widgets/widgets/qdockwidget.cpp
@@ -1000,6 +1000,14 @@ void QDockWidgetPrivate::plug(const QRect &rect)
setWindowState(false, false, rect);
}
+static void setFrameStrutEventsEnabled(const QWidget *w, bool enabled)
+{
+ if (const QWindow *window = w->windowHandle())
+ if (QPlatformWindow *platformWindow = window->handle())
+ if (platformWindow->frameStrutEventsEnabled() != enabled)
+ platformWindow->setFrameStrutEventsEnabled(enabled);
+}
+
void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect &rect)
{
Q_Q(QDockWidget);
@@ -1053,9 +1061,7 @@ void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect
}
if (floating && nativeDeco)
- if (const QWindow *window = q->windowHandle())
- if (QPlatformWindow *platformWindow = window->handle())
- platformWindow->setFrameStrutEventsEnabled(true);
+ setFrameStrutEventsEnabled(q, true);
resizer->setActive(QWidgetResizeHandler::Resize, !unplug && floating && !nativeDeco);
}
@@ -1391,6 +1397,8 @@ bool QDockWidget::event(QEvent *event)
emit visibilityChanged(false);
break;
case QEvent::Show:
+ if (static_cast<QDockWidgetLayout *>(QDockWidget::layout())->nativeWindowDeco(isFloating()))
+ setFrameStrutEventsEnabled(this, true);
d->toggleViewAction->setChecked(true);
emit visibilityChanged(geometry().right() >= 0 && geometry().bottom() >= 0);
break;
diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp
index a3219e69d7..7ea2369ba5 100644
--- a/src/widgets/widgets/qmdisubwindow.cpp
+++ b/src/widgets/widgets/qmdisubwindow.cpp
@@ -160,7 +160,7 @@
#include <QMainWindow>
#include <QScrollBar>
#include <QDebug>
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
#include <private/qmacstyle_mac_p.h>
#endif
#include <QMdiArea>
@@ -296,7 +296,7 @@ static void showToolTip(QHelpEvent *helpEvent, QWidget *widget, const QStyleOpti
Q_ASSERT(helpEvent->type() == QEvent::ToolTip);
Q_ASSERT(widget);
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
// Native Mac windows don't show tool tip.
if (qobject_cast<QMacStyle *>(widget->style()))
return;
@@ -1071,7 +1071,7 @@ void QMdiSubWindowPrivate::updateCursor()
{
#ifndef QT_NO_CURSOR
Q_Q(QMdiSubWindow);
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
if (qobject_cast<QMacStyle *>(q->style()))
return;
#endif
@@ -1491,7 +1491,7 @@ void QMdiSubWindowPrivate::processClickedSubControl()
q->showNormal();
break;
case QStyle::SC_TitleBarMinButton:
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
if (qobject_cast<QMacStyle *>(q->style())) {
if (q->isMinimized())
q->showNormal();
@@ -1508,7 +1508,7 @@ void QMdiSubWindowPrivate::processClickedSubControl()
q->showNormal();
break;
case QStyle::SC_TitleBarMaxButton:
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
if (qobject_cast<QMacStyle *>(q->style())) {
if (q->isMaximized())
q->showNormal();
@@ -1555,7 +1555,7 @@ QRegion QMdiSubWindowPrivate::getRegion(Operation operation) const
}
QRegion region;
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
if (qobject_cast<QMacStyle *>(q->style()))
return region;
#endif
@@ -1709,7 +1709,7 @@ int QMdiSubWindowPrivate::titleBarHeight(const QStyleOptionTitleBar &options) co
}
int height = q->style()->pixelMetric(QStyle::PM_TitleBarHeight, &options, q);
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
// ### Fix mac style, the +4 pixels hack is not necessary anymore
if (qobject_cast<QMacStyle *>(q->style()))
height -= 4;
@@ -1764,7 +1764,7 @@ bool QMdiSubWindowPrivate::drawTitleBarWhenMaximized() const
if (isChildOfTabbedQMdiArea(q))
return false;
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) || defined(Q_OS_WINCE_WM)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) || defined(Q_OS_WINCE_WM)
return true;
#else
if (q->style()->styleHint(QStyle::SH_Workspace_FillSpaceOnMaximize, 0, q))
@@ -2172,7 +2172,7 @@ void QMdiSubWindowPrivate::setSizeGrip(QSizeGrip *newSizeGrip)
return;
newSizeGrip->setFixedSize(newSizeGrip->sizeHint());
bool putSizeGripInLayout = layout ? true : false;
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
if (qobject_cast<QMacStyle *>(q->style()))
putSizeGripInLayout = false;
#endif
@@ -2228,7 +2228,8 @@ void QMdiSubWindowPrivate::updateInternalWindowTitle()
Note that only \l{QMdiSubWindow}s can be set as children of
QMdiArea; you cannot, for instance, write:
- \badcode
+ \code
+ //bad code
QMdiArea mdiArea;
QTextEdit editor(&mdiArea); // invalid child widget
\endcode
@@ -2255,7 +2256,7 @@ QMdiSubWindow::QMdiSubWindow(QWidget *parent, Qt::WindowFlags flags)
d->titleBarPalette = d->desktopPalette();
d->font = QApplication::font("QMdiSubWindowTitleBar");
// We don't want the menu icon by default on mac.
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
if (windowIcon().isNull())
d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, this);
else
@@ -2823,7 +2824,7 @@ bool QMdiSubWindow::event(QEvent *event)
d->isMaximizeMode = false;
d->isWidgetHiddenByUs = false;
if (!parent()) {
-#if !defined(QT_NO_SIZEGRIP) && defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if !defined(QT_NO_SIZEGRIP) && defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
if (qobject_cast<QMacStyle *>(style()))
delete d->sizeGrip;
#endif
@@ -2918,7 +2919,7 @@ void QMdiSubWindow::showEvent(QShowEvent *showEvent)
return;
}
-#if !defined(QT_NO_SIZEGRIP) && defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if !defined(QT_NO_SIZEGRIP) && defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
if (qobject_cast<QMacStyle *>(style()) && !d->sizeGrip
&& !(windowFlags() & Qt::FramelessWindowHint)) {
d->setSizeGrip(new QSizeGrip(0));
@@ -3312,7 +3313,7 @@ void QMdiSubWindow::mouseMoveEvent(QMouseEvent *mouseEvent)
hoverRegion += style()->subControlRect(QStyle::CC_TitleBar, &options,
d->hoveredSubControl, this);
}
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
if (qobject_cast<QMacStyle *>(style()) && !hoverRegion.isEmpty())
hoverRegion += QRegion(0, 0, width(), d->titleBarHeight(options));
#endif
@@ -3522,7 +3523,7 @@ QSize QMdiSubWindow::minimumSizeHint() const
int sizeGripHeight = 0;
if (d->sizeGrip && d->sizeGrip->isVisibleTo(const_cast<QMdiSubWindow *>(this)))
sizeGripHeight = d->sizeGrip->height();
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
else if (parent() && qobject_cast<QMacStyle *>(style()) && !d->sizeGrip)
sizeGripHeight = style()->pixelMetric(QStyle::PM_SizeGripSize, 0, this);
#endif