Seamly2D
Code documentation
LineWeightComboBox Class Reference

#include <lineweight_combobox.h>

Inheritance diagram for LineWeightComboBox:
Collaboration diagram for LineWeightComboBox:

Signals

void lineWeightChanged (const qreal &weight)
 

Public Member Functions

 LineWeightComboBox (QWidget *parent=nullptr, const char *name=nullptr)
 
 LineWeightComboBox (int width, int height, QWidget *parent=nullptr, const char *name=nullptr)
 
virtual ~LineWeightComboBox ()
 
void init ()
 
qreal getLineWeight () const
 
void setLineWeight (const qreal &weight)
 

Private Slots

void updateLineWeight (int index)
 

Private Member Functions

QIcon createIcon (const qreal &width)
 

Private Attributes

qreal m_currentWeight
 
int m_iconWidth
 
int m_iconHeight
 

Detailed Description

A comboBox for choosing a line weight.

Definition at line 34 of file lineweight_combobox.h.

Constructor & Destructor Documentation

◆ LineWeightComboBox() [1/2]

LineWeightComboBox::LineWeightComboBox ( QWidget *  parent = nullptr,
const char *  name = nullptr 
)

Constructor with name.

Definition at line 35 of file lineweight_combobox.cpp.

References init().

◆ LineWeightComboBox() [2/2]

LineWeightComboBox::LineWeightComboBox ( int  width,
int  height,
QWidget *  parent = nullptr,
const char *  name = nullptr 
)

Constructor that provides a width and height for the icon.

Definition at line 49 of file lineweight_combobox.cpp.

References init().

◆ ~LineWeightComboBox()

LineWeightComboBox::~LineWeightComboBox ( )
virtual

Destructor

Definition at line 63 of file lineweight_combobox.cpp.

Member Function Documentation

◆ createIcon()

QIcon LineWeightComboBox::createIcon ( const qreal &  width)
private

Definition at line 148 of file lineweight_combobox.cpp.

References m_iconHeight, and m_iconWidth.

Referenced by init().

◆ getLineWeight()

qreal LineWeightComboBox::getLineWeight ( ) const

Definition at line 113 of file lineweight_combobox.cpp.

References m_currentWeight.

◆ init()

void LineWeightComboBox::init ( )

Initialisation called from constructor or manually but only once.

Definition at line 68 of file lineweight_combobox.cpp.

References createIcon(), m_iconHeight, m_iconWidth, and updateLineWeight().

Referenced by LineWeightComboBox().

◆ lineWeightChanged

void LineWeightComboBox::lineWeightChanged ( const qreal &  weight)
signal

Referenced by updateLineWeight().

◆ setLineWeight()

void LineWeightComboBox::setLineWeight ( const qreal &  weight)

Sets the currently selected weight item to the given weight.

Definition at line 121 of file lineweight_combobox.cpp.

References m_currentWeight, and updateLineWeight().

◆ updateLineWeight

void LineWeightComboBox::updateLineWeight ( int  index)
privateslot

Called when the width has changed. This method sets the current width to the value chosen or even offers a dialog to the user that allows him/ her to choose an individual width.

Definition at line 137 of file lineweight_combobox.cpp.

References lineWeightChanged(), and m_currentWeight.

Referenced by init(), and setLineWeight().

Member Data Documentation

◆ m_currentWeight

qreal LineWeightComboBox::m_currentWeight
private

Definition at line 56 of file lineweight_combobox.h.

Referenced by getLineWeight(), setLineWeight(), and updateLineWeight().

◆ m_iconHeight

int LineWeightComboBox::m_iconHeight
private

Definition at line 58 of file lineweight_combobox.h.

Referenced by createIcon(), and init().

◆ m_iconWidth

int LineWeightComboBox::m_iconWidth
private

Definition at line 57 of file lineweight_combobox.h.

Referenced by createIcon(), and init().


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