mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Improve Conductor Properties size function
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4288 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -222,6 +222,7 @@ ConductorProperties::ConductorProperties() :
|
||||
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 @@ void ConductorProperties::toXml(QDomElement &e) const
|
||||
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 @@ void ConductorProperties::fromXml(QDomElement &e)
|
||||
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 @@ void ConductorProperties::toSettings(QSettings &settings, const QString &prefix)
|
||||
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 @@ void ConductorProperties::fromSettings(QSettings &settings, const QString &prefi
|
||||
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 @@ bool ConductorProperties::operator==(const ConductorProperties &other) const{
|
||||
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 &&\
|
||||
|
||||
@@ -82,6 +82,7 @@ class ConductorProperties
|
||||
m_function,
|
||||
m_tension_protocol;
|
||||
int text_size;
|
||||
int cond_size;
|
||||
double verti_rotate_text;
|
||||
double horiz_rotate_text;
|
||||
bool m_show_text;
|
||||
|
||||
@@ -455,7 +455,7 @@ void Conductor::paint(QPainter *qp, const QStyleOptionGraphicsItem *options, QWi
|
||||
}
|
||||
|
||||
//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);
|
||||
|
||||
@@ -79,6 +79,7 @@ void ConductorPropertiesWidget::setProperties(const ConductorProperties &propert
|
||||
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 @@ ConductorProperties ConductorPropertiesWidget::properties() const
|
||||
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();
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user