Fix narrowing conversions
This commit is contained in:
@@ -744,7 +744,7 @@ QModelIndex PlaylistView::NextEditableIndex(const QModelIndex ¤t) {
|
||||
|
||||
QList<int> columns = GetEditableColumns();
|
||||
QHeaderView *h = header();
|
||||
int idx = columns.indexOf(h->visualIndex(current.column()));
|
||||
int idx = static_cast<int>(columns.indexOf(h->visualIndex(current.column())));
|
||||
|
||||
if (idx + 1 >= columns.size()) {
|
||||
return model()->index(current.row() + 1, h->logicalIndex(columns.first()));
|
||||
@@ -758,7 +758,7 @@ QModelIndex PlaylistView::PrevEditableIndex(const QModelIndex ¤t) {
|
||||
|
||||
QList<int> columns = GetEditableColumns();
|
||||
QHeaderView *h = header();
|
||||
int idx = columns.indexOf(h->visualIndex(current.column()));
|
||||
int idx = static_cast<int>(columns.indexOf(h->visualIndex(current.column())));
|
||||
|
||||
if (idx - 1 < 0) {
|
||||
return model()->index(current.row() - 1, h->logicalIndex(columns.last()));
|
||||
@@ -1459,7 +1459,7 @@ void PlaylistView::set_background_image(const QImage &image) {
|
||||
// Apply opacity filter
|
||||
uchar *bits = background_image_.bits();
|
||||
for (int i = 0; i < background_image_.height() * background_image_.bytesPerLine(); i += 4) {
|
||||
bits[i + 3] = (opacity_level_ / 100.0) * 255;
|
||||
bits[i + 3] = static_cast<uchar>((opacity_level_ / 100.0) * 255);
|
||||
}
|
||||
|
||||
if (blur_radius_ != 0) {
|
||||
|
||||
Reference in New Issue
Block a user