Commit 03925b74 authored by Sylvain Thery's avatar Sylvain Thery
Browse files

snapshot function is back !!

parent dd2af627
...@@ -396,6 +396,8 @@ public: ...@@ -396,6 +396,8 @@ public:
*/ */
std::string selectFileSave(const std::string& title = "open file", const std::string& dir = ".", const std::string& filters = "all (*.*)"); std::string selectFileSave(const std::string& title = "open file", const std::string& dir = ".", const std::string& filters = "all (*.*)");
void snapshot(const QString& filename);
public slots: public slots:
virtual void cb_New() { std::cerr << "callback not implemented" << std::endl; } virtual void cb_New() { std::cerr << "callback not implemented" << std::endl; }
virtual void cb_Open() { std::cerr << "callback not implemented" << std::endl; } virtual void cb_Open() { std::cerr << "callback not implemented" << std::endl; }
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "glm/gtc/type_ptr.hpp" #include "glm/gtc/type_ptr.hpp"
#include <QtGui/QTextEdit> #include <QtGui/QTextEdit>
#include <QImage>
namespace CGoGN namespace CGoGN
{ {
...@@ -513,6 +514,12 @@ void SimpleQT::cb_about() ...@@ -513,6 +514,12 @@ void SimpleQT::cb_about()
QMessageBox::about(this, tr("About App"), m_helpString.c_str()); QMessageBox::about(this, tr("About App"), m_helpString.c_str());
} }
void SimpleQT::snapshot(const QString& filename)
{
QImage im = m_glWidget->grabFrameBuffer(false);
im.save(filename);
}
} // namespace QT } // namespace QT
} // namespace Utils } // namespace Utils
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment