src
gui
src
label_combobox_widget.cpp
Go to the documentation of this file.
1
/*********************************************************************
2
*
3
* Software License Agreement
4
*
5
* Copyright (c) 2020,
6
* TU Dortmund - Institute of Control Theory and Systems Engineering.
7
* All rights reserved.
8
*
9
* This program is free software: you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation, either version 3 of the License, or
12
* (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
18
*
19
* You should have received a copy of the GNU General Public License
20
* along with this program. If not, see <https://www.gnu.org/licenses/>.
21
*
22
* Authors: Christoph Rösmann
23
*********************************************************************/
24
25
#include <
corbo-gui/label_combobox_widget.h
>
26
#include <QHBoxLayout>
27
28
namespace
corbo
{
29
namespace
gui {
30
31
LabelComboBoxWidget::LabelComboBoxWidget
(
const
QString& label, QWidget* parent) : QWidget(parent)
32
{
33
setSizePolicy(QSizePolicy::Policy::Preferred, QSizePolicy::Policy::Preferred);
34
35
QHBoxLayout* box =
new
QHBoxLayout(
this
);
36
box->setContentsMargins(0, 0, 0, 0);
37
box->setAlignment(Qt::AlignLeft);
38
_label
=
new
QLabel(label);
39
box->addWidget(
_label
);
40
_combobox
=
new
QComboBox;
41
42
_label
->setBuddy(
_combobox
);
43
box->addWidget(
_combobox
);
44
}
45
46
QSize
LabelComboBoxWidget::sizeHint
()
const
{
return
QSize(200, 20); }
47
48
}
// namespace gui
49
}
// namespace corbo
corbo
Definition:
communication/include/corbo-communication/utilities.h:37
label_combobox_widget.h
corbo::gui::LabelComboBoxWidget::_label
QLabel * _label
Definition:
label_combobox_widget.h:56
corbo::gui::LabelComboBoxWidget::LabelComboBoxWidget
LabelComboBoxWidget(QWidget *parent=0)
Definition:
label_combobox_widget.h:39
corbo::gui::LabelComboBoxWidget::sizeHint
QSize sizeHint() const override
Definition:
label_combobox_widget.cpp:46
corbo::gui::LabelComboBoxWidget::_combobox
QComboBox * _combobox
Definition:
label_combobox_widget.h:55
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Mon Feb 28 2022 22:06:57