diff options
-rw-r--r-- | src/corelib/kernel/qcoreevent.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 1 | ||||
-rw-r--r-- | src/network/kernel/qnetworkinterface.cpp | 2 | ||||
-rw-r--r-- | src/network/kernel/qnetworkinterface.h | 2 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowsglcontext.cpp | 9 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowstabletsupport.cpp | 99 | ||||
-rw-r--r-- | src/widgets/kernel/qaction.cpp | 2 | ||||
-rw-r--r-- | tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp | 6 |
8 files changed, 91 insertions, 32 deletions
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 1e6b328c75..58ca8279ea 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -194,7 +194,7 @@ QT_BEGIN_NAMESPACE \omitvalue Pointer \value Polish The widget is polished. \value PolishRequest The widget should be polished. - \value QueryWhatsThis The widget should accept the event if it has "What's This?" help. + \value QueryWhatsThis The widget should accept the event if it has "What's This?" help (QHelpEvent). \value ReadOnlyChange Widget's read-only state has changed (since Qt 5.4). \value RequestSoftwareInputPanel A widget wants to open a software input panel (SIP). \value Resize Widget's size changed (QResizeEvent). diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 0e3163eefb..f7578a3c57 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -641,6 +641,7 @@ QRasterPaintEngineState::QRasterPaintEngineState() txscale = 1.; flags.fast_pen = true; + flags.non_complex_pen = false; flags.antialiased = false; flags.bilinear = false; flags.legacy_rounding = false; diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp index 70674e9adf..75a26848a6 100644 --- a/src/network/kernel/qnetworkinterface.cpp +++ b/src/network/kernel/qnetworkinterface.cpp @@ -706,7 +706,7 @@ int QNetworkInterface::index() const \sa QUdpSocket */ -int QNetworkInterface::maxTransmissionUnit() const +int QNetworkInterface::maximumTransmissionUnit() const { return d ? d->mtu : 0; } diff --git a/src/network/kernel/qnetworkinterface.h b/src/network/kernel/qnetworkinterface.h index f7ef192dc0..148fd5e10d 100644 --- a/src/network/kernel/qnetworkinterface.h +++ b/src/network/kernel/qnetworkinterface.h @@ -153,7 +153,7 @@ public: bool isValid() const; int index() const; - int maxTransmissionUnit() const; + int maximumTransmissionUnit() const; QString name() const; QString humanReadableName() const; InterfaceFlags flags() const; diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index 4bdf3167e4..e9c52e2c02 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -391,6 +391,15 @@ static PIXELFORMATDESCRIPTOR pfd.dwFlags |= PFD_DOUBLEBUFFER; pfd.cDepthBits = format.depthBufferSize() >= 0 ? format.depthBufferSize() : 32; + const int redBufferSize = format.redBufferSize(); + if (redBufferSize != -1) + pfd.cRedBits = BYTE(redBufferSize); + const int greenBufferSize = format.greenBufferSize(); + if (greenBufferSize != -1) + pfd.cGreenBits = BYTE(greenBufferSize); + const int blueBufferSize = format.blueBufferSize(); + if (blueBufferSize != -1) + pfd.cBlueBits = BYTE(blueBufferSize); pfd.cAlphaBits = format.alphaBufferSize() > 0 ? format.alphaBufferSize() : 8; pfd.cStencilBits = format.stencilBufferSize() > 0 ? format.stencilBufferSize() : 8; if (additional.formatFlags & QWindowsGLAccumBuffer) diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp index 78e33e57ab..dcad23e446 100644 --- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp +++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp @@ -111,6 +111,61 @@ inline QPointF QWindowsTabletDeviceData::scaleCoordinates(int coordX, int coordY return QPointF(x, y); } +template <class Stream> +static void formatOptions(Stream &str, unsigned options) +{ + if (options & CXO_SYSTEM) + str << " CXO_SYSTEM"; + if (options & CXO_PEN) + str << " CXO_PEN"; + if (options & CXO_MESSAGES) + str << " CXO_MESSAGES"; + if (options & CXO_MARGIN) + str << " CXO_MARGIN"; + if (options & CXO_MGNINSIDE) + str << " CXO_MGNINSIDE"; + if (options & CXO_CSRMESSAGES) + str << " CXO_CSRMESSAGES"; +} + +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug d, const QWindowsTabletDeviceData &t) +{ + QDebugStateSaver saver(d); + d.nospace(); + d << "TabletDevice id:" << t.uniqueId << " pressure: " << t.minPressure + << ".." << t.maxPressure << " tan pressure: " << t.minTanPressure << ".." + << t.maxTanPressure << " area:" << t.minX << t.minY <<t.minZ + << ".." << t.maxX << t.maxY << t.maxZ << " device " << t.currentDevice + << " pointer " << t.currentPointerType; + return d; +} + +QDebug operator<<(QDebug d, const LOGCONTEXT &lc) +{ + QDebugStateSaver saver(d); + d.nospace(); + d << "LOGCONTEXT(\"" << QString::fromWCharArray(lc.lcName) << "\", options=0x" + << hex << lc.lcOptions << dec; + formatOptions(d, lc.lcOptions); + d << ", status=0x" << hex << lc.lcStatus << ", device=0x" << lc.lcDevice + << dec << ", PktRate=" << lc.lcPktRate + << ", PktData=" << lc.lcPktData << ", PktMode=" << lc.lcPktMode + << ", MoveMask=0x" << hex << lc.lcMoveMask << ", BtnDnMask=0x" << lc.lcBtnDnMask + << ", BtnUpMask=0x" << lc.lcBtnUpMask << dec << ", SysMode=" << lc.lcSysMode + << ", InOrg=(" << lc.lcInOrgX << ", " << lc.lcInOrgY << ", " << lc.lcInOrgZ + << "), InExt=(" << lc.lcInExtX << ", " << lc.lcInExtY << ", " << lc.lcInExtZ + << ") OutOrg=(" << lc.lcOutOrgX << ", " << lc.lcOutOrgY << ", " + << lc.lcOutOrgZ << "), OutExt=(" << lc.lcOutExtX << ", " << lc.lcOutExtY + << ", " << lc.lcOutExtZ + << "), Sens=(" << lc.lcSensX << ", " << lc.lcSensX << ", " << lc.lcSensZ + << ") SysOrg=(" << lc.lcSysOrgX << ", " << lc.lcSysOrgY + << "), SysExt=(" << lc.lcSysExtX << ", " << lc.lcSysExtY + << "), SysSens=(" << lc.lcSysSensX << ", " << lc.lcSysSensY << "))"; + return d; +} +#endif // !QT_NO_DEBUG_STREAM + QWindowsWinTab32DLL QWindowsTabletSupport::m_winTab32DLL; /*! @@ -186,6 +241,7 @@ QWindowsTabletSupport *QWindowsTabletSupport::create() LOGCONTEXT lcMine; // build our context from the default context QWindowsTabletSupport::m_winTab32DLL.wTInfo(WTI_DEFSYSCTX, 0, &lcMine); + qCDebug(lcQpaTablet) << "Default: " << lcMine; // Go for the raw coordinates, the tablet event will return good stuff lcMine.lcOptions |= CXO_MESSAGES | CXO_CSRMESSAGES; lcMine.lcPktData = lcMine.lcMoveMask = PACKETDATA; @@ -194,6 +250,7 @@ QWindowsTabletSupport *QWindowsTabletSupport::create() lcMine.lcOutExtX = lcMine.lcInExtX; lcMine.lcOutOrgY = 0; lcMine.lcOutExtY = -lcMine.lcInExtY; + qCDebug(lcQpaTablet) << "Requesting: " << lcMine; const HCTX context = QWindowsTabletSupport::m_winTab32DLL.wTOpen(window, &lcMine, true); if (!context) { qCDebug(lcQpaTablet) << __FUNCTION__ << "Unable to open tablet."; @@ -215,7 +272,7 @@ QWindowsTabletSupport *QWindowsTabletSupport::create() } // mismatch qCDebug(lcQpaTablet) << "Opened tablet context " << context << " on window " << window << "changed packet queue size " << currentQueueSize - << "->" << TabletPacketQSize; + << "->" << TabletPacketQSize << "\nobtained: " << lcMine; return new QWindowsTabletSupport(window, context); } @@ -238,17 +295,23 @@ QString QWindowsTabletSupport::description() const WORD specificationVersion = 0; m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_SPECVERSION, &specificationVersion); const unsigned opts = options(); - QString result = QString::fromLatin1("%1 specification: v%2.%3 implementation: v%4.%5 options: 0x%6") - .arg(QString::fromWCharArray(winTabId.data())) - .arg(specificationVersion >> 8).arg(specificationVersion & 0xFF) - .arg(implementationVersion >> 8).arg(implementationVersion & 0xFF) - .arg(opts, 0, 16); - if (opts & CXO_MESSAGES) - result += QLatin1String(" CXO_MESSAGES"); - if (opts & CXO_CSRMESSAGES) - result += QLatin1String(" CXO_CSRMESSAGES"); + WORD devices = 0; + m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_NDEVICES, &devices); + WORD cursors = 0; + m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_NCURSORS, &cursors); + WORD extensions = 0; + m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_NEXTENSIONS, &extensions); + QString result; + QTextStream str(&result); + str << '"' << QString::fromWCharArray(winTabId.data()) + << "\" specification: v" << (specificationVersion >> 8) + << '.' << (specificationVersion & 0xFF) << " implementation: v" + << (implementationVersion >> 8) << '.' << (implementationVersion & 0xFF) + << ' ' << devices << " device(s), " << cursors << " cursor(s), " + << extensions << " extensions" << ", options: 0x" << hex << opts << dec; + formatOptions(str, opts); if (m_tiltSupport) - result += QLatin1String(" tilt"); + str << " tilt"; return result; } @@ -306,20 +369,6 @@ static inline QTabletEvent::PointerType pointerType(unsigned currentCursor) return QTabletEvent::UnknownPointer; } -#ifndef QT_NO_DEBUG_STREAM -QDebug operator<<(QDebug d, const QWindowsTabletDeviceData &t) -{ - QDebugStateSaver saver(d); - d.nospace(); - d << "TabletDevice id:" << t.uniqueId << " pressure: " << t.minPressure - << ".." << t.maxPressure << " tan pressure: " << t.minTanPressure << ".." - << t.maxTanPressure << " area:" << t.minX << t.minY <<t.minZ - << ".." << t.maxX << t.maxY << t.maxZ << " device " << t.currentDevice - << " pointer " << t.currentPointerType; - return d; -} -#endif // !QT_NO_DEBUG_STREAM - QWindowsTabletDeviceData QWindowsTabletSupport::tabletInit(qint64 uniqueId, UINT cursorType) const { QWindowsTabletDeviceData result; diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp index 8c8217bb75..0ef4ed0634 100644 --- a/src/widgets/kernel/qaction.cpp +++ b/src/widgets/kernel/qaction.cpp @@ -1088,7 +1088,7 @@ QAction::event(QEvent *e) "QAction::event", "Received shortcut event from incorrect shortcut"); if (se->isAmbiguous()) - qWarning("QAction::eventFilter: Ambiguous shortcut overload: %s", se->key().toString(QKeySequence::NativeText).toLatin1().constData()); + qWarning("QAction::event: Ambiguous shortcut overload: %s", se->key().toString(QKeySequence::NativeText).toLatin1().constData()); else activate(Trigger); return true; diff --git a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp index 0b4ed4870d..b73ed8eaec 100644 --- a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp +++ b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp @@ -143,7 +143,7 @@ void tst_QNetworkInterface::dump() qDebug() << " flags: " << qPrintable(flags); qDebug() << " type: " << i.type(); qDebug() << " hw address:" << qPrintable(i.hardwareAddress()); - qDebug() << " MTU: " << i.maxTransmissionUnit(); + qDebug() << " MTU: " << i.maximumTransmissionUnit(); int count = 0; foreach (const QNetworkAddressEntry &e, i.addressEntries()) { @@ -187,7 +187,7 @@ void tst_QNetworkInterface::consistencyCheck() if (iface.index()) interfaceIndexes << iface.index(); - QVERIFY(iface.maxTransmissionUnit() >= 0); + QVERIFY(iface.maximumTransmissionUnit() >= 0); const QList<QNetworkAddressEntry> addresses = iface.addressEntries(); for (auto entry : addresses) { @@ -275,7 +275,7 @@ void tst_QNetworkInterface::localAddress() << "pmtu" << pmtu; // check that the Path MTU is less than or equal the interface's MTU - QVERIFY(pmtu <= outgoingIface->maxTransmissionUnit()); + QVERIFY(pmtu <= outgoingIface->maximumTransmissionUnit()); } void tst_QNetworkInterface::interfaceFromXXX_data() |