Skip to content

Commit

Permalink
feat: Selected effects in the rune plugin were replaced
Browse files Browse the repository at this point in the history
Selected effects in the rune plugin were replaced
  • Loading branch information
JWWTSL committed Nov 24, 2023
1 parent 8796f54 commit b1f627e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 68 deletions.
2 changes: 0 additions & 2 deletions src/plugins/symbol/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ find_package(Clang REQUIRED)
include_directories(${CLANG_INCLUDE_DIRS})

set(CXX_CPP
mainframe/symboldelegate.cpp
mainframe/symbolmodel.cpp
mainframe/symboltreeview.cpp
mainframe/symbolkeeper.cpp
Expand All @@ -20,7 +19,6 @@ set(CXX_CPP

set(CXX_H
mainframe/definitions.h
mainframe/symboldelegate.h
mainframe/symbolmodel.h
mainframe/symboltreeview.h
mainframe/symbolkeeper.h
Expand Down
36 changes: 0 additions & 36 deletions src/plugins/symbol/mainframe/symboldelegate.cpp

This file was deleted.

24 changes: 0 additions & 24 deletions src/plugins/symbol/mainframe/symboldelegate.h

This file was deleted.

9 changes: 3 additions & 6 deletions src/plugins/symbol/mainframe/symboltreeview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

#include "services/project/projectservice.h"

#include "symboldelegate.h"

#include <DMenu>
#include <DTreeView>
#include <DWidget>
Expand All @@ -25,7 +23,6 @@ class SymbolTreeViewPrivate
SymbolTreeView *const q;
QModelIndex selIndex;
QFileSystemModel *model {nullptr};
SymbolDelegate *delegate = {nullptr};
DMenu *getFileLineMenu(const QString &filePath);
SymbolTreeViewPrivate(SymbolTreeView *qq): q(qq){}

Check warning on line 27 in src/plugins/symbol/mainframe/symboltreeview.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Class 'SymbolTreeViewPrivate' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided.
};
Expand All @@ -35,22 +32,22 @@ SymbolTreeView::SymbolTreeView(DWidget *parent)
, d (new SymbolTreeViewPrivate(this))
{
d->model = new SymbolModel();
d->delegate = new SymbolDelegate;
DTreeView::setModel(d->model);
DTreeView::setItemDelegate(d->delegate);

setContextMenuPolicy(Qt::CustomContextMenu);
setEditTriggers(DTreeView::NoEditTriggers); //节点不能编辑
setSelectionBehavior(DTreeView::SelectRows); //一次选中整行
setSelectionMode(DTreeView::SingleSelection); //单选,配合上面的整行就是一次选单行
setFocusPolicy(Qt::NoFocus); //去掉鼠标移到节点上时的虚线框
header()->setVisible(false);

QObject::connect(this, &DTreeView::doubleClicked,
this, &SymbolTreeView::doDoubleClieked,
Qt::UniqueConnection);
QObject::connect(this, &DTreeView::customContextMenuRequested,
this, &SymbolTreeView::doContextMenu,
Qt::UniqueConnection);


}

SymbolTreeView::~SymbolTreeView()
Expand Down

0 comments on commit b1f627e

Please sign in to comment.