ViewSolutions
1.0.100.30ae2aa
View solutions of qml for quasarapp projects
Toggle main menu visibility
Loading...
Searching...
No Matches
viewsolutions.cpp
Go to the documentation of this file.
1
//#
2
//# Copyright (C) 2020-2025 QuasarApp.
3
//# Distributed under the GPLv3 software license, see the accompanying
4
//# Everyone is permitted to copy and distribute verbatim copies
5
//# of this license document, but changing it is not allowed.
6
//#
7
8
#include "
variantlistmodel.h
"
9
#include "
viewsolutions.h
"
10
#include <QQmlContext>
11
#include <
qmlcolorpicker.h
>
12
#include <QQmlApplicationEngine>
13
#include <QFile>
14
#include <QDir>
15
#include <
modelstorage.h
>
16
17
namespace
ViewSolutions
{
18
QSharedPointer<ModelStorage>
init
(QQmlEngine *engine) {
19
20
if
(!engine)
21
return
nullptr
;
22
23
auto
root = engine->rootContext();
24
if
(!root)
25
return
nullptr
;
26
27
initResources
();
28
29
auto
&& storage = QSharedPointer<ModelStorage>::create(engine);
30
QQmlEngine::setObjectOwnership(storage.get(), QQmlEngine::CppOwnership);
31
32
root->setContextProperty(
"modelsStorage"
, storage.get());
33
34
auto
&& picker = QSharedPointer<QMLColorPicker>::create();
35
storage->addModel(picker);
36
37
// to-do - remove
38
root->setContextProperty(
"colorPicker"
, picker.get());
39
40
qRegisterMetaType<VariantListModel>(
"VariantListModel"
);
41
42
return
storage;
43
}
44
}
modelstorage.h
ViewSolutions
The ViewSolutions namespace.
Definition
avatargenerator.cpp:14
ViewSolutions::init
QSharedPointer< ModelStorage > init(QQmlEngine *engine)
init this method import all qml resources to your project and creates the central model storage of th...
Definition
viewsolutions.cpp:18
qmlcolorpicker.h
variantlistmodel.h
viewsolutions.h
initResources
void initResources()
initResources loads the QML resources of the ViewSolutions module.
Definition
viewsolutions.h:32
ViewSolutions
src
viewsolutions.cpp
Generated by
1.18.0