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:
Friedemann Kleint 2019-11-22 15:34:38 +01:00
parent 7bb0d5379d
commit 2c871dfd38
33 changed files with 87 additions and 129 deletions

View File

@ -1763,7 +1763,7 @@ Qt::KeyboardModifiers QGuiApplication::keyboardModifiers()
*/
Qt::KeyboardModifiers QGuiApplication::queryKeyboardModifiers()
{
CHECK_QAPP_INSTANCE(Qt::KeyboardModifiers(0))
CHECK_QAPP_INSTANCE(Qt::KeyboardModifiers{})
QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
return pi->queryKeyboardModifiers();
}

View File

@ -186,7 +186,7 @@ QVariant QPlatformDialogHelper::defaultStyleHint(QPlatformDialogHelper::StyleHi
class QFontDialogOptionsPrivate : public QSharedData
{
public:
QFontDialogOptionsPrivate() : options(0) {}
QFontDialogOptionsPrivate() = default;
QFontDialogOptions::FontDialogOptions options;
QString windowTitle;
@ -328,7 +328,7 @@ Q_GLOBAL_STATIC(QColorDialogStaticData, qColorDialogStaticData)
class QColorDialogOptionsPrivate : public QSharedData
{
public:
QColorDialogOptionsPrivate() : options(0) {}
QColorDialogOptionsPrivate() = default;
// Write out settings around destruction of dialogs
~QColorDialogOptionsPrivate() { qColorDialogStaticData()->writeSettings(); }
@ -465,24 +465,16 @@ void QPlatformColorDialogHelper::setOptions(const QSharedPointer<QColorDialogOpt
class QFileDialogOptionsPrivate : public QSharedData
{
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;
QString windowTitle;
QFileDialogOptions::ViewMode viewMode;
QFileDialogOptions::FileMode fileMode;
QFileDialogOptions::AcceptMode acceptMode;
QFileDialogOptions::ViewMode viewMode = QFileDialogOptions::Detail;
QFileDialogOptions::FileMode fileMode = QFileDialogOptions::AnyFile;
QFileDialogOptions::AcceptMode acceptMode = QFileDialogOptions::AcceptOpen;
QString labels[QFileDialogOptions::DialogLabelCount];
QDir::Filters filters;
QDir::Filters filters = QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs;
QList<QUrl> sidebarUrls;
bool useDefaultNameFilters;
bool useDefaultNameFilters = true;
QStringList nameFilters;
QStringList mimeTypeFilters;
QString defaultSuffix;

View File

@ -7786,16 +7786,9 @@ QPainterState::QPainterState(const QPainterState *s)
}
QPainterState::QPainterState()
: brushOrigin(0, 0), bgBrush(Qt::white), clipOperation(Qt::NoClip),
renderHints(0),
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)
: brushOrigin(0, 0), WxF(false), VxF(false), clipEnabled(true),
layoutDirection(QGuiApplication::layoutDirection())
{
dirtyFlags = { };
}
QPainterState::~QPainterState()

View File

@ -154,29 +154,29 @@ public:
QFont deviceFont;
QPen pen;
QBrush brush;
QBrush bgBrush; // background brush
QBrush bgBrush = Qt::white; // background brush
QRegion clipRegion;
QPainterPath clipPath;
Qt::ClipOperation clipOperation;
Qt::ClipOperation clipOperation = Qt::NoClip;
QPainter::RenderHints renderHints;
QVector<QPainterClipInfo> clipInfo; // ### Make me smaller and faster to copy around...
QTransform worldMatrix; // World transformation matrix, not window and viewport
QTransform matrix; // Complete transformation matrix,
QTransform redirectionMatrix;
int wx, wy, ww, wh; // window rectangle
int vx, vy, vw, vh; // viewport rectangle
qreal opacity;
int wx = 0, wy = 0, ww = 0, wh = 0; // window rectangle
int vx = 0, vy = 0, vw = 0, vh = 0; // viewport rectangle
qreal opacity = 1;
uint WxF:1; // World transformation
uint VxF:1; // View transformation
uint clipEnabled:1;
Qt::BGMode bgMode;
QPainter *painter;
Qt::BGMode bgMode = Qt::TransparentMode;
QPainter *painter = nullptr;
Qt::LayoutDirection layoutDirection;
QPainter::CompositionMode composition_mode;
uint emulationSpecifier;
uint changeFlags;
QPainter::CompositionMode composition_mode = QPainter::CompositionMode_SourceOver;
uint emulationSpecifier = 0;
uint changeFlags = 0;
};
struct QPainterDummyState

View File

@ -1253,7 +1253,7 @@ void QPainterPath::addText(const QPointF &point, const QFont &f, const QString &
fe->addOutlineToPath(x, y, glyphs, this,
si.analysis.bidiLevel % 2
? QTextItem::RenderFlags(QTextItem::RightToLeft)
: QTextItem::RenderFlags(0));
: QTextItem::RenderFlags{});
const qreal lw = fe->lineThickness().toReal();
if (f.d->underline) {

View File

@ -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.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)

View File

@ -1896,7 +1896,7 @@ int QTextEngine::shapeTextWithHarfbuzz(const QScriptItem &si, const ushort *stri
}
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) {
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)
: justified(false),
underlineStyle(QTextCharFormat::NoUnderline),
charFormat(format),
num_chars(0),
chars(nullptr),
logClusters(nullptr),
: charFormat(format),
f(font),
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)
: flags(0),
justified(false),
underlineStyle(QTextCharFormat::NoUnderline),
charFormat(format),
: charFormat(format),
num_chars(numChars),
chars(chars_),
logClusters(nullptr),
f(font),
glyphs(g),
fontEngine(fe)

View File

@ -303,10 +303,7 @@ struct QScriptItem;
class QTextItemInt : public QTextItem
{
public:
inline QTextItemInt()
: justified(false), underlineStyle(QTextCharFormat::NoUnderline), num_chars(0), chars(nullptr),
logClusters(nullptr), f(nullptr), fontEngine(nullptr)
{}
inline QTextItemInt() = default;
QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format = QTextCharFormat());
QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars, int numChars, QFontEngine *fe,
const QTextCharFormat &format = QTextCharFormat());
@ -321,16 +318,16 @@ public:
QFixed width;
RenderFlags flags;
bool justified;
QTextCharFormat::UnderlineStyle underlineStyle;
bool justified = false;
QTextCharFormat::UnderlineStyle underlineStyle = QTextCharFormat::NoUnderline;
const QTextCharFormat charFormat;
int num_chars;
const QChar *chars;
const unsigned short *logClusters;
const QFont *f;
int num_chars = 0;
const QChar *chars = nullptr;
const unsigned short *logClusters = nullptr;
const QFont *f = nullptr;
QGlyphLayout glyphs;
QFontEngine *fontEngine;
QFontEngine *fontEngine = nullptr;
};
struct QScriptItem

View File

@ -251,7 +251,6 @@ public:
QVulkanInstancePrivate(QVulkanInstance *q)
: q_ptr(q),
vkInst(VK_NULL_HANDLE),
flags(0),
errorCode(VK_SUCCESS)
{ }
~QVulkanInstancePrivate() { reset(); }

View File

@ -355,7 +355,7 @@ QNetworkConfigurationManager::Capabilities QNetworkConfigurationManager::capabil
if (priv)
return priv->capabilities();
return QNetworkConfigurationManager::Capabilities(0);
return {};
}
/*!

View File

@ -746,7 +746,7 @@ QString QNetworkInterface::humanReadableName() const
*/
QNetworkInterface::InterfaceFlags QNetworkInterface::flags() const
{
return d ? d->flags : InterfaceFlags(0);
return d ? d->flags : InterfaceFlags{};
}
/*!

View File

@ -64,7 +64,6 @@ QLocalSocketPrivate::QLocalSocketPrivate() : QIODevicePrivate(),
delayConnect(0),
connectTimer(0),
connectingSocket(-1),
connectingOpenMode(0),
state(QLocalSocket::UnconnectedState)
{
}

View File

@ -83,7 +83,8 @@ QT_BEGIN_NAMESPACE
class QGLDefaultExtensions
{
public:
QGLDefaultExtensions() : extensions(0) {
QGLDefaultExtensions()
{
QGLTemporaryContext tempContext;
Q_ASSERT(QOpenGLContext::currentContext());
QOpenGLExtensions *ext = qgl_extensions();

View File

@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
*/
QWindowsGuiEventDispatcher::QWindowsGuiEventDispatcher(QObject *parent) :
QEventDispatcherWin32(parent), m_flags(0)
QEventDispatcherWin32(parent)
{
setObjectName(QStringLiteral("QWindowsGuiEventDispatcher"));
createInternalHwnd(); // QTBUG-40881: Do not delay registering timers, etc. for QtMfc.

View File

@ -458,7 +458,7 @@ bool QWindowsFontEngineDirectWrite::stringToCMap(const QChar *str, int len, QGly
glyphs->numGlyphs = actualLength;
if (!(flags & GlyphIndicesOnly))
recalcAdvances(glyphs, 0);
recalcAdvances(glyphs, {});
return true;
}

View File

@ -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)
: m_device(device), m_fd(fd), m_notify(0), m_x(0), m_y(0), m_prevx(0), m_prevy(0),
m_abs(abs), m_compression(compression), m_buttons(0), m_prevInvalid(true)
: m_device(device), m_fd(fd), m_abs(abs), m_compression(compression)
{
setObjectName(QLatin1String("Evdev Mouse Handler"));

View File

@ -84,16 +84,16 @@ private:
QString m_device;
int m_fd;
QSocketNotifier *m_notify;
int m_x, m_y;
int m_prevx, m_prevy;
QSocketNotifier *m_notify = nullptr;
int m_x = 0, m_y = 0;
int m_prevx = 0, m_prevy = 0;
bool m_abs;
bool m_compression;
Qt::MouseButtons m_buttons;
Qt::MouseButton m_button;
QEvent::Type m_eventType;
int m_jitterLimitSquared;
bool m_prevInvalid;
bool m_prevInvalid = true;
int m_hardwareWidth;
int m_hardwareHeight;
qreal m_hardwareScalerY;

View File

@ -113,16 +113,13 @@ public:
QList<QWindowSystemInterface::TouchPoint> m_lastTouchPoints;
struct Contact {
int trackingId;
int x;
int y;
int maj;
int pressure;
Qt::TouchPointState state;
int trackingId = -1;
int x = 0;
int y = 0;
int maj = -1;
int pressure = 0;
Qt::TouchPointState state = Qt::TouchPointPressed;
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_lastContacts;

View File

@ -89,7 +89,7 @@ struct QWindowsOpenGLContextFormat
QSurfaceFormat::OpenGLContextProfile profile = QSurfaceFormat::NoProfile;
int version = 0; //! majorVersion<<8 + minorVersion
QSurfaceFormat::FormatOptions options = nullptr;
QSurfaceFormat::FormatOptions options;
};
#ifndef QT_NO_DEBUG_STREAM

View File

@ -1019,14 +1019,14 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, MSG msg,
if (dirStatus == VK_LSHIFT
&& ((msg.wParam == VK_SHIFT && GetKeyState(VK_LCONTROL))
|| (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);
result = true;
dirStatus = 0;
} else if (dirStatus == VK_RSHIFT
&& ( (msg.wParam == VK_SHIFT && GetKeyState(VK_RCONTROL))
|| (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);
result = true;
dirStatus = 0;

View File

@ -165,7 +165,7 @@ void QWindowsMouseHandler::clearEvents()
Qt::MouseButtons QWindowsMouseHandler::queryMouseButtons()
{
Qt::MouseButtons result = nullptr;
Qt::MouseButtons result;
const bool mouseSwapped = GetSystemMetrics(SM_SWAPBUTTON);
if (GetAsyncKeyState(VK_LBUTTON) < 0)
result |= mouseSwapped ? Qt::RightButton: Qt::LeftButton;
@ -630,7 +630,7 @@ bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND,
QTouchPointList touchPoints;
touchPoints.reserve(winTouchPointCount);
Qt::TouchPointStates allStates = nullptr;
Qt::TouchPointStates allStates;
GetTouchInputInfo(reinterpret_cast<HTOUCHINPUT>(msg.lParam),
UINT(msg.wParam), winTouchInputs.data(), sizeof(TOUCHINPUT));

View File

@ -482,7 +482,7 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd,
<< " message=" << Qt::hex << msg.message
<< " count=" << Qt::dec << count;
Qt::TouchPointStates allStates = nullptr;
Qt::TouchPointStates allStates;
for (quint32 i = 0; i < count; ++i) {
if (QWindowsContext::verbose > 1)

View File

@ -71,7 +71,7 @@ public:
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 displayChanged() { refreshIconPixmapSizes(); }

View File

@ -876,7 +876,7 @@ enum {
QXcbWindow::NetWmStates QXcbWindow::netWmStates()
{
NetWmStates result(0);
NetWmStates result;
auto reply = Q_XCB_REPLY_UNCHECKED(xcb_get_property, xcb_connection(),
0, m_window, atom(QXcbAtom::_NET_WM_STATE),
@ -1063,7 +1063,7 @@ void QXcbWindow::setNetWmStateOnUnmappedWindow()
if (Q_UNLIKELY(m_mapped))
qCWarning(lcQpaXcb()) << "internal error: " << Q_FUNC_INFO << "called on mapped window";
NetWmStates states(0);
NetWmStates states;
const Qt::WindowFlags flags = window()->flags();
if (flags & Qt::WindowStaysOnTopHint) {
states |= NetWmStateAbove;
@ -1477,7 +1477,7 @@ uint QXcbWindow::visualIdStatic(QWindow *window)
QXcbWindowFunctions::WmWindowTypes QXcbWindow::wmWindowTypes() const
{
QXcbWindowFunctions::WmWindowTypes result(0);
QXcbWindowFunctions::WmWindowTypes result;
auto reply = Q_XCB_REPLY_UNCHECKED(xcb_get_property, xcb_connection(),
0, m_window, atom(QXcbAtom::_NET_WM_WINDOW_TYPE),

View File

@ -344,8 +344,7 @@ class QGraphicsSceneMouseEventPrivate : public QGraphicsSceneEventPrivate
Q_DECLARE_PUBLIC(QGraphicsSceneMouseEvent)
public:
inline QGraphicsSceneMouseEventPrivate()
: button(Qt::NoButton),
buttons(0), modifiers(0), source(Qt::MouseEventNotSynthesized), flags(0)
: button(Qt::NoButton), source(Qt::MouseEventNotSynthesized)
{ }
QPointF pos;
@ -691,17 +690,15 @@ class QGraphicsSceneWheelEventPrivate : public QGraphicsSceneEventPrivate
{
Q_DECLARE_PUBLIC(QGraphicsSceneWheelEvent)
public:
inline QGraphicsSceneWheelEventPrivate()
: buttons(0), modifiers(0), delta(0), orientation(Qt::Horizontal)
{ }
inline QGraphicsSceneWheelEventPrivate() = default;
QPointF pos;
QPointF scenePos;
QPoint screenPos;
Qt::MouseButtons buttons;
Qt::KeyboardModifiers modifiers;
int delta;
Qt::Orientation orientation;
int delta = 0;
Qt::Orientation orientation = Qt::Horizontal;
};
/*!
@ -872,15 +869,13 @@ class QGraphicsSceneContextMenuEventPrivate : public QGraphicsSceneEventPrivate
{
Q_DECLARE_PUBLIC(QGraphicsSceneContextMenuEvent)
public:
inline QGraphicsSceneContextMenuEventPrivate()
: modifiers(0), reason(QGraphicsSceneContextMenuEvent::Other)
{ }
inline QGraphicsSceneContextMenuEventPrivate() = default;
QPointF pos;
QPointF scenePos;
QPoint screenPos;
Qt::KeyboardModifiers modifiers;
QGraphicsSceneContextMenuEvent::Reason reason;
QGraphicsSceneContextMenuEvent::Reason reason = QGraphicsSceneContextMenuEvent::Other;
};
/*!

View File

@ -352,14 +352,13 @@ QGraphicsViewPrivate::QGraphicsViewPrivate()
alignment(Qt::AlignCenter),
transformationAnchor(QGraphicsView::AnchorViewCenter), resizeAnchor(QGraphicsView::NoAnchor),
viewportUpdateMode(QGraphicsView::MinimalViewportUpdate),
optimizationFlags(0),
scene(0),
#if QT_CONFIG(rubberband)
rubberBanding(false),
rubberBandSelectionMode(Qt::IntersectsItemShape),
rubberBandSelectionOperation(Qt::ReplaceSelection),
#endif
handScrollMotions(0), cacheMode(0),
handScrollMotions(0),
#ifndef QT_NO_CURSOR
hasStoredOriginalCursor(false),
#endif

View File

@ -1173,7 +1173,7 @@ void QBoxLayout::setDirection(Direction direction)
if (box->magic) {
QSpacerItem *sp = box->item->spacerItem();
if (sp) {
if (sp->expandingDirections() == Qt::Orientations(0) /*No Direction*/) {
if (sp->expandingDirections() == Qt::Orientations{} /*No Direction*/) {
//spacing or strut
QSize s = sp->sizeHint();
sp->changeSize(s.height(), s.width(),

View File

@ -199,18 +199,17 @@ public:
ItemMatrix m_matrix;
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_height; // what that height was
int hfw_minheight; // what that minheight was
int hfw_width = -1; // the last width we calculated HFW for
int hfw_height = -1; // what that height was
int hfw_sh_height; // the hfw for sh_width
int hfw_sh_minheight; // the minhfw for sh_width
int hfw_sh_height = -1; // the hfw 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 sh_width; // 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 min_width = -1; // the width that gets turned into minSize (from updateSizes)
int sh_width = -1; // the width that gets turned into prefSize (from updateSizes)
int thresh_width = QLAYOUTSIZE_MAX; // the width that we start splitting label/field pairs at (from updateSizes)
QSize minSize;
QSize prefSize;
int formMaxWidth;
@ -222,17 +221,15 @@ public:
QVector<QLayoutStruct> hfwLayouts;
int hSpacing;
int vSpacing;
int hSpacing = -1;
int vSpacing = -1;
QLayoutItem* replaceAt(int index, QLayoutItem*) override;
};
QFormLayoutPrivate::QFormLayoutPrivate()
: fieldGrowthPolicy(DefaultFieldGrowthPolicy),
rowWrapPolicy(DefaultRowWrapPolicy), has_hfw(false), dirty(true), sizesDirty(true),
expandVertical(0), expandHorizontal(0), labelAlignment(0), formAlignment(0),
layoutWidth(-1), hfw_width(-1), hfw_sh_height(-1), min_width(-1),
sh_width(-1), thresh_width(QLAYOUTSIZE_MAX), hSpacing(-1), vSpacing(-1)
expandVertical(0), expandHorizontal(0)
{
}
@ -481,7 +478,6 @@ void QFormLayoutPrivate::recalcHFW(int w)
} else {
hfw_width = w;
hfw_height = qMin(QLAYOUTSIZE_MAX, h);
hfw_minheight = qMin(QLAYOUTSIZE_MAX, mh);
}
}

View File

@ -591,7 +591,7 @@ Qt::Orientations QSpacerItem::expandingDirections() const
Qt::Orientations QWidgetItem::expandingDirections() const
{
if (isEmpty())
return Qt::Orientations(0);
return {};
Qt::Orientations e = wid->sizePolicy().expandingDirections();
/*

View File

@ -2909,7 +2909,7 @@ QStyleOptionRubberBand::QStyleOptionRubberBand(int version)
*/
QStyleOptionTitleBar::QStyleOptionTitleBar()
: QStyleOptionComplex(Version, SO_TitleBar), titleBarState(0), titleBarFlags(0)
: QStyleOptionComplex(Version, SO_TitleBar), titleBarState(0)
{
}
@ -2954,7 +2954,7 @@ QStyleOptionTitleBar::QStyleOptionTitleBar()
\internal
*/
QStyleOptionTitleBar::QStyleOptionTitleBar(int version)
: QStyleOptionComplex(version, SO_TitleBar), titleBarState(0), titleBarFlags(0)
: QStyleOptionComplex(version, SO_TitleBar), titleBarState(0)
{
}

View File

@ -610,7 +610,7 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state,
}
// depending on the scroller state return the gesture state
Result result(0);
Result result;
bool scrollerIsActive = (scroller->state() == QScroller::Dragging ||
scroller->state() == QScroller::Scrolling);

View File

@ -1416,9 +1416,9 @@ QDateTimeEdit::StepEnabled QDateTimeEdit::stepEnabled() const
{
Q_D(const QDateTimeEdit);
if (d->readOnly)
return StepEnabled(0);
return {};
if (d->specialValue()) {
return (d->minimum == d->maximum ? StepEnabled(0) : StepEnabled(StepUpEnabled));
return (d->minimum == d->maximum ? StepEnabled{} : StepEnabled(StepUpEnabled));
}
QAbstractSpinBox::StepEnabled ret = { };

View File

@ -240,9 +240,9 @@ Qt::Orientations QToolBarLayout::expandingDirections() const
updateGeomArray();
QToolBar *tb = qobject_cast<QToolBar*>(parentWidget());
if (!tb)
return Qt::Orientations(0);
return {};
Qt::Orientation o = tb->orientation();
return expanding ? Qt::Orientations(o) : Qt::Orientations(0);
return expanding ? Qt::Orientations(o) : Qt::Orientations{};
}
bool QToolBarLayout::movable() const