svgui
1.9
|
Colour-picker combo box with swatches, optionally including "Add New Colour..." entry to invoke a QColorDialog/ColourNameDialog. More...
#include <ColourComboBox.h>
Signals | |
void | colourChanged (int colourIndex) |
Emitted when the current index is changed. More... | |
void | mouseEntered () |
void | mouseLeft () |
Public Member Functions | |
ColourComboBox (bool withAddNewColourEntry, QWidget *parent=0) | |
void | includeUnsetEntry (QString label) |
Add an entry at the top of the combo for "no colour selected", with the given label. More... | |
int | getCurrentColourIndex () const |
Get the current colour index. More... | |
Protected Member Functions | |
void | enterEvent (QEvent *) override |
void | leaveEvent (QEvent *) override |
Private Slots | |
void | rebuild () |
void | comboActivated (int) |
Private Attributes | |
bool | m_withAddNewColourEntry |
QString | m_unsetEntry |
Detailed Description
Colour-picker combo box with swatches, optionally including "Add New Colour..." entry to invoke a QColorDialog/ColourNameDialog.
Definition at line 25 of file ColourComboBox.h.
Constructor & Destructor Documentation
ColourComboBox::ColourComboBox | ( | bool | withAddNewColourEntry, |
QWidget * | parent = 0 |
||
) |
Definition at line 31 of file ColourComboBox.cpp.
References comboActivated(), ColourDatabase::getInstance(), and rebuild().
Member Function Documentation
void ColourComboBox::includeUnsetEntry | ( | QString | label | ) |
Add an entry at the top of the combo for "no colour selected", with the given label.
Definition at line 44 of file ColourComboBox.cpp.
References m_unsetEntry, and rebuild().
|
inline |
Get the current colour index.
This is the same as QComboBox::currentIndex() if there is no unset entry, or 1 less than it if includeUnsetEntry() has been used. So if there is an unset entry, and it is selected, this returns -1.
Definition at line 44 of file ColourComboBox.h.
References colourChanged(), comboActivated(), m_unsetEntry, and rebuild().
|
signal |
Emitted when the current index is changed.
The argument is the value returned by getCurrentColourIndex()
Referenced by comboActivated(), and getCurrentColourIndex().
|
privateslot |
Definition at line 90 of file ColourComboBox.cpp.
References ColourDatabase::getColourCount(), ColourDatabase::getColourName(), ColourDatabase::getExamplePixmap(), ColourDatabase::getInstance(), m_unsetEntry, and m_withAddNewColourEntry.
Referenced by ColourComboBox(), getCurrentColourIndex(), and includeUnsetEntry().
|
privateslot |
!! command
Definition at line 57 of file ColourComboBox.cpp.
References ColourDatabase::addColour(), colourChanged(), ColourDatabase::getInstance(), m_unsetEntry, m_withAddNewColourEntry, ColourDatabase::setUseDarkBackground(), and ColourNameDialog::showDarkBackgroundCheckbox().
Referenced by ColourComboBox(), and getCurrentColourIndex().
|
signalinherited |
Referenced by NotifyingComboBox::enterEvent(), and NotifyingComboBox::NotifyingComboBox().
|
signalinherited |
Referenced by NotifyingComboBox::leaveEvent(), and NotifyingComboBox::NotifyingComboBox().
|
overrideprotectedinherited |
Definition at line 23 of file NotifyingComboBox.cpp.
References NotifyingComboBox::mouseEntered().
Referenced by NotifyingComboBox::NotifyingComboBox().
|
overrideprotectedinherited |
Definition at line 30 of file NotifyingComboBox.cpp.
References NotifyingComboBox::mouseLeft().
Referenced by NotifyingComboBox::NotifyingComboBox().
Member Data Documentation
|
private |
Definition at line 65 of file ColourComboBox.h.
Referenced by comboActivated(), and rebuild().
|
private |
Definition at line 66 of file ColourComboBox.h.
Referenced by comboActivated(), getCurrentColourIndex(), includeUnsetEntry(), and rebuild().
The documentation for this class was generated from the following files:
Generated by 1.8.11