1
0
mirror of https://github.com/QRouland/UTPass.git synced 2025-06-30 01:02:29 +00:00

Initial Commit

This commit is contained in:
2019-03-13 19:38:12 +01:00
commit 851e0348c2
41 changed files with 1479 additions and 0 deletions

View 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}/)

View File

@ -0,0 +1,11 @@
#include <QDebug>
#include "filesystem.h"
FileSystem::FileSystem() {
}
void FileSystem::list_dir() {
qDebug() << "hello world!";
}

View 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

View 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; });
}

View 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

View File

@ -0,0 +1,2 @@
module FileSystem
plugin FileSystem