mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-13 12:26:05 -05:00
Add 'export map image' action to File menu
This commit is contained in:
@@ -759,3 +759,12 @@ void MainWindow::checkToolButtons() {
|
||||
void MainWindow::onMapChanged(Map *map) {
|
||||
updateMapList();
|
||||
}
|
||||
|
||||
void MainWindow::on_action_Export_Map_Image_triggered()
|
||||
{
|
||||
QString defaultFilepath = QString("%1/%2.png").arg(editor->project->root).arg(editor->map->name);
|
||||
QString filepath = QFileDialog::getSaveFileName(this, "Export Map Image", defaultFilepath, "Image Files (*.png *.jpg *.bmp)");
|
||||
if (!filepath.isEmpty()) {
|
||||
editor->map_item->pixmap().save(filepath);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user