13 #include <QHBoxLayout> 14 #include <QToolButton> 27 QVBoxLayout* layout =
new QVBoxLayout(
this);
29 this->setLayout(layout);
33 mShowHeaderButton = expandButton;
34 this->setFixedSize(expandButton->sizeHint());
36 QAction* action =
new QAction(QIcon(
":icons/open_icon_library/layer-lower-3.png"),
"Controls",
this);
37 QString tip =
"Show Controls";
38 action->setStatusTip(tip);
39 action->setWhatsThis(tip);
40 action->setToolTip(tip);
41 connect(action, SIGNAL(triggered()),
this, SLOT(onTriggered()));
44 mShowHeaderButton->setDefaultAction(action);
45 layout->addWidget(mShowHeaderButton);
47 action->setCheckable(
true);
52 return mAction->isChecked();
57 mAction->setChecked(val);
60 void PopupButton::onTriggered()
63 mAction->setIcon(QIcon(
":icons/open_icon_library/layer-raise-3.png"));
65 mAction->setIcon(QIcon(
":icons/open_icon_library/layer-lower-3.png"));
77 mControlLayout =
new QHBoxLayout(
this);
78 mControlLayout->setMargin(0);
80 mShowControlsButton =
new PopupButton(this->parentWidget());
81 mControlLayout->addWidget(mShowControlsButton);
84 mButtonWidget =
new QWidget(
this);
85 mControlLayout->addWidget(mButtonWidget);
97 return mButtonWidget->isVisible();
106 void PopupToolbarWidget::onPopup()
110 mButtonWidget->setVisible(show);
114 mControlLayout->insertWidget(0, mShowControlsButton);
119 mControlLayout->removeWidget(mShowControlsButton);
120 mShowControlsButton->setParent(NULL);
121 mShowControlsButton->setParent(this->parentWidget());
122 mShowControlsButton->setVisible(
true);
Namespace for all CustusX production code.