diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2018-06-11 21:36:54 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2018-06-11 21:36:54 +0200 |
commit | 102e10f2ddfb3409dfc8dc54200a382320dc3a2e (patch) | |
tree | 16f7fcf8090e55150ad83f3549f1de5aa82c26c1 | |
parent | 599cbb12fa2c2db56509d666eaf6b8b8ae241739 (diff) | |
download | nextpnr-102e10f2ddfb3409dfc8dc54200a382320dc3a2e.tar.gz nextpnr-102e10f2ddfb3409dfc8dc54200a382320dc3a2e.tar.bz2 nextpnr-102e10f2ddfb3409dfc8dc54200a382320dc3a2e.zip |
Clang format to ignore 3rdparty and fix one file
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | gui/mainwindow.cc | 119 |
2 files changed, 84 insertions, 36 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 03dc1855..19558081 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,6 +108,7 @@ endforeach (family) file(GLOB_RECURSE CLANGFORMAT_FILES *.cc *.h) string(REGEX REPLACE "[^;]*/ice40/chipdbs/chipdb-[^;]*.cc" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}") +string(REGEX REPLACE "[^;]*/3rdparty[^;]*" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}") add_custom_target( clangformat diff --git a/gui/mainwindow.cc b/gui/mainwindow.cc index b24fb58b..31ce8fae 100644 --- a/gui/mainwindow.cc +++ b/gui/mainwindow.cc @@ -4,10 +4,10 @@ #include <string> #include "emb.h" #include "pybindings.h" -#include "ui_mainwindow.h" #include "qtpropertymanager.h" -#include "qtvariantproperty.h" #include "qttreepropertybrowser.h" +#include "qtvariantproperty.h" +#include "ui_mainwindow.h" #include <QDate> #include <QLocale> @@ -26,116 +26,163 @@ MainWindow::MainWindow(Design *_design, QWidget *parent) emb::set_stdout(write); std::string title = "nextpnr-ice40 - " + design->chip.getChipName(); setWindowTitle(title.c_str()); - QtVariantPropertyManager *variantManager = new QtVariantPropertyManager(); + QtVariantPropertyManager *variantManager = new QtVariantPropertyManager(); int i = 0; - QtProperty *topItem = variantManager->addProperty(QtVariantPropertyManager::groupTypeId(), - QString::number(i++) + QLatin1String(" Group Property")); + QtProperty *topItem = variantManager->addProperty( + QtVariantPropertyManager::groupTypeId(), + QString::number(i++) + QLatin1String(" Group Property")); - QtVariantProperty *item = variantManager->addProperty(QVariant::Bool, QString::number(i++) + QLatin1String(" Bool Property")); + QtVariantProperty *item = variantManager->addProperty( + QVariant::Bool, + QString::number(i++) + QLatin1String(" Bool Property")); item->setValue(true); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::Int, QString::number(i++) + QLatin1String(" Int Property")); + item = variantManager->addProperty(QVariant::Int, + QString::number(i++) + + QLatin1String(" Int Property")); item->setValue(20); item->setAttribute(QLatin1String("minimum"), 0); item->setAttribute(QLatin1String("maximum"), 100); item->setAttribute(QLatin1String("singleStep"), 10); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::Double, QString::number(i++) + QLatin1String(" Double Property")); + item = variantManager->addProperty( + QVariant::Double, + QString::number(i++) + QLatin1String(" Double Property")); item->setValue(1.2345); item->setAttribute(QLatin1String("singleStep"), 0.1); item->setAttribute(QLatin1String("decimals"), 3); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::String, QString::number(i++) + QLatin1String(" String Property")); + item = variantManager->addProperty( + QVariant::String, + QString::number(i++) + QLatin1String(" String Property")); item->setValue("Value"); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::Date, QString::number(i++) + QLatin1String(" Date Property")); + item = variantManager->addProperty(QVariant::Date, + QString::number(i++) + + QLatin1String(" Date Property")); item->setValue(QDate::currentDate().addDays(2)); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::Time, QString::number(i++) + QLatin1String(" Time Property")); + item = variantManager->addProperty(QVariant::Time, + QString::number(i++) + + QLatin1String(" Time Property")); item->setValue(QTime::currentTime()); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::DateTime, QString::number(i++) + QLatin1String(" DateTime Property")); + item = variantManager->addProperty( + QVariant::DateTime, + QString::number(i++) + QLatin1String(" DateTime Property")); item->setValue(QDateTime::currentDateTime()); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::KeySequence, QString::number(i++) + QLatin1String(" KeySequence Property")); + item = variantManager->addProperty( + QVariant::KeySequence, + QString::number(i++) + QLatin1String(" KeySequence Property")); item->setValue(QKeySequence(Qt::ControlModifier | Qt::Key_Q)); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::Char, QString::number(i++) + QLatin1String(" Char Property")); + item = variantManager->addProperty(QVariant::Char, + QString::number(i++) + + QLatin1String(" Char Property")); item->setValue(QChar(386)); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::Locale, QString::number(i++) + QLatin1String(" Locale Property")); + item = variantManager->addProperty( + QVariant::Locale, + QString::number(i++) + QLatin1String(" Locale Property")); item->setValue(QLocale(QLocale::Polish, QLocale::Poland)); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::Point, QString::number(i++) + QLatin1String(" Point Property")); + item = variantManager->addProperty( + QVariant::Point, + QString::number(i++) + QLatin1String(" Point Property")); item->setValue(QPoint(10, 10)); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::PointF, QString::number(i++) + QLatin1String(" PointF Property")); + item = variantManager->addProperty( + QVariant::PointF, + QString::number(i++) + QLatin1String(" PointF Property")); item->setValue(QPointF(1.2345, -1.23451)); item->setAttribute(QLatin1String("decimals"), 3); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::Size, QString::number(i++) + QLatin1String(" Size Property")); + item = variantManager->addProperty(QVariant::Size, + QString::number(i++) + + QLatin1String(" Size Property")); item->setValue(QSize(20, 20)); item->setAttribute(QLatin1String("minimum"), QSize(10, 10)); item->setAttribute(QLatin1String("maximum"), QSize(30, 30)); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::SizeF, QString::number(i++) + QLatin1String(" SizeF Property")); + item = variantManager->addProperty( + QVariant::SizeF, + QString::number(i++) + QLatin1String(" SizeF Property")); item->setValue(QSizeF(1.2345, 1.2345)); item->setAttribute(QLatin1String("decimals"), 3); item->setAttribute(QLatin1String("minimum"), QSizeF(0.12, 0.34)); item->setAttribute(QLatin1String("maximum"), QSizeF(20.56, 20.78)); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::Rect, QString::number(i++) + QLatin1String(" Rect Property")); + item = variantManager->addProperty(QVariant::Rect, + QString::number(i++) + + QLatin1String(" Rect Property")); item->setValue(QRect(10, 10, 20, 20)); topItem->addSubProperty(item); item->setAttribute(QLatin1String("constraint"), QRect(0, 0, 50, 50)); - item = variantManager->addProperty(QVariant::RectF, QString::number(i++) + QLatin1String(" RectF Property")); + item = variantManager->addProperty( + QVariant::RectF, + QString::number(i++) + QLatin1String(" RectF Property")); item->setValue(QRectF(1.2345, 1.2345, 1.2345, 1.2345)); topItem->addSubProperty(item); item->setAttribute(QLatin1String("constraint"), QRectF(0, 0, 50, 50)); item->setAttribute(QLatin1String("decimals"), 3); item = variantManager->addProperty(QtVariantPropertyManager::enumTypeId(), - QString::number(i++) + QLatin1String(" Enum Property")); + QString::number(i++) + + QLatin1String(" Enum Property")); QStringList enumNames; - enumNames << "Enum0" << "Enum1" << "Enum2"; + enumNames << "Enum0" + << "Enum1" + << "Enum2"; item->setAttribute(QLatin1String("enumNames"), enumNames); item->setValue(1); topItem->addSubProperty(item); item = variantManager->addProperty(QtVariantPropertyManager::flagTypeId(), - QString::number(i++) + QLatin1String(" Flag Property")); + QString::number(i++) + + QLatin1String(" Flag Property")); QStringList flagNames; - flagNames << "Flag0" << "Flag1" << "Flag2"; + flagNames << "Flag0" + << "Flag1" + << "Flag2"; item->setAttribute(QLatin1String("flagNames"), flagNames); item->setValue(5); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::SizePolicy, QString::number(i++) + QLatin1String(" SizePolicy Property")); + item = variantManager->addProperty( + QVariant::SizePolicy, + QString::number(i++) + QLatin1String(" SizePolicy Property")); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::Font, QString::number(i++) + QLatin1String(" Font Property")); + item = variantManager->addProperty(QVariant::Font, + QString::number(i++) + + QLatin1String(" Font Property")); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::Cursor, QString::number(i++) + QLatin1String(" Cursor Property")); + item = variantManager->addProperty( + QVariant::Cursor, + QString::number(i++) + QLatin1String(" Cursor Property")); topItem->addSubProperty(item); - item = variantManager->addProperty(QVariant::Color, QString::number(i++) + QLatin1String(" Color Property")); + item = variantManager->addProperty( + QVariant::Color, + QString::number(i++) + QLatin1String(" Color Property")); topItem->addSubProperty(item); QtVariantEditorFactory *variantFactory = new QtVariantEditorFactory(); @@ -149,13 +196,13 @@ MainWindow::MainWindow(Design *_design, QWidget *parent) ui->splitter_2->addWidget(variantEditor); } -MainWindow::~MainWindow() -{ - - //delete variantManager; - //delete variantFactory; - //delete variantEditor; -delete ui; +MainWindow::~MainWindow() +{ + + // delete variantManager; + // delete variantFactory; + // delete variantEditor; + delete ui; } void handle_system_exit() { exit(-1); } |