From 6ca3c2a995e983509ae349b7e5b26bb522cca2f0 Mon Sep 17 00:00:00 2001 From: baydam Date: Sat, 18 Jun 2016 00:21:02 +0000 Subject: [PATCH] Cosmetic changes --- MappingListModel.cpp | 7 +++---- OutputGLCanvas.cpp | 31 ++++--------------------------- 2 files changed, 7 insertions(+), 31 deletions(-) diff --git a/MappingListModel.cpp b/MappingListModel.cpp index c251f3d..548f80c 100644 --- a/MappingListModel.cpp +++ b/MappingListModel.cpp @@ -39,7 +39,7 @@ QVariant MappingListModel::data(const QModelIndex &index, int role) const { if (!index.isValid()) return QVariant(); - + switch (role) { case Qt::CheckStateRole: return mappingList.at(index.row()).isVisible ? Qt::Checked : Qt::Unchecked; @@ -205,7 +205,7 @@ bool MappingListModel::setData(const QModelIndex &index, const QVariant &value, void MappingListModel::removeItem(int index) { - QList::iterator it = mappingList.begin(); + auto it = mappingList.begin(); mappingList.erase(it + index); } @@ -230,8 +230,7 @@ void MappingListModel::updateModel() void MappingListModel::clear() { - for (QList::iterator it = mappingList.end() - 1; - it >= mappingList.begin(); --it) { + for (auto it = mappingList.end() - 1; it >= mappingList.begin(); --it) { mappingList.erase(it); updateModel(); } diff --git a/OutputGLCanvas.cpp b/OutputGLCanvas.cpp index ce4c3e3..ab55840 100644 --- a/OutputGLCanvas.cpp +++ b/OutputGLCanvas.cpp @@ -189,24 +189,10 @@ void OutputGLCanvas::_drawNTSCTestCard(QPainter* painter) const QRect& geo = geometry(); int width = geo.width(); int height = geo.height(); - QList colors; - QColor white(Qt::white); - QColor yellow(Qt::yellow); - QColor cyan(Qt::cyan); - QColor green(Qt::green); - QColor magenta(Qt::magenta); - QColor red(Qt::red); - QColor blue(Qt::blue); - QColor black(Qt::black); - - colors.push_back(white); - colors.push_back(yellow); - colors.push_back(cyan); - colors.push_back(green); - colors.push_back(magenta); - colors.push_back(red); - colors.push_back(blue); - colors.push_back(black); + QList colors = { + Qt::white, Qt::yellow, Qt::cyan, Qt::green, + Qt::magenta, Qt::red, Qt::blue, Qt::black + }; const int bandWidth = width / colors.size(); @@ -219,15 +205,6 @@ void OutputGLCanvas::_drawNTSCTestCard(QPainter* painter) painter->drawRect(x * bandWidth, 0, bandWidth, height); } - // Create responsive image -// QImage image = _palTestCard.scaled(height - (rectSize * 2), height - (rectSize * 2), -// Qt::KeepAspectRatio, Qt::SmoothTransformation); -// // Draw image -// int imageX = (width - image.width()) / 2; -// int imageY = (height - image.height()) / 2; -// int imageWidth = image.width(); -// int imageHeight = image.height(); -// painter->drawImage(imageX, imageY, image); // Draw text for screen resolution int fontSize = height / 30; QRect textRect((width / 2) - (fontSize * 3), height / 3, fontSize * 6, fontSize);