summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp2
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.h7
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.mm5
-rw-r--r--src/plugins/platforms/cocoa/qnswindowdelegate.mm4
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp2
-rw-r--r--src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp2
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglintegration.cpp1
-rw-r--r--src/plugins/platforms/qnx/qqnxeglwindow.cpp14
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.cpp9
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp6
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h2
-rw-r--r--src/plugins/platforms/winrt/qwinrttheme.cpp37
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h1
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp28
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp5
-rw-r--r--src/plugins/printsupport/windows/qwindowsprintdevice.cpp4
-rw-r--r--src/plugins/sqldrivers/configure.json56
-rw-r--r--src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp29
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm74
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac_p_p.h8
-rw-r--r--src/plugins/styles/windowsvista/qwindowsvistastyle.cpp12
-rw-r--r--src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h6
-rw-r--r--src/plugins/styles/windowsvista/qwindowsxpstyle.cpp22
24 files changed, 246 insertions, 94 deletions
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
index eb9e9c8b8d..6df454adb0 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
@@ -133,7 +133,7 @@ QIBusPlatformInputContext::~QIBusPlatformInputContext (void)
bool QIBusPlatformInputContext::isValid() const
{
- return d->valid;
+ return d->valid && d->busConnected;
}
void QIBusPlatformInputContext::invokeAction(QInputMethod::Action a, int)
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h
index a2e0876073..4478895538 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.h
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.h
@@ -167,7 +167,12 @@ QT_END_NAMESPACE
- (void)onCancelClicked;
@end
-@interface QT_MANGLE_NAMESPACE(QNSPanelContentsWrapper) : NSView
+@interface QT_MANGLE_NAMESPACE(QNSPanelContentsWrapper) : NSView {
+ NSButton *_okButton;
+ NSButton *_cancelButton;
+ NSView *_panelContents;
+ NSEdgeInsets _panelContentsMargins;
+}
@property (nonatomic, readonly) NSButton *okButton;
@property (nonatomic, readonly) NSButton *cancelButton;
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
index 37e69fa8c8..9f9618177d 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
@@ -301,6 +301,11 @@ QT_END_NAMESPACE
*/
@implementation QNSPanelContentsWrapper
+@synthesize okButton = _okButton;
+@synthesize cancelButton = _cancelButton;
+@synthesize panelContents = _panelContents;
+@synthesize panelContentsMargins = _panelContentsMargins;
+
- (instancetype)initWithPanelDelegate:(id<QT_MANGLE_NAMESPACE(QNSPanelDelegate)>)panelDelegate
{
if ((self = [super initWithFrame:NSZeroRect])) {
diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
index 8295d4a36c..1224d138d9 100644
--- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm
+++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
@@ -75,7 +75,7 @@
// window.screen.visibleFrame directly, as that ensures we have the same
// behavior for both use-cases/APIs.
Q_ASSERT(window == m_cocoaWindow->nativeWindow());
- return m_cocoaWindow->screen()->availableGeometry().toCGRect();
+ return NSRectFromCGRect(m_cocoaWindow->screen()->availableGeometry().toCGRect());
}
#if QT_MACOS_DEPLOYMENT_TARGET_BELOW(__MAC_10_11)
@@ -90,7 +90,7 @@
{
Q_UNUSED(proposedSize);
Q_ASSERT(window == m_cocoaWindow->nativeWindow());
- return m_cocoaWindow->screen()->geometry().size().toCGSize();
+ return NSSizeFromCGSize(m_cocoaWindow->screen()->geometry().size().toCGSize());
}
#endif
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp
index 5f85e4b0b0..e218d580a2 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp
@@ -142,7 +142,7 @@ void QEglFSKmsGbmDevice::handleDrmEvent()
{
drmEventContext drmEvent;
memset(&drmEvent, 0, sizeof(drmEvent));
- drmEvent.version = DRM_EVENT_CONTEXT_VERSION;
+ drmEvent.version = 2;
drmEvent.vblank_handler = nullptr;
drmEvent.page_flip_handler = pageFlipHandler;
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp b/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp
index c9fbb8281c..e15d6fee24 100644
--- a/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp
+++ b/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp
@@ -314,7 +314,7 @@ void QLinuxFbDevice::swapBuffers(Output *output)
while (output->backFb == fbIdx) {
drmEventContext drmEvent;
memset(&drmEvent, 0, sizeof(drmEvent));
- drmEvent.version = DRM_EVENT_CONTEXT_VERSION;
+ drmEvent.version = 2;
drmEvent.vblank_handler = nullptr;
drmEvent.page_flip_handler = pageFlipHandler;
// Blocks until there is something to read on the drm fd
diff --git a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
index 81512b1561..a716a6092a 100644
--- a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
+++ b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
@@ -100,6 +100,7 @@ QMinimalEglIntegration::QMinimalEglIntegration()
QMinimalEglIntegration::~QMinimalEglIntegration()
{
destroyScreen(mScreen);
+ delete mFontDb;
}
bool QMinimalEglIntegration::hasCapability(QPlatformIntegration::Capability cap) const
diff --git a/src/plugins/platforms/qnx/qqnxeglwindow.cpp b/src/plugins/platforms/qnx/qqnxeglwindow.cpp
index aa2e4db193..33ce0f924c 100644
--- a/src/plugins/platforms/qnx/qqnxeglwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxeglwindow.cpp
@@ -140,11 +140,17 @@ EGLSurface QQnxEglWindow::getSurface()
if (m_newSurfaceRequested.testAndSetOrdered(true, false)) {
const QMutexLocker locker(&m_mutex); //Set geomety must not reset the requestedBufferSize till
//the surface is created
- if (m_eglSurface != EGL_NO_SURFACE) {
- platformOpenGLContext()->doneCurrent();
- destroyEGLSurface();
+
+ if ((m_requestedBufferSize != bufferSize()) || (m_eglSurface == EGL_NO_SURFACE)) {
+ if (m_eglSurface != EGL_NO_SURFACE) {
+ platformOpenGLContext()->doneCurrent();
+ destroyEGLSurface();
+ }
+ createEGLSurface();
+ } else {
+ // Must've been a sequence of unprocessed changes returning us to the original size.
+ resetBuffers();
}
- createEGLSurface();
}
return m_eglSurface;
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index d87fb75d14..6d4b7922db 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -988,8 +988,10 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
d->m_creationContext->obtainedGeometry.moveTo(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
return true;
case QtWindows::NonClientCreate:
- if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10 && d->m_creationContext->window->isTopLevel())
+ if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10 && d->m_creationContext->window->isTopLevel()
+ && !d->m_creationContext->window->property(QWindowsWindow::embeddedNativeParentHandleProperty).isValid()) {
enableNonClientDpiScaling(msg.hwnd);
+ }
return false;
case QtWindows::CalculateSize:
return QWindowsGeometryHint::handleCalculateSize(d->m_creationContext->customMargins, msg, result);
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
index 0e15ab08c1..af4304cb19 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
@@ -387,12 +387,13 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd,
&& (!hasCapture || currentWindowUnderMouse == window))
|| (m_previousCaptureWindow && window != m_previousCaptureWindow && currentWindowUnderMouse
&& currentWindowUnderMouse != m_previousCaptureWindow)) {
+ QPoint localPosition;
qCDebug(lcQpaEvents) << "Entering " << currentWindowUnderMouse;
- if (QWindowsWindow *wumPlatformWindow = QWindowsWindow::windowsWindowOf(currentWindowUnderMouse))
+ if (QWindowsWindow *wumPlatformWindow = QWindowsWindow::windowsWindowOf(currentWindowUnderMouse)) {
+ localPosition = wumPlatformWindow->mapFromGlobal(globalPosition);
wumPlatformWindow->applyCursor();
- QWindowSystemInterface::handleEnterEvent(currentWindowUnderMouse,
- currentWindowUnderMouse->mapFromGlobal(globalPosition),
- globalPosition);
+ }
+ QWindowSystemInterface::handleEnterEvent(currentWindowUnderMouse, localPosition, globalPosition);
}
// We need to track m_windowUnderMouse separately from m_trackedWindow, as
// Windows mouse tracking will not trigger WM_MOUSELEAVE for leaving window when
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 6b737207f5..15906961ac 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -515,7 +515,7 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag
// Sometimes QWindow doesn't have a QWindow parent but does have a native parent window,
// e.g. in case of embedded ActiveQt servers. They should not be considered a top-level
// windows in such cases.
- QVariant prop = w->property("_q_embedded_native_parent_handle");
+ QVariant prop = w->property(QWindowsWindow::embeddedNativeParentHandleProperty);
if (prop.isValid()) {
embedded = true;
parentHandle = reinterpret_cast<HWND>(prop.value<WId>());
@@ -1061,6 +1061,8 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w,
\ingroup qt-lighthouse-win
*/
+const char *QWindowsWindow::embeddedNativeParentHandleProperty = "_q_embedded_native_parent_handle";
+
QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data) :
QWindowsBaseWindow(aWindow),
m_data(data),
@@ -1858,7 +1860,7 @@ bool QWindowsWindow::isFullScreen_sys() const
if (testFlag(HasBorderInFullScreen))
geometry += QMargins(1, 1, 1, 1);
QPlatformScreen *screen = screenForGeometry(geometry);
- return screen && geometry == QHighDpi::toNativePixels(screen->geometry(), screen);
+ return screen && geometry == screen->geometry();
}
/*!
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index 60289bdc08..982f3dfd30 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -332,6 +332,8 @@ public:
void setHasBorderInFullScreen(bool border);
static QString formatWindowTitle(const QString &title);
+ static const char *embeddedNativeParentHandleProperty;
+
private:
inline void show_sys() const;
inline QWindowsWindowData setWindowFlags_sys(Qt::WindowFlags wt, unsigned flags = 0) const;
diff --git a/src/plugins/platforms/winrt/qwinrttheme.cpp b/src/plugins/platforms/winrt/qwinrttheme.cpp
index 5696ae7a10..283825a880 100644
--- a/src/plugins/platforms/winrt/qwinrttheme.cpp
+++ b/src/plugins/platforms/winrt/qwinrttheme.cpp
@@ -61,6 +61,26 @@ QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcQpaTheme, "qt.qpa.theme")
+class QWinRTApiInformationHandler {
+public:
+ QWinRTApiInformationHandler()
+ {
+ HRESULT hr;
+ hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Foundation_Metadata_ApiInformation).Get(),
+ IID_PPV_ARGS(&m_apiInformationStatics));
+ Q_ASSERT_SUCCEEDED(hr);
+ }
+
+ ComPtr<IApiInformationStatics> apiInformationStatics() const
+ {
+ return m_apiInformationStatics;
+ }
+
+private:
+ ComPtr<IApiInformationStatics> m_apiInformationStatics;
+};
+Q_GLOBAL_STATIC(QWinRTApiInformationHandler, gApiHandler);
+
static IUISettings *uiSettings()
{
static ComPtr<IUISettings> settings;
@@ -86,17 +106,16 @@ static inline QColor fromColor(const Color &color)
static bool uiColorSettings(const wchar_t *value, UIElementType type, Color *color)
{
- static ComPtr<IApiInformationStatics> apiInformationStatics;
- HRESULT hr;
+ ComPtr<IApiInformationStatics> apiInformationStatics = gApiHandler->apiInformationStatics();
if (!apiInformationStatics) {
- hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Foundation_Metadata_ApiInformation).Get(),
- IID_PPV_ARGS(&apiInformationStatics));
- RETURN_FALSE_IF_FAILED("Could not get ApiInformationStatics");
+ qErrnoWarning("Could not get ApiInformationStatics");
+ return false;
}
static const HStringReference enumRef(L"Windows.UI.ViewManagement.UIElementType");
HStringReference valueRef(value);
+ HRESULT hr;
boolean exists;
hr = apiInformationStatics->IsEnumNamedValuePresent(enumRef.Get(), valueRef.Get(), &exists);
@@ -149,6 +168,14 @@ static void nativeColorSettings(QPalette &p)
// Starting with SDK 15063 those have been removed.
#ifndef QT_WINRT_DISABLE_PHONE_COLORS
//Phone related
+ ComPtr<IApiInformationStatics> apiInformationStatics = gApiHandler->apiInformationStatics();
+ boolean phoneApiPresent = false;
+ HRESULT hr;
+ HStringReference phoneRef(L"Windows.Phone.PhoneContract");
+ hr = apiInformationStatics.Get()->IsApiContractPresentByMajor(phoneRef.Get(), 1, &phoneApiPresent);
+ if (FAILED(hr) || !phoneApiPresent)
+ return;
+
if (uiColorSettings(L"PopupBackground", UIElementType_PopupBackground, &color)) {
p.setColor(QPalette::ToolTipBase, fromColor(color));
p.setColor(QPalette::AlternateBase, fromColor(color));
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index 674b0cef4b..13f5cd5842 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -428,6 +428,7 @@ public:
#if QT_CONFIG(xinput2)
void xi2Select(xcb_window_t window);
+ void xi2SelectStateEvents();
bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; }
bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; }
#endif
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index bf17e9c1e1..8ed6909990 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -79,6 +79,7 @@ void QXcbConnection::initializeXInput2()
qCDebug(lcQpaXInput, "Using XInput version %d.%d", xiMajor, m_xi2Minor);
m_xi2Enabled = true;
xi2SetupDevices();
+ xi2SelectStateEvents();
break;
case BadRequest: // Must be an X server with XInput 1
qCDebug(lcQpaXInput, "X server does not support XInput 2");
@@ -90,6 +91,22 @@ void QXcbConnection::initializeXInput2()
}
}
+void QXcbConnection::xi2SelectStateEvents()
+{
+ // These state events do not depend on a specific X window, but are global
+ // for the X client's (application's) state.
+ unsigned int bitMask = 0;
+ unsigned char *xiBitMask = reinterpret_cast<unsigned char *>(&bitMask);
+ XIEventMask xiEventMask;
+ bitMask = XI_HierarchyChangedMask;
+ bitMask |= XI_DeviceChangedMask;
+ xiEventMask.deviceid = XIAllDevices;
+ xiEventMask.mask_len = sizeof(bitMask);
+ xiEventMask.mask = xiBitMask;
+ Display *dpy = static_cast<Display *>(m_xlib_display);
+ XISelectEvents(dpy, DefaultRootWindow(dpy), &xiEventMask, 1);
+}
+
void QXcbConnection::xi2SetupDevice(void *info, bool removeExisting)
{
XIDeviceInfo *deviceInfo = reinterpret_cast<XIDeviceInfo *>(info);
@@ -373,17 +390,6 @@ void QXcbConnection::xi2Select(xcb_window_t window)
#else
Q_UNUSED(xiBitMask);
#endif
-
- {
- // Listen for hotplug events
- XIEventMask xiEventMask;
- bitMask = XI_HierarchyChangedMask;
- bitMask |= XI_DeviceChangedMask;
- xiEventMask.deviceid = XIAllDevices;
- xiEventMask.mask_len = sizeof(bitMask);
- xiEventMask.mask = xiBitMask;
- XISelectEvents(xDisplay, window, &xiEventMask, 1);
- }
}
QXcbConnection::TouchDeviceData *QXcbConnection::touchDeviceForId(int id)
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index 8ba6834565..c8efe2fce8 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -329,12 +329,15 @@ QAbstractEventDispatcher *QXcbIntegration::createEventDispatcher() const
void QXcbIntegration::initialize()
{
+ const QLatin1String defaultInputContext("compose");
// Perform everything that may potentially need the event dispatcher (timers, socket
// notifiers) here instead of the constructor.
QString icStr = QPlatformInputContextFactory::requested();
if (icStr.isNull())
- icStr = QLatin1String("compose");
+ icStr = defaultInputContext;
m_inputContext.reset(QPlatformInputContextFactory::create(icStr));
+ if (!m_inputContext && icStr != defaultInputContext && icStr != QLatin1String("none"))
+ m_inputContext.reset(QPlatformInputContextFactory::create(defaultInputContext));
}
void QXcbIntegration::moveToScreen(QWindow *window, int screen)
diff --git a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp
index 99e8ec8999..1cb14514ee 100644
--- a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp
+++ b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp
@@ -449,7 +449,9 @@ QStringList QWindowsPrintDevice::availablePrintDeviceIds()
QString QWindowsPrintDevice::defaultPrintDeviceId()
{
DWORD size = 0;
- GetDefaultPrinter(NULL, &size);
+ if (GetDefaultPrinter(NULL, &size) == ERROR_FILE_NOT_FOUND)
+ return QString();
+
QScopedArrayPointer<wchar_t> name(new wchar_t[size]);
GetDefaultPrinter(name.data(), &size);
return QString::fromWCharArray(name.data());
diff --git a/src/plugins/sqldrivers/configure.json b/src/plugins/sqldrivers/configure.json
index 5603ceb37b..234f880579 100644
--- a/src/plugins/sqldrivers/configure.json
+++ b/src/plugins/sqldrivers/configure.json
@@ -39,7 +39,9 @@
"libraries": {
"db2": {
"label": "DB2 (IBM)",
- "test": "unix/db2",
+ "test": {
+ "include": [ "sqlcli.h", "sqlcli1.h" ]
+ },
"sources": [
{ "libs": "-ldb2cli", "condition": "config.win32" },
{ "libs": "-ldb2", "condition": "!config.win32" }
@@ -47,7 +49,9 @@
},
"ibase": {
"label": "InterBase",
- "test": "unix/ibase",
+ "test": {
+ "include": "ibase.h"
+ },
"sources": [
{ "libs": "-lgds32_ms", "condition": "config.win32" },
{ "libs": "-lgds", "condition": "!config.win32" }
@@ -55,7 +59,15 @@
},
"mysql": {
"label": "MySQL",
- "test": "unix/mysql",
+ "test": {
+ "head": [
+ "#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)",
+ "# include <windows.h>",
+ "#endif"
+ ],
+ "include": "mysql.h",
+ "main": "mysql_get_client_version();"
+ },
"sources": [
{ "type": "mysqlConfig", "query": "--libs_r", "cleanlibs": true },
{ "type": "mysqlConfig", "query": "--libs", "cleanlibs": true },
@@ -68,7 +80,13 @@
},
"psql": {
"label": "PostgreSQL",
- "test": "unix/psql",
+ "test": {
+ "include": "libpq-fe.h",
+ "main": [
+ "PQescapeBytea(0, 0, 0);",
+ "PQunescapeBytea(0, 0);"
+ ]
+ },
"sources": [
{ "type": "pkgConfig", "args": "libpq" },
{ "type": "psqlConfig" },
@@ -78,7 +96,9 @@
},
"tds": {
"label": "TDS (Sybase)",
- "test": "unix/tds",
+ "test": {
+ "include": [ "sybfront.h", "sybdb.h" ]
+ },
"sources": [
{ "type": "sybaseEnv", "libs": "-lNTWDBLIB", "condition": "config.win32" },
{ "type": "sybaseEnv", "libs": "-lsybdb", "condition": "!config.win32" }
@@ -86,7 +106,9 @@
},
"oci": {
"label": "OCI (Oracle)",
- "test": "unix/oci",
+ "test": {
+ "include": "oci.h"
+ },
"sources": [
{ "libs": "-loci", "condition": "config.win32" },
{ "libs": "-lclntsh", "condition": "!config.win32" }
@@ -94,7 +116,18 @@
},
"odbc": {
"label": "ODBC",
- "test": "unix/odbc",
+ "test": {
+ "head": [
+ "#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)",
+ "# include <windows.h>",
+ "#endif"
+ ],
+ "include": [ "sql.h", "sqlext.h" ],
+ "main": [
+ "SQLHANDLE env;",
+ "SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);"
+ ]
+ },
"sources": [
{ "libs": "-lodbc32", "condition": "config.win32" },
{ "libs": "-liodbc", "condition": "config.darwin" },
@@ -103,7 +136,9 @@
},
"sqlite2": {
"label": "SQLite (version 2)",
- "test": "unix/sqlite2",
+ "test": {
+ "include": "sqlite.h"
+ },
"sources": [
"-lsqlite"
]
@@ -111,7 +146,10 @@
"sqlite3": {
"label": "SQLite (version 3)",
"export": "sqlite",
- "test": "unix/sqlite",
+ "test": {
+ "include": "sqlite3.h",
+ "main": "sqlite3_open_v2(0, 0, 0, 0);"
+ },
"sources": [
{ "type": "pkgConfig", "args": "sqlite3" },
"-lsqlite3"
diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
index b0db1c276e..e9f5ee9508 100644
--- a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
+++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
@@ -55,6 +55,7 @@
#include <qcache.h>
#include <qregularexpression.h>
#endif
+#include <QTimeZone>
#if defined Q_OS_WIN
# include <qt_windows.h>
@@ -416,6 +417,32 @@ bool QSQLiteResult::prepare(const QString &query)
return true;
}
+static QString secondsToOffset(int seconds)
+{
+ const QChar sign = ushort(seconds < 0 ? '-' : '+');
+ seconds = qAbs(seconds);
+ const int hours = seconds / 3600;
+ const int minutes = (seconds % 3600) / 60;
+
+ return QString(QStringLiteral("%1%2:%3")).arg(sign).arg(hours, 2, 10, QLatin1Char('0')).arg(minutes, 2, 10, QLatin1Char('0'));
+}
+
+static QString timespecToString(const QDateTime &dateTime)
+{
+ switch (dateTime.timeSpec()) {
+ case Qt::LocalTime:
+ return QString();
+ case Qt::UTC:
+ return QStringLiteral("Z");
+ case Qt::OffsetFromUTC:
+ return secondsToOffset(dateTime.offsetFromUtc());
+ case Qt::TimeZone:
+ return secondsToOffset(dateTime.timeZone().offsetFromUtc(dateTime));
+ default:
+ return QString();
+ }
+}
+
bool QSQLiteResult::exec()
{
Q_D(QSQLiteResult);
@@ -481,7 +508,7 @@ bool QSQLiteResult::exec()
break;
case QVariant::DateTime: {
const QDateTime dateTime = value.toDateTime();
- const QString str = dateTime.toString(QStringViewLiteral("yyyy-MM-ddThh:mm:ss.zzz"));
+ const QString str = dateTime.toString(QLatin1String("yyyy-MM-ddThh:mm:ss.zzz") + timespecToString(dateTime));
res = sqlite3_bind_text16(d->stmt, i + 1, str.utf16(),
str.size() * sizeof(ushort), SQLITE_TRANSIENT);
break;
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index 6266728c84..a6ece7632a 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -52,16 +52,22 @@
//#define DEBUG_SIZE_CONSTRAINT
#include <private/qcore_mac_p.h>
-#include <private/qcombobox_p.h>
+#if QT_CONFIG(tabbar)
#include <private/qtabbar_p.h>
+#endif
#include <private/qpainter_p.h>
#include <qapplication.h>
#include <qbitmap.h>
+#if QT_CONFIG(combobox)
+#include <private/qcombobox_p.h>
#include <qcombobox.h>
+#endif
#if QT_CONFIG(dialogbuttonbox)
#include <qdialogbuttonbox.h>
#endif
+#if QT_CONFIG(dockwidget)
#include <qdockwidget.h>
+#endif
#include <qevent.h>
#include <qfocusframe.h>
#include <qformlayout.h>
@@ -287,7 +293,7 @@ static const QColor tabBarCloseButtonCrossSelected(115, 115, 115);
static const int closeButtonSize = 14;
static const qreal closeButtonCornerRadius = 2.0;
-#ifndef QT_NO_TABBAR
+#if QT_CONFIG(tabbar)
static bool isVerticalTabs(const QTabBar::Shape shape) {
return (shape == QTabBar::RoundedEast
|| shape == QTabBar::TriangularEast
@@ -363,7 +369,7 @@ static void drawTabCloseButton(QPainter *p, bool hover, bool selected, bool pres
p->drawLine(margin, height - margin, width - margin, margin);
}
-#ifndef QT_NO_TABBAR
+#if QT_CONFIG(tabbar)
QRect rotateTabPainter(QPainter *p, QTabBar::Shape shape, QRect tabRect)
{
if (isVerticalTabs(shape)) {
@@ -502,7 +508,7 @@ static inline bool isTreeView(const QWidget *widget)
}
#endif
-#ifndef QT_NO_TABBAR
+#if QT_CONFIG(tabbar)
static inline ThemeTabDirection getTabDirection(QTabBar::Shape shape)
{
ThemeTabDirection ttd;
@@ -771,7 +777,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
else if (qobject_cast<const QCheckBox *>(widg))
ct = QStyle::CT_CheckBox;
#endif
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
else if (qobject_cast<const QComboBox *>(widg))
ct = QStyle::CT_ComboBox;
#endif
@@ -1017,7 +1023,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
break;
}
#endif
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case QStyle::CT_LineEdit:
if (!widg || !qobject_cast<QComboBox *>(widg->parentWidget())) {
//should I take into account the font dimentions of the lineedit? -Sam
@@ -1145,17 +1151,17 @@ void QMacStylePrivate::drawFocusRing(QPainter *p, const QRect &targetRect, int h
NSBezierPath *focusRingPath;
if (radius > 0) {
const CGFloat roundedRectInset = -1.5;
- focusRingPath = [NSBezierPath bezierPathWithRoundedRect:CGRectInset(focusRingRect, roundedRectInset, roundedRectInset)
+ focusRingPath = [NSBezierPath bezierPathWithRoundedRect:NSRectFromCGRect(CGRectInset(focusRingRect, roundedRectInset, roundedRectInset))
xRadius:radius
yRadius:radius];
} else {
const CGFloat outerClipInset = -focusRingWidth / 2;
- NSBezierPath *focusRingClipPath = [NSBezierPath bezierPathWithRect:CGRectInset(focusRingRect, outerClipInset, outerClipInset)];
+ NSBezierPath *focusRingClipPath = [NSBezierPath bezierPathWithRect:NSRectFromCGRect(CGRectInset(focusRingRect, outerClipInset, outerClipInset))];
const CGFloat innerClipInset = 1;
- NSBezierPath *focusRingInnerClipPath = [NSBezierPath bezierPathWithRect:CGRectInset(focusRingRect, innerClipInset, innerClipInset)];
+ NSBezierPath *focusRingInnerClipPath = [NSBezierPath bezierPathWithRect:NSRectFromCGRect(CGRectInset(focusRingRect, innerClipInset, innerClipInset))];
[focusRingClipPath appendBezierPath:focusRingInnerClipPath.bezierPathByReversingPath];
[focusRingClipPath setClip];
- focusRingPath = [NSBezierPath bezierPathWithRect:focusRingRect];
+ focusRingPath = [NSBezierPath bezierPathWithRect:NSRectFromCGRect(focusRingRect)];
focusRingPath.lineJoinStyle = NSRoundLineJoinStyle;
}
@@ -1200,7 +1206,7 @@ void QMacStylePrivate::drawFocusRing(QPainter *p, const QRect &targetRect, int h
QRect(focusRingPixmap.width() - shCornerSize, svCornerSize, shCornerSize, focusRingPixmap.width() - 2 * svCornerSize));
}
-#ifndef QT_NO_TABBAR
+#if QT_CONFIG(tabbar)
void QMacStylePrivate::tabLayout(const QStyleOptionTab *opt, const QWidget *widget, QRect *textRect, QRect *iconRect) const
{
Q_ASSERT(textRect);
@@ -1263,7 +1269,7 @@ void QMacStylePrivate::tabLayout(const QStyleOptionTab *opt, const QWidget *widg
*textRect = tr;
}
-#endif //QT_NO_TABBAR
+#endif // QT_CONFIG(tabbar)
QStyleHelper::WidgetSizePolicy QMacStylePrivate::effectiveAquaSizeConstrain(const QStyleOption *option,
const QWidget *widg,
@@ -2357,7 +2363,7 @@ void QMacStyle::polish(QWidget* w)
{
#ifndef QT_NO_MENU
if (qobject_cast<QMenu*>(w)
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
|| qobject_cast<QComboBoxPrivateContainer *>(w)
#endif
) {
@@ -2382,7 +2388,7 @@ void QMacStyle::polish(QWidget* w)
}
#endif
-#ifndef QT_NO_TABBAR
+#if QT_CONFIG(tabbar)
if (QTabBar *tb = qobject_cast<QTabBar*>(w)) {
if (tb->documentMode()) {
w->setAttribute(Qt::WA_Hover);
@@ -2424,7 +2430,7 @@ void QMacStyle::unpolish(QWidget* w)
w->setWindowOpacity(1.0);
}
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
if (QComboBox *combo = qobject_cast<QComboBox *>(w)) {
if (!combo->isEditable()) {
if (QWidget *widget = combo->findChild<QComboBoxPrivateContainer *>())
@@ -2433,7 +2439,7 @@ void QMacStyle::unpolish(QWidget* w)
}
#endif
-#ifndef QT_NO_TABBAR
+#if QT_CONFIG(tabbar)
if (qobject_cast<QTabBar*>(w)) {
if (!w->testAttribute(Qt::WA_SetFont))
w->setFont(qApp->font(w));
@@ -2941,7 +2947,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
ret = QEvent::MouseButtonRelease;
break;
case SH_TabBar_SelectMouseType:
-#ifndef QT_NO_TABBAR
+#if QT_CONFIG(tabbar)
if (const QStyleOptionTabBarBase *opt2 = qstyleoption_cast<const QStyleOptionTabBarBase *>(opt)) {
ret = opt2->documentMode ? QEvent::MouseButtonPress : QEvent::MouseButtonRelease;
} else
@@ -2966,7 +2972,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
ret = Qt::AlignRight;
break;
case SH_TabBar_Alignment: {
-#ifndef QT_NO_TABWIDGET
+#if QT_CONFIG(tabwidget)
if (const QTabWidget *tab = qobject_cast<const QTabWidget*>(w)) {
if (tab->documentMode()) {
ret = Qt::AlignLeft;
@@ -2974,7 +2980,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
}
}
#endif
-#ifndef QT_NO_TABBAR
+#if QT_CONFIG(tabbar)
if (const QTabBar *tab = qobject_cast<const QTabBar*>(w)) {
if (tab->documentMode()) {
ret = Qt::AlignLeft;
@@ -3151,7 +3157,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
case SH_ItemView_PaintAlternatingRowColorsForEmptyArea:
ret = true;
break;
-#ifndef QT_NO_TABBAR
+#if QT_CONFIG(tabbar)
case SH_TabBar_CloseButtonPosition:
ret = QTabBar::LeftSide;
break;
@@ -3282,7 +3288,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
p->drawPath(path);
p->restore();
break; }
-#ifndef QT_NO_TABBAR
+#if QT_CONFIG(tabbar)
case PE_FrameTabBarBase:
if (const QStyleOptionTabBarBase *tbb
= qstyleoption_cast<const QStyleOptionTabBarBase *>(opt)) {
@@ -3598,7 +3604,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
}
break;
-#ifndef QT_NO_TABWIDGET
+#if QT_CONFIG(tabwidget)
case PE_FrameTabWidget:
if (const QStyleOptionTabWidgetFrame *twf
= qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
@@ -4112,7 +4118,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
QCommonStyle::drawControl(CE_ComboBoxLabel, &comboCopy, p, w);
}
break;
-#ifndef QT_NO_TABBAR
+#if QT_CONFIG(tabbar)
case CE_TabBarTabShape:
if (const QStyleOptionTab *tabOpt = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
if (tabOpt->documentMode) {
@@ -4261,7 +4267,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
}
break;
#endif
-#ifndef QT_NO_DOCKWIDGET
+#if QT_CONFIG(dockwidget)
case CE_DockWidgetTitle:
if (const QDockWidget *dockWidget = qobject_cast<const QDockWidget *>(w)) {
bool floating = dockWidget->isFloating();
@@ -4440,7 +4446,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
// Always be normal or disabled to follow the Mac style.
int smallIconSize = proxy()->pixelMetric(PM_SmallIconSize);
QSize iconSize(smallIconSize, smallIconSize);
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
if (const QComboBox *comboBox = qobject_cast<const QComboBox *>(w)) {
iconSize = comboBox->iconSize();
}
@@ -4816,7 +4822,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
int(outRect.size.height));
break;
}
-#ifndef QT_NO_TABWIDGET
+#if QT_CONFIG(tabwidget)
case SE_TabWidgetLeftCorner:
if (const QStyleOptionTabWidgetFrame *twf
= qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
@@ -4949,7 +4955,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
#endif
case SE_LineEditContents:
rect = QCommonStyle::subElementRect(sr, opt, widget);
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
if (widget && qobject_cast<const QComboBox*>(widget->parentWidget()))
rect.adjust(-1, -2, 0, 0);
else
@@ -5093,7 +5099,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
}
rect.setBottom(rect.bottom() - 1);
break;
-#ifndef QT_NO_TABWIDGET
+#if QT_CONFIG(tabwidget)
case SE_TabWidgetLayoutItem:
if (const QStyleOptionTabWidgetFrame *tabWidgetOpt =
qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
@@ -5108,7 +5114,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
}
break;
#endif
-#ifndef QT_NO_DOCKWIDGET
+#if QT_CONFIG(dockwidget)
case SE_DockWidgetCloseButton:
case SE_DockWidgetFloatButton:
case SE_DockWidgetTitleBarText:
@@ -6411,7 +6417,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
* overlap is how much the pane should overlap the tab bar
*/
// then add the size between the stackwidget and the "contentsRect"
-#ifndef QT_NO_TABWIDGET
+#if QT_CONFIG(tabwidget)
if (const QStyleOptionTabWidgetFrame *twf
= qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
QSize extra(0,0);
@@ -6427,7 +6433,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
}
#endif
break;
-#ifndef QT_NO_TABBAR
+#if QT_CONFIG(tabbar)
case QStyle::CT_TabBarTab:
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
const QStyleHelper::WidgetSizePolicy AquaSize = d->aquaSizeConstrain(opt, widget);
@@ -6510,7 +6516,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
case QStyle::CT_MenuItem:
if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
int maxpmw = mi->maxIconWidth;
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
const QComboBox *comboBox = qobject_cast<const QComboBox *>(widget);
#endif
int w = sz.width(),
@@ -6521,7 +6527,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
} else {
h = mi->fontMetrics.height() + 2;
if (!mi->icon.isNull()) {
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
if (comboBox) {
const QSize &iconSize = comboBox->iconSize();
h = qMax(h, iconSize.height() + 4);
@@ -6542,7 +6548,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
w += maxpmw + 6;
// add space for a check. All items have place for a check too.
w += 20;
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
if (comboBox && comboBox->isVisible()) {
QStyleOptionComboBox cmb;
cmb.initFrom(comboBox);
diff --git a/src/plugins/styles/mac/qmacstyle_mac_p_p.h b/src/plugins/styles/mac/qmacstyle_mac_p_p.h
index 2dff9afacb..8574a52a87 100644
--- a/src/plugins/styles/mac/qmacstyle_mac_p_p.h
+++ b/src/plugins/styles/mac/qmacstyle_mac_p_p.h
@@ -48,7 +48,9 @@
#include <QtWidgets/private/qcommonstyle_p.h>
#include "qmacstyle_mac_p.h"
#include <private/qapplication_p.h>
+#if QT_CONFIG(combobox)
#include <private/qcombobox_p.h>
+#endif
#include <private/qpainter_p.h>
#include <private/qstylehelper_p.h>
#include <qapplication.h>
@@ -60,7 +62,9 @@
#if QT_CONFIG(dialogbuttonbox)
#include <qdialogbuttonbox.h>
#endif
+#if QT_CONFIG(dockwidget)
#include <qdockwidget.h>
+#endif
#include <qevent.h>
#include <qfocusframe.h>
#include <qformlayout.h>
@@ -69,7 +73,9 @@
#include <qheaderview.h>
#include <qlayout.h>
#include <qlineedit.h>
+#if QT_CONFIG(listview)
#include <qlistview.h>
+#endif
#include <qmainwindow.h>
#include <qmap.h>
#include <qmenubar.h>
@@ -249,7 +255,7 @@ public:
void drawFocusRing(QPainter *p, const QRect &targetRect, int hMargin, int vMargin, qreal radius = 0) const;
-#ifndef QT_NO_TABBAR
+#if QT_CONFIG(tabbar)
void tabLayout(const QStyleOptionTab *opt, const QWidget *widget, QRect *textRect, QRect *iconRect) const;
#endif
diff --git a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
index ebd3934c90..60a5c25b1f 100644
--- a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
+++ b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
@@ -1436,7 +1436,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
}
}
break;
-#ifndef QT_NO_ITEMVIEWS
+#if QT_CONFIG(itemviews)
case CE_ItemViewItem:
{
const QStyleOptionViewItem *vopt;
@@ -1471,12 +1471,12 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
}
break;
}
-#endif // QT_NO_ITEMVIEWS
-#ifndef QT_NO_COMBOBOX
+#endif // QT_CONFIG(itemviews)
+#if QT_CONFIG(combobox)
case CE_ComboBoxLabel:
QCommonStyle::drawControl(element, option, painter, widget);
break;
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
default:
QWindowsXPStyle::drawControl(element, option, painter, widget);
break;
@@ -2119,7 +2119,7 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt
QRect rect = QWindowsXPStyle::subControlRect(control, option, subControl, widget);
switch (control) {
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case CC_ComboBox:
if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
int x = cb->rect.x(),
@@ -2152,7 +2152,7 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt
return rect;
}
break;
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
case CC_TitleBar:
if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(option)) {
if (!buttonVisible(subControl, tb))
diff --git a/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h b/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h
index c8e9edeb3b..14af2c6bbc 100644
--- a/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h
+++ b/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h
@@ -70,11 +70,17 @@
#include <qtoolbutton.h>
#include <qspinbox.h>
#include <qtoolbar.h>
+#if QT_CONFIG(combobox)
#include <qcombobox.h>
+#endif
#include <qscrollbar.h>
#include <qprogressbar.h>
+#if QT_CONFIG(dockwidget)
#include <qdockwidget.h>
+#endif
+#if QT_CONFIG(listview)
#include <qlistview.h>
+#endif
#if QT_CONFIG(treeview)
#include <qtreeview.h>
#endif
diff --git a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
index e670794cd3..a3a665f22b 100644
--- a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
+++ b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
@@ -56,12 +56,18 @@
#include <qdesktopwidget.h>
#include <qtoolbutton.h>
+#if QT_CONFIG(tabbar)
#include <qtabbar.h>
+#endif
+#if QT_CONFIG(combobox)
#include <qcombobox.h>
+#endif
#include <qscrollbar.h>
#include <qheaderview.h>
#include <qspinbox.h>
+#if QT_CONFIG(listview)
#include <qlistview.h>
+#endif
#include <qstackedwidget.h>
#if QT_CONFIG(pushbutton)
#include <qpushbutton.h>
@@ -1151,9 +1157,9 @@ void QWindowsXPStyle::polish(QWidget *widget)
#endif
|| qobject_cast<QToolButton*>(widget)
|| qobject_cast<QTabBar*>(widget)
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
|| qobject_cast<QComboBox*>(widget)
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
|| qobject_cast<QScrollBar*>(widget)
|| qobject_cast<QSlider*>(widget)
|| qobject_cast<QHeaderView*>(widget)
@@ -1226,9 +1232,9 @@ void QWindowsXPStyle::unpolish(QWidget *widget)
#endif
|| qobject_cast<QToolButton*>(widget)
|| qobject_cast<QTabBar*>(widget)
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
|| qobject_cast<QComboBox*>(widget)
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
|| qobject_cast<QScrollBar*>(widget)
|| qobject_cast<QSlider*>(widget)
|| qobject_cast<QHeaderView*>(widget)
@@ -2292,7 +2298,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
drawItemText(p, mbi->rect, alignment, mbi->palette, mbi->state & State_Enabled, mbi->text, textRole);
}
return;
-#ifndef QT_NO_DOCKWIDGET
+#if QT_CONFIG(dockwidget)
case CE_DockWidgetTitle:
if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(option))
{
@@ -2417,7 +2423,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
return;
}
break;
-#endif // QT_NO_DOCKWIDGET
+#endif // QT_CONFIG(dockwidget)
#if QT_CONFIG(rubberband)
case CE_RubberBand:
if (qstyleoption_cast<const QStyleOptionRubberBand *>(option)) {
@@ -2554,7 +2560,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
}
break;
#endif // QT_NO_SPINBOX
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case CC_ComboBox:
if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(option))
{
@@ -2605,7 +2611,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
}
}
break;
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
case CC_ScrollBar:
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(option))
{