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 | // Created by Mohammed Nafees on 04/03/2014. | 5 | // Created by Mohammed Nafees on 04/03/2014. |
| 6 | // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. | 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 | #include <QDebug> | 12 | #include <QDebug> |
| 13 | #include <QHeaderView> | ||
| 13 | #include <QKeyEvent> | 14 | #include <QKeyEvent> |
| 15 | #include <QPainter> | ||
| 16 | |||
| 17 | #include "ScriptsTableWidget.h" | ||
| 14 | 18 | ||
| 15 | ScriptsTableWidget::ScriptsTableWidget(QWidget *parent) : | 19 | ScriptsTableWidget::ScriptsTableWidget(QWidget* parent) : |
| 16 | QTableWidget(parent) | 20 | QTableWidget(parent) { |
| 17 | { | ||
| 18 | verticalHeader()->setVisible(false); | 21 | verticalHeader()->setVisible(false); |
| 19 | horizontalHeader()->setVisible(false); | 22 | horizontalHeader()->setVisible(false); |
| 20 | setShowGrid(false); | 23 | setShowGrid(false); |
| @@ -26,13 +29,12 @@ ScriptsTableWidget::ScriptsTableWidget(QWidget *parent) : · 5 unmodified lines | |||
| 26 | setGeometry(0, 0, parent->width(), parent->height()); | 29 | setGeometry(0, 0, parent->width(), parent->height()); |
| 27 | } | 30 | } |
| 28 | 31 | ||
| 29 | void ScriptsTableWidget::paintEvent(QPaintEvent *event) | 32 | void ScriptsTableWidget::paintEvent(QPaintEvent* event) { |
| 30 | { | ||
| 31 | QPainter painter(viewport()); | 33 | QPainter painter(viewport()); |
| 32 | painter.setPen(QColor::fromRgb(225, 225, 225)); // #e1e1e1 | 34 | painter.setPen(QColor::fromRgb(225, 225, 225)); // #e1e1e1 |
| 33 | 35 | ||
| 34 | int y = 0; | 36 | int y = 0; |
| 35 | for (int i = 0; i < rowCount(); ++i) { | 37 | for (int i = 0; i < rowCount(); i++) { |
| 36 | painter.drawLine(5, rowHeight(i) + y, width(), rowHeight(i) + y); | 38 | painter.drawLine(5, rowHeight(i) + y, width(), rowHeight(i) + y); |
| 37 | y += rowHeight(i); | 39 | y += rowHeight(i); |
| 38 | } | 40 | } |
| @@ -41,7 +43,7 @@ void ScriptsTableWidget::paintEvent(QPaintEvent *event) · 2 unmodified lines | |||
| 41 | QTableWidget::paintEvent(event); | 43 | QTableWidget::paintEvent(event); |
| 42 | } | 44 | } |
| 43 | 45 | ||
| 44 | void ScriptsTableWidget::keyPressEvent(QKeyEvent *event) { | 46 | void ScriptsTableWidget::keyPressEvent(QKeyEvent* event) { |
| 45 | // Ignore keys so they will propagate correctly | 47 | // Ignore keys so they will propagate correctly |
| 46 | event->ignore(); | 48 | event->ignore(); |
| 47 | } | 49 | } |