+ fixes #0002297: 'Export to PDF...' from drawing view does not show an error if existing file can not be overwritten
This commit is contained in:
parent
9abedaf0d2
commit
efd3a494d7
|
@ -36,6 +36,7 @@
|
||||||
# include <QGLFormat>
|
# include <QGLFormat>
|
||||||
# include <QGLWidget>
|
# include <QGLWidget>
|
||||||
# include <QGLPixelBuffer>
|
# include <QGLPixelBuffer>
|
||||||
|
# include <QMessageBox>
|
||||||
# include <QPainter>
|
# include <QPainter>
|
||||||
# include <QPrinter>
|
# include <QPrinter>
|
||||||
# include <QPrintDialog>
|
# include <QPrintDialog>
|
||||||
|
@ -531,6 +532,13 @@ void View3DInventor::print(QPrinter* printer)
|
||||||
#else
|
#else
|
||||||
QImage img;
|
QImage img;
|
||||||
QPainter p(printer);
|
QPainter p(printer);
|
||||||
|
if (!p.isActive() && !printer->outputFileName().isEmpty()) {
|
||||||
|
qApp->setOverrideCursor(Qt::ArrowCursor);
|
||||||
|
QMessageBox::critical(this, tr("Opening file failed"),
|
||||||
|
tr("Can't open file '%1' for writing.").arg(printer->outputFileName()));
|
||||||
|
qApp->restoreOverrideCursor();
|
||||||
|
return;
|
||||||
|
}
|
||||||
QRect rect = printer->pageRect();
|
QRect rect = printer->pageRect();
|
||||||
|
|
||||||
bool pbuffer = QGLPixelBuffer::hasOpenGLPbuffers();
|
bool pbuffer = QGLPixelBuffer::hasOpenGLPbuffers();
|
||||||
|
|
|
@ -593,6 +593,13 @@ void DrawingView::print(QPrinter* printer)
|
||||||
}
|
}
|
||||||
|
|
||||||
QPainter p(printer);
|
QPainter p(printer);
|
||||||
|
if (!p.isActive() && !printer->outputFileName().isEmpty()) {
|
||||||
|
qApp->setOverrideCursor(Qt::ArrowCursor);
|
||||||
|
QMessageBox::critical(this, tr("Opening file failed"),
|
||||||
|
tr("Can't open file '%1' for writing.").arg(printer->outputFileName()));
|
||||||
|
qApp->restoreOverrideCursor();
|
||||||
|
return;
|
||||||
|
}
|
||||||
QRect rect = printer->paperRect();
|
QRect rect = printer->paperRect();
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
// On Windows the preview looks broken when using paperRect as render area.
|
// On Windows the preview looks broken when using paperRect as render area.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user