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
const auto *const watcher = new QDBusPendingCallWatcher(s_dbusInterface->GetCapabilities());
connect(watcher, &QDBusPendingCallWatcher::finished, [&callback](QDBusPendingCallWatcher *watcher) {
const auto *const newWatcher = new QDBusPendingCallWatcher(s_dbusInterface->GetCapabilities());
connect(newWatcher, &QDBusPendingCallWatcher::finished, [&callback](QDBusPendingCallWatcher *watcher) {
watcher->deleteLater();
const QDBusPendingReply<QStringList> returnValue(*watcher);
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_palette.setBrush(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.
#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));
if (++i != end) {
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) {
searchPaths << QString::fromLocal8Bit(*i);
}
@ -179,7 +179,7 @@ void QtConfigArguments::applySettings(bool preventApplyingDefaultFont) const
#endif
if (m_libraryPathsArg.isPresent()) {
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()) {
libraryPaths << QString::fromLocal8Bit(path);
}

View File

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