Description: * Patch to resolve, 3D Graph -> Save displays black page. Author: Prathibha B --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: Origin: , Bug: Bug-Debian: https://bugs.debian.org/ Bug-Ubuntu: https://launchpad.net/bugs/ Forwarded: Reviewed-By: Last-Update: --- kalgebra-4.14.2.orig/src/kalgebra.cpp +++ kalgebra-4.14.2/src/kalgebra.cpp @@ -58,6 +58,10 @@ #include #include #include +#include +#include +#include +#include class Add2DOption : public InlineOptions { @@ -573,12 +577,24 @@ void KAlgebra::set_solid() #endif } +void KAlgebra::save3D() +{ + QRect rect=geometry(); + px=QPixmap::grabWindow(QApplication::desktop()->winId(),rect.x(),rect.y(),rect.width(),rect.height()); +} + void KAlgebra::save3DGraph() { #ifdef HAVE_OPENGL + //Prathibha B(BOSS Team) - To resolve, 'save only displays a black page'. + menuBar()->hide(); + statusBar()->hide(); + t_exp->hide(); + QTimer::singleShot(100, this, SLOT(save3D())); + QString path = KFileDialog::getSaveFileName(KUrl(), i18n("*.png|PNG File\n*.pdf|PDF Document"), this, QString(), KFileDialog::ConfirmOverwrite); if(!path.isEmpty()) { - QPixmap px = m_graph3d->renderPixmap(); + //QPixmap px = m_graph3d->renderPixmap(); if(path.endsWith(".pdf")) { QPrinter printer; printer.setOutputFormat(QPrinter::PdfFormat); @@ -593,6 +609,9 @@ void KAlgebra::save3DGraph() px.save(path); } } + menuBar()->show(); + statusBar()->show(); + t_exp->show(); #endif } --- kalgebra-4.14.2.orig/src/kalgebra.h +++ kalgebra-4.14.2/src/kalgebra.h @@ -52,6 +52,7 @@ class KAlgebra : public KMainWindow void add2D(const Analitza::Expression& exp); void add3D(const Analitza::Expression& exp); private: + QPixmap px; QLabel *m_status; QTabWidget* m_tabs; @@ -119,7 +120,8 @@ class KAlgebra : public KMainWindow void set_lines(); void set_solid(); void save3DGraph(); - + void save3D(); + void saveGraph(); void functools ( int );