CVB++ 14.0
ImageLabelItem Class Reference

Image label item for QML. More...

#include <cvb/ui/image_view_item.hpp>

Inherits QQuickItem.

Public Member Functions

double ImageX () const noexcept
 Get the X position of this label on the image. More...
 
void SetImageX (double imageX)
 Set the X position of this label on the image. More...
 
double ImageY () const noexcept
 Get the Y position of this label on the image. More...
 
void SetImageY (double imageY)
 Set the Y position of this label on the image. More...
 
void SetImageView (ImageViewItem *view)
 Set the image view for this label. More...
 
int LabelScale () const noexcept
 Get the label scale behaviour (as integer, see Cvb::UI::LabelScale). More...
 
void SetLabelScale (int labelScale)
 Set the label scale behaviour (as integer, see Cvb::UI::LabelScale). More...
 

Static Public Member Functions

template<class T >
static void Register (const char *uri, int versionMajor, int versionMinor, const char *qmlName)
 Convenience method to register this type or a derived type in QML. More...
 
static void Register ()
 Convenience method to register this type in QML. More...
 

Detailed Description

Image label item for QML.

This class (or an extended subclass) should be registered in QML. The item provides an overlay object to draw into an image display (see ImageViewItem) Instances should only be created from QML.

For convenience see ImageLabelItem::Register

Member Function Documentation

◆ ImageX()

double ImageX ( ) const
inlinenoexcept

Get the X position of this label on the image.

Returns
The X position.
Exceptions
Doesnot throw any exception.

Use in QML as property: imageX.

◆ ImageY()

double ImageY ( ) const
inlinenoexcept

Get the Y position of this label on the image.

Returns
The Y position.
Exceptions
Doesnot throw any exception.

Use in QML as property: imageY.

◆ LabelScale()

int LabelScale ( ) const
inlinenoexcept

Get the label scale behaviour (as integer, see Cvb::UI::LabelScale).

Returns
The label scale behavior.
Exceptions
Doesnot throw any exception.

Use in QML as property: labelScale.

This if this property is set to "On" the label will zoom/scale according to the image view.

The related enum is automatically registered in QML using ImageLabelItem::Register.

◆ Register() [1/2]

static void Register ( )
inlinestatic

Convenience method to register this type in QML.

Exceptions
Doesnot throw any exception.

This type is registered as ImageLabel in CvbQuick. In addition also the required enums are registered.

Examples
Foundation/QmlBlobSearch, Minos/QmlMinos, and Polimago/QmlCookieClassification.

◆ Register() [2/2]

static void Register ( const char *  uri,
int  versionMajor,
int  versionMinor,
const char *  qmlName 
)
inlinestatic

Convenience method to register this type or a derived type in QML.

Parameters
[in]uriURI forwarded to Qt.
[in]versionMajorMajor version forwarded to Qt.
[in]versionMinorMinor version forwarded to Qt.
[in]qmlNameName in QML forwarded to Qt.
Exceptions
Doesnot throw any exception.

Basically just calls qmlRegisterType(...). In addition also the required enums are registered.

◆ SetImageView()

void SetImageView ( ImageViewItem view)
inline

Set the image view for this label.

Parameters
[in]viewThe view.
Exceptions
Doesnot throw any exception.

Use in QML as property: imageView.

Use this property in QML to associate the label with an image view.

◆ SetImageX()

void SetImageX ( double  imageX)
inline

Set the X position of this label on the image.

Parameters
[in]imageXThe new X position.
Exceptions
Doesnot throw any exception.

Use in QML as property: imageX.

◆ SetImageY()

void SetImageY ( double  imageY)
inline

Set the Y position of this label on the image.

Parameters
[in]imageYThe new Y position.
Exceptions
Doesnot throw any exception.

Use in QML as property: imageY.

◆ SetLabelScale()

void SetLabelScale ( int  labelScale)
inline

Set the label scale behaviour (as integer, see Cvb::UI::LabelScale).

Parameters
[in]labelScaleThe label scale behavior.
Exceptions
Doesnot throw any exception.

Use in QML as property: labelScale.

This if this property is set to "On" the label will zoom/scale according to the image view.

The related enum is automatically registered in QML using ImageLabelItem::Register.