summaryrefslogtreecommitdiff
path: root/launcher/ui/widgets/ModListView.cpp
diff options
context:
space:
mode:
authorMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 17:36:40 +0300
committerMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 17:36:40 +0300
commit1d4bf6e8b1208383021e22f61d859e9b721c482d (patch)
tree21c8e0c4350d7c44d817243ebf409be625ea4f21 /launcher/ui/widgets/ModListView.cpp
parent38c57e163abad6216f7e0f44d401c362c5fd5da6 (diff)
downloadProject-Tick-1d4bf6e8b1208383021e22f61d859e9b721c482d.tar.gz
Project-Tick-1d4bf6e8b1208383021e22f61d859e9b721c482d.zip
NOISSUE reformat MeshMC to new clang format rules and fixed macOS portability issue and java find issue
Signed-off-by: Mehmet Samet Duman <yongdohyun@projecttick.org>
Diffstat (limited to 'launcher/ui/widgets/ModListView.cpp')
-rw-r--r--launcher/ui/widgets/ModListView.cpp75
1 files changed, 35 insertions, 40 deletions
diff --git a/launcher/ui/widgets/ModListView.cpp b/launcher/ui/widgets/ModListView.cpp
index 2ec4492f2c..8da7896bd0 100644
--- a/launcher/ui/widgets/ModListView.cpp
+++ b/launcher/ui/widgets/ModListView.cpp
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
+ *
* This file incorporates work covered by the following copyright and
* permission notice:
*
@@ -43,47 +43,42 @@
#include <QDrag>
#include <QRect>
-ModListView::ModListView ( QWidget* parent )
- :QTreeView ( parent )
+ModListView::ModListView(QWidget* 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 )
+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);
+ }
}