diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2018-06-28 18:06:31 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2018-06-28 18:06:31 +0200 |
commit | 960c65047877c72498d65ecc401371ab1552c82a (patch) | |
tree | 5b0a4aa7063fd6a24ff4a74b9786e8b1daad0a57 /gui | |
parent | 1676b285ae726eb858d4d7ed089496133ce3de4b (diff) | |
download | nextpnr-960c65047877c72498d65ecc401371ab1552c82a.tar.gz nextpnr-960c65047877c72498d65ecc401371ab1552c82a.tar.bz2 nextpnr-960c65047877c72498d65ecc401371ab1552c82a.zip |
clangformat cleanup
Diffstat (limited to 'gui')
-rw-r--r-- | gui/basewindow.cc | 8 | ||||
-rw-r--r-- | gui/designwidget.cc | 9 | ||||
-rw-r--r-- | gui/fpgaviewwidget.cc | 6 | ||||
-rw-r--r-- | gui/fpgaviewwidget.h | 1 | ||||
-rw-r--r-- | gui/ice40/mainwindow.cc | 12 | ||||
-rw-r--r-- | gui/ice40/worker.cc | 6 |
6 files changed, 17 insertions, 25 deletions
diff --git a/gui/basewindow.cc b/gui/basewindow.cc index 2e8d7c85..5d2e21cc 100644 --- a/gui/basewindow.cc +++ b/gui/basewindow.cc @@ -67,8 +67,8 @@ BaseMainWindow::BaseMainWindow(QWidget *parent) : QMainWindow(parent), ctx(nullp designview->setMinimumWidth(300);
designview->setMaximumWidth(300);
splitter_h->addWidget(designview);
-
- connect(this, SIGNAL(contextChanged(Context*)), designview, SLOT(newContext(Context*)));
+
+ connect(this, SIGNAL(contextChanged(Context *)), designview, SLOT(newContext(Context *)));
connect(designview, SIGNAL(info(std::string)), this, SLOT(writeInfo(std::string)));
@@ -76,7 +76,7 @@ BaseMainWindow::BaseMainWindow(QWidget *parent) : QMainWindow(parent), ctx(nullp #ifndef NO_PYTHON
PythonTab *pythontab = new PythonTab();
tabWidget->addTab(pythontab, "Python");
- connect(this, SIGNAL(contextChanged(Context*)), pythontab, SLOT(newContext(Context*)));
+ connect(this, SIGNAL(contextChanged(Context *)), pythontab, SLOT(newContext(Context *)));
#endif
info = new InfoTab();
tabWidget->addTab(info, "Info");
@@ -85,7 +85,7 @@ BaseMainWindow::BaseMainWindow(QWidget *parent) : QMainWindow(parent), ctx(nullp FPGAViewWidget *fpgaView = new FPGAViewWidget();
centralTabWidget->addTab(fpgaView, "Graphics");
- connect(this, SIGNAL(contextChanged(Context*)), fpgaView, SLOT(newContext(Context*)));
+ connect(this, SIGNAL(contextChanged(Context *)), fpgaView, SLOT(newContext(Context *)));
splitter_v->addWidget(centralTabWidget);
splitter_v->addWidget(tabWidget);
diff --git a/gui/designwidget.cc b/gui/designwidget.cc index a989080e..2168a673 100644 --- a/gui/designwidget.cc +++ b/gui/designwidget.cc @@ -135,8 +135,7 @@ void DesignWidget::newContext(Context *ctx) bel_root->setText(0, QString("Bels"));
treeWidget->insertTopLevelItem(0, bel_root);
QList<QTreeWidgetItem *> bel_items;
- if (ctx)
- {
+ if (ctx) {
for (auto bel : ctx->getBels()) {
auto name = ctx->getBelName(bel);
bel_items.append(new BelTreeItem(name, ElementType::BEL, QString(name.c_str(ctx))));
@@ -149,8 +148,7 @@ void DesignWidget::newContext(Context *ctx) QList<QTreeWidgetItem *> wire_items;
wire_root->setText(0, QString("Wires"));
treeWidget->insertTopLevelItem(0, wire_root);
- if (ctx)
- {
+ if (ctx) {
for (auto wire : ctx->getWires()) {
auto name = ctx->getWireName(wire);
wire_items.append(new WireTreeItem(name, ElementType::WIRE, QString(name.c_str(ctx))));
@@ -163,8 +161,7 @@ void DesignWidget::newContext(Context *ctx) QList<QTreeWidgetItem *> pip_items;
pip_root->setText(0, QString("Pips"));
treeWidget->insertTopLevelItem(0, pip_root);
- if (ctx)
- {
+ if (ctx) {
for (auto pip : ctx->getPips()) {
auto name = ctx->getPipName(pip);
pip_items.append(new PipTreeItem(name, ElementType::PIP, QString(name.c_str(ctx))));
diff --git a/gui/fpgaviewwidget.cc b/gui/fpgaviewwidget.cc index a2691401..12d52c77 100644 --- a/gui/fpgaviewwidget.cc +++ b/gui/fpgaviewwidget.cc @@ -355,8 +355,7 @@ void FPGAViewWidget::paintGL() // Draw Bels. auto bels = LineShaderData(0.02f, QColor("#b000ba")); - if (ctx_) - { + if (ctx_) { for (auto bel : ctx_->getBels()) { for (auto &el : ctx_->getBelGraphics(bel)) drawElement(bels, el); @@ -366,8 +365,7 @@ void FPGAViewWidget::paintGL() // Draw Frame Graphics. auto frames = LineShaderData(0.02f, QColor("#0066ba")); - if (ctx_) - { + if (ctx_) { for (auto &el : ctx_->getFrameGraphics()) { drawElement(frames, el); } diff --git a/gui/fpgaviewwidget.h b/gui/fpgaviewwidget.h index 1d878696..77735071 100644 --- a/gui/fpgaviewwidget.h +++ b/gui/fpgaviewwidget.h @@ -242,6 +242,7 @@ class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions void drawElement(LineShaderData &data, const GraphicElement &el); public Q_SLOTS: void newContext(Context *ctx); + private: QPoint lastPos_; float moveX_; diff --git a/gui/ice40/mainwindow.cc b/gui/ice40/mainwindow.cc index 2563a767..c89b5d2d 100644 --- a/gui/ice40/mainwindow.cc +++ b/gui/ice40/mainwindow.cc @@ -58,8 +58,8 @@ MainWindow::MainWindow(QWidget *parent) : BaseMainWindow(parent), timing_driven( connect(task, SIGNAL(taskStarted()), this, SLOT(taskStarted()));
connect(task, SIGNAL(taskPaused()), this, SLOT(taskPaused()));
- connect(this, SIGNAL(contextChanged(Context*)), this, SLOT(newContext(Context*)));
- connect(this, SIGNAL(contextChanged(Context*)), task, SIGNAL(contextChanged(Context*)));
+ connect(this, SIGNAL(contextChanged(Context *)), this, SLOT(newContext(Context *)));
+ connect(this, SIGNAL(contextChanged(Context *)), task, SIGNAL(contextChanged(Context *)));
createMenu();
}
@@ -184,10 +184,10 @@ void MainWindow::new_proj() ArchArgs chipArgs;
chipArgs.type = ArchArgs::HX1K;
chipArgs.package = "tq144";
- if (ctx)
+ if (ctx)
delete ctx;
ctx = new Context(chipArgs);
-
+
Q_EMIT contextChanged(ctx);
actionLoadJSON->setEnabled(true);
@@ -352,7 +352,7 @@ void MainWindow::taskStarted() disableActions();
actionPause->setEnabled(true);
actionStop->setEnabled(true);
-
+
actionNew->setEnabled(false);
actionOpen->setEnabled(false);
}
@@ -362,7 +362,7 @@ void MainWindow::taskPaused() disableActions();
actionPlay->setEnabled(true);
actionStop->setEnabled(true);
-
+
actionNew->setEnabled(false);
actionOpen->setEnabled(false);
}
diff --git a/gui/ice40/worker.cc b/gui/ice40/worker.cc index c49b8769..ce513a05 100644 --- a/gui/ice40/worker.cc +++ b/gui/ice40/worker.cc @@ -56,10 +56,7 @@ Worker::Worker(TaskManager *parent) : ctx(nullptr) }; } -void Worker::newContext(Context *ctx_) -{ - ctx = ctx_; -} +void Worker::newContext(Context *ctx_) { ctx = ctx_; } void Worker::loadfile(const std::string &filename) { @@ -156,7 +153,6 @@ TaskManager::TaskManager() : toTerminate(false), toPause(false) connect(this, &TaskManager::place, worker, &Worker::place); connect(this, &TaskManager::route, worker, &Worker::route); - connect(this, &TaskManager::contextChanged, worker, &Worker::newContext); connect(worker, &Worker::log, this, &TaskManager::info); |