summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/MainWindow.h2
-rw-r--r--src/OffscreenView.cc2
-rw-r--r--src/OffscreenView.h6
-rw-r--r--src/QGLView.h3
-rw-r--r--src/mainwin.cc26
-rw-r--r--src/qglview.cc7
6 files changed, 24 insertions, 22 deletions
diff --git a/src/MainWindow.h b/src/MainWindow.h
index b685bf1..4848db6 100644
--- a/src/MainWindow.h
+++ b/src/MainWindow.h
@@ -87,7 +87,7 @@ private:
void loadViewSettings();
void loadDesignSettings();
- class QDialog *openglbox;
+ class QMessageBox *openglbox;
private slots:
void actionNew();
diff --git a/src/OffscreenView.cc b/src/OffscreenView.cc
index 6f9b2da..bc1b97c 100644
--- a/src/OffscreenView.cc
+++ b/src/OffscreenView.cc
@@ -147,7 +147,7 @@ bool OffscreenView::save(std::ostream &output)
return save_framebuffer(this->ctx, output);
}
-const std::string &OffscreenView::getRendererInfo()
+std::string OffscreenView::getRendererInfo()
{
std::stringstream out;
diff --git a/src/OffscreenView.h b/src/OffscreenView.h
index c27277e..97d8198 100644
--- a/src/OffscreenView.h
+++ b/src/OffscreenView.h
@@ -24,9 +24,9 @@ public:
void setupPerspective();
void setupOrtho(bool offset=false);
void paintGL();
- bool save(const char *filename);
- bool save(std::ostream &output);
- const std::string &getRendererInfo();
+ bool save(const char *filename); //
+ bool save(std::ostream &output); // not implemented in qgl?
+ std::string getRendererInfo(); //
GLint shaderinfo[11]; //
diff --git a/src/QGLView.h b/src/QGLView.h
index 862d751..57e5faf 100644
--- a/src/QGLView.h
+++ b/src/QGLView.h
@@ -35,7 +35,8 @@ public:
void setShowCrosshairs(bool enabled) { this->showcrosshairs = enabled; }
bool orthoMode() const { return this->orthomode; }
void setOrthoMode(bool enabled) { this->orthomode = enabled; }
- const std::string &getRendererInfo() const { return this->rendererInfo; }
+ std::string getRendererInfo() const { return this->rendererInfo; }
+ bool save(const char *filename);
public:
QLabel *statusLabel;
diff --git a/src/mainwin.cc b/src/mainwin.cc
index 52020ec..b4e1f50 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -1452,20 +1452,17 @@ void MainWindow::actionExportCSG()
void MainWindow::actionExportImage()
{
- QImage img = this->qglview->grabFrameBuffer();
setCurrentOutput();
QString img_filename = QFileDialog::getSaveFileName(this,
"Export Image", "", "PNG Files (*.png)");
if (img_filename.isEmpty()) {
PRINT("No filename specified. Image export aborted.");
- clearCurrentOutput();
- return;
+ } else {
+ qglview->save(img_filename.toStdString().c_str());
}
-
- img.save(img_filename, "PNG");
-
clearCurrentOutput();
+ return;
}
void MainWindow::actionFlushCaches()
@@ -1745,16 +1742,13 @@ void MainWindow::helpLibrary()
qVersion());
if (!this->openglbox) {
- this->openglbox = new QDialog( this );
- QVBoxLayout *ql = new QVBoxLayout( openglbox );
- QTextEdit *qte = new QTextEdit( openglbox );
- ql->addWidget( qte );
- }
- QTextEdit *qte = openglbox->findChild<QTextEdit *>();
- qte->setText(libinfo + QString(this->qglview->getRendererInfo().c_str()));
- qte->setReadOnly( true );
- openglbox->setMinimumSize( QSize(400,200) );
- openglbox->show();
+ this->openglbox = new QMessageBox(QMessageBox::Information,
+ "OpenGL Info", "Detailed Library Info",
+ QMessageBox::Ok, this);
+ this->openglbox->setMinimumSize( QSize(400,200) );
+ }
+ this->openglbox->setDetailedText(libinfo + QString(qglview->getRendererInfo().c_str()));
+ this->openglbox->show();
}
/*!
diff --git a/src/qglview.cc b/src/qglview.cc
index 5310eac..c80d155 100644
--- a/src/qglview.cc
+++ b/src/qglview.cc
@@ -637,3 +637,10 @@ void QGLView::mouseReleaseEvent(QMouseEvent*)
mouse_drag_active = false;
releaseMouse();
}
+
+bool QGLView::save(const char *filename)
+{
+ QImage img = grabFrameBuffer();
+ return img.save(filename, "PNG");
+}
+
contact: Jan Huwald // Impressum