Conductor : remove "simple" conductor, and add option "visible" for text of multiwire conductor

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3338 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2014-09-28 09:47:06 +00:00
parent 373c833eb7
commit 8eaa2949c6
5 changed files with 62 additions and 46 deletions

View File

@@ -72,6 +72,7 @@ void ConductorPropertiesWidget::setProperties(const ConductorProperties &propert
if (index != -1) ui -> m_line_style_cb -> setCurrentIndex(index);
ui -> m_text_le -> setText (m_properties.text);
ui -> m_text_size_sb -> setValue (m_properties.text_size);
ui -> m_show_text_cb -> setChecked (m_properties.m_show_text);
ui -> m_earth_cb -> setChecked (m_properties.singleLineProperties.hasGround);
ui -> m_neutral_cb -> setChecked (m_properties.singleLineProperties.hasNeutral);
ui -> m_pen_cb -> setChecked (m_properties.singleLineProperties.isPen());
@@ -90,13 +91,13 @@ void ConductorPropertiesWidget::setProperties(const ConductorProperties &propert
*/
ConductorProperties ConductorPropertiesWidget::properties() const {
ConductorProperties properties_;
if (ui -> m_simple_rb -> isChecked()) properties_.type = ConductorProperties::Simple;
else if (ui -> m_multi_rb -> isChecked()) properties_.type = ConductorProperties::Multi;
if (ui -> m_multi_rb -> isChecked()) properties_.type = ConductorProperties::Multi;
else if (ui -> m_single_rb -> isChecked()) properties_.type = ConductorProperties::Single;
properties_.color = ui->m_color_pb->palette().color(QPalette::Button);
properties_.style = static_cast<Qt::PenStyle>(ui->m_line_style_cb->itemData(ui->m_line_style_cb->currentIndex()).toInt());
properties_.text = ui -> m_text_le -> text();
properties_.text_size = ui -> m_text_size_sb -> value();
properties_.m_show_text = ui -> m_show_text_cb -> isChecked();
properties_.verti_rotate_text = m_verti_select -> value();
properties_.horiz_rotate_text = m_horiz_select -> value();
properties_.singleLineProperties.hasGround = ui -> m_earth_cb -> isChecked();
@@ -145,9 +146,6 @@ void ConductorPropertiesWidget::initWidget() {
*/
void ConductorPropertiesWidget::setConductorType(ConductorProperties::ConductorType type) {
switch (type) {
case ConductorProperties::Simple:
ui -> m_simple_rb -> setChecked(true);
break;
case ConductorProperties::Multi:
ui -> m_multi_rb -> setChecked(true);
break;

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>430</width>
<height>571</height>
<height>407</height>
</rect>
</property>
<property name="windowTitle">
@@ -23,13 +23,6 @@
<string>Type de conducteur</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QRadioButton" name="m_simple_rb">
<property name="text">
<string>Simple</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="m_multi_rb">
<property name="text">
@@ -57,12 +50,16 @@
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Texte par defaut :</string>
<string>Texte :</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="m_text_le"/>
<widget class="QLineEdit" name="m_text_le">
<property name="toolTip">
<string>Texte</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
@@ -73,6 +70,9 @@
</item>
<item>
<widget class="QSpinBox" name="m_text_size_sb">
<property name="toolTip">
<string>taille</string>
</property>
<property name="minimum">
<number>5</number>
</property>
@@ -81,6 +81,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="m_show_text_cb">
<property name="text">
<string>Visible</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
@@ -256,24 +266,24 @@
<string>Apparence du conducteur</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="1">
<item row="3" column="2">
<widget class="QComboBox" name="m_line_style_cb"/>
</item>
<item row="0" column="0">
<item row="1" column="1">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Couleur :</string>
</property>
</widget>
</item>
<item row="0" column="1">
<item row="1" column="2">
<widget class="QPushButton" name="m_color_pb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="1">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Style :</string>