[GUI] Remove code for Qt < 5.9

This commit is contained in:
Chris Hennes
2021-03-30 15:38:26 -05:00
committed by wmayer
parent 67d26939dc
commit 50c7ee36bf
57 changed files with 19 additions and 686 deletions

View File

@@ -70,18 +70,12 @@ public:
GraphvizWorker(QObject * parent = 0)
: QThread(parent)
{
#if QT_VERSION < 0x050000
dotProc.moveToThread(this);
unflattenProc.moveToThread(this);
#endif
}
virtual ~GraphvizWorker()
{
#if QT_VERSION >= 0x050000
dotProc.moveToThread(this);
unflattenProc.moveToThread(this);
#endif
}
void setData(const QByteArray & data)
@@ -90,7 +84,6 @@ public:
}
void startThread() {
#if QT_VERSION >= 0x050000
// This doesn't actually run a thread but calls the function
// directly in the main thread.
// This is needed because embedding a QProcess into a QThread
@@ -98,9 +91,6 @@ public:
run();
// Can't use the finished() signal of QThread
emitFinished();
#else
start();
#endif
}
void run() {
@@ -268,9 +258,7 @@ GraphvizView::GraphvizView(App::Document & _doc, QWidget* parent)
// Create worker thread
thread = new GraphvizWorker(this);
#if QT_VERSION >= 0x050000
connect(thread, SIGNAL(emitFinished()), this, SLOT(done()));
#endif
connect(thread, SIGNAL(finished()), this, SLOT(done()));
connect(thread, SIGNAL(error()), this, SLOT(error()));
connect(thread, SIGNAL(svgFileRead(const QByteArray &)), this, SLOT(svgFileRead(const QByteArray &)));
@@ -533,11 +521,7 @@ bool GraphvizView::onHasMsg(const char* pMsg) const
void GraphvizView::print(QPrinter* printer)
{
QPainter p(printer);
#if QT_VERSION >= 0x050300
QRect rect = printer->pageLayout().paintRectPixels(printer->resolution());
#else
QRect rect = printer->pageRect();
#endif
view->scene()->render(&p, rect);
//QByteArray buffer = exportGraph(QString::fromLatin1("svg"));
//QSvgRenderer svg(buffer);
@@ -549,11 +533,7 @@ void GraphvizView::print()
{
QPrinter printer(QPrinter::HighResolution);
printer.setFullPage(true);
#if QT_VERSION >= 0x050300
printer.setPageOrientation(QPageLayout::Landscape);
#else
printer.setOrientation(QPrinter::Landscape);
#endif
QPrintDialog dlg(&printer, this);
if (dlg.exec() == QDialog::Accepted) {
print(&printer);
@@ -583,11 +563,7 @@ void GraphvizView::printPreview()
{
QPrinter printer(QPrinter::HighResolution);
printer.setFullPage(true);
#if QT_VERSION >= 0x050300
printer.setPageOrientation(QPageLayout::Landscape);
#else
printer.setOrientation(QPrinter::Landscape);
#endif
QPrintPreviewDialog dlg(&printer, this);
connect(&dlg, SIGNAL(paintRequested (QPrinter *)),