mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 22:41:25 +12:00
Qt: add show_windowed_image to qt_utils
This commit is contained in:
parent
ed7d514c31
commit
ff89f7ca45
2 changed files with 17 additions and 0 deletions
|
@ -191,5 +191,19 @@ namespace gui
|
||||||
if (table->horizontalScrollBar())
|
if (table->horizontalScrollBar())
|
||||||
table->removeRow(--item_count);
|
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
|
} // utils
|
||||||
} // gui
|
} // 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
|
// 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);
|
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
|
} // utils
|
||||||
} // gui
|
} // gui
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue