Avoid initializing QFlags with 0 or nullptr in further cases
Amends qtbase/af2daafde72db02454d24b7d691aa6861525ab99. Where applicable, port over to member initialization, thus also fixing nullptr warnings. Change-Id: Iaaf2dbbbcf2952253390b8839fd15a1b17be32c0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
parent
7bb0d5379d
commit
2c871dfd38
@ -1763,7 +1763,7 @@ Qt::KeyboardModifiers QGuiApplication::keyboardModifiers()
|
|||||||
*/
|
*/
|
||||||
Qt::KeyboardModifiers QGuiApplication::queryKeyboardModifiers()
|
Qt::KeyboardModifiers QGuiApplication::queryKeyboardModifiers()
|
||||||
{
|
{
|
||||||
CHECK_QAPP_INSTANCE(Qt::KeyboardModifiers(0))
|
CHECK_QAPP_INSTANCE(Qt::KeyboardModifiers{})
|
||||||
QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
|
QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
|
||||||
return pi->queryKeyboardModifiers();
|
return pi->queryKeyboardModifiers();
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ QVariant QPlatformDialogHelper::defaultStyleHint(QPlatformDialogHelper::StyleHi
|
|||||||
class QFontDialogOptionsPrivate : public QSharedData
|
class QFontDialogOptionsPrivate : public QSharedData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QFontDialogOptionsPrivate() : options(0) {}
|
QFontDialogOptionsPrivate() = default;
|
||||||
|
|
||||||
QFontDialogOptions::FontDialogOptions options;
|
QFontDialogOptions::FontDialogOptions options;
|
||||||
QString windowTitle;
|
QString windowTitle;
|
||||||
@ -328,7 +328,7 @@ Q_GLOBAL_STATIC(QColorDialogStaticData, qColorDialogStaticData)
|
|||||||
class QColorDialogOptionsPrivate : public QSharedData
|
class QColorDialogOptionsPrivate : public QSharedData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QColorDialogOptionsPrivate() : options(0) {}
|
QColorDialogOptionsPrivate() = default;
|
||||||
// Write out settings around destruction of dialogs
|
// Write out settings around destruction of dialogs
|
||||||
~QColorDialogOptionsPrivate() { qColorDialogStaticData()->writeSettings(); }
|
~QColorDialogOptionsPrivate() { qColorDialogStaticData()->writeSettings(); }
|
||||||
|
|
||||||
@ -465,24 +465,16 @@ void QPlatformColorDialogHelper::setOptions(const QSharedPointer<QColorDialogOpt
|
|||||||
class QFileDialogOptionsPrivate : public QSharedData
|
class QFileDialogOptionsPrivate : public QSharedData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QFileDialogOptionsPrivate() : options(0),
|
|
||||||
viewMode(QFileDialogOptions::Detail),
|
|
||||||
fileMode(QFileDialogOptions::AnyFile),
|
|
||||||
acceptMode(QFileDialogOptions::AcceptOpen),
|
|
||||||
filters(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs),
|
|
||||||
useDefaultNameFilters(true)
|
|
||||||
{}
|
|
||||||
|
|
||||||
QFileDialogOptions::FileDialogOptions options;
|
QFileDialogOptions::FileDialogOptions options;
|
||||||
QString windowTitle;
|
QString windowTitle;
|
||||||
|
|
||||||
QFileDialogOptions::ViewMode viewMode;
|
QFileDialogOptions::ViewMode viewMode = QFileDialogOptions::Detail;
|
||||||
QFileDialogOptions::FileMode fileMode;
|
QFileDialogOptions::FileMode fileMode = QFileDialogOptions::AnyFile;
|
||||||
QFileDialogOptions::AcceptMode acceptMode;
|
QFileDialogOptions::AcceptMode acceptMode = QFileDialogOptions::AcceptOpen;
|
||||||
QString labels[QFileDialogOptions::DialogLabelCount];
|
QString labels[QFileDialogOptions::DialogLabelCount];
|
||||||
QDir::Filters filters;
|
QDir::Filters filters = QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs;
|
||||||
QList<QUrl> sidebarUrls;
|
QList<QUrl> sidebarUrls;
|
||||||
bool useDefaultNameFilters;
|
bool useDefaultNameFilters = true;
|
||||||
QStringList nameFilters;
|
QStringList nameFilters;
|
||||||
QStringList mimeTypeFilters;
|
QStringList mimeTypeFilters;
|
||||||
QString defaultSuffix;
|
QString defaultSuffix;
|
||||||
|
@ -7786,16 +7786,9 @@ QPainterState::QPainterState(const QPainterState *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QPainterState::QPainterState()
|
QPainterState::QPainterState()
|
||||||
: brushOrigin(0, 0), bgBrush(Qt::white), clipOperation(Qt::NoClip),
|
: brushOrigin(0, 0), WxF(false), VxF(false), clipEnabled(true),
|
||||||
renderHints(0),
|
layoutDirection(QGuiApplication::layoutDirection())
|
||||||
wx(0), wy(0), ww(0), wh(0), vx(0), vy(0), vw(0), vh(0),
|
|
||||||
opacity(1), WxF(false), VxF(false), clipEnabled(true),
|
|
||||||
bgMode(Qt::TransparentMode), painter(0),
|
|
||||||
layoutDirection(QGuiApplication::layoutDirection()),
|
|
||||||
composition_mode(QPainter::CompositionMode_SourceOver),
|
|
||||||
emulationSpecifier(0), changeFlags(0)
|
|
||||||
{
|
{
|
||||||
dirtyFlags = { };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QPainterState::~QPainterState()
|
QPainterState::~QPainterState()
|
||||||
|
@ -154,29 +154,29 @@ public:
|
|||||||
QFont deviceFont;
|
QFont deviceFont;
|
||||||
QPen pen;
|
QPen pen;
|
||||||
QBrush brush;
|
QBrush brush;
|
||||||
QBrush bgBrush; // background brush
|
QBrush bgBrush = Qt::white; // background brush
|
||||||
QRegion clipRegion;
|
QRegion clipRegion;
|
||||||
QPainterPath clipPath;
|
QPainterPath clipPath;
|
||||||
Qt::ClipOperation clipOperation;
|
Qt::ClipOperation clipOperation = Qt::NoClip;
|
||||||
QPainter::RenderHints renderHints;
|
QPainter::RenderHints renderHints;
|
||||||
QVector<QPainterClipInfo> clipInfo; // ### Make me smaller and faster to copy around...
|
QVector<QPainterClipInfo> clipInfo; // ### Make me smaller and faster to copy around...
|
||||||
QTransform worldMatrix; // World transformation matrix, not window and viewport
|
QTransform worldMatrix; // World transformation matrix, not window and viewport
|
||||||
QTransform matrix; // Complete transformation matrix,
|
QTransform matrix; // Complete transformation matrix,
|
||||||
QTransform redirectionMatrix;
|
QTransform redirectionMatrix;
|
||||||
int wx, wy, ww, wh; // window rectangle
|
int wx = 0, wy = 0, ww = 0, wh = 0; // window rectangle
|
||||||
int vx, vy, vw, vh; // viewport rectangle
|
int vx = 0, vy = 0, vw = 0, vh = 0; // viewport rectangle
|
||||||
qreal opacity;
|
qreal opacity = 1;
|
||||||
|
|
||||||
uint WxF:1; // World transformation
|
uint WxF:1; // World transformation
|
||||||
uint VxF:1; // View transformation
|
uint VxF:1; // View transformation
|
||||||
uint clipEnabled:1;
|
uint clipEnabled:1;
|
||||||
|
|
||||||
Qt::BGMode bgMode;
|
Qt::BGMode bgMode = Qt::TransparentMode;
|
||||||
QPainter *painter;
|
QPainter *painter = nullptr;
|
||||||
Qt::LayoutDirection layoutDirection;
|
Qt::LayoutDirection layoutDirection;
|
||||||
QPainter::CompositionMode composition_mode;
|
QPainter::CompositionMode composition_mode = QPainter::CompositionMode_SourceOver;
|
||||||
uint emulationSpecifier;
|
uint emulationSpecifier = 0;
|
||||||
uint changeFlags;
|
uint changeFlags = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct QPainterDummyState
|
struct QPainterDummyState
|
||||||
|
@ -1253,7 +1253,7 @@ void QPainterPath::addText(const QPointF &point, const QFont &f, const QString &
|
|||||||
fe->addOutlineToPath(x, y, glyphs, this,
|
fe->addOutlineToPath(x, y, glyphs, this,
|
||||||
si.analysis.bidiLevel % 2
|
si.analysis.bidiLevel % 2
|
||||||
? QTextItem::RenderFlags(QTextItem::RightToLeft)
|
? QTextItem::RenderFlags(QTextItem::RightToLeft)
|
||||||
: QTextItem::RenderFlags(0));
|
: QTextItem::RenderFlags{});
|
||||||
|
|
||||||
const qreal lw = fe->lineThickness().toReal();
|
const qreal lw = fe->lineThickness().toReal();
|
||||||
if (f.d->underline) {
|
if (f.d->underline) {
|
||||||
|
@ -141,7 +141,7 @@ static void hb_getAdvances(HB_Font font, const HB_Glyph *glyphs, hb_uint32 numGl
|
|||||||
qglyphs.glyphs = const_cast<glyph_t *>(glyphs);
|
qglyphs.glyphs = const_cast<glyph_t *>(glyphs);
|
||||||
qglyphs.advances = reinterpret_cast<QFixed *>(advances);
|
qglyphs.advances = reinterpret_cast<QFixed *>(advances);
|
||||||
|
|
||||||
fe->recalcAdvances(&qglyphs, (flags & HB_ShaperFlag_UseDesignMetrics) ? QFontEngine::DesignMetrics : QFontEngine::ShaperFlags(0));
|
fe->recalcAdvances(&qglyphs, (flags & HB_ShaperFlag_UseDesignMetrics) ? QFontEngine::DesignMetrics : QFontEngine::ShaperFlags{});
|
||||||
}
|
}
|
||||||
|
|
||||||
static HB_Bool hb_canRender(HB_Font font, const HB_UChar16 *string, hb_uint32 length)
|
static HB_Bool hb_canRender(HB_Font font, const HB_UChar16 *string, hb_uint32 length)
|
||||||
|
@ -1896,7 +1896,7 @@ int QTextEngine::shapeTextWithHarfbuzz(const QScriptItem &si, const ushort *stri
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (kerningEnabled && !shaper_item.kerning_applied)
|
if (kerningEnabled && !shaper_item.kerning_applied)
|
||||||
actualFontEngine->doKerning(&g, option.useDesignMetrics() ? QFontEngine::DesignMetrics : QFontEngine::ShaperFlags(0));
|
actualFontEngine->doKerning(&g, option.useDesignMetrics() ? QFontEngine::DesignMetrics : QFontEngine::ShaperFlags{});
|
||||||
|
|
||||||
if (engineIdx != 0) {
|
if (engineIdx != 0) {
|
||||||
for (quint32 i = 0; i < shaper_item.num_glyphs; ++i)
|
for (quint32 i = 0; i < shaper_item.num_glyphs; ++i)
|
||||||
@ -3895,12 +3895,7 @@ QStackTextEngine::QStackTextEngine(const QString &string, const QFont &f)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QTextItemInt::QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format)
|
QTextItemInt::QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format)
|
||||||
: justified(false),
|
: charFormat(format),
|
||||||
underlineStyle(QTextCharFormat::NoUnderline),
|
|
||||||
charFormat(format),
|
|
||||||
num_chars(0),
|
|
||||||
chars(nullptr),
|
|
||||||
logClusters(nullptr),
|
|
||||||
f(font),
|
f(font),
|
||||||
fontEngine(font->d->engineForScript(si.analysis.script))
|
fontEngine(font->d->engineForScript(si.analysis.script))
|
||||||
{
|
{
|
||||||
@ -3910,13 +3905,9 @@ QTextItemInt::QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFo
|
|||||||
}
|
}
|
||||||
|
|
||||||
QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars_, int numChars, QFontEngine *fe, const QTextCharFormat &format)
|
QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars_, int numChars, QFontEngine *fe, const QTextCharFormat &format)
|
||||||
: flags(0),
|
: charFormat(format),
|
||||||
justified(false),
|
|
||||||
underlineStyle(QTextCharFormat::NoUnderline),
|
|
||||||
charFormat(format),
|
|
||||||
num_chars(numChars),
|
num_chars(numChars),
|
||||||
chars(chars_),
|
chars(chars_),
|
||||||
logClusters(nullptr),
|
|
||||||
f(font),
|
f(font),
|
||||||
glyphs(g),
|
glyphs(g),
|
||||||
fontEngine(fe)
|
fontEngine(fe)
|
||||||
|
@ -303,10 +303,7 @@ struct QScriptItem;
|
|||||||
class QTextItemInt : public QTextItem
|
class QTextItemInt : public QTextItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline QTextItemInt()
|
inline QTextItemInt() = default;
|
||||||
: justified(false), underlineStyle(QTextCharFormat::NoUnderline), num_chars(0), chars(nullptr),
|
|
||||||
logClusters(nullptr), f(nullptr), fontEngine(nullptr)
|
|
||||||
{}
|
|
||||||
QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format = QTextCharFormat());
|
QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format = QTextCharFormat());
|
||||||
QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars, int numChars, QFontEngine *fe,
|
QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars, int numChars, QFontEngine *fe,
|
||||||
const QTextCharFormat &format = QTextCharFormat());
|
const QTextCharFormat &format = QTextCharFormat());
|
||||||
@ -321,16 +318,16 @@ public:
|
|||||||
QFixed width;
|
QFixed width;
|
||||||
|
|
||||||
RenderFlags flags;
|
RenderFlags flags;
|
||||||
bool justified;
|
bool justified = false;
|
||||||
QTextCharFormat::UnderlineStyle underlineStyle;
|
QTextCharFormat::UnderlineStyle underlineStyle = QTextCharFormat::NoUnderline;
|
||||||
const QTextCharFormat charFormat;
|
const QTextCharFormat charFormat;
|
||||||
int num_chars;
|
int num_chars = 0;
|
||||||
const QChar *chars;
|
const QChar *chars = nullptr;
|
||||||
const unsigned short *logClusters;
|
const unsigned short *logClusters = nullptr;
|
||||||
const QFont *f;
|
const QFont *f = nullptr;
|
||||||
|
|
||||||
QGlyphLayout glyphs;
|
QGlyphLayout glyphs;
|
||||||
QFontEngine *fontEngine;
|
QFontEngine *fontEngine = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct QScriptItem
|
struct QScriptItem
|
||||||
|
@ -251,7 +251,6 @@ public:
|
|||||||
QVulkanInstancePrivate(QVulkanInstance *q)
|
QVulkanInstancePrivate(QVulkanInstance *q)
|
||||||
: q_ptr(q),
|
: q_ptr(q),
|
||||||
vkInst(VK_NULL_HANDLE),
|
vkInst(VK_NULL_HANDLE),
|
||||||
flags(0),
|
|
||||||
errorCode(VK_SUCCESS)
|
errorCode(VK_SUCCESS)
|
||||||
{ }
|
{ }
|
||||||
~QVulkanInstancePrivate() { reset(); }
|
~QVulkanInstancePrivate() { reset(); }
|
||||||
|
@ -355,7 +355,7 @@ QNetworkConfigurationManager::Capabilities QNetworkConfigurationManager::capabil
|
|||||||
if (priv)
|
if (priv)
|
||||||
return priv->capabilities();
|
return priv->capabilities();
|
||||||
|
|
||||||
return QNetworkConfigurationManager::Capabilities(0);
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -746,7 +746,7 @@ QString QNetworkInterface::humanReadableName() const
|
|||||||
*/
|
*/
|
||||||
QNetworkInterface::InterfaceFlags QNetworkInterface::flags() const
|
QNetworkInterface::InterfaceFlags QNetworkInterface::flags() const
|
||||||
{
|
{
|
||||||
return d ? d->flags : InterfaceFlags(0);
|
return d ? d->flags : InterfaceFlags{};
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -64,7 +64,6 @@ QLocalSocketPrivate::QLocalSocketPrivate() : QIODevicePrivate(),
|
|||||||
delayConnect(0),
|
delayConnect(0),
|
||||||
connectTimer(0),
|
connectTimer(0),
|
||||||
connectingSocket(-1),
|
connectingSocket(-1),
|
||||||
connectingOpenMode(0),
|
|
||||||
state(QLocalSocket::UnconnectedState)
|
state(QLocalSocket::UnconnectedState)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,8 @@ QT_BEGIN_NAMESPACE
|
|||||||
class QGLDefaultExtensions
|
class QGLDefaultExtensions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QGLDefaultExtensions() : extensions(0) {
|
QGLDefaultExtensions()
|
||||||
|
{
|
||||||
QGLTemporaryContext tempContext;
|
QGLTemporaryContext tempContext;
|
||||||
Q_ASSERT(QOpenGLContext::currentContext());
|
Q_ASSERT(QOpenGLContext::currentContext());
|
||||||
QOpenGLExtensions *ext = qgl_extensions();
|
QOpenGLExtensions *ext = qgl_extensions();
|
||||||
|
@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
QWindowsGuiEventDispatcher::QWindowsGuiEventDispatcher(QObject *parent) :
|
QWindowsGuiEventDispatcher::QWindowsGuiEventDispatcher(QObject *parent) :
|
||||||
QEventDispatcherWin32(parent), m_flags(0)
|
QEventDispatcherWin32(parent)
|
||||||
{
|
{
|
||||||
setObjectName(QStringLiteral("QWindowsGuiEventDispatcher"));
|
setObjectName(QStringLiteral("QWindowsGuiEventDispatcher"));
|
||||||
createInternalHwnd(); // QTBUG-40881: Do not delay registering timers, etc. for QtMfc.
|
createInternalHwnd(); // QTBUG-40881: Do not delay registering timers, etc. for QtMfc.
|
||||||
|
@ -458,7 +458,7 @@ bool QWindowsFontEngineDirectWrite::stringToCMap(const QChar *str, int len, QGly
|
|||||||
glyphs->numGlyphs = actualLength;
|
glyphs->numGlyphs = actualLength;
|
||||||
|
|
||||||
if (!(flags & GlyphIndicesOnly))
|
if (!(flags & GlyphIndicesOnly))
|
||||||
recalcAdvances(glyphs, 0);
|
recalcAdvances(glyphs, {});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -99,8 +99,7 @@ std::unique_ptr<QEvdevMouseHandler> QEvdevMouseHandler::create(const QString &de
|
|||||||
}
|
}
|
||||||
|
|
||||||
QEvdevMouseHandler::QEvdevMouseHandler(const QString &device, int fd, bool abs, bool compression, int jitterLimit)
|
QEvdevMouseHandler::QEvdevMouseHandler(const QString &device, int fd, bool abs, bool compression, int jitterLimit)
|
||||||
: m_device(device), m_fd(fd), m_notify(0), m_x(0), m_y(0), m_prevx(0), m_prevy(0),
|
: m_device(device), m_fd(fd), m_abs(abs), m_compression(compression)
|
||||||
m_abs(abs), m_compression(compression), m_buttons(0), m_prevInvalid(true)
|
|
||||||
{
|
{
|
||||||
setObjectName(QLatin1String("Evdev Mouse Handler"));
|
setObjectName(QLatin1String("Evdev Mouse Handler"));
|
||||||
|
|
||||||
|
@ -84,16 +84,16 @@ private:
|
|||||||
|
|
||||||
QString m_device;
|
QString m_device;
|
||||||
int m_fd;
|
int m_fd;
|
||||||
QSocketNotifier *m_notify;
|
QSocketNotifier *m_notify = nullptr;
|
||||||
int m_x, m_y;
|
int m_x = 0, m_y = 0;
|
||||||
int m_prevx, m_prevy;
|
int m_prevx = 0, m_prevy = 0;
|
||||||
bool m_abs;
|
bool m_abs;
|
||||||
bool m_compression;
|
bool m_compression;
|
||||||
Qt::MouseButtons m_buttons;
|
Qt::MouseButtons m_buttons;
|
||||||
Qt::MouseButton m_button;
|
Qt::MouseButton m_button;
|
||||||
QEvent::Type m_eventType;
|
QEvent::Type m_eventType;
|
||||||
int m_jitterLimitSquared;
|
int m_jitterLimitSquared;
|
||||||
bool m_prevInvalid;
|
bool m_prevInvalid = true;
|
||||||
int m_hardwareWidth;
|
int m_hardwareWidth;
|
||||||
int m_hardwareHeight;
|
int m_hardwareHeight;
|
||||||
qreal m_hardwareScalerY;
|
qreal m_hardwareScalerY;
|
||||||
|
@ -113,16 +113,13 @@ public:
|
|||||||
QList<QWindowSystemInterface::TouchPoint> m_lastTouchPoints;
|
QList<QWindowSystemInterface::TouchPoint> m_lastTouchPoints;
|
||||||
|
|
||||||
struct Contact {
|
struct Contact {
|
||||||
int trackingId;
|
int trackingId = -1;
|
||||||
int x;
|
int x = 0;
|
||||||
int y;
|
int y = 0;
|
||||||
int maj;
|
int maj = -1;
|
||||||
int pressure;
|
int pressure = 0;
|
||||||
Qt::TouchPointState state;
|
Qt::TouchPointState state = Qt::TouchPointPressed;
|
||||||
QTouchEvent::TouchPoint::InfoFlags flags;
|
QTouchEvent::TouchPoint::InfoFlags flags;
|
||||||
Contact() : trackingId(-1),
|
|
||||||
x(0), y(0), maj(-1), pressure(0),
|
|
||||||
state(Qt::TouchPointPressed), flags(0) { }
|
|
||||||
};
|
};
|
||||||
QHash<int, Contact> m_contacts; // The key is a tracking id for type A, slot number for type B.
|
QHash<int, Contact> m_contacts; // The key is a tracking id for type A, slot number for type B.
|
||||||
QHash<int, Contact> m_lastContacts;
|
QHash<int, Contact> m_lastContacts;
|
||||||
|
@ -89,7 +89,7 @@ struct QWindowsOpenGLContextFormat
|
|||||||
|
|
||||||
QSurfaceFormat::OpenGLContextProfile profile = QSurfaceFormat::NoProfile;
|
QSurfaceFormat::OpenGLContextProfile profile = QSurfaceFormat::NoProfile;
|
||||||
int version = 0; //! majorVersion<<8 + minorVersion
|
int version = 0; //! majorVersion<<8 + minorVersion
|
||||||
QSurfaceFormat::FormatOptions options = nullptr;
|
QSurfaceFormat::FormatOptions options;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef QT_NO_DEBUG_STREAM
|
#ifndef QT_NO_DEBUG_STREAM
|
||||||
|
@ -1019,14 +1019,14 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, MSG msg,
|
|||||||
if (dirStatus == VK_LSHIFT
|
if (dirStatus == VK_LSHIFT
|
||||||
&& ((msg.wParam == VK_SHIFT && GetKeyState(VK_LCONTROL))
|
&& ((msg.wParam == VK_SHIFT && GetKeyState(VK_LCONTROL))
|
||||||
|| (msg.wParam == VK_CONTROL && GetKeyState(VK_LSHIFT)))) {
|
|| (msg.wParam == VK_CONTROL && GetKeyState(VK_LSHIFT)))) {
|
||||||
sendExtendedPressRelease(receiver, Qt::Key_Direction_L, nullptr,
|
sendExtendedPressRelease(receiver, Qt::Key_Direction_L, {},
|
||||||
scancode, vk_key, nModifiers, QString(), false);
|
scancode, vk_key, nModifiers, QString(), false);
|
||||||
result = true;
|
result = true;
|
||||||
dirStatus = 0;
|
dirStatus = 0;
|
||||||
} else if (dirStatus == VK_RSHIFT
|
} else if (dirStatus == VK_RSHIFT
|
||||||
&& ( (msg.wParam == VK_SHIFT && GetKeyState(VK_RCONTROL))
|
&& ( (msg.wParam == VK_SHIFT && GetKeyState(VK_RCONTROL))
|
||||||
|| (msg.wParam == VK_CONTROL && GetKeyState(VK_RSHIFT)))) {
|
|| (msg.wParam == VK_CONTROL && GetKeyState(VK_RSHIFT)))) {
|
||||||
sendExtendedPressRelease(receiver, Qt::Key_Direction_R, nullptr,
|
sendExtendedPressRelease(receiver, Qt::Key_Direction_R, {},
|
||||||
scancode, vk_key, nModifiers, QString(), false);
|
scancode, vk_key, nModifiers, QString(), false);
|
||||||
result = true;
|
result = true;
|
||||||
dirStatus = 0;
|
dirStatus = 0;
|
||||||
|
@ -165,7 +165,7 @@ void QWindowsMouseHandler::clearEvents()
|
|||||||
|
|
||||||
Qt::MouseButtons QWindowsMouseHandler::queryMouseButtons()
|
Qt::MouseButtons QWindowsMouseHandler::queryMouseButtons()
|
||||||
{
|
{
|
||||||
Qt::MouseButtons result = nullptr;
|
Qt::MouseButtons result;
|
||||||
const bool mouseSwapped = GetSystemMetrics(SM_SWAPBUTTON);
|
const bool mouseSwapped = GetSystemMetrics(SM_SWAPBUTTON);
|
||||||
if (GetAsyncKeyState(VK_LBUTTON) < 0)
|
if (GetAsyncKeyState(VK_LBUTTON) < 0)
|
||||||
result |= mouseSwapped ? Qt::RightButton: Qt::LeftButton;
|
result |= mouseSwapped ? Qt::RightButton: Qt::LeftButton;
|
||||||
@ -630,7 +630,7 @@ bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND,
|
|||||||
|
|
||||||
QTouchPointList touchPoints;
|
QTouchPointList touchPoints;
|
||||||
touchPoints.reserve(winTouchPointCount);
|
touchPoints.reserve(winTouchPointCount);
|
||||||
Qt::TouchPointStates allStates = nullptr;
|
Qt::TouchPointStates allStates;
|
||||||
|
|
||||||
GetTouchInputInfo(reinterpret_cast<HTOUCHINPUT>(msg.lParam),
|
GetTouchInputInfo(reinterpret_cast<HTOUCHINPUT>(msg.lParam),
|
||||||
UINT(msg.wParam), winTouchInputs.data(), sizeof(TOUCHINPUT));
|
UINT(msg.wParam), winTouchInputs.data(), sizeof(TOUCHINPUT));
|
||||||
|
@ -482,7 +482,7 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd,
|
|||||||
<< " message=" << Qt::hex << msg.message
|
<< " message=" << Qt::hex << msg.message
|
||||||
<< " count=" << Qt::dec << count;
|
<< " count=" << Qt::dec << count;
|
||||||
|
|
||||||
Qt::TouchPointStates allStates = nullptr;
|
Qt::TouchPointStates allStates;
|
||||||
|
|
||||||
for (quint32 i = 0; i < count; ++i) {
|
for (quint32 i = 0; i < count; ++i) {
|
||||||
if (QWindowsContext::verbose > 1)
|
if (QWindowsContext::verbose > 1)
|
||||||
|
@ -71,7 +71,7 @@ public:
|
|||||||
|
|
||||||
QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const override;
|
QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const override;
|
||||||
|
|
||||||
QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions = nullptr) const override;
|
QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions = {}) const override;
|
||||||
|
|
||||||
void windowsThemeChanged(QWindow *window);
|
void windowsThemeChanged(QWindow *window);
|
||||||
void displayChanged() { refreshIconPixmapSizes(); }
|
void displayChanged() { refreshIconPixmapSizes(); }
|
||||||
|
@ -876,7 +876,7 @@ enum {
|
|||||||
|
|
||||||
QXcbWindow::NetWmStates QXcbWindow::netWmStates()
|
QXcbWindow::NetWmStates QXcbWindow::netWmStates()
|
||||||
{
|
{
|
||||||
NetWmStates result(0);
|
NetWmStates result;
|
||||||
|
|
||||||
auto reply = Q_XCB_REPLY_UNCHECKED(xcb_get_property, xcb_connection(),
|
auto reply = Q_XCB_REPLY_UNCHECKED(xcb_get_property, xcb_connection(),
|
||||||
0, m_window, atom(QXcbAtom::_NET_WM_STATE),
|
0, m_window, atom(QXcbAtom::_NET_WM_STATE),
|
||||||
@ -1063,7 +1063,7 @@ void QXcbWindow::setNetWmStateOnUnmappedWindow()
|
|||||||
if (Q_UNLIKELY(m_mapped))
|
if (Q_UNLIKELY(m_mapped))
|
||||||
qCWarning(lcQpaXcb()) << "internal error: " << Q_FUNC_INFO << "called on mapped window";
|
qCWarning(lcQpaXcb()) << "internal error: " << Q_FUNC_INFO << "called on mapped window";
|
||||||
|
|
||||||
NetWmStates states(0);
|
NetWmStates states;
|
||||||
const Qt::WindowFlags flags = window()->flags();
|
const Qt::WindowFlags flags = window()->flags();
|
||||||
if (flags & Qt::WindowStaysOnTopHint) {
|
if (flags & Qt::WindowStaysOnTopHint) {
|
||||||
states |= NetWmStateAbove;
|
states |= NetWmStateAbove;
|
||||||
@ -1477,7 +1477,7 @@ uint QXcbWindow::visualIdStatic(QWindow *window)
|
|||||||
|
|
||||||
QXcbWindowFunctions::WmWindowTypes QXcbWindow::wmWindowTypes() const
|
QXcbWindowFunctions::WmWindowTypes QXcbWindow::wmWindowTypes() const
|
||||||
{
|
{
|
||||||
QXcbWindowFunctions::WmWindowTypes result(0);
|
QXcbWindowFunctions::WmWindowTypes result;
|
||||||
|
|
||||||
auto reply = Q_XCB_REPLY_UNCHECKED(xcb_get_property, xcb_connection(),
|
auto reply = Q_XCB_REPLY_UNCHECKED(xcb_get_property, xcb_connection(),
|
||||||
0, m_window, atom(QXcbAtom::_NET_WM_WINDOW_TYPE),
|
0, m_window, atom(QXcbAtom::_NET_WM_WINDOW_TYPE),
|
||||||
|
@ -344,8 +344,7 @@ class QGraphicsSceneMouseEventPrivate : public QGraphicsSceneEventPrivate
|
|||||||
Q_DECLARE_PUBLIC(QGraphicsSceneMouseEvent)
|
Q_DECLARE_PUBLIC(QGraphicsSceneMouseEvent)
|
||||||
public:
|
public:
|
||||||
inline QGraphicsSceneMouseEventPrivate()
|
inline QGraphicsSceneMouseEventPrivate()
|
||||||
: button(Qt::NoButton),
|
: button(Qt::NoButton), source(Qt::MouseEventNotSynthesized)
|
||||||
buttons(0), modifiers(0), source(Qt::MouseEventNotSynthesized), flags(0)
|
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
QPointF pos;
|
QPointF pos;
|
||||||
@ -691,17 +690,15 @@ class QGraphicsSceneWheelEventPrivate : public QGraphicsSceneEventPrivate
|
|||||||
{
|
{
|
||||||
Q_DECLARE_PUBLIC(QGraphicsSceneWheelEvent)
|
Q_DECLARE_PUBLIC(QGraphicsSceneWheelEvent)
|
||||||
public:
|
public:
|
||||||
inline QGraphicsSceneWheelEventPrivate()
|
inline QGraphicsSceneWheelEventPrivate() = default;
|
||||||
: buttons(0), modifiers(0), delta(0), orientation(Qt::Horizontal)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
QPointF pos;
|
QPointF pos;
|
||||||
QPointF scenePos;
|
QPointF scenePos;
|
||||||
QPoint screenPos;
|
QPoint screenPos;
|
||||||
Qt::MouseButtons buttons;
|
Qt::MouseButtons buttons;
|
||||||
Qt::KeyboardModifiers modifiers;
|
Qt::KeyboardModifiers modifiers;
|
||||||
int delta;
|
int delta = 0;
|
||||||
Qt::Orientation orientation;
|
Qt::Orientation orientation = Qt::Horizontal;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -872,15 +869,13 @@ class QGraphicsSceneContextMenuEventPrivate : public QGraphicsSceneEventPrivate
|
|||||||
{
|
{
|
||||||
Q_DECLARE_PUBLIC(QGraphicsSceneContextMenuEvent)
|
Q_DECLARE_PUBLIC(QGraphicsSceneContextMenuEvent)
|
||||||
public:
|
public:
|
||||||
inline QGraphicsSceneContextMenuEventPrivate()
|
inline QGraphicsSceneContextMenuEventPrivate() = default;
|
||||||
: modifiers(0), reason(QGraphicsSceneContextMenuEvent::Other)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
QPointF pos;
|
QPointF pos;
|
||||||
QPointF scenePos;
|
QPointF scenePos;
|
||||||
QPoint screenPos;
|
QPoint screenPos;
|
||||||
Qt::KeyboardModifiers modifiers;
|
Qt::KeyboardModifiers modifiers;
|
||||||
QGraphicsSceneContextMenuEvent::Reason reason;
|
QGraphicsSceneContextMenuEvent::Reason reason = QGraphicsSceneContextMenuEvent::Other;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -352,14 +352,13 @@ QGraphicsViewPrivate::QGraphicsViewPrivate()
|
|||||||
alignment(Qt::AlignCenter),
|
alignment(Qt::AlignCenter),
|
||||||
transformationAnchor(QGraphicsView::AnchorViewCenter), resizeAnchor(QGraphicsView::NoAnchor),
|
transformationAnchor(QGraphicsView::AnchorViewCenter), resizeAnchor(QGraphicsView::NoAnchor),
|
||||||
viewportUpdateMode(QGraphicsView::MinimalViewportUpdate),
|
viewportUpdateMode(QGraphicsView::MinimalViewportUpdate),
|
||||||
optimizationFlags(0),
|
|
||||||
scene(0),
|
scene(0),
|
||||||
#if QT_CONFIG(rubberband)
|
#if QT_CONFIG(rubberband)
|
||||||
rubberBanding(false),
|
rubberBanding(false),
|
||||||
rubberBandSelectionMode(Qt::IntersectsItemShape),
|
rubberBandSelectionMode(Qt::IntersectsItemShape),
|
||||||
rubberBandSelectionOperation(Qt::ReplaceSelection),
|
rubberBandSelectionOperation(Qt::ReplaceSelection),
|
||||||
#endif
|
#endif
|
||||||
handScrollMotions(0), cacheMode(0),
|
handScrollMotions(0),
|
||||||
#ifndef QT_NO_CURSOR
|
#ifndef QT_NO_CURSOR
|
||||||
hasStoredOriginalCursor(false),
|
hasStoredOriginalCursor(false),
|
||||||
#endif
|
#endif
|
||||||
|
@ -1173,7 +1173,7 @@ void QBoxLayout::setDirection(Direction direction)
|
|||||||
if (box->magic) {
|
if (box->magic) {
|
||||||
QSpacerItem *sp = box->item->spacerItem();
|
QSpacerItem *sp = box->item->spacerItem();
|
||||||
if (sp) {
|
if (sp) {
|
||||||
if (sp->expandingDirections() == Qt::Orientations(0) /*No Direction*/) {
|
if (sp->expandingDirections() == Qt::Orientations{} /*No Direction*/) {
|
||||||
//spacing or strut
|
//spacing or strut
|
||||||
QSize s = sp->sizeHint();
|
QSize s = sp->sizeHint();
|
||||||
sp->changeSize(s.height(), s.width(),
|
sp->changeSize(s.height(), s.width(),
|
||||||
|
@ -199,18 +199,17 @@ public:
|
|||||||
ItemMatrix m_matrix;
|
ItemMatrix m_matrix;
|
||||||
QList<QFormLayoutItem *> m_things;
|
QList<QFormLayoutItem *> m_things;
|
||||||
|
|
||||||
int layoutWidth; // the last width that we called setupVerticalLayoutData on (for vLayouts)
|
int layoutWidth = -1; // the last width that we called setupVerticalLayoutData on (for vLayouts)
|
||||||
|
|
||||||
int hfw_width; // the last width we calculated HFW for
|
int hfw_width = -1; // the last width we calculated HFW for
|
||||||
int hfw_height; // what that height was
|
int hfw_height = -1; // what that height was
|
||||||
int hfw_minheight; // what that minheight was
|
|
||||||
|
|
||||||
int hfw_sh_height; // the hfw for sh_width
|
int hfw_sh_height = -1; // the hfw for sh_width
|
||||||
int hfw_sh_minheight; // the minhfw for sh_width
|
int hfw_sh_minheight = -1; // the minhfw for sh_width
|
||||||
|
|
||||||
int min_width; // the width that gets turned into minSize (from updateSizes)
|
int min_width = -1; // the width that gets turned into minSize (from updateSizes)
|
||||||
int sh_width; // the width that gets turned into prefSize (from updateSizes)
|
int sh_width = -1; // the width that gets turned into prefSize (from updateSizes)
|
||||||
int thresh_width; // the width that we start splitting label/field pairs at (from updateSizes)
|
int thresh_width = QLAYOUTSIZE_MAX; // the width that we start splitting label/field pairs at (from updateSizes)
|
||||||
QSize minSize;
|
QSize minSize;
|
||||||
QSize prefSize;
|
QSize prefSize;
|
||||||
int formMaxWidth;
|
int formMaxWidth;
|
||||||
@ -222,17 +221,15 @@ public:
|
|||||||
|
|
||||||
QVector<QLayoutStruct> hfwLayouts;
|
QVector<QLayoutStruct> hfwLayouts;
|
||||||
|
|
||||||
int hSpacing;
|
int hSpacing = -1;
|
||||||
int vSpacing;
|
int vSpacing = -1;
|
||||||
QLayoutItem* replaceAt(int index, QLayoutItem*) override;
|
QLayoutItem* replaceAt(int index, QLayoutItem*) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
QFormLayoutPrivate::QFormLayoutPrivate()
|
QFormLayoutPrivate::QFormLayoutPrivate()
|
||||||
: fieldGrowthPolicy(DefaultFieldGrowthPolicy),
|
: fieldGrowthPolicy(DefaultFieldGrowthPolicy),
|
||||||
rowWrapPolicy(DefaultRowWrapPolicy), has_hfw(false), dirty(true), sizesDirty(true),
|
rowWrapPolicy(DefaultRowWrapPolicy), has_hfw(false), dirty(true), sizesDirty(true),
|
||||||
expandVertical(0), expandHorizontal(0), labelAlignment(0), formAlignment(0),
|
expandVertical(0), expandHorizontal(0)
|
||||||
layoutWidth(-1), hfw_width(-1), hfw_sh_height(-1), min_width(-1),
|
|
||||||
sh_width(-1), thresh_width(QLAYOUTSIZE_MAX), hSpacing(-1), vSpacing(-1)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -481,7 +478,6 @@ void QFormLayoutPrivate::recalcHFW(int w)
|
|||||||
} else {
|
} else {
|
||||||
hfw_width = w;
|
hfw_width = w;
|
||||||
hfw_height = qMin(QLAYOUTSIZE_MAX, h);
|
hfw_height = qMin(QLAYOUTSIZE_MAX, h);
|
||||||
hfw_minheight = qMin(QLAYOUTSIZE_MAX, mh);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -591,7 +591,7 @@ Qt::Orientations QSpacerItem::expandingDirections() const
|
|||||||
Qt::Orientations QWidgetItem::expandingDirections() const
|
Qt::Orientations QWidgetItem::expandingDirections() const
|
||||||
{
|
{
|
||||||
if (isEmpty())
|
if (isEmpty())
|
||||||
return Qt::Orientations(0);
|
return {};
|
||||||
|
|
||||||
Qt::Orientations e = wid->sizePolicy().expandingDirections();
|
Qt::Orientations e = wid->sizePolicy().expandingDirections();
|
||||||
/*
|
/*
|
||||||
|
@ -2909,7 +2909,7 @@ QStyleOptionRubberBand::QStyleOptionRubberBand(int version)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
QStyleOptionTitleBar::QStyleOptionTitleBar()
|
QStyleOptionTitleBar::QStyleOptionTitleBar()
|
||||||
: QStyleOptionComplex(Version, SO_TitleBar), titleBarState(0), titleBarFlags(0)
|
: QStyleOptionComplex(Version, SO_TitleBar), titleBarState(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2954,7 +2954,7 @@ QStyleOptionTitleBar::QStyleOptionTitleBar()
|
|||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
QStyleOptionTitleBar::QStyleOptionTitleBar(int version)
|
QStyleOptionTitleBar::QStyleOptionTitleBar(int version)
|
||||||
: QStyleOptionComplex(version, SO_TitleBar), titleBarState(0), titleBarFlags(0)
|
: QStyleOptionComplex(version, SO_TitleBar), titleBarState(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// depending on the scroller state return the gesture state
|
// depending on the scroller state return the gesture state
|
||||||
Result result(0);
|
Result result;
|
||||||
bool scrollerIsActive = (scroller->state() == QScroller::Dragging ||
|
bool scrollerIsActive = (scroller->state() == QScroller::Dragging ||
|
||||||
scroller->state() == QScroller::Scrolling);
|
scroller->state() == QScroller::Scrolling);
|
||||||
|
|
||||||
|
@ -1416,9 +1416,9 @@ QDateTimeEdit::StepEnabled QDateTimeEdit::stepEnabled() const
|
|||||||
{
|
{
|
||||||
Q_D(const QDateTimeEdit);
|
Q_D(const QDateTimeEdit);
|
||||||
if (d->readOnly)
|
if (d->readOnly)
|
||||||
return StepEnabled(0);
|
return {};
|
||||||
if (d->specialValue()) {
|
if (d->specialValue()) {
|
||||||
return (d->minimum == d->maximum ? StepEnabled(0) : StepEnabled(StepUpEnabled));
|
return (d->minimum == d->maximum ? StepEnabled{} : StepEnabled(StepUpEnabled));
|
||||||
}
|
}
|
||||||
|
|
||||||
QAbstractSpinBox::StepEnabled ret = { };
|
QAbstractSpinBox::StepEnabled ret = { };
|
||||||
|
@ -240,9 +240,9 @@ Qt::Orientations QToolBarLayout::expandingDirections() const
|
|||||||
updateGeomArray();
|
updateGeomArray();
|
||||||
QToolBar *tb = qobject_cast<QToolBar*>(parentWidget());
|
QToolBar *tb = qobject_cast<QToolBar*>(parentWidget());
|
||||||
if (!tb)
|
if (!tb)
|
||||||
return Qt::Orientations(0);
|
return {};
|
||||||
Qt::Orientation o = tb->orientation();
|
Qt::Orientation o = tb->orientation();
|
||||||
return expanding ? Qt::Orientations(o) : Qt::Orientations(0);
|
return expanding ? Qt::Orientations(o) : Qt::Orientations{};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QToolBarLayout::movable() const
|
bool QToolBarLayout::movable() const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user