mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Add in config the possibility to start the numbering of the columns of
titleblocks at 0. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5510 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -193,13 +193,15 @@ namespace autonum
|
|||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
QSettings settings;
|
||||||
|
|
||||||
AssignVariables::AssignVariables(const QString& formula, const sequentialNumbers& seqStruct , Diagram *diagram, const Element *elmt):
|
AssignVariables::AssignVariables(const QString& formula, const sequentialNumbers& seqStruct , Diagram *diagram, const Element *elmt):
|
||||||
m_diagram(diagram),
|
m_diagram(diagram),
|
||||||
m_arg_formula(formula),
|
m_arg_formula(formula),
|
||||||
m_assigned_label(formula),
|
m_assigned_label(formula),
|
||||||
m_seq_struct(seqStruct),
|
m_seq_struct(seqStruct),
|
||||||
m_element(elmt)
|
m_element(elmt)
|
||||||
|
|
||||||
{
|
{
|
||||||
if (m_diagram)
|
if (m_diagram)
|
||||||
{
|
{
|
||||||
@@ -210,10 +212,14 @@ namespace autonum
|
|||||||
m_assigned_label.replace("%M", m_diagram -> border_and_titleblock.machine());
|
m_assigned_label.replace("%M", m_diagram -> border_and_titleblock.machine());
|
||||||
m_assigned_label.replace("%LM", m_diagram -> border_and_titleblock.locmach());
|
m_assigned_label.replace("%LM", m_diagram -> border_and_titleblock.locmach());
|
||||||
|
|
||||||
|
|
||||||
if (m_element)
|
if (m_element)
|
||||||
{
|
{
|
||||||
|
if (settings.value("border-columns_0", true).toBool()){
|
||||||
|
m_assigned_label.replace("%c", QString::number(m_diagram->convertPosition(m_element->scenePos()).number() - 1));
|
||||||
|
}else{
|
||||||
m_assigned_label.replace("%c", QString::number(m_diagram->convertPosition(m_element->scenePos()).number()));
|
m_assigned_label.replace("%c", QString::number(m_diagram->convertPosition(m_element->scenePos()).number()));
|
||||||
|
}
|
||||||
m_assigned_label.replace("%l", m_diagram->convertPosition(m_element->scenePos()).letter());
|
m_assigned_label.replace("%l", m_diagram->convertPosition(m_element->scenePos()).letter());
|
||||||
m_assigned_label.replace("%prefix", m_element->getPrefix());
|
m_assigned_label.replace("%prefix", m_element->getPrefix());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -437,6 +437,8 @@ void BorderTitleBlock::draw(QPainter *painter)
|
|||||||
painter -> setPen(pen);
|
painter -> setPen(pen);
|
||||||
painter -> setBrush(Qt::NoBrush);
|
painter -> setBrush(Qt::NoBrush);
|
||||||
|
|
||||||
|
QSettings settings;
|
||||||
|
|
||||||
//Draw the borer
|
//Draw the borer
|
||||||
if (display_border_) painter -> drawRect(diagram_rect_);
|
if (display_border_) painter -> drawRect(diagram_rect_);
|
||||||
|
|
||||||
@@ -464,7 +466,11 @@ void BorderTitleBlock::draw(QPainter *painter)
|
|||||||
columns_header_height_
|
columns_header_height_
|
||||||
);
|
);
|
||||||
painter -> drawRect(numbered_rectangle);
|
painter -> drawRect(numbered_rectangle);
|
||||||
|
if (settings.value("border-columns_0", true).toBool()){
|
||||||
|
painter -> drawText(numbered_rectangle, Qt::AlignVCenter | Qt::AlignCenter, QString("%1").arg(i - 1));
|
||||||
|
}else{
|
||||||
painter -> drawText(numbered_rectangle, Qt::AlignVCenter | Qt::AlignCenter, QString("%1").arg(i));
|
painter -> drawText(numbered_rectangle, Qt::AlignVCenter | Qt::AlignCenter, QString("%1").arg(i));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -530,6 +536,8 @@ void BorderTitleBlock::drawDxf(int width, int height, bool keep_aspect_ratio, QS
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSettings settings;
|
||||||
|
|
||||||
// dessine la numerotation des colonnes
|
// dessine la numerotation des colonnes
|
||||||
if (display_border_ &&
|
if (display_border_ &&
|
||||||
display_columns_) {
|
display_columns_) {
|
||||||
@@ -541,8 +549,13 @@ void BorderTitleBlock::drawDxf(int width, int height, bool keep_aspect_ratio, QS
|
|||||||
double recWidth = columns_width_;
|
double recWidth = columns_width_;
|
||||||
double recHeight = columns_header_height_;
|
double recHeight = columns_header_height_;
|
||||||
Createdxf::drawRectangle(file_path, xCoord, yCoord, recWidth, recHeight, color);
|
Createdxf::drawRectangle(file_path, xCoord, yCoord, recWidth, recHeight, color);
|
||||||
|
if (settings.value("border-columns_0", true).toBool()){
|
||||||
|
Createdxf::drawTextAligned(file_path, QString::number(i - 1), xCoord,
|
||||||
|
yCoord + recHeight*0.5, recHeight*0.7, 0, 0, 1, 2, xCoord+recWidth/2, color, 0);
|
||||||
|
}else{
|
||||||
Createdxf::drawTextAligned(file_path, QString::number(i), xCoord,
|
Createdxf::drawTextAligned(file_path, QString::number(i), xCoord,
|
||||||
yCoord + recHeight*0.5, recHeight*0.7, 0, 0, 1, 2, xCoord+recWidth/2, color, 0);
|
yCoord + recHeight*0.5, recHeight*0.7, 0, 0, 1, 2, xCoord+recWidth/2, color, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "diagramposition.h"
|
#include "diagramposition.h"
|
||||||
|
#include "qetapp.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Constructeur
|
Constructeur
|
||||||
@@ -59,7 +60,13 @@ QString DiagramPosition::toString() {
|
|||||||
if (isOutOfBounds()) {
|
if (isOutOfBounds()) {
|
||||||
return("-");
|
return("-");
|
||||||
}
|
}
|
||||||
|
QSettings settings;
|
||||||
|
|
||||||
|
if (settings.value("border-columns_0", true).toBool()){
|
||||||
|
return(QString("%1%2").arg(letter_).arg(number_ - 1));
|
||||||
|
}else{
|
||||||
return(QString("%1%2").arg(letter_).arg(number_));
|
return(QString("%1%2").arg(letter_).arg(number_));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) :
|
|||||||
ui->m_save_label_paste->setChecked(settings.value("diagramcommands/erase-label-on-copy", true).toBool());
|
ui->m_save_label_paste->setChecked(settings.value("diagramcommands/erase-label-on-copy", true).toBool());
|
||||||
ui->m_use_folio_label->setChecked(settings.value("genericpanel/folio", true).toBool());
|
ui->m_use_folio_label->setChecked(settings.value("genericpanel/folio", true).toBool());
|
||||||
ui->m_export_terminal->setChecked(settings.value("nomenclature-exportlist", true).toBool());
|
ui->m_export_terminal->setChecked(settings.value("nomenclature-exportlist", true).toBool());
|
||||||
|
ui->m_border_0->setChecked(settings.value("border-columns_0", false).toBool());
|
||||||
ui->m_autosave_sb->setValue(settings.value("diagrameditor/autosave-interval", 0).toInt());
|
ui->m_autosave_sb->setValue(settings.value("diagrameditor/autosave-interval", 0).toInt());
|
||||||
|
|
||||||
QString fontInfos = settings.value("diagramitemfont").toString() + " " +
|
QString fontInfos = settings.value("diagramitemfont").toString() + " " +
|
||||||
@@ -114,6 +115,7 @@ void GeneralConfigurationPage::applyConf()
|
|||||||
settings.setValue("diagrameditor/zoom-out-beyond-of-folio", ui->m_zoom_out_beyond_folio->isChecked());
|
settings.setValue("diagrameditor/zoom-out-beyond-of-folio", ui->m_zoom_out_beyond_folio->isChecked());
|
||||||
settings.setValue("genericpanel/folio",ui->m_use_folio_label->isChecked());
|
settings.setValue("genericpanel/folio",ui->m_use_folio_label->isChecked());
|
||||||
settings.setValue("nomenclature/terminal-exportlist",ui->m_export_terminal->isChecked());
|
settings.setValue("nomenclature/terminal-exportlist",ui->m_export_terminal->isChecked());
|
||||||
|
settings.setValue("border-columns_0",ui->m_border_0->isChecked());
|
||||||
settings.setValue("diagrameditor/autosave-interval", ui->m_autosave_sb->value());
|
settings.setValue("diagrameditor/autosave-interval", ui->m_autosave_sb->value());
|
||||||
|
|
||||||
QString path = settings.value("elements-collections/common-collection-path").toString();
|
QString path = settings.value("elements-collections/common-collection-path").toString();
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>827</width>
|
<width>930</width>
|
||||||
<height>779</height>
|
<height>905</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -108,21 +108,21 @@
|
|||||||
<string>Projets</string>
|
<string>Projets</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="8" column="2">
|
<item row="9" column="2">
|
||||||
<widget class="QPushButton" name="m_font_pb">
|
<widget class="QPushButton" name="m_font_pb">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
<item row="8" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Sauvegarde automatique des projets (appliqué au prochain lancement de QElectroTech)</string>
|
<string>Sauvegarde automatique des projets (appliqué au prochain lancement de QElectroTech)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="2">
|
<item row="10" column="2">
|
||||||
<widget class="QPushButton" name="m_folio_list_pb">
|
<widget class="QPushButton" name="m_folio_list_pb">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
@@ -150,14 +150,14 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0">
|
<item row="10" column="0">
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Police des champs textes des pages sommaires</string>
|
<string>Police des champs textes des pages sommaires</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0">
|
<item row="9" column="0">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Police des champs de texte</string>
|
<string>Police des champs de texte</string>
|
||||||
@@ -171,7 +171,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="2">
|
<item row="8" column="2">
|
||||||
<widget class="QSpinBox" name="m_autosave_sb">
|
<widget class="QSpinBox" name="m_autosave_sb">
|
||||||
<property name="frame">
|
<property name="frame">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@@ -205,7 +205,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="1">
|
<item row="8" column="1">
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
@@ -218,6 +218,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="7" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="m_border_0">
|
||||||
|
<property name="text">
|
||||||
|
<string extracomment="Choix de l'increment de depart 1 ou 0">Activer la numérotation à partir de 0 pour la colonne des cartouches au lieu de 1</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user