QElectroTech  0.70
borderpropertieswidget.cpp
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #include "borderpropertieswidget.h"
19 #include "ui_borderpropertieswidget.h"
20 #include "diagram.h"
21 
29  QWidget(parent),
30  ui(new Ui::BorderPropertiesWidget)
31 {
32  ui->setupUi(this);
33  setProperties(bp);
34 }
35 
41 {
42  delete ui;
43 }
44 
51  m_properties = bp;
52  ui -> m_colums_count_sp ->setValue (m_properties.columns_count);
53  ui -> m_columns_width_sp ->setValue (m_properties.columns_width);
54  ui -> m_display_columns_cb ->setChecked (m_properties.display_columns);
55  ui -> m_rows_count_sp ->setValue (m_properties.rows_count);
56  ui -> m_rows_height_sp ->setValue (m_properties.rows_height);
57  ui -> m_display_rows_cb ->setChecked (m_properties.display_rows);
58 }
59 
65  m_properties.columns_count = ui -> m_colums_count_sp -> value();
66  m_properties.columns_width = ui -> m_columns_width_sp -> value();
67  m_properties.display_columns = ui -> m_display_columns_cb -> isChecked();
68  m_properties.rows_count = ui -> m_rows_count_sp -> value();
69  m_properties.rows_height = ui -> m_rows_height_sp -> value();
70  m_properties.display_rows = ui -> m_display_rows_cb -> isChecked();
71  return m_properties;
72 }
73 
80  ui->border_gb->setDisabled(ro);
81 }
Ui::BorderPropertiesWidget * ui
The BorderPropertiesWidget class this widget edit the properties of a border.
const BorderProperties & properties()
BorderPropertiesWidget::properties.
void setReadOnly(const bool &ro)
BorderPropertiesWidget::setReadOnly Enable or disable this widget.
qreal columns_width
Columns width.
void setProperties(const BorderProperties &bp)
BorderPropertiesWidget::setProperties Set the current properties to edit.
~BorderPropertiesWidget() override
BorderPropertiesWidget::~BorderPropertiesWidget default destructor.
QIcon ro
Definition: qeticons.cpp:199
qreal rows_height
Rows height.
int columns_count
Columns count.
bool display_rows
Whether to display row headers.
BorderPropertiesWidget(const BorderProperties &bp, QWidget *parent=nullptr)
BorderPropertiesWidget::BorderPropertiesWidget default constructor.
int rows_count
Rows count.
bool display_columns
Whether to display column headers.