[qet] [4288] Improve Conductor Properties size function |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 4288
Author: scorpio810
Date: 2015-12-23 19:41:13 +0100 (Wed, 23 Dec 2015)
Log Message:
-----------
Improve Conductor Properties size function
Modified Paths:
--------------
trunk/sources/conductorproperties.cpp
trunk/sources/conductorproperties.h
trunk/sources/qetgraphicsitem/conductor.cpp
trunk/sources/ui/conductorpropertieswidget.cpp
trunk/sources/ui/conductorpropertieswidget.ui
Modified: trunk/sources/conductorproperties.cpp
===================================================================
--- trunk/sources/conductorproperties.cpp 2015-12-16 17:16:15 UTC (rev 4287)
+++ trunk/sources/conductorproperties.cpp 2015-12-23 18:41:13 UTC (rev 4288)
@@ -222,6 +222,7 @@
color(Qt::black),
text("_"),
text_size(9),
+ cond_size(1),
verti_rotate_text(270),
horiz_rotate_text(0),
m_show_text(true),
@@ -255,6 +256,7 @@
e.setAttribute("function", m_function);
e.setAttribute("tension-protocol", m_tension_protocol);
e.setAttribute("numsize", text_size);
+ e.setAttribute("condsize", cond_size);
e.setAttribute("displaytext", m_show_text);
e.setAttribute("onetextperfolio", m_one_text_per_folio);
e.setAttribute("vertirotatetext", verti_rotate_text);
@@ -293,6 +295,7 @@
m_function = e.attribute("function");
m_tension_protocol = e.attribute("tension-protocol");
text_size = e.attribute("numsize", QString::number(9)).toInt();
+ cond_size = e.attribute("condsize", QString::number(1)).toInt();
m_show_text = e.attribute("displaytext", QString::number(1)).toInt();
m_one_text_per_folio = e.attribute("onetextperfolio", QString::number(0)).toInt();
verti_rotate_text = e.attribute("vertirotatetext").toDouble();
@@ -317,6 +320,7 @@
settings.setValue(prefix + "function", m_function);
settings.setValue(prefix + "tension-protocol", m_tension_protocol);
settings.setValue(prefix + "textsize", QString::number(text_size));
+ settings.setValue(prefix + "size", QString::number(cond_size));
settings.setValue(prefix + "displaytext", m_show_text);
settings.setValue(prefix + "onetextperfolio", m_one_text_per_folio);
settings.setValue(prefix + "vertirotatetext", QString::number(verti_rotate_text));
@@ -342,6 +346,7 @@
m_function = settings.value(prefix + "function", "").toString();
m_tension_protocol = settings.value(prefix + "tension-protocol", "").toString();
text_size = settings.value(prefix + "textsize", "7").toInt();
+ cond_size = settings.value(prefix + "size", "1").toInt();
m_show_text = settings.value(prefix + "displaytext", true).toBool();
m_one_text_per_folio = settings.value(prefix + "onetextperfolio", false).toBool();
verti_rotate_text = settings.value((prefix + "vertirotatetext"), "270").toDouble();
@@ -389,6 +394,7 @@
other.m_tension_protocol == m_tension_protocol &&\
other.m_show_text == m_show_text &&\
other.text_size == text_size &&\
+ other.cond_size == cond_size &&\
other.verti_rotate_text == verti_rotate_text &&\
other.horiz_rotate_text == horiz_rotate_text &&\
other.singleLineProperties == singleLineProperties &&\
Modified: trunk/sources/conductorproperties.h
===================================================================
--- trunk/sources/conductorproperties.h 2015-12-16 17:16:15 UTC (rev 4287)
+++ trunk/sources/conductorproperties.h 2015-12-23 18:41:13 UTC (rev 4288)
@@ -82,6 +82,7 @@
m_function,
m_tension_protocol;
int text_size;
+ int cond_size;
double verti_rotate_text;
double horiz_rotate_text;
bool m_show_text;
Modified: trunk/sources/qetgraphicsitem/conductor.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/conductor.cpp 2015-12-16 17:16:15 UTC (rev 4287)
+++ trunk/sources/qetgraphicsitem/conductor.cpp 2015-12-23 18:41:13 UTC (rev 4288)
@@ -455,7 +455,7 @@
}
//Draw the conductor bigger when is hovered
- conductor_pen.setWidth(bMouseOver? 5 : 1);
+ conductor_pen.setWidth(bMouseOver? 5 : (properties_.cond_size));
// affectation du QPen et de la QBrush modifies au QPainter
qp -> setBrush(conductor_brush);
Modified: trunk/sources/ui/conductorpropertieswidget.cpp
===================================================================
--- trunk/sources/ui/conductorpropertieswidget.cpp 2015-12-16 17:16:15 UTC (rev 4287)
+++ trunk/sources/ui/conductorpropertieswidget.cpp 2015-12-23 18:41:13 UTC (rev 4288)
@@ -76,9 +76,10 @@
if (index != -1) ui -> m_line_style_cb -> setCurrentIndex(index);
ui->m_text_le -> setText (m_properties.text);
- ui->m_function_le ->setText (m_properties.m_function);
- ui->m_tension_protocol_le ->setText (m_properties.m_tension_protocol);
+ ui->m_function_le -> setText (m_properties.m_function);
+ ui->m_tension_protocol_le -> setText (m_properties.m_tension_protocol);
ui->m_text_size_sb -> setValue (m_properties.text_size);
+ ui->m_cond_size_sb -> setValue (m_properties.cond_size);
ui->m_show_text_cb -> setChecked (m_properties.m_show_text);
ui->m_one_text_per_folio_cb -> setChecked (m_properties.m_one_text_per_folio);
ui->m_earth_cb -> setChecked (m_properties.singleLineProperties.hasGround);
@@ -110,6 +111,7 @@
properties_.m_function = ui -> m_function_le->text();
properties_.m_tension_protocol = ui -> m_tension_protocol_le->text();
properties_.text_size = ui -> m_text_size_sb -> value();
+ properties_.cond_size = ui -> m_cond_size_sb -> value();
properties_.m_show_text = ui -> m_show_text_cb -> isChecked();
properties_.m_one_text_per_folio = ui -> m_one_text_per_folio_cb -> isChecked();
properties_.verti_rotate_text = m_verti_select -> value();
@@ -250,7 +252,7 @@
void ConductorPropertiesWidget::on_m_neutral_cb_toggled(bool checked) {
if (checked && ui -> m_earth_cb -> isChecked())
ui -> m_pen_cb -> setEnabled(true);
- else ui -> m_pen_cb -> setDisabled(true);
+ else ui -> m_pen_cb -> setDisabled(true);
}
/**
Modified: trunk/sources/ui/conductorpropertieswidget.ui
===================================================================
--- trunk/sources/ui/conductorpropertieswidget.ui 2015-12-16 17:16:15 UTC (rev 4287)
+++ trunk/sources/ui/conductorpropertieswidget.ui 2015-12-23 18:41:13 UTC (rev 4288)
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>504</width>
- <height>420</height>
+ <height>480</height>
</rect>
</property>
<property name="windowTitle">
@@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
- <number>0</number>
+ <number>1</number>
</property>
<widget class="QWidget" name="type">
<attribute name="title">
@@ -357,7 +357,7 @@
</property>
</widget>
</item>
- <item row="2" column="0">
+ <item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -370,6 +370,23 @@
</property>
</spacer>
</item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_10">
+ <property name="text">
+ <string>size:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QSpinBox" name="m_cond_size_sb">
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="maximum">
+ <number>10</number>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</widget>