mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-01 04:51:49 +01:00
Qt: add show_windowed_image to qt_utils
This commit is contained in:
parent
ed7d514c31
commit
ff89f7ca45
@ -191,5 +191,19 @@ namespace gui
|
||||
if (table->horizontalScrollBar())
|
||||
table->removeRow(--item_count);
|
||||
}
|
||||
|
||||
void show_windowed_image(const QImage& img, const QString& title)
|
||||
{
|
||||
if (img.isNull())
|
||||
return;
|
||||
|
||||
QLabel* canvas = new QLabel();
|
||||
canvas->setWindowTitle(title);
|
||||
canvas->setObjectName("windowed_image");
|
||||
canvas->setPixmap(QPixmap::fromImage(img));
|
||||
canvas->setFixedSize(img.size());
|
||||
canvas->ensurePolished();
|
||||
canvas->show();
|
||||
}
|
||||
} // utils
|
||||
} // gui
|
||||
|
@ -40,5 +40,8 @@ namespace gui
|
||||
|
||||
// Recalculates a table's item count based on the available visible space and fills it with empty items
|
||||
void update_table_item_count(QTableWidget* table);
|
||||
|
||||
// Opens an image in a new window with original size
|
||||
void show_windowed_image(const QImage& img, const QString& title = "");
|
||||
} // utils
|
||||
} // gui
|
||||
|
Loading…
x
Reference in New Issue
Block a user