ViewSolutions 1.0.100.30ae2aa
View solutions of qml for quasarapp projects
Loading...
Searching...
No Matches
ViewSolutions::QMLColorPicker Class Reference

The QMLColorPicker class - Qml wrapper for ColorPicker class. More...

#include <qmlcolorpicker.h>

Inheritance diagram for ViewSolutions::QMLColorPicker:
Inheritance graph
Collaboration diagram for ViewSolutions::QMLColorPicker:
Collaboration graph

Public Member Functions

 QMLColorPicker (QObject *parent=nullptr)
Q_INVOKABLE QColor pick (const QString &img) const
 pick This is override function for qml.
QString modelId () const override
 modelId This method returns the model id of the QMLColorPicker.
Public Member Functions inherited from ViewSolutions::iModel
 iModel ()=default
virtual ~iModel ()=default
const QWeakPointer< ModelStorage > & storage () const
 storage returns storage object. this method return context of the model's storage.
QQmlEngine * engine () const
 engine returns qml engine.

Additional Inherited Members

Protected Member Functions inherited from ViewSolutions::iModel
virtual void initStorage (const QWeakPointer< ModelStorage > &newStorage)
 initStorage This method is called by storage object after adding model to storage.

Detailed Description

The QMLColorPicker class - Qml wrapper for ColorPicker class.

This model is registered in the model storage by ViewSolutions::init and is also available in QML as the colorPicker context property.

Example:

Item {
// General color of an image:
property var color: colorPicker.pick("qrc:/res/icon.png")
}

Definition at line 31 of file qmlcolorpicker.h.

Constructor & Destructor Documentation

◆ QMLColorPicker()

ViewSolutions::QMLColorPicker::QMLColorPicker ( QObject * parent = nullptr)
explicit

Definition at line 15 of file qmlcolorpicker.cpp.

Member Function Documentation

◆ modelId()

QString ViewSolutions::QMLColorPicker::modelId ( ) const
overridevirtual

modelId This method returns the model id of the QMLColorPicker.

Returns
model id of the color picker.

Implements ViewSolutions::iModel.

Definition at line 70 of file qmlcolorpicker.cpp.

◆ pick()

QColor ViewSolutions::QMLColorPicker::pick ( const QString & img) const

pick This is override function for qml.

Parameters
imgThis is path to image.
Returns
General color of image.

Definition at line 20 of file qmlcolorpicker.cpp.

Here is the call graph for this function:

The documentation for this class was generated from the following files: