adopt for QtCreator 8, separate build
This commit is contained in:
@@ -1,7 +1,13 @@
|
|||||||
#cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.17)
|
||||||
#project(ProjectFilesystemPlugin)
|
project(ProjectFilesystemPlugin)
|
||||||
#include($ENV{SDK_QTCREATOR_SRC}/cmake/QtCreatorAPI.cmake)
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
find_package(QtCreator COMPONENTS Core REQUIRED)
|
||||||
file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc")
|
file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc")
|
||||||
add_qtc_plugin(ProjectFilesystemPlugin
|
add_qtc_plugin(ProjectFilesystemPlugin
|
||||||
PLUGIN_DEPENDS Core ProjectExplorer
|
PLUGIN_DEPENDS
|
||||||
SOURCES ${SRC})
|
QtCreator::Core
|
||||||
|
QtCreator::ProjectExplorer
|
||||||
|
SOURCES ${SRC})
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/projectexplorericons.h>
|
#include <projectexplorer/projectexplorericons.h>
|
||||||
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/projecttreewidget.h>
|
#include <projectexplorer/projecttreewidget.h>
|
||||||
#include <projectexplorer/projecttree.h>
|
#include <projectexplorer/projecttree.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
@@ -389,7 +390,7 @@ void ProjectFilesystemWidget::on_tree_itemDoubleClicked(QTreeWidgetItem * item,
|
|||||||
bool dir = item->data(0, roleIsDir).toBool();
|
bool dir = item->data(0, roleIsDir).toBool();
|
||||||
if (dir) return;
|
if (dir) return;
|
||||||
if (afp.isEmpty()) return;
|
if (afp.isEmpty()) return;
|
||||||
Core::EditorManager::openEditor(afp);
|
Core::EditorManager::openEditor(Utils::FilePath::fromString(afp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -464,7 +465,7 @@ void ProjectFilesystemWidget::on_tree_customContextMenuRequested(const QPoint &
|
|||||||
|
|
||||||
void ProjectFilesystemWidget::on_actionOpen_here_triggered() {
|
void ProjectFilesystemWidget::on_actionOpen_here_triggered() {
|
||||||
if (projectfs_menu_target.path().isEmpty()) return;
|
if (projectfs_menu_target.path().isEmpty()) return;
|
||||||
Core::EditorManager::openEditor(projectfs_menu_target.absoluteFilePath(), Core::Constants::K_DEFAULT_TEXT_EDITOR_ID);
|
Core::EditorManager::openEditor(Utils::FilePath::fromString(projectfs_menu_target.absoluteFilePath()), Core::Constants::K_DEFAULT_TEXT_EDITOR_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user