mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +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,6 +193,7 @@ namespace autonum
|
||||
|
||||
return str;
|
||||
}
|
||||
QSettings settings;
|
||||
|
||||
AssignVariables::AssignVariables(const QString& formula, const sequentialNumbers& seqStruct , Diagram *diagram, const Element *elmt):
|
||||
m_diagram(diagram),
|
||||
@@ -200,6 +201,7 @@ namespace autonum
|
||||
m_assigned_label(formula),
|
||||
m_seq_struct(seqStruct),
|
||||
m_element(elmt)
|
||||
|
||||
{
|
||||
if (m_diagram)
|
||||
{
|
||||
@@ -213,7 +215,11 @@ namespace autonum
|
||||
|
||||
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("%l", m_diagram->convertPosition(m_element->scenePos()).letter());
|
||||
m_assigned_label.replace("%prefix", m_element->getPrefix());
|
||||
}
|
||||
|
||||
@@ -437,6 +437,8 @@ void BorderTitleBlock::draw(QPainter *painter)
|
||||
painter -> setPen(pen);
|
||||
painter -> setBrush(Qt::NoBrush);
|
||||
|
||||
QSettings settings;
|
||||
|
||||
//Draw the borer
|
||||
if (display_border_) painter -> drawRect(diagram_rect_);
|
||||
|
||||
@@ -464,9 +466,13 @@ void BorderTitleBlock::draw(QPainter *painter)
|
||||
columns_header_height_
|
||||
);
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Draw the nums of rows
|
||||
if (display_border_ && display_rows_) {
|
||||
@@ -530,6 +536,8 @@ void BorderTitleBlock::drawDxf(int width, int height, bool keep_aspect_ratio, QS
|
||||
);
|
||||
}
|
||||
|
||||
QSettings settings;
|
||||
|
||||
// dessine la numerotation des colonnes
|
||||
if (display_border_ &&
|
||||
display_columns_) {
|
||||
@@ -541,10 +549,15 @@ void BorderTitleBlock::drawDxf(int width, int height, bool keep_aspect_ratio, QS
|
||||
double recWidth = columns_width_;
|
||||
double recHeight = columns_header_height_;
|
||||
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,
|
||||
yCoord + recHeight*0.5, recHeight*0.7, 0, 0, 1, 2, xCoord+recWidth/2, color, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// dessine la numerotation des lignes
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "diagramposition.h"
|
||||
#include "qetapp.h"
|
||||
|
||||
/**
|
||||
Constructeur
|
||||
@@ -59,7 +60,13 @@ QString DiagramPosition::toString() {
|
||||
if (isOutOfBounds()) {
|
||||
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_));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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_use_folio_label->setChecked(settings.value("genericpanel/folio", 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());
|
||||
|
||||
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("genericpanel/folio",ui->m_use_folio_label->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());
|
||||
|
||||
QString path = settings.value("elements-collections/common-collection-path").toString();
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>827</width>
|
||||
<height>779</height>
|
||||
<width>930</width>
|
||||
<height>905</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -108,21 +108,21 @@
|
||||
<string>Projets</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="8" column="2">
|
||||
<item row="9" column="2">
|
||||
<widget class="QPushButton" name="m_font_pb">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Sauvegarde automatique des projets (appliqué au prochain lancement de QElectroTech)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="2">
|
||||
<item row="10" column="2">
|
||||
<widget class="QPushButton" name="m_folio_list_pb">
|
||||
<property name="text">
|
||||
<string/>
|
||||
@@ -150,14 +150,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Police des champs textes des pages sommaires</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Police des champs de texte</string>
|
||||
@@ -171,7 +171,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<item row="8" column="2">
|
||||
<widget class="QSpinBox" name="m_autosave_sb">
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
@@ -205,7 +205,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<item row="8" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -218,6 +218,13 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</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>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user