Debian Codegraph @

tests/manual/chartdesigner/penwidget.cpp

raw
1 // Copyright (C) 2016 The Qt Company Ltd.
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4 #include "penwidget.h"
5 #include <QtWidgets/QFormLayout>
6 #include <QtWidgets/QComboBox>
7 #include <QtWidgets/QSpinBox>
8
9 PenWidget::PenWidget(QWidget *parent):QWidget(parent),
10 m_colorComboBox(0),
11 m_lineStyleComboBox(0),
12 m_widthSpinBox(0)
13 {
14 createContent();
15 createLayout();
16 setFixedSize(minimumSizeHint());
17 }
18
19 PenWidget::~PenWidget()
20 {
21
22 }
23
24 void PenWidget::createContent()
25 {
26 m_colorComboBox = new QComboBox(this);
27 m_lineStyleComboBox = new QComboBox(this);
28 m_widthSpinBox = new QSpinBox(this);
29 }
30
31 void PenWidget::createLayout()
32 {
33 QFormLayout *layout = new QFormLayout();
34 layout->addRow(tr("Color"), m_colorComboBox);
35 layout->addRow(tr("Style"), m_lineStyleComboBox);
36 layout->addRow(tr("Width"), m_widthSpinBox);
37 setLayout(layout);
38 }
39