diff options
author | Clifford Wolf <clifford@clifford.at> | 2013-11-28 11:57:25 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2013-11-28 11:57:25 +0100 |
commit | 143a58bccce1b8a4de9f80ce9402ac07c16471ce (patch) | |
tree | 4e944941dffa81a74a8378821cb55723fbbd832d /libs/svgviewer/mainwindow.cpp | |
parent | 1268182f0bae91925d0b13011800a61fe1c4fe60 (diff) | |
download | yosys-143a58bccce1b8a4de9f80ce9402ac07c16471ce.tar.gz yosys-143a58bccce1b8a4de9f80ce9402ac07c16471ce.tar.bz2 yosys-143a58bccce1b8a4de9f80ce9402ac07c16471ce.zip |
Added QGraphicsWebView to yosys-svgviewer
Diffstat (limited to 'libs/svgviewer/mainwindow.cpp')
-rw-r--r-- | libs/svgviewer/mainwindow.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/svgviewer/mainwindow.cpp b/libs/svgviewer/mainwindow.cpp index f8f72e5c4..70da140eb 100644 --- a/libs/svgviewer/mainwindow.cpp +++ b/libs/svgviewer/mainwindow.cpp @@ -41,6 +41,7 @@ #include "mainwindow.h" #include <QtGui> +#include <unistd.h> #include <QFileSystemWatcher> #include "svgview.h" @@ -60,10 +61,18 @@ MainWindow::MainWindow() menuBar()->addMenu(fileMenu); QMenu *viewMenu = new QMenu(tr("&View"), this); + + m_interactiveAction = viewMenu->addAction(tr("&Interactive")); + m_interactiveAction->setEnabled(false); + m_interactiveAction->setCheckable(true); + m_interactiveAction->setChecked(false); + connect(m_interactiveAction, SIGNAL(toggled(bool)), m_view, SLOT(setViewInteractive(bool))); + m_backgroundAction = viewMenu->addAction(tr("&Background")); m_backgroundAction->setEnabled(false); m_backgroundAction->setCheckable(true); m_backgroundAction->setChecked(false); + m_backgroundAction->setVisible(false); connect(m_backgroundAction, SIGNAL(toggled(bool)), m_view, SLOT(setViewBackground(bool))); m_outlineAction = viewMenu->addAction(tr("&Outline")); @@ -136,6 +145,7 @@ void MainWindow::openFile(const QString &path, bool reload) QMessageBox::critical(this, tr("Open SVG File"), QString("Could not open file '%1'.").arg(fileName)); + m_interactiveAction->setEnabled(false); m_outlineAction->setEnabled(false); m_backgroundAction->setEnabled(false); return; @@ -157,6 +167,7 @@ void MainWindow::openFile(const QString &path, bool reload) connect(m_watcher, SIGNAL(fileChanged(const QString&)), this, SLOT(reloadFile())); } + m_interactiveAction->setEnabled(true); m_outlineAction->setEnabled(true); m_backgroundAction->setEnabled(true); @@ -169,6 +180,8 @@ void MainWindow::openFile(const QString &path, bool reload) void MainWindow::reloadFile() { + // give the writer ~100 ms to finish writing + usleep(100000); openFile(m_currentPath, true); } |