custom style delegate for icon view

This commit is contained in:
itsmattkc
2019-03-24 22:34:34 +11:00
parent be01bdd6f9
commit 54518a5896
15 changed files with 1085 additions and 74 deletions
-14
View File
@@ -77,17 +77,3 @@ FootageStream* Footage::get_stream_from_file_index(bool video, int index) {
}
return nullptr;
}
void FootageStream::make_square_thumb() {
// generate square version for QListView?
int square_size = qMax(video_preview.width(), video_preview.height());
QPixmap pixmap(square_size, square_size);
pixmap.fill(Qt::transparent);
QPainter p(&pixmap);
int diff = (video_preview.width() - video_preview.height())>>1;
int sqx = (diff < 0) ? -diff : 0;
int sqy = (diff > 0) ? diff : 0;
p.drawImage(sqx, sqy, video_preview);
p.end();
video_preview_square = QIcon(pixmap);
}