summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qresource.cpp20
-rw-r--r--src/corelib/io/qwindowspipereader.cpp6
-rw-r--r--src/gui/image/qpixmap.cpp8
-rw-r--r--src/gui/kernel/qstylehints.cpp2
-rw-r--r--src/gui/painting/qpdf.cpp15
-rw-r--r--src/plugins/platforms/winrt/qwinrteglcontext.cpp6
-rw-r--r--src/plugins/platforms/winrt/qwinrteglcontext.h1
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp14
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp11
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h10
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.cpp57
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.h16
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp22
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h3
-rw-r--r--src/plugins/styles/mac/mac.pro2
-rw-r--r--src/plugins/styles/mac/qmacstyle.qdoc207
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac_p_p.h3
17 files changed, 111 insertions, 292 deletions
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 35a0de4fb7..7502fb57a3 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -116,7 +116,7 @@ public:
inline bool isContainer(int node) const { return flags(node) & Directory; }
inline bool isCompressed(int node) const { return flags(node) & Compressed; }
const uchar *data(int node, qint64 *size) const;
- QDateTime lastModified(int node) const;
+ quint64 lastModified(int node) const;
QStringList children(int node) const;
virtual QString mappingRoot() const { return QString(); }
bool mappingRootSubdir(const QString &path, QString *match=0) const;
@@ -245,7 +245,7 @@ public:
mutable qint64 size;
mutable const uchar *data;
mutable QStringList children;
- mutable QDateTime lastModified;
+ mutable quint64 lastModified;
QResource *q_ptr;
Q_DECLARE_PUBLIC(QResource)
@@ -259,7 +259,7 @@ QResourcePrivate::clear()
data = 0;
size = 0;
children.clear();
- lastModified = QDateTime();
+ lastModified = 0;
container = 0;
for(int i = 0; i < related.size(); ++i) {
QResourceRoot *root = related.at(i);
@@ -301,7 +301,7 @@ QResourcePrivate::load(const QString &file)
data = 0;
size = 0;
compressed = 0;
- lastModified = QDateTime();
+ lastModified = 0;
res->ref.ref();
related.append(res);
}
@@ -539,7 +539,7 @@ QDateTime QResource::lastModified() const
{
Q_D(const QResource);
d->ensureInitialized();
- return d->lastModified;
+ return d->lastModified ? QDateTime::fromMSecsSinceEpoch(d->lastModified) : QDateTime();
}
/*!
@@ -797,18 +797,14 @@ const uchar *QResourceRoot::data(int node, qint64 *size) const
return 0;
}
-QDateTime QResourceRoot::lastModified(int node) const
+quint64 QResourceRoot::lastModified(int node) const
{
if (node == -1 || version < 0x02)
- return QDateTime();
+ return 0;
const int offset = findOffset(node) + 14;
- const quint64 timeStamp = qFromBigEndian<quint64>(tree + offset);
- if (timeStamp == 0)
- return QDateTime();
-
- return QDateTime::fromMSecsSinceEpoch(timeStamp);
+ return qFromBigEndian<quint64>(tree + offset);
}
QStringList QResourceRoot::children(int node) const
diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp
index 3055fb392e..2312d5ca63 100644
--- a/src/corelib/io/qwindowspipereader.cpp
+++ b/src/corelib/io/qwindowspipereader.cpp
@@ -316,15 +316,15 @@ void QWindowsPipeReader::emitPendingReadyRead()
*/
bool QWindowsPipeReader::waitForReadyRead(int msecs)
{
- if (!readSequenceStarted)
- return false;
-
if (readyReadPending) {
if (!inReadyRead)
emitPendingReadyRead();
return true;
}
+ if (!readSequenceStarted)
+ return false;
+
if (!waitForNotification(msecs))
return false;
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 4cd8befc1b..4b2334ae52 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -1467,12 +1467,18 @@ QBitmap QPixmap::mask() const
On all platforms the depth of the primary screen will be returned.
+ \note QGuiApplication must be created before calling this function.
+
\sa depth(), QColormap::depth(), {QPixmap#Pixmap Information}{Pixmap Information}
*/
int QPixmap::defaultDepth()
{
- return QGuiApplication::primaryScreen()->depth();
+ QScreen *primary = QGuiApplication::primaryScreen();
+ if (Q_LIKELY(primary))
+ return primary->depth();
+ qWarning("QPixmap: QGuiApplication must be created before calling defaultDepth().");
+ return 0;
}
/*!
diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp
index b2d968c046..48060a2c37 100644
--- a/src/gui/kernel/qstylehints.cpp
+++ b/src/gui/kernel/qstylehints.cpp
@@ -551,7 +551,7 @@ void QStyleHints::setMouseQuickSelectionThreshold(int threshold)
if (d->m_mouseQuickSelectionThreshold == threshold)
return;
d->m_mouseQuickSelectionThreshold = threshold;
- emit mouseDoubleClickIntervalChanged(threshold);
+ emit mouseQuickSelectionThresholdChanged(threshold);
}
/*!
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index e421055ef3..e58f9cee4c 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -2045,7 +2045,6 @@ void QPdfEnginePrivate::printString(const QString &string)
}
-// For strings up to 10000 bytes only !
void QPdfEnginePrivate::xprintf(const char* fmt, ...)
{
if (!stream)
@@ -2057,12 +2056,18 @@ void QPdfEnginePrivate::xprintf(const char* fmt, ...)
va_list args;
va_start(args, fmt);
int bufsize = qvsnprintf(buf, msize, fmt, args);
-
- Q_ASSERT(bufsize<msize);
-
va_end(args);
- stream->writeRawData(buf, bufsize);
+ if (Q_LIKELY(bufsize < msize)) {
+ stream->writeRawData(buf, bufsize);
+ } else {
+ // Fallback for abnormal cases
+ QScopedArrayPointer<char> tmpbuf(new char[bufsize + 1]);
+ va_start(args, fmt);
+ bufsize = qvsnprintf(tmpbuf.data(), bufsize + 1, fmt, args);
+ va_end(args);
+ stream->writeRawData(tmpbuf.data(), bufsize);
+ }
streampos += bufsize;
}
diff --git a/src/plugins/platforms/winrt/qwinrteglcontext.cpp b/src/plugins/platforms/winrt/qwinrteglcontext.cpp
index 8a250c516a..eeb79be2e6 100644
--- a/src/plugins/platforms/winrt/qwinrteglcontext.cpp
+++ b/src/plugins/platforms/winrt/qwinrteglcontext.cpp
@@ -354,6 +354,12 @@ QFunctionPointer QWinRTEGLContext::getProcAddress(const char *procName)
return eglGetProcAddress(procName);
}
+bool QWinRTEGLContext::isValid() const
+{
+ Q_D(const QWinRTEGLContext);
+ return d->eglContext != EGL_NO_CONTEXT;
+}
+
EGLDisplay QWinRTEGLContext::display()
{
return g->eglDisplay;
diff --git a/src/plugins/platforms/winrt/qwinrteglcontext.h b/src/plugins/platforms/winrt/qwinrteglcontext.h
index 5c75aa90d0..325dc82c40 100644
--- a/src/plugins/platforms/winrt/qwinrteglcontext.h
+++ b/src/plugins/platforms/winrt/qwinrteglcontext.h
@@ -60,6 +60,7 @@ public:
QSurfaceFormat format() const override;
QFunctionPointer getProcAddress(const char *procName) override;
+ bool isValid() const override;
static EGLDisplay display();
private:
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index 659d1c53cb..8cfcc49f9a 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -219,12 +219,14 @@ void QXcbBackingStoreImage::create(const QSize &size, const xcb_format_t *fmt, Q
if (!segmentSize)
return;
- if (hasShm() && m_segmentSize > 0 && (m_segmentSize < segmentSize || m_segmentSize / 2 >= segmentSize))
- destroyShmSegment(m_segmentSize);
- if (!hasShm() && connection()->hasShm())
- {
- qCDebug(lcQpaXcb) << "creating shared memory" << segmentSize << "for" << size << "depth" << fmt->depth << "bits" << fmt->bits_per_pixel;
- createShmSegment(segmentSize);
+ if (connection()->hasShm()) {
+ if (m_shm_info.shmaddr && (m_segmentSize < segmentSize || m_segmentSize / 2 >= segmentSize))
+ destroyShmSegment(m_segmentSize);
+ if (!m_shm_info.shmaddr) {
+ qCDebug(lcQpaXcb) << "creating shared memory" << segmentSize << "for"
+ << size << "depth" << fmt->depth << "bits" << fmt->bits_per_pixel;
+ createShmSegment(segmentSize);
+ }
}
m_xcb_image->data = m_shm_info.shmaddr ? m_shm_info.shmaddr : (uint8_t *)malloc(segmentSize);
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 94dbb76117..6f1a3e3c19 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -2109,17 +2109,22 @@ void QXcbConnection::initializeXRender()
{
#if QT_CONFIG(xcb_render)
const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_connection, &xcb_render_id);
- if (!reply || !reply->present)
+ if (!reply || !reply->present) {
+ qCDebug(lcQpaXcb, "XRender extension not present on the X server");
return;
+ }
auto xrender_query = Q_XCB_REPLY(xcb_render_query_version, m_connection,
XCB_RENDER_MAJOR_VERSION,
XCB_RENDER_MINOR_VERSION);
- if (!xrender_query || (xrender_query->major_version == 0 && xrender_query->minor_version < 5)) {
- qWarning("QXcbConnection: Failed to initialize XRender");
+ if (!xrender_query) {
+ qCWarning(lcQpaXcb, "xcb_render_query_version failed");
return;
}
+
has_render_extension = true;
+ m_xrenderVersion.first = xrender_query->major_version;
+ m_xrenderVersion.second = xrender_query->minor_version;
#endif
}
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index 9e16d15b20..3b42d7cf22 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -464,7 +464,13 @@ public:
bool hasXRandr() const { return has_randr_extension; }
bool hasInputShape() const { return has_input_shape; }
bool hasXKB() const { return has_xkb; }
- bool hasXRender() const { return has_render_extension; }
+ bool hasXRender(int major = -1, int minor = -1) const
+ {
+ if (has_render_extension && major != -1 && minor != -1)
+ return m_xrenderVersion >= qMakePair(major, minor);
+
+ return has_render_extension;
+ }
bool hasXInput2() const { return m_xi2Enabled; }
bool hasShm() const { return has_shm; }
bool hasShmFd() const { return has_shm_fd; }
@@ -685,6 +691,8 @@ private:
bool has_shm = false;
bool has_shm_fd = false;
+ QPair<int, int> m_xrenderVersion;
+
Qt::MouseButtons m_buttonState = 0;
Qt::MouseButton m_button = Qt::NoButton;
diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
index 34b7d0d236..8d151b760b 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
@@ -301,6 +301,9 @@ QXcbCursorCacheKey::QXcbCursorCacheKey(const QCursor &c)
QXcbCursor::QXcbCursor(QXcbConnection *conn, QXcbScreen *screen)
: QXcbObject(conn), m_screen(screen), m_gtkCursorThemeInitialized(false)
{
+ // see NUM_BITMAPS in libXcursor/src/xcursorint.h
+ m_bitmapCache.setMaxCost(8);
+
if (cursorCount++)
return;
@@ -351,37 +354,38 @@ QXcbCursor::~QXcbCursor()
}
#ifndef QT_NO_CURSOR
-void QXcbCursor::changeCursor(QCursor *cursor, QWindow *widget)
+void QXcbCursor::changeCursor(QCursor *cursor, QWindow *window)
{
- QXcbWindow *w = 0;
- if (widget && widget->handle())
- w = static_cast<QXcbWindow *>(widget->handle());
- else
- // No X11 cursor control when there is no widget under the cursor
+ if (!window || !window->handle())
return;
xcb_cursor_t c = XCB_CURSOR_NONE;
- bool isBitmapCursor = false;
-
if (cursor) {
+ const QXcbCursorCacheKey key(*cursor);
const Qt::CursorShape shape = cursor->shape();
- isBitmapCursor = shape == Qt::BitmapCursor;
- if (!isBitmapCursor) {
- const QXcbCursorCacheKey key(*cursor);
- CursorHash::iterator it = m_cursorHash.find(key);
- if (it == m_cursorHash.end()) {
- it = m_cursorHash.insert(key, createFontCursor(shape));
+ if (shape == Qt::BitmapCursor) {
+ auto *bitmap = m_bitmapCache.object(key);
+ if (bitmap) {
+ c = bitmap->cursor;
+ } else {
+ c = createBitmapCursor(cursor);
+ m_bitmapCache.insert(key, new CachedCursor(xcb_connection(), c));
}
- c = it.value();
} else {
- // Do not cache bitmap cursors, as otherwise they have unclear
- // lifetime (we effectively leak xcb_cursor_t).
- c = createBitmapCursor(cursor);
+ auto it = m_cursorHash.find(key);
+ if (it == m_cursorHash.end()) {
+ c = createFontCursor(shape);
+ m_cursorHash.insert(key, c);
+ } else {
+ c = it.value();
+ }
}
}
- w->setCursor(c, isBitmapCursor);
+ auto *w = static_cast<QXcbWindow *>(window->handle());
+ xcb_change_window_attributes(xcb_connection(), w->xcb_window(), XCB_CW_CURSOR, &c);
+ xcb_flush(xcb_connection());
}
static int cursorIdForShape(int cshape)
@@ -597,12 +601,19 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
xcb_cursor_t QXcbCursor::createBitmapCursor(QCursor *cursor)
{
- xcb_connection_t *conn = xcb_connection();
QPoint spot = cursor->hotSpot();
xcb_cursor_t c = XCB_NONE;
- if (cursor->pixmap().depth() > 1)
- c = qt_xcb_createCursorXRender(m_screen, cursor->pixmap().toImage(), spot);
- if (!c) {
+ if (cursor->pixmap().depth() > 1) {
+#if QT_CONFIG(xcb_render)
+ if (connection()->hasXRender(0, 5))
+ c = qt_xcb_createCursorXRender(m_screen, cursor->pixmap().toImage(), spot);
+ else
+ qCWarning(lcQpaXcb, "xrender >= 0.5 required to create pixmap cursors");
+#else
+ qCWarning(lcQpaXcb, "This build of Qt does not support pixmap cursors");
+#endif
+ } else {
+ xcb_connection_t *conn = xcb_connection();
xcb_pixmap_t cp = qt_xcb_XPixmapFromBitmap(m_screen, cursor->bitmap()->toImage());
xcb_pixmap_t mp = qt_xcb_XPixmapFromBitmap(m_screen, cursor->mask()->toImage());
c = xcb_generate_id(conn);
diff --git a/src/plugins/platforms/xcb/qxcbcursor.h b/src/plugins/platforms/xcb/qxcbcursor.h
index e3f88518fe..5bc806381c 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.h
+++ b/src/plugins/platforms/xcb/qxcbcursor.h
@@ -43,6 +43,8 @@
#include <qpa/qplatformcursor.h>
#include "qxcbscreen.h"
+#include <QtCore/QCache>
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_CURSOR
@@ -76,7 +78,7 @@ public:
QXcbCursor(QXcbConnection *conn, QXcbScreen *screen);
~QXcbCursor();
#ifndef QT_NO_CURSOR
- void changeCursor(QCursor *cursor, QWindow *widget) override;
+ void changeCursor(QCursor *cursor, QWindow *window) override;
#endif
QPoint pos() const override;
void setPos(const QPoint &pos) override;
@@ -89,9 +91,20 @@ public:
#endif
private:
+
#ifndef QT_NO_CURSOR
typedef QHash<QXcbCursorCacheKey, xcb_cursor_t> CursorHash;
+ struct CachedCursor
+ {
+ explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c)
+ : cursor(c), connection(conn) {}
+ ~CachedCursor() { xcb_free_cursor(connection, cursor); }
+ xcb_cursor_t cursor;
+ xcb_connection_t *connection;
+ };
+ typedef QCache<QXcbCursorCacheKey, CachedCursor> BitmapCursorCache;
+
xcb_cursor_t createFontCursor(int cshape);
xcb_cursor_t createBitmapCursor(QCursor *cursor);
xcb_cursor_t createNonStandardCursor(int cshape);
@@ -100,6 +113,7 @@ private:
QXcbScreen *m_screen;
#ifndef QT_NO_CURSOR
CursorHash m_cursorHash;
+ BitmapCursorCache m_bitmapCache;
#endif
#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen,
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index a19d69af41..01eb88eea7 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -560,10 +560,6 @@ void QXcbWindow::create()
QXcbWindow::~QXcbWindow()
{
- if (m_currentBitmapCursor != XCB_CURSOR_NONE) {
- xcb_free_cursor(xcb_connection(), m_currentBitmapCursor);
- }
-
destroy();
}
@@ -2591,24 +2587,6 @@ bool QXcbWindow::setMouseGrabEnabled(bool grab)
return result;
}
-void QXcbWindow::setCursor(xcb_cursor_t cursor, bool isBitmapCursor)
-{
- xcb_connection_t *conn = xcb_connection();
-
- xcb_change_window_attributes(conn, m_window, XCB_CW_CURSOR, &cursor);
- xcb_flush(conn);
-
- if (m_currentBitmapCursor != XCB_CURSOR_NONE) {
- xcb_free_cursor(conn, m_currentBitmapCursor);
- }
-
- if (isBitmapCursor) {
- m_currentBitmapCursor = cursor;
- } else {
- m_currentBitmapCursor = XCB_CURSOR_NONE;
- }
-}
-
void QXcbWindow::windowEvent(QEvent *event)
{
switch (event->type()) {
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index a1f1540466..edfee1f574 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -103,8 +103,6 @@ public:
bool setKeyboardGrabEnabled(bool grab) override;
bool setMouseGrabEnabled(bool grab) override;
- void setCursor(xcb_cursor_t cursor, bool isBitmapCursor);
-
QSurfaceFormat format() const override;
void windowEvent(QEvent *event) override;
@@ -285,7 +283,6 @@ protected:
SyncState m_syncState = NoSyncNeeded;
QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr;
- xcb_cursor_t m_currentBitmapCursor = XCB_CURSOR_NONE;
};
class QXcbForeignWindow : public QXcbWindow
diff --git a/src/plugins/styles/mac/mac.pro b/src/plugins/styles/mac/mac.pro
index f3c7c1c067..9044354c07 100644
--- a/src/plugins/styles/mac/mac.pro
+++ b/src/plugins/styles/mac/mac.pro
@@ -10,7 +10,7 @@ HEADERS += \
qmacstyle_mac_p.h \
qmacstyle_mac_p_p.h
-LIBS_PRIVATE += -framework AppKit -framework ApplicationServices -framework Carbon
+LIBS_PRIVATE += -framework AppKit
DISTFILES += macstyle.json
diff --git a/src/plugins/styles/mac/qmacstyle.qdoc b/src/plugins/styles/mac/qmacstyle.qdoc
deleted file mode 100644
index 30b3d7775f..0000000000
--- a/src/plugins/styles/mac/qmacstyle.qdoc
+++ /dev/null
@@ -1,207 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-/*!
- \class QMacStyle
- \brief The QMacStyle class provides a \macos style using the Apple Appearance Manager.
-
- \ingroup appearance
- \inmodule QtWidgets
- \internal
-
- This class is implemented as a wrapper to the HITheme
- APIs, allowing applications to be styled according to the current
- theme in use on \macos. This is done by having primitives
- in QStyle implemented in terms of what \macos would normally theme.
-
- \warning This style is only available on \macos because it relies on the
- HITheme APIs.
-
- There are additional issues that should be taken
- into consideration to make an application compatible with the
- \l{Apple Human Interface Guidelines}{Apple Human Interface Guidelines}. Some of these issues are outlined
- below.
-
- \list
-
- \li Layout - The restrictions on window layout are such that some
- aspects of layout that are style-dependent cannot be achieved
- using QLayout. Changes are being considered (and feedback would be
- appreciated) to make layouts QStyle-able. Some of the restrictions
- involve horizontal and vertical widget alignment and widget size
- (covered below).
-
- \li Widget size - \macos allows widgets to have specific fixed sizes. Qt
- does not fully implement this behavior so as to maintain cross-platform
- compatibility. As a result some widgets sizes may be inappropriate (and
- subsequently not rendered correctly by the HITheme APIs).The
- QWidget::sizeHint() will return the appropriate size for many
- managed widgets (widgets enumerated in \l QStyle::ContentsType).
-
- \li Effects - QMacStyle uses HITheme for performing most of the drawing, but
- also uses emulation in a few cases where HITheme does not provide the
- required functionality (for example, tab bars on Panther, the toolbar
- separator, etc). We tried to make the emulation as close to the original as
- possible. Please report any issues you see in effects or non-standard
- widgets.
-
- \endlist
-
- There are other issues that need to be considered in the feel of
- your application (including the general color scheme to match the
- Aqua colors). The Guidelines mentioned above will remain current
- with new advances and design suggestions for \macos.
-
- Note that the functions provided by QMacStyle are
- reimplementations of QStyle functions; see QStyle for their
- documentation.
-
- \image qmacstyle.png
- \sa QWindowsVistaStyle, QWindowsStyle, QFusionStyle
-*/
-
-
-/*!
- \enum QStyleHelper::WidgetSizePolicy
-
- \value SizeSmall
- \value SizeLarge
- \value SizeMini
- \value SizeDefault
-*/
-
-/*! \fn QMacStyle::QMacStyle()
- Constructs a QMacStyle object.
-*/
-
-/*! \fn QMacStyle::~QMacStyle()
- Destructs a QMacStyle object.
-*/
-
-/*! \fn void QMacStyle::polish(QPalette &pal)
- \reimp
-*/
-
-/*! \fn void QMacStyle::polish(QApplication *)
- \reimp
-*/
-
-/*! \fn void QMacStyle::unpolish(QApplication *)
- \reimp
-*/
-
-/*! \fn void QMacStyle::polish(QWidget* w)
- \reimp
-*/
-
-/*! \fn void QMacStyle::unpolish(QWidget* w)
- \reimp
-*/
-
-/*! \fn int QMacStyle::pixelMetric(QStyle::PixelMetric metric, const QStyleOption *opt, const QWidget *widget) const
- \reimp
-*/
-
-/*! \fn QPalette QMacStyle::standardPalette() const
- \reimp
-*/
-
-/*! \fn int QMacStyle::styleHint(QStyle::StyleHint sh, const QStyleOption *opt, const QWidget *w, QStyleHintReturn *hret) const
- \reimp
-*/
-
-/*! \fn QPixmap QMacStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const
- \reimp
-*/
-
-/*! \fn QPixmap QMacStyle::standardPixmap(QStyle::StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget) const
- \reimp
-*/
-
-/*! \fn void QStyleHelper::setWidgetSizePolicy(const QWidget *widget, QStyleHelper::WidgetSizePolicy policy)
-
- \obsolete
-
- Call QWidget::setAttribute() with Qt::WA_MacMiniSize, Qt::WA_MacSmallSize,
- or Qt::WA_MacNormalSize instead.
-*/
-
-/*! \fn QStyleHelper::WidgetSizePolicy QStyleHelper::widgetSizePolicy(const QWidget *widget, const QStyleOption *opt)
- \obsolete
-
- Call QWidget::testAttribute() with Qt::WA_MacMiniSize, Qt::WA_MacSmallSize,
- or Qt::WA_MacNormalSize instead.
-*/
-
-/*! \fn void QMacStyle::drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const
-
- \reimp
-*/
-
-/*! \fn void QMacStyle::drawControl(QStyle::ControlElement ce, const QStyleOption *opt, QPainter *p, const QWidget *w) const
-
- \reimp
-*/
-
-/*! \fn QRect QMacStyle::subElementRect(QStyle::SubElement sr, const QStyleOption *opt, const QWidget *widget) const
-
- \reimp
-*/
-
-/*! \fn void QMacStyle::drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget) const
- \reimp
-*/
-
-/*! \fn QStyle::SubControl QMacStyle::hitTestComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget) const
- \reimp
-*/
-
-/*! \fn QRect QMacStyle::subControlRect(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, QStyle::SubControl sc, const QWidget *widget) const
- \reimp
-*/
-
-/*! \fn QSize QMacStyle::sizeFromContents(QStyle::ContentsType ct, const QStyleOption *opt, const QSize &csz, const QWidget *widget) const
- \reimp
-*/
-
-/*! \fn void QMacStyle::drawItemText(QPainter *p, const QRect &r, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole) const
- \reimp
-*/
-
-/*! \fn bool QMacStyle::event(QEvent *e)
- \reimp
-*/
-
-/*! \fn QIcon QMacStyle::standardIcon(QStyle::StandardPixmap standardIcon, const QStyleOption *opt, const QWidget *widget) const
- \reimp
-*/
-
-/*! \fn int QMacStyle::layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option, const QWidget *widget) const
- \reimp
-*/
-
diff --git a/src/plugins/styles/mac/qmacstyle_mac_p_p.h b/src/plugins/styles/mac/qmacstyle_mac_p_p.h
index 705bb2b462..2a81274765 100644
--- a/src/plugins/styles/mac/qmacstyle_mac_p_p.h
+++ b/src/plugins/styles/mac/qmacstyle_mac_p_p.h
@@ -41,9 +41,6 @@
#ifndef QMACSTYLE_MAC_P_P_H
#define QMACSTYLE_MAC_P_P_H
-#include <Carbon/Carbon.h>
-#undef check
-
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include <QtWidgets/private/qcommonstyle_p.h>
#include "qmacstyle_mac_p.h"