mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
ImageView: fixed image not saved if extension not set (set default png)
This commit is contained in:
@@ -666,6 +666,12 @@ void ImageView::contextMenuEvent(QContextMenuEvent * e)
|
|||||||
#endif
|
#endif
|
||||||
if(!text.isEmpty())
|
if(!text.isEmpty())
|
||||||
{
|
{
|
||||||
|
if(QFileInfo(text).suffix() == "")
|
||||||
|
{
|
||||||
|
//use png by default
|
||||||
|
text += ".png";
|
||||||
|
}
|
||||||
|
|
||||||
_savedFileName = text;
|
_savedFileName = text;
|
||||||
QImage img(_graphicsView->sceneRect().width(), _graphicsView->sceneRect().height(), QImage::Format_ARGB32_Premultiplied);
|
QImage img(_graphicsView->sceneRect().width(), _graphicsView->sceneRect().height(), QImage::Format_ARGB32_Premultiplied);
|
||||||
QPainter p(&img);
|
QPainter p(&img);
|
||||||
|
|||||||
Reference in New Issue
Block a user