Merge remote-tracking branch 'origin/5.11' into dev

Change-Id: Ic193ccc3e9e3a86e15a002d599c13f35940e1eab
This commit is contained in:
Qt Forward Merge Bot 2018-03-12 01:00:09 +01:00
commit 6dc1a52b4a
8 changed files with 91 additions and 32 deletions

View File

@ -194,7 +194,7 @@ QT_BEGIN_NAMESPACE
\omitvalue Pointer \omitvalue Pointer
\value Polish The widget is polished. \value Polish The widget is polished.
\value PolishRequest The widget should be 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 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 RequestSoftwareInputPanel A widget wants to open a software input panel (SIP).
\value Resize Widget's size changed (QResizeEvent). \value Resize Widget's size changed (QResizeEvent).

View File

@ -641,6 +641,7 @@ QRasterPaintEngineState::QRasterPaintEngineState()
txscale = 1.; txscale = 1.;
flags.fast_pen = true; flags.fast_pen = true;
flags.non_complex_pen = false;
flags.antialiased = false; flags.antialiased = false;
flags.bilinear = false; flags.bilinear = false;
flags.legacy_rounding = false; flags.legacy_rounding = false;

View File

@ -706,7 +706,7 @@ int QNetworkInterface::index() const
\sa QUdpSocket \sa QUdpSocket
*/ */
int QNetworkInterface::maxTransmissionUnit() const int QNetworkInterface::maximumTransmissionUnit() const
{ {
return d ? d->mtu : 0; return d ? d->mtu : 0;
} }

View File

@ -153,7 +153,7 @@ public:
bool isValid() const; bool isValid() const;
int index() const; int index() const;
int maxTransmissionUnit() const; int maximumTransmissionUnit() const;
QString name() const; QString name() const;
QString humanReadableName() const; QString humanReadableName() const;
InterfaceFlags flags() const; InterfaceFlags flags() const;

View File

@ -391,6 +391,15 @@ static PIXELFORMATDESCRIPTOR
pfd.dwFlags |= PFD_DOUBLEBUFFER; pfd.dwFlags |= PFD_DOUBLEBUFFER;
pfd.cDepthBits = pfd.cDepthBits =
format.depthBufferSize() >= 0 ? format.depthBufferSize() : 32; 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.cAlphaBits = format.alphaBufferSize() > 0 ? format.alphaBufferSize() : 8;
pfd.cStencilBits = format.stencilBufferSize() > 0 ? format.stencilBufferSize() : 8; pfd.cStencilBits = format.stencilBufferSize() > 0 ? format.stencilBufferSize() : 8;
if (additional.formatFlags & QWindowsGLAccumBuffer) if (additional.formatFlags & QWindowsGLAccumBuffer)

View File

@ -111,6 +111,61 @@ inline QPointF QWindowsTabletDeviceData::scaleCoordinates(int coordX, int coordY
return QPointF(x, y); 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; QWindowsWinTab32DLL QWindowsTabletSupport::m_winTab32DLL;
/*! /*!
@ -186,6 +241,7 @@ QWindowsTabletSupport *QWindowsTabletSupport::create()
LOGCONTEXT lcMine; LOGCONTEXT lcMine;
// build our context from the default context // build our context from the default context
QWindowsTabletSupport::m_winTab32DLL.wTInfo(WTI_DEFSYSCTX, 0, &lcMine); QWindowsTabletSupport::m_winTab32DLL.wTInfo(WTI_DEFSYSCTX, 0, &lcMine);
qCDebug(lcQpaTablet) << "Default: " << lcMine;
// Go for the raw coordinates, the tablet event will return good stuff // Go for the raw coordinates, the tablet event will return good stuff
lcMine.lcOptions |= CXO_MESSAGES | CXO_CSRMESSAGES; lcMine.lcOptions |= CXO_MESSAGES | CXO_CSRMESSAGES;
lcMine.lcPktData = lcMine.lcMoveMask = PACKETDATA; lcMine.lcPktData = lcMine.lcMoveMask = PACKETDATA;
@ -194,6 +250,7 @@ QWindowsTabletSupport *QWindowsTabletSupport::create()
lcMine.lcOutExtX = lcMine.lcInExtX; lcMine.lcOutExtX = lcMine.lcInExtX;
lcMine.lcOutOrgY = 0; lcMine.lcOutOrgY = 0;
lcMine.lcOutExtY = -lcMine.lcInExtY; lcMine.lcOutExtY = -lcMine.lcInExtY;
qCDebug(lcQpaTablet) << "Requesting: " << lcMine;
const HCTX context = QWindowsTabletSupport::m_winTab32DLL.wTOpen(window, &lcMine, true); const HCTX context = QWindowsTabletSupport::m_winTab32DLL.wTOpen(window, &lcMine, true);
if (!context) { if (!context) {
qCDebug(lcQpaTablet) << __FUNCTION__ << "Unable to open tablet."; qCDebug(lcQpaTablet) << __FUNCTION__ << "Unable to open tablet.";
@ -215,7 +272,7 @@ QWindowsTabletSupport *QWindowsTabletSupport::create()
} // mismatch } // mismatch
qCDebug(lcQpaTablet) << "Opened tablet context " << context << " on window " qCDebug(lcQpaTablet) << "Opened tablet context " << context << " on window "
<< window << "changed packet queue size " << currentQueueSize << window << "changed packet queue size " << currentQueueSize
<< "->" << TabletPacketQSize; << "->" << TabletPacketQSize << "\nobtained: " << lcMine;
return new QWindowsTabletSupport(window, context); return new QWindowsTabletSupport(window, context);
} }
@ -238,17 +295,23 @@ QString QWindowsTabletSupport::description() const
WORD specificationVersion = 0; WORD specificationVersion = 0;
m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_SPECVERSION, &specificationVersion); m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_SPECVERSION, &specificationVersion);
const unsigned opts = options(); const unsigned opts = options();
QString result = QString::fromLatin1("%1 specification: v%2.%3 implementation: v%4.%5 options: 0x%6") WORD devices = 0;
.arg(QString::fromWCharArray(winTabId.data())) m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_NDEVICES, &devices);
.arg(specificationVersion >> 8).arg(specificationVersion & 0xFF) WORD cursors = 0;
.arg(implementationVersion >> 8).arg(implementationVersion & 0xFF) m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_NCURSORS, &cursors);
.arg(opts, 0, 16); WORD extensions = 0;
if (opts & CXO_MESSAGES) m_winTab32DLL.wTInfo(WTI_INTERFACE, IFC_NEXTENSIONS, &extensions);
result += QLatin1String(" CXO_MESSAGES"); QString result;
if (opts & CXO_CSRMESSAGES) QTextStream str(&result);
result += QLatin1String(" CXO_CSRMESSAGES"); 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) if (m_tiltSupport)
result += QLatin1String(" tilt"); str << " tilt";
return result; return result;
} }
@ -306,20 +369,6 @@ static inline QTabletEvent::PointerType pointerType(unsigned currentCursor)
return QTabletEvent::UnknownPointer; 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 QWindowsTabletSupport::tabletInit(qint64 uniqueId, UINT cursorType) const
{ {
QWindowsTabletDeviceData result; QWindowsTabletDeviceData result;

View File

@ -1088,7 +1088,7 @@ QAction::event(QEvent *e)
"QAction::event", "QAction::event",
"Received shortcut event from incorrect shortcut"); "Received shortcut event from incorrect shortcut");
if (se->isAmbiguous()) 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 else
activate(Trigger); activate(Trigger);
return true; return true;

View File

@ -143,7 +143,7 @@ void tst_QNetworkInterface::dump()
qDebug() << " flags: " << qPrintable(flags); qDebug() << " flags: " << qPrintable(flags);
qDebug() << " type: " << i.type(); qDebug() << " type: " << i.type();
qDebug() << " hw address:" << qPrintable(i.hardwareAddress()); qDebug() << " hw address:" << qPrintable(i.hardwareAddress());
qDebug() << " MTU: " << i.maxTransmissionUnit(); qDebug() << " MTU: " << i.maximumTransmissionUnit();
int count = 0; int count = 0;
foreach (const QNetworkAddressEntry &e, i.addressEntries()) { foreach (const QNetworkAddressEntry &e, i.addressEntries()) {
@ -187,7 +187,7 @@ void tst_QNetworkInterface::consistencyCheck()
if (iface.index()) if (iface.index())
interfaceIndexes << iface.index(); interfaceIndexes << iface.index();
QVERIFY(iface.maxTransmissionUnit() >= 0); QVERIFY(iface.maximumTransmissionUnit() >= 0);
const QList<QNetworkAddressEntry> addresses = iface.addressEntries(); const QList<QNetworkAddressEntry> addresses = iface.addressEntries();
for (auto entry : addresses) { for (auto entry : addresses) {
@ -275,7 +275,7 @@ void tst_QNetworkInterface::localAddress()
<< "pmtu" << pmtu; << "pmtu" << pmtu;
// check that the Path MTU is less than or equal the interface's MTU // 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() void tst_QNetworkInterface::interfaceFromXXX_data()