mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 09:30:25 +08:00
Fixed build for Lunar
This commit is contained in:
@@ -161,7 +161,11 @@ ADD_LIBRARY(rtabmap_gui ${SRC_FILES})
|
||||
|
||||
TARGET_LINK_LIBRARIES(rtabmap_gui rtabmap_core rtabmap_utilite ${LIBRARIES})
|
||||
IF(Qt5_FOUND)
|
||||
QT5_USE_MODULES(rtabmap_gui Widgets Core Gui Svg PrintSupport)
|
||||
IF(Qt5Svg_FOUND)
|
||||
QT5_USE_MODULES(rtabmap_gui Widgets Core Gui Svg PrintSupport)
|
||||
ELSE()
|
||||
QT5_USE_MODULES(rtabmap_gui Widgets Core Gui PrintSupport)
|
||||
ENDIF()
|
||||
ENDIF(Qt5_FOUND)
|
||||
|
||||
SET_TARGET_PROPERTIES(
|
||||
|
||||
@@ -37,7 +37,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <QtGui/QDesktopServices>
|
||||
#include <QtGui/QContextMenuEvent>
|
||||
#include <QColorDialog>
|
||||
#ifdef QT_SVG_LIB
|
||||
#include <QtSvg/QSvgGenerator>
|
||||
#endif
|
||||
#include <QInputDialog>
|
||||
#include <QMessageBox>
|
||||
|
||||
@@ -1233,6 +1235,9 @@ void GraphViewer::contextMenuEvent(QContextMenuEvent * event)
|
||||
QMenu menu;
|
||||
QAction * aScreenShotPNG = menu.addAction(tr("Take a screenshot (PNG)"));
|
||||
QAction * aScreenShotSVG = menu.addAction(tr("Take a screenshot (SVG)"));
|
||||
#ifndef QT_SVG_LIB
|
||||
aScreenShotSVG->setEnabled(false);
|
||||
#endif
|
||||
menu.addSeparator();
|
||||
|
||||
QAction * aChangeNodeColor = menu.addAction(createIcon(_nodeColor), tr("Set node color..."));
|
||||
@@ -1422,6 +1427,7 @@ void GraphViewer::contextMenuEvent(QContextMenuEvent * event)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef QT_SVG_LIB
|
||||
QSvgGenerator svgGen;
|
||||
|
||||
svgGen.setFileName( targetDir + name );
|
||||
@@ -1433,6 +1439,9 @@ void GraphViewer::contextMenuEvent(QContextMenuEvent * event)
|
||||
QPainter painter( &svgGen );
|
||||
|
||||
this->scene()->render(&painter);
|
||||
#else
|
||||
UERROR("RTAB-MAp is not built with Qt's SVG library, cannot save picture in svg format.");
|
||||
#endif
|
||||
}
|
||||
|
||||
//reset scale
|
||||
|
||||
Reference in New Issue
Block a user