Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxDetailedLabeledComboBoxWidget.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
13 
14 #include <QAction>
15 #include <QToolButton>
16 
17 namespace cx
18 {
19 DetailedLabeledComboBoxWidget::DetailedLabeledComboBoxWidget(QWidget* parent, StringPropertyBasePtr adapter, QGridLayout* gridLayout, int row) :
20  LabeledComboBoxWidget(parent, adapter, gridLayout, row)
21 {
22  //Add detailed button
23  QAction* detailsAction = this->createAction(this,
24  QIcon(":/icons/open_icon_library/system-run-5.png"),
25  "Details", "Toggle Details",
26  SLOT(toggleDetailsSlot()),
27  NULL);
28 
29  QToolButton* detailsButton = new QToolButton();
30  detailsButton->setObjectName("DetailedButton");
31  detailsButton->setDefaultAction(detailsAction);
32 
33 
34  if (gridLayout) // add to input gridlayout
35  {
36  gridLayout->addWidget(detailsButton, row, 2);
37  }
38  else // add directly to this
39  {
40  mTopLayout->addWidget(detailsButton, 2);
41  }
42 
43  this->setModified();
44 }
45 
47 {}
48 
49 void DetailedLabeledComboBoxWidget::toggleDetailsSlot()
50 {
51  emit detailsTriggered();
52 }
53 
54 
55 } /* namespace cxtest */
Composite widget for string selection.
QAction * createAction(QObject *parent, QIcon iconName, QString text, QString tip, T slot, QLayout *layout=NULL, QToolButton *button=new QToolButton())
Definition: cxBaseWidget.h:129
DetailedLabeledComboBoxWidget(QWidget *parent, StringPropertyBasePtr, QGridLayout *gridLayout=0, int row=0)
boost::shared_ptr< class StringPropertyBase > StringPropertyBasePtr
Namespace for all CustusX production code.