From be361dcf94e8813cd550eaaab9528ffaffe2f7bb Mon Sep 17 00:00:00 2001 From: EndrII Date: Tue, 8 Jun 2021 17:15:38 +0300 Subject: [PATCH] fix readme --- README.md | 83 ++++++++++++++---------- ViewSolutions/src/colorpicker.h | 2 +- ViewSolutions/src/listviewmodel.cpp | 2 +- ViewSolutions/src/listviewmodel.h | 2 +- ViewSolutions/src/qmlcolorpicker.h | 2 +- ViewSolutions/src/viewsolutions.h | 2 +- ViewSolutions/src/viewsolutions_global.h | 4 +- 7 files changed, 54 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 02796e2..db8b44d 100644 --- a/README.md +++ b/README.md @@ -1,50 +1,61 @@ # ViewSolutions + View solutions of qml for quasarapp projects +## QML classes: -QML classes: #### ImageView + This is animate image viewer + ##### Example: -``` qml - ImageView { - anchors.fill: parent - soucre: "qrc:/img/images/example.png" - text: "exampele" - anchors.margins: 100 - borderColor: "red" - } +```qml +import ViewSolutionsModule 1.0 + +ImageView { + + anchors.fill: parent + soucre: "qrc:/img/images/example.png" + text: "exampele" + anchors.margins: 100 + borderColor: "red" +} ``` #### ViewPortPage + This is animate Delegate viewer for ListView + ##### Example: -``` qml - ListView { - id: viewPort - property real globalPos: 0 - anchors.fill: parent - delegate: Component { - ViewPortPage { - viewPortDelegatH: 500 // base size of content item - scrollPos: viewPort.globalPos // due to qml limitations, this field will have to be tied to updating the location of the scroll - source: modelData - viewground: root // this is plane to display the main background - title: "Test ViewPortPage" - text: "Test ViewPortPage. General text and html code" - } + +```qml +import ViewSolutionsModule 1.0 + +ListView { + id: viewPort + property real globalPos: 0 + anchors.fill: parent + delegate: Component { + ViewPortPage { + viewPortDelegatH: 500 // base size of content item + scrollPos: viewPort.globalPos // due to qml limitations, this field will have to be tied to updating the location of the scroll + source: modelData + viewground: root // this is plane to display the main background + title: "Test ViewPortPage" + text: "Test ViewPortPage. General text and html code" } - - ScrollBar.vertical: ScrollBar { - onPositionChanged: { - viewPort.globalPos = position - } - } - - - model: [ - "qrc:/img/res/LOGO.png", - "qrc:/img/res/LOGO-GREAN.png", - ] } -``` \ No newline at end of file + + ScrollBar.vertical: ScrollBar { + onPositionChanged: { + viewPort.globalPos = position + } + } + + + model: [ + "qrc:/img/res/LOGO.png", + "qrc:/img/res/LOGO-GREAN.png", + ] +} +``` diff --git a/ViewSolutions/src/colorpicker.h b/ViewSolutions/src/colorpicker.h index b66b17f..a512f00 100644 --- a/ViewSolutions/src/colorpicker.h +++ b/ViewSolutions/src/colorpicker.h @@ -9,7 +9,7 @@ namespace ViewSolutions { /** * @brief The ColorPicker class - This class provide methods of get generals colors from images. */ -class LOGINVIEW_EXPORT ColorPicker +class VIEWSOLUTION_EXPORT ColorPicker { public: explicit ColorPicker(); diff --git a/ViewSolutions/src/listviewmodel.cpp b/ViewSolutions/src/listviewmodel.cpp index 516045c..21bcd7a 100644 --- a/ViewSolutions/src/listviewmodel.cpp +++ b/ViewSolutions/src/listviewmodel.cpp @@ -77,7 +77,7 @@ void ListViewModel::addSource(QObject* data) { } void ListViewModel::clear(bool fast) { - for (auto i : _data) { + for (auto i : qAsConst(_data)) { if (fast) { i->deleteLater(); } else { diff --git a/ViewSolutions/src/listviewmodel.h b/ViewSolutions/src/listviewmodel.h index 281431d..eb7a5ed 100644 --- a/ViewSolutions/src/listviewmodel.h +++ b/ViewSolutions/src/listviewmodel.h @@ -9,7 +9,7 @@ enum class ListViewModelRoles { ModelData = Qt::UserRole }; -class LOGINVIEW_EXPORT ListViewModel: public QAbstractListModel +class VIEWSOLUTION_EXPORT ListViewModel: public QAbstractListModel { Q_OBJECT public: diff --git a/ViewSolutions/src/qmlcolorpicker.h b/ViewSolutions/src/qmlcolorpicker.h index 812c8bf..8eba381 100644 --- a/ViewSolutions/src/qmlcolorpicker.h +++ b/ViewSolutions/src/qmlcolorpicker.h @@ -10,7 +10,7 @@ namespace ViewSolutions { /** * @brief The QMLColorPicker class - Qml wrapper for ColorPicker class. */ -class LOGINVIEW_EXPORT QMLColorPicker : public QObject, private ColorPicker +class VIEWSOLUTION_EXPORT QMLColorPicker : public QObject, private ColorPicker { Q_OBJECT public: diff --git a/ViewSolutions/src/viewsolutions.h b/ViewSolutions/src/viewsolutions.h index 3ebba83..80777df 100644 --- a/ViewSolutions/src/viewsolutions.h +++ b/ViewSolutions/src/viewsolutions.h @@ -18,7 +18,7 @@ namespace ViewSolutions { /** * @brief init this method import all qml resources to your project. */ - bool LOGINVIEW_EXPORT init(QQmlApplicationEngine *engine); + bool VIEWSOLUTION_EXPORT init(QQmlApplicationEngine *engine); } #endif // VIEWSOLUTIONS_H diff --git a/ViewSolutions/src/viewsolutions_global.h b/ViewSolutions/src/viewsolutions_global.h index 009db71..25ccaa3 100644 --- a/ViewSolutions/src/viewsolutions_global.h +++ b/ViewSolutions/src/viewsolutions_global.h @@ -11,9 +11,9 @@ #include #if defined(VIEW_SOLUTIONS_LIBRARY) -# define LOGINVIEW_EXPORT Q_DECL_EXPORT +# define VIEWSOLUTION_EXPORT Q_DECL_EXPORT #else -# define LOGINVIEW_EXPORT Q_DECL_IMPORT +# define VIEWSOLUTION_EXPORT Q_DECL_IMPORT #endif