--HG--
branch : develop
This commit is contained in:
dismine 2014-04-15 21:39:08 +03:00
commit 4a404a4ab8
5 changed files with 64 additions and 30 deletions

View file

@ -19,6 +19,11 @@ syntax: glob
# Ignore this directory. # Ignore this directory.
html/ html/
latex/ latex/
bin/
moc/
obj/
uic/
rcc/
# Ignore file used QtCreator for user profile. # Ignore file used QtCreator for user profile.
*.pro.user *.pro.user
@ -28,3 +33,6 @@ latex/
# Ignore Mercurial .orig files # Ignore Mercurial .orig files
*.orig *.orig
# Ignore Makefile
Makefile

4
.hgtags Normal file
View file

@ -0,0 +1,4 @@
2ab78f901668c44312af334dd09ed90984df1a71 v0.1.0
841f8c5c7d9689bb934a2abf3511b186eb2730b6 v0.2.0
05574b36e68c06986e8d3a51106694bf54eef65c v0.2.1
a734ccf61671ef07ba20b24878548174c4a6b092 v0.2.2

View file

@ -42,8 +42,8 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, QWidget *parent)
flagFormula = false; flagFormula = false;
flagName = false; flagName = false;
CheckState();
InitOkCansel(ui); InitOkCansel(ui);
CheckState();
FillComboBoxTypeLine(ui->comboBoxLineType); FillComboBoxTypeLine(ui->comboBoxLineType);
ui->comboBoxLineType->setCurrentIndex(0); ui->comboBoxLineType->setCurrentIndex(0);

View file

@ -987,14 +987,14 @@ void MainWindow::PatternWasModified()
void MainWindow::ChangedSize(const QString & text) void MainWindow::ChangedSize(const QString & text)
{ {
qint32 size = text.toInt(); qint32 size = text.toInt();
pattern->SetSize(size*10); pattern->SetSize(size);
doc->FullUpdateTree(); doc->FullUpdateTree();
} }
void MainWindow::ChangedHeight(const QString &text) void MainWindow::ChangedHeight(const QString &text)
{ {
qint32 growth = text.toInt(); qint32 growth = text.toInt();
pattern->SetHeight(growth*10); pattern->SetHeight(growth);
doc->FullUpdateTree(); doc->FullUpdateTree();
} }

View file

@ -6,8 +6,8 @@
** **
** @brief ** @brief
** @copyright ** @copyright
** This source code is part of the Valentine project, a pattern making ** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing. ** program that allows creating and modelling patterns of clothing.
** Copyright (C) 2013 Valentina project ** Copyright (C) 2013 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved. ** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
** **
@ -41,7 +41,25 @@
#endif #endif
/** /**
* @brief The VDomDocument class extend QDomDocument class. * @brief The VDomDocument class represents a Valentina document (.val file).
*
* A Valentina document describes the construction of a sewing pattern. The
* information is stored in XML format. By parsing a VDomDocument, the contained
* pattern is rendered to a Valentina graphics scene (VMainGraphicsScene).
*
* A sewing pattern consists of zero or more increments and one
* or more pattern pieces.
*
* An increment is an auxiliary variable that is calculated from regular measurement
* variables (that belong to the standard measurements table). Increments are used to
* create a graduation schema for the sewing pattern.
*
* A pattern piece contains
* 1) auxiliary pattern construction elements (calculation),
* 2) pattern construction elements (modeling), and
* 3) special markers, e.g. seam allowances (details).
* Of these, 2) and 3) are visible in the final pattern (draw mode 'Modeling'),
* 1) is only displayed when editing (draw mode 'Calculation') the pattern.
*/ */
class VDomDocument : public QDomDocument class VDomDocument : public QDomDocument
{ {
@ -53,21 +71,22 @@ public:
static const QString UnitCM; static const QString UnitCM;
static const QString UnitINCH; static const QString UnitINCH;
/** /**
* @brief VDomDocument constructor. * @param data container with variables
* @param data container with variables. * @param comboBoxDraws pointer to the ComboBox that will hold the pattern piece names
* @param parent parent object * @param mode draw mode
*/ * @param parent
*/
VDomDocument(VContainer *data); VDomDocument(VContainer *data);
virtual ~VDomDocument(){} virtual ~VDomDocument(){}
/** /**
* @brief elementById find element by id. * @brief Finds an element by id.
* @param id value id attribute. * @param id value id attribute.
* @return dom element. * @return dom element.
*/ */
QDomElement elementById(const QString& id); QDomElement elementById(const QString& id);
/** /**
* @brief removeAllChilds remove all tag childs. * @brief Removes all children of a given element tag. RENAME: removeAllChildren
* @param element tag. * @param element tag
*/ */
void removeAllChilds(QDomElement &element); void removeAllChilds(QDomElement &element);
template <typename T> template <typename T>
@ -76,6 +95,11 @@ public:
* @param domElement element in xml tree. * @param domElement element in xml tree.
* @param name name of attribute. * @param name name of attribute.
* @param value value of attribute. * @param value value of attribute.
* @param parse parsing mode
* @return list of tool pointers
* @return list of history record lists
* @return cursor
* @throw VExceptionUniqueId
*/ */
void SetAttribute(QDomElement &domElement, const QString &name, const T &value) void SetAttribute(QDomElement &domElement, const QString &name, const T &value)
{ {
@ -84,29 +108,27 @@ public:
domElement.setAttribute(name, val); domElement.setAttribute(name, val);
} }
/** /**
* @brief GetParametrLongLong return long long value of attribute. * @brief Returns the long long value of the given attribute. RENAME: GetParameterLongLong?
* @param domElement tag in xml tree. * @param domElement tag in xml tree
* @param name attribute name. * @param name attribute name
* @return long long value. * @return long long value
*/ */
quint32 GetParametrUInt(const QDomElement& domElement, const QString &name, quint32 GetParametrUInt(const QDomElement& domElement, const QString &name,
const QString &defValue) const; const QString &defValue) const;
/** /**
* @brief GetParametrString return string value of attribute. * @brief Returns the string value of the given attribute. RENAME: see above
* *
* if attribute empty return default value. If default value empty too throw exception. * if attribute empty return default value. If default value empty too throw exception.
* @param domElement tag in xml tree. * @return attribute value
* @param name attribute name.
* @throw VExceptionEmptyParameter when attribute is empty * @throw VExceptionEmptyParameter when attribute is empty
* @return attribute value.
*/ */
QString GetParametrString(const QDomElement& domElement, const QString &name, QString GetParametrString(const QDomElement& domElement, const QString &name,
const QString &defValue = QString()) const; const QString &defValue = QString()) const;
/** /**
* @brief GetParametrDouble return double value of attribute. * @brief Returns the double value of the given attribute.
* @param domElement tag in xml tree. * @param domElement tag in xml tree
* @param name attribute name. * @param name attribute name
* @return double value. * @return double value
*/ */
qreal GetParametrDouble(const QDomElement& domElement, const QString &name, const QString &defValue) const; qreal GetParametrDouble(const QDomElement& domElement, const QString &name, const QString &defValue) const;
QString UniqueTagText(const QString &tagName, const QString &defVal = QString()) const; QString UniqueTagText(const QString &tagName, const QString &defVal = QString()) const;
@ -134,15 +156,15 @@ protected:
private: private:
Q_DISABLE_COPY(VDomDocument) Q_DISABLE_COPY(VDomDocument)
/** /**
* @brief map use for finding element by id. * @brief Map used for finding element by id.
*/ */
QHash<QString, QDomElement> map; QHash<QString, QDomElement> map;
/** /**
* @brief find find element by id. * @brief Find element by id.
* @param node node. * @param node node
* @param id id value. * @param id id value
* @return true if found. * @return true if found
*/ */
bool find(const QDomElement &node, const QString& id); bool find(const QDomElement &node, const QString& id);
}; };