34 #include <QHBoxLayout> 35 #include <QToolButton> 48 QVBoxLayout* layout =
new QVBoxLayout(
this);
50 this->setLayout(layout);
54 mShowHeaderButton = expandButton;
55 this->setFixedSize(expandButton->sizeHint());
57 QAction* action =
new QAction(QIcon(
":icons/open_icon_library/layer-lower-3.png"),
"Controls",
this);
58 QString tip =
"Show Controls";
59 action->setStatusTip(tip);
60 action->setWhatsThis(tip);
61 action->setToolTip(tip);
62 connect(action, SIGNAL(triggered()),
this, SLOT(onTriggered()));
65 mShowHeaderButton->setDefaultAction(action);
66 layout->addWidget(mShowHeaderButton);
68 action->setCheckable(
true);
73 return mAction->isChecked();
78 mAction->setChecked(val);
81 void PopupButton::onTriggered()
84 mAction->setIcon(QIcon(
":icons/open_icon_library/layer-raise-3.png"));
86 mAction->setIcon(QIcon(
":icons/open_icon_library/layer-lower-3.png"));
98 mControlLayout =
new QHBoxLayout(
this);
99 mControlLayout->setMargin(0);
101 mShowControlsButton =
new PopupButton(this->parentWidget());
102 mControlLayout->addWidget(mShowControlsButton);
103 connect(mShowControlsButton, &
PopupButton::popup,
this, &PopupToolbarWidget::onPopup);
105 mButtonWidget =
new QWidget(
this);
106 mControlLayout->addWidget(mButtonWidget);
113 return mButtonWidget;
118 return mButtonWidget->isVisible();
127 void PopupToolbarWidget::onPopup()
131 mButtonWidget->setVisible(show);
135 mControlLayout->insertWidget(0, mShowControlsButton);
140 mControlLayout->removeWidget(mShowControlsButton);
141 mShowControlsButton->setParent(NULL);
142 mShowControlsButton->setParent(this->parentWidget());
143 mShowControlsButton->setVisible(
true);
Namespace for all CustusX production code.