diff options
author | Petr Mrázek <peterix@gmail.com> | 2018-07-15 14:51:05 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2018-07-15 14:51:05 +0200 |
commit | bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9 (patch) | |
tree | e6497e304b7b9368367565fbc7c06efab1124b1c /application/widgets/ModListView.cpp | |
parent | 03280cc62e75f8073f8d3d9e9e3952acf21fa77d (diff) | |
download | MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar.gz MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar.lz MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar.xz MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.zip |
NOISSUE tabs -> spaces
Diffstat (limited to 'application/widgets/ModListView.cpp')
-rw-r--r-- | application/widgets/ModListView.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/application/widgets/ModListView.cpp b/application/widgets/ModListView.cpp index 96e8d91b..6f084ba7 100644 --- a/application/widgets/ModListView.cpp +++ b/application/widgets/ModListView.cpp @@ -21,46 +21,46 @@ #include <QRect> ModListView::ModListView ( QWidget* parent ) - :QTreeView ( parent ) + :QTreeView ( parent ) { - setAllColumnsShowFocus ( true ); - setExpandsOnDoubleClick ( false ); - setRootIsDecorated ( false ); - setSortingEnabled ( true ); - setAlternatingRowColors ( true ); - setSelectionMode ( QAbstractItemView::ExtendedSelection ); - setHeaderHidden ( false ); - setSelectionBehavior(QAbstractItemView::SelectRows); - setVerticalScrollBarPolicy ( Qt::ScrollBarAlwaysOn ); - setHorizontalScrollBarPolicy ( Qt::ScrollBarAsNeeded ); - setDropIndicatorShown(true); - setDragEnabled(true); - setDragDropMode(QAbstractItemView::DropOnly); - viewport()->setAcceptDrops(true); + setAllColumnsShowFocus ( true ); + setExpandsOnDoubleClick ( false ); + setRootIsDecorated ( false ); + setSortingEnabled ( true ); + setAlternatingRowColors ( true ); + setSelectionMode ( QAbstractItemView::ExtendedSelection ); + setHeaderHidden ( false ); + setSelectionBehavior(QAbstractItemView::SelectRows); + setVerticalScrollBarPolicy ( Qt::ScrollBarAlwaysOn ); + setHorizontalScrollBarPolicy ( Qt::ScrollBarAsNeeded ); + setDropIndicatorShown(true); + setDragEnabled(true); + setDragDropMode(QAbstractItemView::DropOnly); + viewport()->setAcceptDrops(true); } void ModListView::setModel ( QAbstractItemModel* model ) { - QTreeView::setModel ( model ); - auto head = header(); - head->setStretchLastSection(false); - // HACK: this is true for the checkbox column of mod lists - auto string = model->headerData(0,head->orientation()).toString(); - if(head->count() < 1) - { - return; - } - if(!string.size()) - { - head->setSectionResizeMode(0, QHeaderView::ResizeToContents); - head->setSectionResizeMode(1, QHeaderView::Stretch); - for(int i = 2; i < head->count(); i++) - head->setSectionResizeMode(i, QHeaderView::ResizeToContents); - } - else - { - head->setSectionResizeMode(0, QHeaderView::Stretch); - for(int i = 1; i < head->count(); i++) - head->setSectionResizeMode(i, QHeaderView::ResizeToContents); - } + QTreeView::setModel ( model ); + auto head = header(); + head->setStretchLastSection(false); + // HACK: this is true for the checkbox column of mod lists + auto string = model->headerData(0,head->orientation()).toString(); + if(head->count() < 1) + { + return; + } + if(!string.size()) + { + head->setSectionResizeMode(0, QHeaderView::ResizeToContents); + head->setSectionResizeMode(1, QHeaderView::Stretch); + for(int i = 2; i < head->count(); i++) + head->setSectionResizeMode(i, QHeaderView::ResizeToContents); + } + else + { + head->setSectionResizeMode(0, QHeaderView::Stretch); + for(int i = 1; i < head->count(); i++) + head->setSectionResizeMode(i, QHeaderView::ResizeToContents); + } } |