Clang-format (#3028)

* 1/3 Add .clang-format file and travis compilation check

* 2/3 Run clang-format

* 3/3 Fix compilation problems due to include reordering

* 3bis/3 AfterControlStatement: false
This commit is contained in:
ctrlaltca 2018-01-27 10:41:32 +01:00 committed by GitHub
parent 8dbdd24c8e
commit b29bd9e070
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
272 changed files with 13378 additions and 9535 deletions

View file

@ -1,12 +1,11 @@
#include "gameview.h"
#include "gamescene.h"
#include "settingscache.h"
#include <QResizeEvent>
#include <QAction>
#include <QResizeEvent>
#include <QRubberBand>
GameView::GameView(QGraphicsScene *scene, QWidget *parent)
: QGraphicsView(scene, parent), rubberBand(0)
GameView::GameView(QGraphicsScene *scene, QWidget *parent) : QGraphicsView(scene, parent), rubberBand(0)
{
setBackgroundBrush(QBrush(QColor(0, 0, 0)));
setRenderHints(QPainter::TextAntialiasing | QPainter::Antialiasing);
@ -14,7 +13,7 @@ GameView::GameView(QGraphicsScene *scene, QWidget *parent)
setViewportUpdateMode(BoundingRectViewportUpdate);
connect(scene, SIGNAL(sceneRectChanged(const QRectF &)), this, SLOT(updateSceneRect(const QRectF &)));
connect(scene, SIGNAL(sigStartRubberBand(const QPointF &)), this, SLOT(startRubberBand(const QPointF &)));
connect(scene, SIGNAL(sigResizeRubberBand(const QPointF &)), this, SLOT(resizeRubberBand(const QPointF &)));
connect(scene, SIGNAL(sigStopRubberBand()), this, SLOT(stopRubberBand()));
@ -23,7 +22,7 @@ GameView::GameView(QGraphicsScene *scene, QWidget *parent)
connect(aCloseMostRecentZoneView, SIGNAL(triggered()), scene, SLOT(closeMostRecentZoneView()));
addAction(aCloseMostRecentZoneView);
connect(&settingsCache->shortcuts(), SIGNAL(shortCutchanged()),this,SLOT(refreshShortcuts()));
connect(&settingsCache->shortcuts(), SIGNAL(shortCutchanged()), this, SLOT(refreshShortcuts()));
refreshShortcuts();
rubberBand = new QRubberBand(QRubberBand::Rectangle, this);
}
@ -35,7 +34,7 @@ void GameView::resizeEvent(QResizeEvent *event)
GameScene *s = dynamic_cast<GameScene *>(scene());
if (s)
s->processViewSizeChange(event->size());
updateSceneRect(scene()->sceneRect());
}