From b8a42ff53b1fbb6e03d169d14e58180a750f4cad Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Thu, 12 Jul 2018 22:04:13 +0200 Subject: Updates from clang-format Signed-off-by: Clifford Wolf --- gui/basewindow.h | 2 +- gui/designwidget.cc | 10 +++++----- gui/fpgaviewwidget.cc | 16 ++++++---------- gui/fpgaviewwidget.h | 2 +- 4 files changed, 13 insertions(+), 17 deletions(-) (limited to 'gui') diff --git a/gui/basewindow.h b/gui/basewindow.h index c98a0356..ef3dcb95 100644 --- a/gui/basewindow.h +++ b/gui/basewindow.h @@ -26,10 +26,10 @@ #include #include #include +#include #include #include #include -#include Q_DECLARE_METATYPE(std::string) diff --git a/gui/designwidget.cc b/gui/designwidget.cc index 14de974e..110cf1b7 100644 --- a/gui/designwidget.cc +++ b/gui/designwidget.cc @@ -91,7 +91,7 @@ DesignWidget::DesignWidget(QWidget *parent) : QWidget(parent), ctx(nullptr), net propertyEditor->show(); const QIcon searchIcon(":/icons/resources/zoom.png"); - QLineEdit* lineEdit = new QLineEdit(); + QLineEdit *lineEdit = new QLineEdit(); lineEdit->setClearButtonEnabled(true); lineEdit->addAction(searchIcon, QLineEdit::LeadingPosition); lineEdit->setPlaceholderText("Search..."); @@ -139,17 +139,17 @@ DesignWidget::DesignWidget(QWidget *parent) : QWidget(parent), ctx(nullptr), net hbox->addWidget(toolbar); QWidget *btmWidget = new QWidget(); - + QVBoxLayout *vbox2 = new QVBoxLayout(); - btmWidget->setLayout(vbox2); + btmWidget->setLayout(vbox2); vbox2->setSpacing(0); vbox2->setContentsMargins(0, 0, 0, 0); vbox2->addWidget(toolbarWidget); vbox2->addWidget(propertyEditor); QSplitter *splitter = new QSplitter(Qt::Vertical); - splitter->addWidget(topWidget); - splitter->addWidget(btmWidget); + splitter->addWidget(topWidget); + splitter->addWidget(btmWidget); QGridLayout *mainLayout = new QGridLayout(); mainLayout->setSpacing(0); diff --git a/gui/fpgaviewwidget.cc b/gui/fpgaviewwidget.cc index edb3aca8..1b105b98 100644 --- a/gui/fpgaviewwidget.cc +++ b/gui/fpgaviewwidget.cc @@ -240,8 +240,7 @@ void LineShader::draw(const LineShaderData &line, const QMatrix4x4 &projection) vao_.release(); } -FPGAViewWidget::FPGAViewWidget(QWidget *parent) - : QOpenGLWidget(parent), lineShader_(this), zoom_(500.f), ctx_(nullptr) +FPGAViewWidget::FPGAViewWidget(QWidget *parent) : QOpenGLWidget(parent), lineShader_(this), zoom_(500.f), ctx_(nullptr) { backgroundColor = QColor("#ffffff"); gridColor = QColor("#ddd"); @@ -284,7 +283,7 @@ void FPGAViewWidget::initializeGL() log_error("Could not compile shader.\n"); } initializeOpenGLFunctions(); - glClearColor(backgroundColor.red()/255, backgroundColor.green()/255, backgroundColor.blue()/255, 0.0); + glClearColor(backgroundColor.red() / 255, backgroundColor.green() / 255, backgroundColor.blue() / 255, 0.0); } void FPGAViewWidget::drawElement(LineShaderData &out, const GraphicElement &el) @@ -311,7 +310,7 @@ QMatrix4x4 FPGAViewWidget::getProjection(void) QMatrix4x4 matrix; const float aspect = float(width()) / float(height()); - matrix.perspective(3.14/2, aspect, zoomNear_, zoomFar_); + matrix.perspective(3.14 / 2, aspect, zoomNear_, zoomFar_); matrix.translate(0.0f, 0.0f, -zoom_); return matrix; } @@ -391,10 +390,7 @@ void FPGAViewWidget::paintGL() void FPGAViewWidget::resizeGL(int width, int height) {} -void FPGAViewWidget::mousePressEvent(QMouseEvent *event) -{ - lastPos_ = event->pos(); -} +void FPGAViewWidget::mousePressEvent(QMouseEvent *event) { lastPos_ = event->pos(); } // Invert the projection matrix to calculate screen/mouse to world/grid // coordinates. @@ -403,8 +399,8 @@ QVector4D FPGAViewWidget::mouseToWorldCoordinates(int x, int y) QMatrix4x4 p = getProjection(); QVector2D unit = p.map(QVector4D(1, 1, 0, 1)).toVector2DAffine(); - float sx = (((float)x) / (width()/2)); - float sy = (((float)y) / (height()/2)); + float sx = (((float)x) / (width() / 2)); + float sy = (((float)y) / (height() / 2)); return QVector4D(sx / unit.x(), sy / unit.y(), 0, 1); } diff --git a/gui/fpgaviewwidget.h b/gui/fpgaviewwidget.h index 526c6199..a2495f4e 100644 --- a/gui/fpgaviewwidget.h +++ b/gui/fpgaviewwidget.h @@ -258,7 +258,7 @@ class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions QMatrix4x4 getProjection(void); QVector4D mouseToWorldCoordinates(int x, int y); - const float zoomNear_ = 1.0f; // do not zoom closer than this + const float zoomNear_ = 1.0f; // do not zoom closer than this const float zoomFar_ = 10000.0f; // do not zoom further than this const float zoomLvl1_ = 100.0f; -- cgit v1.2.3