Seamly2D
Code documentation
LineTypeComboBox Class Reference

#include <linetype_combobox.h>

Inheritance diagram for LineTypeComboBox:
Collaboration diagram for LineTypeComboBox:

Signals

void lineTypeChanged (const QString &type)
 

Public Member Functions

 LineTypeComboBox (QWidget *parent=nullptr)
 
 LineTypeComboBox (int width, int height, QWidget *parent=nullptr, const char *name=nullptr)
 
virtual ~LineTypeComboBox ()
 
QString getLineType ()
 
void setLineType (const QString &type)
 
void init ()
 

Private Slots

void updateLineType (int index)
 

Private Member Functions

QIcon createIcon (const QString &type)
 

Private Attributes

QString m_currentLineType
 
int m_iconWidth
 
int m_iconHeight
 

Detailed Description

A comboBox for choosing a line type.

Definition at line 38 of file linetype_combobox.h.

Constructor & Destructor Documentation

◆ LineTypeComboBox() [1/2]

LineTypeComboBox::LineTypeComboBox ( QWidget *  parent = nullptr)

Definition at line 37 of file linetype_combobox.cpp.

References init().

◆ LineTypeComboBox() [2/2]

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

Constructor that provides a width & height for the icon, and a name for the combobox.

Definition at line 50 of file linetype_combobox.cpp.

References init().

◆ ~LineTypeComboBox()

LineTypeComboBox::~LineTypeComboBox ( )
virtual

Destructor

Definition at line 63 of file linetype_combobox.cpp.

Member Function Documentation

◆ createIcon()

QIcon LineTypeComboBox::createIcon ( const QString &  type)
private

Definition at line 137 of file linetype_combobox.cpp.

References lineTypeToPenStyle(), m_iconHeight, and m_iconWidth.

Referenced by init().

◆ getLineType()

QString LineTypeComboBox::getLineType ( )
inline

Definition at line 48 of file linetype_combobox.h.

References m_currentLineType.

◆ init()

void LineTypeComboBox::init ( )

Initialisation called from constructor or manually but only once.

Definition at line 69 of file linetype_combobox.cpp.

References createIcon(), LineTypeDashDotDotLine, LineTypeDashDotLine, LineTypeDashLine, LineTypeDotLine, LineTypeNone, LineTypeSolidLine, m_iconHeight, m_iconWidth, and updateLineType().

Referenced by LineTypeComboBox().

◆ lineTypeChanged

void LineTypeComboBox::lineTypeChanged ( const QString &  type)
signal

Referenced by updateLineType().

◆ setLineType()

void LineTypeComboBox::setLineType ( const QString &  type)

Sets the currently selected linetype item to the given linetype.

Definition at line 109 of file linetype_combobox.cpp.

References m_currentLineType, and updateLineType().

◆ updateLineType

void LineTypeComboBox::updateLineType ( int  index)
privateslot

Definition at line 126 of file linetype_combobox.cpp.

References lineTypeChanged(), and m_currentLineType.

Referenced by init(), and setLineType().

Member Data Documentation

◆ m_currentLineType

QString LineTypeComboBox::m_currentLineType
private

Definition at line 61 of file linetype_combobox.h.

Referenced by getLineType(), setLineType(), and updateLineType().

◆ m_iconHeight

int LineTypeComboBox::m_iconHeight
private

Definition at line 63 of file linetype_combobox.h.

Referenced by createIcon(), and init().

◆ m_iconWidth

int LineTypeComboBox::m_iconWidth
private

Definition at line 62 of file linetype_combobox.h.

Referenced by createIcon(), and init().


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