mirror of
https://github.com/QRouland/UTPass.git
synced 2025-06-30 01:02:29 +00:00
Initial Commit
This commit is contained in:
25
plugins/FileSystem/CMakeLists.txt
Normal file
25
plugins/FileSystem/CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
set(PLUGIN "FileSystem")
|
||||
|
||||
set(
|
||||
SRC
|
||||
plugin.cpp
|
||||
filesystem.cpp
|
||||
)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
add_library(${PLUGIN} MODULE ${SRC})
|
||||
set_target_properties(${PLUGIN} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PLUGIN})
|
||||
qt5_use_modules(${PLUGIN} Qml Quick DBus)
|
||||
|
||||
execute_process(
|
||||
COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
|
||||
OUTPUT_VARIABLE ARCH_TRIPLET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
set(QT_IMPORTS_DIR "/lib/${ARCH_TRIPLET}")
|
||||
|
||||
install(TARGETS ${PLUGIN} DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN}/)
|
||||
install(FILES qmldir DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN}/)
|
11
plugins/FileSystem/filesystem.cpp
Normal file
11
plugins/FileSystem/filesystem.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include <QDebug>
|
||||
|
||||
#include "filesystem.h"
|
||||
|
||||
FileSystem::FileSystem() {
|
||||
|
||||
}
|
||||
|
||||
void FileSystem::list_dir() {
|
||||
qDebug() << "hello world!";
|
||||
}
|
16
plugins/FileSystem/filesystem.h
Normal file
16
plugins/FileSystem/filesystem.h
Normal file
@ -0,0 +1,16 @@
|
||||
#ifndef PASS_H
|
||||
#define PASS_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class FileSystem: public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FileSystem();
|
||||
~FileSystem() = default;
|
||||
|
||||
Q_INVOKABLE void list_dir();
|
||||
};
|
||||
|
||||
#endif
|
10
plugins/FileSystem/plugin.cpp
Normal file
10
plugins/FileSystem/plugin.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
#include <QtQml>
|
||||
#include <QtQml/QQmlContext>
|
||||
|
||||
#include "plugin.h"
|
||||
#include "filesystem.h"
|
||||
|
||||
void FileSystemPlugin::registerTypes(const char *uri) {
|
||||
//@uri Pass
|
||||
qmlRegisterSingletonType<FileSystem>(uri, 1, 0, "FileSystem", [](QQmlEngine*, QJSEngine*) -> QObject* { return new FileSystem; });
|
||||
}
|
14
plugins/FileSystem/plugin.h
Normal file
14
plugins/FileSystem/plugin.h
Normal file
@ -0,0 +1,14 @@
|
||||
#ifndef PASSPLUGIN_H
|
||||
#define PASSPLUGIN_H
|
||||
|
||||
#include <QQmlExtensionPlugin>
|
||||
|
||||
class FileSystemPlugin : public QQmlExtensionPlugin {
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
|
||||
|
||||
public:
|
||||
void registerTypes(const char *uri);
|
||||
};
|
||||
|
||||
#endif
|
2
plugins/FileSystem/qmldir
Normal file
2
plugins/FileSystem/qmldir
Normal file
@ -0,0 +1,2 @@
|
||||
module FileSystem
|
||||
plugin FileSystem
|
Reference in New Issue
Block a user