命名规范

This commit is contained in:
2026-07-29 12:30:40 +08:00
parent f5f1bf9cc7
commit 18edce4838
59 changed files with 1690 additions and 1795 deletions
+17 -17
View File
@@ -2,23 +2,23 @@
#include "CustomFileDelegate.h"
FileExplorer::FileExplorer() {
file_explorer::file_explorer() {
model = new QFileSystemModel(this);
resize(1000, 800);
treeView = new QTreeView(this);
treeView->setModel(model);
it = new CustomFileDelegate(this, treeView);
treeView->setItemDelegate(it);
treeView->setHeaderHidden(false);
treeView->setColumnWidth(0, 250);
treeView->setAnimated(true);
treeView->setSortingEnabled(true);
treeView->setSelectionMode(QAbstractItemView::SingleSelection);
tree_view = new QTreeView(this);
tree_view->setModel(model);
it = new Custom_File_Delegate(this, tree_view);
tree_view->setItemDelegate(it);
tree_view->setHeaderHidden(false);
tree_view->setColumnWidth(0, 250);
tree_view->setAnimated(true);
tree_view->setSortingEnabled(true);
tree_view->setSelectionMode(QAbstractItemView::SingleSelection);
layout = new QVBoxLayout(this);
showRootDir = new QLineEdit;
show_root_dir = new QLineEdit;
showFocusFile = new QLabel;
layout->addWidget(showRootDir);
layout->addWidget(treeView);
layout->addWidget(show_root_dir);
layout->addWidget(tree_view);
auto bottom = new QHBoxLayout();
confirmButton = new QPushButton("确定");
cancelButton = new QPushButton("取消");
@@ -29,12 +29,12 @@ FileExplorer::FileExplorer() {
bottom->addWidget(confirmButton);
bottom->addWidget(cancelButton);
layout->addLayout(bottom);
changeRoot("D:/");
change_root("D:/");
connect(showRootDir, &QLineEdit::returnPressed, [this](){
changeRoot(showRootDir->text());
connect(show_root_dir, &QLineEdit::returnPressed, [this](){
change_root(show_root_dir->text());
});
connect(treeView, &QTreeView::clicked, [this](const QModelIndex &index) {
connect(tree_view, &QTreeView::clicked, [this](const QModelIndex &index) {
focus = model->fileInfo(index);
showFocusFile->setText(focus.fileName());
});