mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 16:20:52 +01:00
Les modifications faites au schema (colonnes et hauteur) sont desormais enregistrees et relues dans les fichiers
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@73 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -132,6 +132,13 @@ void BorderInset::removeColumn() {
|
||||
updateRectangles();
|
||||
}
|
||||
|
||||
void BorderInset::setNbColumns(int nb_c) {
|
||||
if (nb_c < 3) return;
|
||||
nb_columns = nb_c;
|
||||
setInsetWidth(nb_columns * columns_width);
|
||||
updateRectangles();
|
||||
}
|
||||
|
||||
/**
|
||||
Change la largeur des colonnes ; celle-ci doit rester comprise entre 10 et
|
||||
200px.
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
// methodes d'acces en ecriture aux dimensions
|
||||
void addColumn ();
|
||||
void removeColumn ();
|
||||
void setNbColumns (int);
|
||||
void setColumnsWidth (const qreal &);
|
||||
void setColumnsHeaderHeight(const qreal &);
|
||||
void setColumnsHeight (const qreal &);
|
||||
|
||||
16
diagram.cpp
16
diagram.cpp
@@ -158,6 +158,9 @@ QDomDocument Diagram::toXml(bool diagram) {
|
||||
if (!border_and_inset.title().isNull()) racine.setAttribute("titre", border_and_inset.title());
|
||||
if (!border_and_inset.fileName().isNull()) racine.setAttribute("filename", border_and_inset.fileName());
|
||||
if (!border_and_inset.folio().isNull()) racine.setAttribute("folio", border_and_inset.folio());
|
||||
racine.setAttribute("cols", border_and_inset.nbColumn());
|
||||
racine.setAttribute("colsize", border_and_inset.columnsWidth());
|
||||
racine.setAttribute("height", border_and_inset.columnsHeight());
|
||||
}
|
||||
document.appendChild(racine);
|
||||
|
||||
@@ -227,6 +230,19 @@ bool Diagram::fromXml(QDomDocument &document, QPointF position, bool consider_in
|
||||
border_and_inset.setDate(QDate::fromString(racine.attribute("date"), "yyyyMMdd"));
|
||||
border_and_inset.setFileName(racine.attribute("filename"));
|
||||
border_and_inset.setFolio(racine.attribute("folio"));
|
||||
|
||||
bool ok;
|
||||
// nombre de colonnes
|
||||
int nb_cols = racine.attribute("cols").toInt(&ok);
|
||||
if (ok) border_and_inset.setNbColumns(nb_cols);
|
||||
|
||||
// taille des colonnes
|
||||
double col_size = racine.attribute("colsize").toDouble(&ok);
|
||||
if (ok) border_and_inset.setColumnsWidth(col_size);
|
||||
|
||||
// hauteur du schema
|
||||
double height = racine.attribute("height").toDouble(&ok);
|
||||
if (ok) border_and_inset.setColumnsHeight(height);
|
||||
}
|
||||
|
||||
// si la racine n'a pas d'enfant : le chargement est fini (schema vide)
|
||||
|
||||
Reference in New Issue
Block a user