The ComboLinks class is a helper class that binds to a combo box and provides an interface to add links, retrieve links and select items by link value. More...
#include <TaskTransformedParameters.h>
Public Member Functions | |
int | addLink (App::DocumentObject *linkObj, std::string linkSubname, QString itemText) |
int | addLink (const App::PropertyLinkSub &lnk, QString itemText) |
addLink adds an item to the combo. More... | |
void | clear () |
QComboBox & | combo (void) const |
ComboLinks () | |
ComboLinks (QComboBox &combo) | |
ComboLinks constructor. More... | |
App::PropertyLinkSub & | getCurrentLink () const |
getCurrentLink More... | |
App::PropertyLinkSub & | getLink (int index) const |
void | setCombo (QComboBox &combo) |
int | setCurrentLink (const App::PropertyLinkSub &lnk) |
setCurrentLink selects the item with the link that matches the argument. More... | |
~ComboLinks () | |
The ComboLinks class is a helper class that binds to a combo box and provides an interface to add links, retrieve links and select items by link value.
ComboLinks::ComboLinks | ( | QComboBox & | combo | ) |
ComboLinks constructor.
combo. | It will be cleared as soon as it is bound. Don't add or remove items from the combo directly, otherwise internal tracking list will go out of sync, and crashes may result. |
References combo().
PartDesignGui::ComboLinks::ComboLinks | ( | ) |
PartDesignGui::ComboLinks::~ComboLinks | ( | ) |
References clear().
int ComboLinks::addLink | ( | App::DocumentObject * | linkObj, |
std::string | linkSubname, | ||
QString | itemText | ||
) |
int ComboLinks::addLink | ( | const App::PropertyLinkSub & | lnk, |
QString | itemText | ||
) |
addLink adds an item to the combo.
Doesn't check for duplicates.
lnk | can be a link to NULL, which is usually used for special item "Select Reference" |
itemText |
References App::DocumentObject::getDocument(), App::PropertyLinkSub::getValue(), and App::PropertyLinkSub::Paste().
Referenced by PartDesignGui::TaskTransformedParameters::fillAxisCombo(), and PartDesignGui::TaskTransformedParameters::fillPlanesCombo().
void ComboLinks::clear | ( | ) |
QComboBox & PartDesignGui::ComboLinks::combo | ( | void | ) | const |
Referenced by ComboLinks(), and setCombo().
App::PropertyLinkSub & ComboLinks::getCurrentLink | ( | ) | const |
getCurrentLink
References getLink().
Referenced by PartDesignGui::TaskPolarPatternParameters::getAxis(), PartDesignGui::TaskLinearPatternParameters::getDirection(), and PartDesignGui::TaskMirroredParameters::getMirrorPlane().
App::PropertyLinkSub & ComboLinks::getLink | ( | int | index | ) | const |
References App::Document::isIn().
Referenced by getCurrentLink().
int ComboLinks::setCurrentLink | ( | const App::PropertyLinkSub & | lnk | ) |
setCurrentLink selects the item with the link that matches the argument.
If there is no such link in the list, -1 is returned and selected item is not changed. Signals from combo are blocked in this function.
lnk |
References App::PropertyLinkSub::getSubValues(), and App::PropertyLinkSub::getValue().