allow externally supplied ModeButtons in SceneToolMode

loadfix
Marc Zinnschlag 10 years ago
parent 4dd645559d
commit 9e67a07ad4

@ -45,6 +45,13 @@ void CSVWidget::SceneToolMode::addButton (const std::string& icon, const std::st
const QString& tooltip)
{
ModeButton *button = new ModeButton (QIcon (QPixmap (icon.c_str())), tooltip, mPanel);
addButton (button, id);
}
void CSVWidget::SceneToolMode::addButton (ModeButton *button, const std::string& id)
{
button->setParent (mPanel);
button->setSizePolicy (QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed));
button->setIconSize (QSize (mIconSize, mIconSize));
button->setFixedSize (mButtonSize, mButtonSize);

@ -38,6 +38,9 @@ namespace CSVWidget
void addButton (const std::string& icon, const std::string& id,
const QString& tooltip = "");
/// The ownership of \a button is transferred to *this.
void addButton (ModeButton *button, const std::string& id);
signals:
void modeChanged (const std::string& id);

Loading…
Cancel
Save