#include <lineweight_combobox.h>
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 |
A comboBox for choosing a line weight.
Definition at line 34 of file lineweight_combobox.h.
LineWeightComboBox::LineWeightComboBox | ( | QWidget * | parent = nullptr , |
const char * | name = nullptr |
||
) |
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().
|
virtual |
Destructor
Definition at line 63 of file lineweight_combobox.cpp.
|
private |
Definition at line 148 of file lineweight_combobox.cpp.
References m_iconHeight, and m_iconWidth.
Referenced by init().
qreal LineWeightComboBox::getLineWeight | ( | ) | const |
Definition at line 113 of file lineweight_combobox.cpp.
References m_currentWeight.
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().
|
signal |
Referenced by updateLineWeight().
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().
|
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().
|
private |
Definition at line 56 of file lineweight_combobox.h.
Referenced by getLineWeight(), setLineWeight(), and updateLineWeight().
|
private |
Definition at line 58 of file lineweight_combobox.h.
Referenced by createIcon(), and init().
|
private |
Definition at line 57 of file lineweight_combobox.h.
Referenced by createIcon(), and init().