1
0
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:
Megamouse 2018-03-30 17:14:09 +02:00 committed by Ivan
parent ed7d514c31
commit ff89f7ca45
2 changed files with 17 additions and 0 deletions

View File

@ -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

View File

@ -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