Commit c3f109c2 authored by Thomas BOUTROUE's avatar Thomas BOUTROUE

Add a lot of missing files to Qbs project, and add RoundedRectangle shapes to repo

parent 0a43c978
Pipeline #1006 passed with stage
in 21 seconds
......@@ -13,15 +13,16 @@
#include "QQuickRowContainer.h"
#include "QQuickStackContainer.h"
#include "QQuickSvgIconHelper.h"
#include "QQuickRoundedRectangleItem.h"
#include "QQmlMimeIconsHelper.h"
#include "QQuickWindowIconHelper.h"
#include "QQmlIntrospector.h"
#include "QQmlFsSingleton.h"
#include "QQmlVariantListModel.h"
#include <qqml.h>
void QtQmlTricks::registerComponents (QQmlEngine * engine) {
Q_UNUSED (engine)
static const QString ERR_ENUM_CLASS { QStringLiteral ("Enum-class !") };
static const QString ERR_ATTACHED_OBJ { QStringLiteral ("Attached-object class !") };
static const QString ERR_ABSTRACT_BASE { QStringLiteral ("Abstract base class !") };
......@@ -31,13 +32,20 @@ void QtQmlTricks::registerComponents (QQmlEngine * engine) {
qmlRegisterType<QQuickFormContainer> ("QtQmlTricks", 3, 0, "FormContainer");
qmlRegisterType<QQuickRowContainer> ("QtQmlTricks", 3, 0, "RowContainer");
qmlRegisterType<QQuickFastObjectListView> ("QtQmlTricks", 3, 0, "FastObjectListView");
qmlRegisterUncreatableType<VerticalDirections> ("QtQmlTricks", 3, 0, "VerticalDirections", ERR_ENUM_CLASS);
qmlRegisterUncreatableType<HorizontalDirections> ("QtQmlTricks", 3, 0, "HorizontalDirections", ERR_ENUM_CLASS);
qmlRegisterUncreatableType<FlowDirections> ("QtQmlTricks", 3, 0, "FlowDirections", ERR_ENUM_CLASS);
qmlRegisterUncreatableType<QQuickExtraAnchors> ("QtQmlTricks", 3, 0, "ExtraAnchors", ERR_ATTACHED_OBJ);
qmlRegisterUncreatableType<QQuickContainerAttachedObject> ("QtQmlTricks", 3, 0, "Container", ERR_ATTACHED_OBJ);
qmlRegisterUncreatableType<QQmlObjectListModelBase> ("QtQmlTricks", 3, 0, "ObjectListModel", ERR_ABSTRACT_BASE);
qmlRegisterUncreatableType<QQmlFastObjectListModelBase> ("QtQmlTricks", 3, 0, "FastObjectListModel", ERR_ABSTRACT_BASE);
qmlRegisterUncreatableType<VerticalDirections> ("QtQmlTricks", 3, 0, "VerticalDirections", ERR_ENUM_CLASS);
qmlRegisterUncreatableType<HorizontalDirections> ("QtQmlTricks", 3, 0, "HorizontalDirections", ERR_ENUM_CLASS);
qmlRegisterUncreatableType<FlowDirections> ("QtQmlTricks", 3, 0, "FlowDirections", ERR_ENUM_CLASS);
qmlRegisterUncreatableType<QQuickExtraAnchors> ("QtQmlTricks", 3, 0, "ExtraAnchors", ERR_ATTACHED_OBJ);
qmlRegisterUncreatableType<QQuickContainerAttachedObject> ("QtQmlTricks", 3, 0, "Container", ERR_ATTACHED_OBJ);
qmlRegisterUncreatableType<QQmlObjectListModelBase> ("QtQmlTricks", 3, 0, "ObjectListModel", ERR_ABSTRACT_BASE);
qmlRegisterUncreatableType<QQmlVariantListModelBase> ("QtQmlTricks", 3, 0, "VariantListModel", ERR_ABSTRACT_BASE);
qmlRegisterUncreatableType<QQmlFastObjectListModelBase> ("QtQmlTricks", 3, 0, "FastObjectListModel", ERR_ABSTRACT_BASE);
qmlRegisterUncreatableType<QQmlAbstractMaterial> ("QtQmlTricks", 3, 0, "AbstractMaterial", ERR_ABSTRACT_BASE);
qmlRegisterUncreatableType<QQmlAbstractGradientMaterial> ("QtQmlTricks", 3, 0, "AbstractGradientMaterial", ERR_ABSTRACT_BASE);
qmlRegisterType<QQmlFlatColorMaterial> ("QtQmlTricks", 3, 0, "FlatColorMaterial");
qmlRegisterType<QQmlVerticalGradientMaterial> ("QtQmlTricks", 3, 0, "VerticalGradientMaterial");
qmlRegisterType<QQmlHorizontalGradientMaterial> ("QtQmlTricks", 3, 0, "HorizontalGradientMaterial");
qmlRegisterType<QQuickRoundedRectangleItem> ("QtQmlTricks", 3, 0, "RoundedRectangle");
qmlRegisterType<QQuickSvgIconHelper> ("QtQmlTricks", 3, 0, "SvgIconHelper");
qmlRegisterType<QQmlMimeIconsHelper> ("QtQmlTricks", 3, 0, "MimeIconsHelper");
qmlRegisterType<QQuickGroupItem> ("QtQmlTricks", 3, 0, "Group");
......
This diff is collapsed.
#ifndef QQUICKROUNDEDRECTANGLEITEM_H
#define QQUICKROUNDEDRECTANGLEITEM_H
#include <QObject>
#include <QColor>
#include <QVariantList>
#include <QQuickItem>
#include <QSGGeometry>
#include "QmlPropertyHelpers.h"
class QQmlAbstractMaterial : public QObject {
Q_OBJECT
public:
explicit QQmlAbstractMaterial (QObject * parent = Q_NULLPTR);
virtual QSGNode * createNodes (QSGGeometry * geometryNode, const QRectF & boundingRect) = 0;
signals:
void updated (void);
};
class QQmlFlatColorMaterial : public QQmlAbstractMaterial {
Q_OBJECT
QML_WRITABLE_CSTREF_PROPERTY (color, QColor)
public:
explicit QQmlFlatColorMaterial (QObject * parent = Q_NULLPTR);
QSGNode * createNodes (QSGGeometry * geometryNode, const QRectF & boundingRect) Q_DECL_FINAL;
};
class QQmlAbstractGradientMaterial : public QQmlAbstractMaterial {
Q_OBJECT
QML_WRITABLE_CSTREF_PROPERTY (gradientStops, QVariantList)
public:
explicit QQmlAbstractGradientMaterial (QObject * parent = Q_NULLPTR);
QSGNode * createNodes (QSGGeometry * geometryNode, const QRectF & boundingRect) Q_DECL_FINAL;
protected:
virtual void setPointEvenXY (QSGGeometry::ColoredPoint2D * point, const qreal ratio, const QRectF & boundingRect) = 0;
virtual void setPointOddXY (QSGGeometry::ColoredPoint2D * point, const qreal ratio, const QRectF & boundingRect) = 0;
};
class QQmlVerticalGradientMaterial : public QQmlAbstractGradientMaterial {
Q_OBJECT
public:
explicit QQmlVerticalGradientMaterial (QObject * parent = Q_NULLPTR);
protected:
void setPointEvenXY (QSGGeometry::ColoredPoint2D * point, const qreal ratio, const QRectF & boundingRect) Q_DECL_FINAL;
void setPointOddXY (QSGGeometry::ColoredPoint2D * point, const qreal ratio, const QRectF & boundingRect) Q_DECL_FINAL;
};
class QQmlHorizontalGradientMaterial : public QQmlAbstractGradientMaterial {
Q_OBJECT
public:
explicit QQmlHorizontalGradientMaterial (QObject * parent = Q_NULLPTR);
protected:
void setPointEvenXY (QSGGeometry::ColoredPoint2D * point, const qreal ratio, const QRectF & boundingRect) Q_DECL_FINAL;
void setPointOddXY (QSGGeometry::ColoredPoint2D * point, const qreal ratio, const QRectF & boundingRect) Q_DECL_FINAL;
};
class QQuickRoundedRectangleItem : public QQuickItem {
Q_OBJECT
QML_WRITABLE_VAR_PROPERTY (border, qreal)
QML_WRITABLE_VAR_PROPERTY (topBorder, qreal)
QML_WRITABLE_VAR_PROPERTY (leftBorder, qreal)
QML_WRITABLE_VAR_PROPERTY (rightBorder, qreal)
QML_WRITABLE_VAR_PROPERTY (bottomBorder, qreal)
QML_WRITABLE_VAR_PROPERTY (radius, qreal)
QML_WRITABLE_VAR_PROPERTY (topLeftRadius, qreal)
QML_WRITABLE_VAR_PROPERTY (topRightRadius, qreal)
QML_WRITABLE_VAR_PROPERTY (bottomLeftRadius, qreal)
QML_WRITABLE_VAR_PROPERTY (bottomRightRadius, qreal)
QML_WRITABLE_PTR_PROPERTY (background, QQmlAbstractMaterial)
QML_WRITABLE_PTR_PROPERTY (foreground, QQmlAbstractMaterial)
public:
explicit QQuickRoundedRectangleItem (QQuickItem * parent = Q_NULLPTR);
protected:
void classBegin (void) Q_DECL_FINAL;
void componentComplete (void) Q_DECL_FINAL;
QSGNode * updatePaintNode (QSGNode * oldNode, UpdatePaintNodeData * nodeData) Q_DECL_FINAL;
};
#endif // QQUICKROUNDEDRECTANGLEITEM_H
......@@ -6,12 +6,14 @@ Product {
cpp.cxxLanguageVersion: "c++11";
cpp.includePaths: [
".",
"core",
"core/macros",
"core/models",
"gui",
"gui/containers",
"gui/helpers",
"./core",
"./core/macros",
"./core/models",
"./core/helpers",
"./gui",
"./gui/containers",
"./gui/helpers",
"./gui/shapes",
]
Export {
......@@ -21,9 +23,11 @@ Product {
"./core",
"./core/macros",
"./core/models",
"./core/helpers",
"./gui",
"./gui/containers",
"./gui/helpers",
"./gui/shapes",
]
Depends {
......@@ -46,9 +50,17 @@ Product {
files: [
"QtQmlTricks.cpp",
"QtQmlTricks.h",
"core/helpers/QQmlFsSingleton.cpp",
"core/helpers/QQmlFsSingleton.h",
"core/helpers/QQmlIntrospector.cpp",
"core/helpers/QQmlIntrospector.h",
"core/helpers/QQmlMimeIconsHelper.cpp",
"core/helpers/QQmlMimeIconsHelper.h",
"core/macros/QmlEnumHelpers.h",
"core/macros/QmlPropertyHelpers.h",
"core/models/QQmlFastObjectListModel.h",
"core/models/QQmlObjectListModel.h",
"core/models/QQmlVariantListModel.h",
"gui/containers/QQmlContainerEnums.h",
"gui/containers/QQuickAbstractContainerBase.cpp",
"gui/containers/QQuickAbstractContainerBase.h",
......@@ -56,12 +68,24 @@ Product {
"gui/containers/QQuickColumnContainer.h",
"gui/containers/QQuickContainerAttachedObject.cpp",
"gui/containers/QQuickContainerAttachedObject.h",
"gui/containers/QQuickFastObjectListView.cpp",
"gui/containers/QQuickFastObjectListView.h",
"gui/containers/QQuickFormContainer.cpp",
"gui/containers/QQuickFormContainer.h",
"gui/containers/QQuickGridContainer.cpp",
"gui/containers/QQuickGridContainer.h",
"gui/containers/QQuickRowContainer.cpp",
"gui/containers/QQuickRowContainer.h",
"gui/containers/QQuickStackContainer.cpp",
"gui/containers/QQuickStackContainer.h",
"gui/helpers/QQuickExtraAnchors.cpp",
"gui/helpers/QQuickExtraAnchors.h",
"gui/helpers/QQuickSvgIconHelper.cpp",
"gui/helpers/QQuickSvgIconHelper.h",
"gui/helpers/QQuickWindowIconHelper.cpp",
"gui/helpers/QQuickWindowIconHelper.h",
"gui/shapes/QQuickRoundedRectangleItem.cpp",
"gui/shapes/QQuickRoundedRectangleItem.h",
]
}
Group {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment