moved TextWithHeader to new module

This commit is contained in:
Yuri Kozyrev 2022-07-04 19:47:36 +04:00
parent 33fbd154ce
commit 52e2e73871
14 changed files with 482 additions and 3 deletions

View File

@ -2,6 +2,7 @@ import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import TextWithHeader 1.0
ColumnLayout{
Rectangle{

View File

@ -23,7 +23,7 @@ int main(int argc, char *argv[])
}
QQmlApplicationEngine engine;
const QUrl url(QStringLiteral("/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorDistInfo/AlteratorDistInfo.qml"));
const QUrl url(QStringLiteral("/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorDistInfo/DistInfo.qml"));
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl)

View File

@ -4,7 +4,6 @@
<file>AlteratorToolBar.qml</file>
<file>AlteratorWindow.qml</file>
<file>DistInfo.qml</file>
<file>TextWithHeader.qml</file>
<file>Test.qml</file>
</qresource>
</RCC>

View File

@ -0,0 +1,73 @@
# This file is used to ignore files which are generated
# ----------------------------------------------------------------------------
*~
*.autosave
*.a
*.core
*.moc
*.o
*.obj
*.orig
*.rej
*.so
*.so.*
*_pch.h.cpp
*_resource.rc
*.qm
.#*
*.*#
core
!core/
tags
.DS_Store
.directory
*.debug
Makefile*
*.prl
*.app
moc_*.cpp
ui_*.h
qrc_*.cpp
Thumbs.db
*.res
*.rc
/.qmake.cache
/.qmake.stash
# qtcreator generated files
*.pro.user*
# xemacs temporary files
*.flc
# Vim temporary files
.*.swp
# Visual Studio generated files
*.ib_pdb_index
*.idb
*.ilk
*.pdb
*.sln
*.suo
*.vcproj
*vcproj.*.*.user
*.ncb
*.sdf
*.opensdf
*.vcxproj
*vcxproj.*
# MinGW generated files
*.Debug
*.Release
# Python byte code
*.pyc
# Binaries
# --------
*.dll
*.exe

View File

@ -0,0 +1,34 @@
TEMPLATE = lib
TARGET = Test
QT += qml quick
CONFIG += plugin c++11
TARGET = $$qtLibraryTarget($$TARGET)
uri = com.mycompany.qmlcomponents
# Input
SOURCES += \
test_plugin.cpp \
myitem.cpp
HEADERS += \
test_plugin.h \
myitem.h
DISTFILES = qmldir
!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
copy_qmldir.target = $$OUT_PWD/qmldir
copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir
copy_qmldir.commands = $(COPY_FILE) "$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)" "$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)"
QMAKE_EXTRA_TARGETS += copy_qmldir
PRE_TARGETDEPS += $$copy_qmldir.target
}
qmldir.files = qmldir
unix {
installPath = $$[QT_INSTALL_QML]/$$replace(uri, \., /)
qmldir.path = $$installPath
target.path = $$installPath
INSTALLS += target qmldir
}

View File

@ -0,0 +1,15 @@
#include "myitem.h"
MyItem::MyItem(QQuickItem *parent)
: QQuickItem(parent)
{
// By default, QQuickItem does not draw anything. If you subclass
// QQuickItem to create a visual item, you will need to uncomment the
// following line and re-implement updatePaintNode()
// setFlag(ItemHasContents, true);
}
MyItem::~MyItem()
{
}

View File

@ -0,0 +1,16 @@
#ifndef MYITEM_H
#define MYITEM_H
#include <QQuickItem>
class MyItem : public QQuickItem
{
Q_OBJECT
Q_DISABLE_COPY(MyItem)
public:
explicit MyItem(QQuickItem *parent = nullptr);
~MyItem() override;
};
#endif // MYITEM_H

View File

@ -0,0 +1,2 @@
module com.mycompany.qmlcomponents
plugin Test

View File

@ -0,0 +1,12 @@
#include "test_plugin.h"
#include "myitem.h"
#include <qqml.h>
void TestPlugin::registerTypes(const char *uri)
{
// @uri com.mycompany.qmlcomponents
qmlRegisterType<MyItem>(uri, 1, 0, "MyItem");
}

View File

@ -0,0 +1,15 @@
#ifndef TEST_PLUGIN_H
#define TEST_PLUGIN_H
#include <QQmlExtensionPlugin>
class TestPlugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
public:
void registerTypes(const char *uri) override;
};
#endif // TEST_PLUGIN_H

View File

@ -18,6 +18,7 @@ AlteratorLoader::AlteratorLoader(QObject *p)
void AlteratorLoader::open(QString targetUrl){
QString windowId = QUuid::createUuid().toString();
QQmlApplicationEngine *engine = new QQmlApplicationEngine(windowUrl, parent);
engine->addImportPath("/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator");
QObject *window = engine->rootObjects().at(0);
window->setProperty("url", targetUrl);
window->setProperty("windowId", windowId);
@ -55,7 +56,6 @@ void AlteratorLoader::moveReq(QString senderId, QString targetUrl){
void AlteratorLoader::closed(QString senderId){
past.remove(senderId);
future.remove(senderId);
widgets[senderId]->quit();
widgets[senderId]->deleteLater();
widgets.remove(senderId);
if(widgets.isEmpty()) {

View File

@ -0,0 +1,310 @@
[
{
"arguments": [
"clang",
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders",
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/.private/kozyrevid/QtCreator-VphRSC/clang-uiheader-CkfDhN",
"-nostdinc",
"-nostdinc++",
"-pipe",
"-g",
"-std=gnu++11",
"-Wall",
"-Wextra",
"-D_REENTRANT",
"-fPIC",
"-fsyntax-only",
"-m64",
"--target=x86_64-alt-linux",
"-DQ_CREATOR_RUN",
"-DQT_QML_DEBUG",
"-DQT_PLUGIN",
"-DQT_QUICK_LIB",
"-DQT_GUI_LIB",
"-DQT_QMLMODELS_LIB",
"-DQT_QML_LIB",
"-DQT_NETWORK_LIB",
"-DQT_CORE_LIB",
"-I",
"/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/Test",
"-I",
"/usr/include/qt5",
"-I",
"/usr/include/qt5/QtQuick",
"-I",
"/usr/include/qt5/QtGui",
"-I",
"/usr/include/qt5/QtQmlModels",
"-I",
"/usr/include/qt5/QtQml",
"-I",
"/usr/include/qt5/QtNetwork",
"-I",
"/usr/include/qt5/QtCore",
"-I",
"/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/build-Test-Desktop-Debug",
"-I",
"/usr/lib64/qt5/mkspecs/linux-g++",
"-isystem",
"/usr/include/c++/10",
"-isystem",
"/usr/include/c++/10/x86_64-alt-linux",
"-isystem",
"/usr/include/c++/10/backward",
"-isystem",
"/usr/local/include",
"-isystem",
"/usr/lib/llvm-12.0/lib64/clang/12.0.1/include",
"-isystem",
"/usr/include",
"-fmessage-length=0",
"-fdiagnostics-show-note-include-stack",
"-fretain-comments-from-system-headers",
"-fmacro-backtrace-limit=0",
"-ferror-limit=1000",
"-x",
"c++",
"-Wno-unknown-pragmas",
"-Wno-unknown-warning-option",
"-Wno-documentation-unknown-command",
"/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/Test/test_plugin.cpp"
],
"directory": "/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/build-Test-Desktop-Debug/.qtc_clangd",
"file": "/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/Test/test_plugin.cpp"
},
{
"arguments": [
"clang",
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders",
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/.private/kozyrevid/QtCreator-VphRSC/clang-uiheader-CkfDhN",
"-nostdinc",
"-nostdinc++",
"-pipe",
"-g",
"-std=gnu++11",
"-Wall",
"-Wextra",
"-D_REENTRANT",
"-fPIC",
"-fsyntax-only",
"-m64",
"--target=x86_64-alt-linux",
"-DQ_CREATOR_RUN",
"-DQT_QML_DEBUG",
"-DQT_PLUGIN",
"-DQT_QUICK_LIB",
"-DQT_GUI_LIB",
"-DQT_QMLMODELS_LIB",
"-DQT_QML_LIB",
"-DQT_NETWORK_LIB",
"-DQT_CORE_LIB",
"-I",
"/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/Test",
"-I",
"/usr/include/qt5",
"-I",
"/usr/include/qt5/QtQuick",
"-I",
"/usr/include/qt5/QtGui",
"-I",
"/usr/include/qt5/QtQmlModels",
"-I",
"/usr/include/qt5/QtQml",
"-I",
"/usr/include/qt5/QtNetwork",
"-I",
"/usr/include/qt5/QtCore",
"-I",
"/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/build-Test-Desktop-Debug",
"-I",
"/usr/lib64/qt5/mkspecs/linux-g++",
"-isystem",
"/usr/include/c++/10",
"-isystem",
"/usr/include/c++/10/x86_64-alt-linux",
"-isystem",
"/usr/include/c++/10/backward",
"-isystem",
"/usr/local/include",
"-isystem",
"/usr/lib/llvm-12.0/lib64/clang/12.0.1/include",
"-isystem",
"/usr/include",
"-fmessage-length=0",
"-fdiagnostics-show-note-include-stack",
"-fretain-comments-from-system-headers",
"-fmacro-backtrace-limit=0",
"-ferror-limit=1000",
"-x",
"c++",
"-Wno-unknown-pragmas",
"-Wno-unknown-warning-option",
"-Wno-documentation-unknown-command",
"/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/Test/myitem.cpp"
],
"directory": "/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/build-Test-Desktop-Debug/.qtc_clangd",
"file": "/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/Test/myitem.cpp"
},
{
"arguments": [
"clang",
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders",
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/.private/kozyrevid/QtCreator-VphRSC/clang-uiheader-CkfDhN",
"-nostdinc",
"-nostdinc++",
"-pipe",
"-g",
"-std=gnu++11",
"-Wall",
"-Wextra",
"-D_REENTRANT",
"-fPIC",
"-fsyntax-only",
"-m64",
"--target=x86_64-alt-linux",
"-DQ_CREATOR_RUN",
"-DQT_QML_DEBUG",
"-DQT_PLUGIN",
"-DQT_QUICK_LIB",
"-DQT_GUI_LIB",
"-DQT_QMLMODELS_LIB",
"-DQT_QML_LIB",
"-DQT_NETWORK_LIB",
"-DQT_CORE_LIB",
"-I",
"/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/Test",
"-I",
"/usr/include/qt5",
"-I",
"/usr/include/qt5/QtQuick",
"-I",
"/usr/include/qt5/QtGui",
"-I",
"/usr/include/qt5/QtQmlModels",
"-I",
"/usr/include/qt5/QtQml",
"-I",
"/usr/include/qt5/QtNetwork",
"-I",
"/usr/include/qt5/QtCore",
"-I",
"/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/build-Test-Desktop-Debug",
"-I",
"/usr/lib64/qt5/mkspecs/linux-g++",
"-isystem",
"/usr/include/c++/10",
"-isystem",
"/usr/include/c++/10/x86_64-alt-linux",
"-isystem",
"/usr/include/c++/10/backward",
"-isystem",
"/usr/local/include",
"-isystem",
"/usr/lib/llvm-12.0/lib64/clang/12.0.1/include",
"-isystem",
"/usr/include",
"-fmessage-length=0",
"-fdiagnostics-show-note-include-stack",
"-fretain-comments-from-system-headers",
"-fmacro-backtrace-limit=0",
"-ferror-limit=1000",
"-x",
"c++-header",
"-Wno-unknown-pragmas",
"-Wno-unknown-warning-option",
"-Wno-documentation-unknown-command",
"/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/Test/test_plugin.h"
],
"directory": "/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/build-Test-Desktop-Debug/.qtc_clangd",
"file": "/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/Test/test_plugin.h"
},
{
"arguments": [
"clang",
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders",
"-I",
"/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/.private/kozyrevid/QtCreator-VphRSC/clang-uiheader-CkfDhN",
"-nostdinc",
"-nostdinc++",
"-pipe",
"-g",
"-std=gnu++11",
"-Wall",
"-Wextra",
"-D_REENTRANT",
"-fPIC",
"-fsyntax-only",
"-m64",
"--target=x86_64-alt-linux",
"-DQ_CREATOR_RUN",
"-DQT_QML_DEBUG",
"-DQT_PLUGIN",
"-DQT_QUICK_LIB",
"-DQT_GUI_LIB",
"-DQT_QMLMODELS_LIB",
"-DQT_QML_LIB",
"-DQT_NETWORK_LIB",
"-DQT_CORE_LIB",
"-I",
"/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/Test",
"-I",
"/usr/include/qt5",
"-I",
"/usr/include/qt5/QtQuick",
"-I",
"/usr/include/qt5/QtGui",
"-I",
"/usr/include/qt5/QtQmlModels",
"-I",
"/usr/include/qt5/QtQml",
"-I",
"/usr/include/qt5/QtNetwork",
"-I",
"/usr/include/qt5/QtCore",
"-I",
"/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/build-Test-Desktop-Debug",
"-I",
"/usr/lib64/qt5/mkspecs/linux-g++",
"-isystem",
"/usr/include/c++/10",
"-isystem",
"/usr/include/c++/10/x86_64-alt-linux",
"-isystem",
"/usr/include/c++/10/backward",
"-isystem",
"/usr/local/include",
"-isystem",
"/usr/lib/llvm-12.0/lib64/clang/12.0.1/include",
"-isystem",
"/usr/include",
"-fmessage-length=0",
"-fdiagnostics-show-note-include-stack",
"-fretain-comments-from-system-headers",
"-fmacro-backtrace-limit=0",
"-ferror-limit=1000",
"-x",
"c++-header",
"-Wno-unknown-pragmas",
"-Wno-unknown-warning-option",
"-Wno-documentation-unknown-command",
"/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/Test/myitem.h"
],
"directory": "/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/build-Test-Desktop-Debug/.qtc_clangd",
"file": "/home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/AlteratorLoader/Test/myitem.h"
}
]

View File

@ -0,0 +1,2 @@
module TextWithHeader
TextWithHeader 1.0 TextWithHeader.qml