Showing the changes to interface/src/ui/ScriptsTableWidget.cpp (1 of 8 files). Show all
Unified · Split
| @@ -4,17 +4,20 @@ · 3 unmodified lines | ||
| 4 | 4 | // |
| 5 | 5 | // Created by Mohammed Nafees on 04/03/2014. |
| 6 | 6 | // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. |
| 7 | +// | |
| 8 | +// Distributed under the Apache License, Version 2.0. | |
| 9 | +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | |
| 10 | +// | |
| 7 | 11 | |
| 8 | −#include "ScriptsTableWidget.h" | |
| 9 | − | |
| 10 | −#include <QHeaderView> | |
| 11 | −#include <QPainter> | |
| 12 | 12 | #include <QDebug> |
| 13 | +#include <QHeaderView> | |
| 13 | 14 | #include <QKeyEvent> |
| 15 | +#include <QPainter> | |
| 16 | + | |
| 17 | +#include "ScriptsTableWidget.h" | |
| 14 | 18 | |
| 15 | −ScriptsTableWidget::ScriptsTableWidget(QWidget *parent) : | |
| 16 | − QTableWidget(parent) | |
| 17 | −{ | |
| 19 | +ScriptsTableWidget::ScriptsTableWidget(QWidget* parent) : | |
| 20 | + QTableWidget(parent) { | |
| 18 | 21 | verticalHeader()->setVisible(false); |
| 19 | 22 | horizontalHeader()->setVisible(false); |
| 20 | 23 | setShowGrid(false); |
| @@ -26,13 +29,12 @@ ScriptsTableWidget::ScriptsTableWidget(QWidget *parent) : · 5 unmodified lines | ||
| 26 | 29 | setGeometry(0, 0, parent->width(), parent->height()); |
| 27 | 30 | } |
| 28 | 31 | |
| 29 | −void ScriptsTableWidget::paintEvent(QPaintEvent *event) | |
| 30 | −{ | |
| 32 | +void ScriptsTableWidget::paintEvent(QPaintEvent* event) { | |
| 31 | 33 | QPainter painter(viewport()); |
| 32 | 34 | painter.setPen(QColor::fromRgb(225, 225, 225)); // #e1e1e1 |
| 33 | 35 | |
| 34 | 36 | int y = 0; |
| 35 | − for (int i = 0; i < rowCount(); ++i) { | |
| 37 | + for (int i = 0; i < rowCount(); i++) { | |
| 36 | 38 | painter.drawLine(5, rowHeight(i) + y, width(), rowHeight(i) + y); |
| 37 | 39 | y += rowHeight(i); |
| 38 | 40 | } |
| @@ -41,7 +43,7 @@ void ScriptsTableWidget::paintEvent(QPaintEvent *event) · 2 unmodified lines | ||
| 41 | 43 | QTableWidget::paintEvent(event); |
| 42 | 44 | } |
| 43 | 45 | |
| 44 | −void ScriptsTableWidget::keyPressEvent(QKeyEvent *event) { | |
| 46 | +void ScriptsTableWidget::keyPressEvent(QKeyEvent* event) { | |
| 45 | 47 | // Ignore keys so they will propagate correctly |
| 46 | 48 | event->ignore(); |
| 47 | 49 | } |