From 990218c07e2052f7e75af42a965cfc84b36e8371 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 12 Oct 2013 05:30:18 +0200 Subject: Fix Style issues * Change fixed width front from "courier" to "Monospace" * Remove foregroundcolor from SmTreeItem. Wasn't used nor needed, quite the opposite: it made SheMov deviate from the default style. --- archivemodel.cpp | 2 +- filesystemfileproxy.cpp | 3 ++- helper.cpp | 2 +- newpicsdialog.cpp | 2 +- picfilesmodel.cpp | 2 +- smtreeitem.cpp | 9 --------- smtreeitem.h | 3 --- smtreemodel.cpp | 4 ---- 8 files changed, 6 insertions(+), 21 deletions(-) diff --git a/archivemodel.cpp b/archivemodel.cpp index b4a1e2b..0f266ca 100644 --- a/archivemodel.cpp +++ b/archivemodel.cpp @@ -827,7 +827,7 @@ QVariant ArchiveFilesModel::data(const QModelIndex &index, int role) const { case Md5Sum: case FullPath: case SizeDur: - return QFont("courier new"); + return QFont("Monospace"); } } if(role == Qt::DecorationRole){ diff --git a/filesystemfileproxy.cpp b/filesystemfileproxy.cpp index 1267560..524456c 100644 --- a/filesystemfileproxy.cpp +++ b/filesystemfileproxy.cpp @@ -50,7 +50,8 @@ QVariant FilesystemFileProxy::data(const QModelIndex &index, int role) const{ } if(role == Qt::FontRole){ if(index.column() == SmDirModel::Md5sum || index.column() == SmDirModel::DurSize || index.column() == SmDirModel::Bitrate){ - return QFont("courier"); + + return QFont("Monospace"); } } return QSortFilterProxyModel::data(index, role); diff --git a/helper.cpp b/helper.cpp index 102e0f3..3a1e780 100644 --- a/helper.cpp +++ b/helper.cpp @@ -291,7 +291,7 @@ namespace Helper { QImage retval(tf.fileName()); retval = retval.scaledToWidth(640); Duration dur(where); - QFont font("courier", 10); + QFont font("Monospace", 10); QFontMetrics fm(font); int width = fm.width(dur.toString()); int height = fm.height(); diff --git a/newpicsdialog.cpp b/newpicsdialog.cpp index decdf4d..a325863 100644 --- a/newpicsdialog.cpp +++ b/newpicsdialog.cpp @@ -213,7 +213,7 @@ QVariant NewPicFilesModel::data(const QModelIndex &index, int role) const{ } } if(role == Qt::FontRole && index.column() == Md5Sum){ - return QFont("courier"); + return QFont("Monospace"); } return SmTreeModel::data(index, role); } diff --git a/picfilesmodel.cpp b/picfilesmodel.cpp index 21344dc..ea51beb 100644 --- a/picfilesmodel.cpp +++ b/picfilesmodel.cpp @@ -36,7 +36,7 @@ void PicFilesModel::setMapping(int pMapId){ QVariant PicFilesModel::data(const QModelIndex &index, int role) const { if(role == Qt::FontRole){ if(index.column() == Md5Sum){ - return QFont("courier"); + return QFont("Monospace"); } } if(role == Qt::ForegroundRole){ diff --git a/smtreeitem.cpp b/smtreeitem.cpp index a8e183c..559bcd3 100644 --- a/smtreeitem.cpp +++ b/smtreeitem.cpp @@ -21,7 +21,6 @@ SmTreeItem::SmTreeItem(int rows, SmTreeItem *parent) : mParent(parent){ SmTreeItem::SmTreeItem(const SmTreeItem &other){ mParent = 0; mData = other.mData; - mForegroundColor = other.mForegroundColor; } SmTreeItem::~SmTreeItem(){ @@ -81,14 +80,6 @@ void SmTreeItem::setData(int column, const QVariant &data){ mData[column] = data; } -QVariant SmTreeItem::foregroundColor() const{ - return mForegroundColor; -} - -void SmTreeItem::setForegroundColor(const QVariant &data){ - mForegroundColor = data; -} - bool SmTreeItem::insertChild(int where, SmTreeItem *child){ if((where < 0) || (where > mChildren.count())){ return false; diff --git a/smtreeitem.h b/smtreeitem.h index 4e5265c..4021a3a 100644 --- a/smtreeitem.h +++ b/smtreeitem.h @@ -26,8 +26,6 @@ class SmTreeItem { void setParent(SmTreeItem *parent); QVariant data(int column) const; void setData(int column, const QVariant &data); - QVariant foregroundColor() const; - void setForegroundColor(const QVariant &data); bool insertChild(int where, SmTreeItem *child); bool removeChild(int where, bool deleteChild = true); friend class ArchiveCollector; @@ -36,7 +34,6 @@ class SmTreeItem { SmTreeItem(const SmTreeItem &other); QList mChildren; QList mData; - QVariant mForegroundColor; SmTreeItem *mParent; }; diff --git a/smtreemodel.cpp b/smtreemodel.cpp index d797f36..b909fcd 100644 --- a/smtreemodel.cpp +++ b/smtreemodel.cpp @@ -113,10 +113,6 @@ QVariant SmTreeModel::data(const QModelIndex &index, int role) const{ return mDecorationIcon; } } - if(role == Qt::ForegroundRole){ - QColor fgCol = item->foregroundColor().value(); - return QBrush(fgCol); - } return QVariant(); } -- cgit v1.2.3-70-g09d2