Fix/silence warnings

This commit is contained in:
Martchus 2021-03-20 21:02:00 +01:00
parent 4cadb04b44
commit 25062fcf01
4 changed files with 9 additions and 9 deletions

View File

@ -362,8 +362,8 @@ bool DBusNotification::queryCapabilities(const std::function<void(Capabilities &
} }
// invoke GetCapabilities() and pass the return value to the callback when available // invoke GetCapabilities() and pass the return value to the callback when available
const auto *const watcher = new QDBusPendingCallWatcher(s_dbusInterface->GetCapabilities()); const auto *const newWatcher = new QDBusPendingCallWatcher(s_dbusInterface->GetCapabilities());
connect(watcher, &QDBusPendingCallWatcher::finished, [&callback](QDBusPendingCallWatcher *watcher) { connect(newWatcher, &QDBusPendingCallWatcher::finished, [&callback](QDBusPendingCallWatcher *watcher) {
watcher->deleteLater(); watcher->deleteLater();
const QDBusPendingReply<QStringList> returnValue(*watcher); const QDBusPendingReply<QStringList> returnValue(*watcher);
if (returnValue.isError()) { if (returnValue.isError()) {

View File

@ -327,7 +327,7 @@ bool PaletteModel::setData(const QModelIndex &index, const QVariant &value, int
m_parentPalette.brush(QPalette::Inactive, static_cast<QPalette::ColorRole>(r))); m_parentPalette.brush(QPalette::Inactive, static_cast<QPalette::ColorRole>(r)));
m_palette.setBrush(QPalette::Disabled, static_cast<QPalette::ColorRole>(r), m_palette.setBrush(QPalette::Disabled, static_cast<QPalette::ColorRole>(r),
m_parentPalette.brush(QPalette::Disabled, static_cast<QPalette::ColorRole>(r))); m_parentPalette.brush(QPalette::Disabled, static_cast<QPalette::ColorRole>(r)));
mask &= ~(1 << index.row()); mask &= ~static_cast<decltype(mask)>(1 << index.row());
} }
m_palette. m_palette.
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))

View File

@ -132,7 +132,7 @@ void QtConfigArguments::applySettings(bool preventApplyingDefaultFont) const
QIcon::setThemeName(QString::fromLocal8Bit(*i)); QIcon::setThemeName(QString::fromLocal8Bit(*i));
if (++i != end) { if (++i != end) {
QStringList searchPaths; QStringList searchPaths;
searchPaths.reserve(m_iconThemeArg.values().size() - 1); searchPaths.reserve(static_cast<QStringList::size_type>(m_iconThemeArg.values().size() - 1));
for (; i != end; ++i) { for (; i != end; ++i) {
searchPaths << QString::fromLocal8Bit(*i); searchPaths << QString::fromLocal8Bit(*i);
} }
@ -179,7 +179,7 @@ void QtConfigArguments::applySettings(bool preventApplyingDefaultFont) const
#endif #endif
if (m_libraryPathsArg.isPresent()) { if (m_libraryPathsArg.isPresent()) {
QStringList libraryPaths; QStringList libraryPaths;
libraryPaths.reserve(m_libraryPathsArg.values().size()); libraryPaths.reserve(static_cast<QStringList::size_type>(m_libraryPathsArg.values().size()));
for (const auto &path : m_libraryPathsArg.values()) { for (const auto &path : m_libraryPathsArg.values()) {
libraryPaths << QString::fromLocal8Bit(path); libraryPaths << QString::fromLocal8Bit(path);
} }

View File

@ -80,7 +80,7 @@ QSize IconButton::sizeHint() const
#else #else
const qreal pixmapRatio = 1.0; const qreal pixmapRatio = 1.0;
#endif #endif
return QSize(m_pixmap.width() / pixmapRatio, m_pixmap.height() / pixmapRatio); return QSize(static_cast<int>(m_pixmap.width() / pixmapRatio), static_cast<int>(m_pixmap.height() / pixmapRatio));
} }
void IconButton::paintEvent(QPaintEvent *) void IconButton::paintEvent(QPaintEvent *)
@ -90,12 +90,12 @@ void IconButton::paintEvent(QPaintEvent *)
#else #else
const qreal pixmapRatio = 1.0; const qreal pixmapRatio = 1.0;
#endif #endif
QStylePainter painter(this); auto painter = QStylePainter(this);
QRect pixmapRect = QRect(0, 0, m_pixmap.width() / pixmapRatio, m_pixmap.height() / pixmapRatio); auto pixmapRect = QRect(0, 0, static_cast<int>(m_pixmap.width() / pixmapRatio), static_cast<int>(m_pixmap.height() / pixmapRatio));
pixmapRect.moveCenter(rect().center()); pixmapRect.moveCenter(rect().center());
painter.drawPixmap(pixmapRect, m_pixmap); painter.drawPixmap(pixmapRect, m_pixmap);
if (hasFocus()) { if (hasFocus()) {
QStyleOptionFocusRect focusOption; auto focusOption = QStyleOptionFocusRect();
focusOption.initFrom(this); focusOption.initFrom(this);
focusOption.rect = pixmapRect; focusOption.rect = pixmapRect;
#ifdef Q_OS_MAC #ifdef Q_OS_MAC