mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
Wrap code for better readability
This commit is contained in:
parent
8ee38fab9e
commit
5d92393ee7
@ -53,7 +53,8 @@ ElementsLocation::ElementsLocation(const QString &path, QETProject *project) :
|
||||
@brief ElementsLocation::~ElementsLocation
|
||||
Destructeur
|
||||
*/
|
||||
ElementsLocation::~ElementsLocation() {
|
||||
ElementsLocation::~ElementsLocation()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -110,7 +111,8 @@ ElementsLocation &ElementsLocation::operator=(const ElementsLocation &other) {
|
||||
\~French true si other et cet ElementsLocation sont identiques,
|
||||
false sinon
|
||||
*/
|
||||
bool ElementsLocation::operator==(const ElementsLocation &other) const {
|
||||
bool ElementsLocation::operator==(const ElementsLocation &other) const
|
||||
{
|
||||
return(
|
||||
m_collection_path == other.m_collection_path &&\
|
||||
m_project == other.m_project
|
||||
@ -124,7 +126,8 @@ bool ElementsLocation::operator==(const ElementsLocation &other) const {
|
||||
@return true si other et cet ElementsLocation sont differents,
|
||||
false sinon
|
||||
*/
|
||||
bool ElementsLocation::operator!=(const ElementsLocation &other) const {
|
||||
bool ElementsLocation::operator!=(const ElementsLocation &other) const
|
||||
{
|
||||
return(
|
||||
m_collection_path != other.m_collection_path ||\
|
||||
m_project != other.m_project
|
||||
@ -139,7 +142,8 @@ bool ElementsLocation::operator!=(const ElementsLocation &other) const {
|
||||
For exemple if this location represent an element they return myElement.
|
||||
@see fileName()
|
||||
*/
|
||||
QString ElementsLocation::baseName() const {
|
||||
QString ElementsLocation::baseName() const
|
||||
{
|
||||
QRegExp regexp("^.*([^/]+)\\.elmt$");
|
||||
if (regexp.exactMatch(m_collection_path)) {
|
||||
return(regexp.capturedTexts().at(1));
|
||||
@ -203,7 +207,8 @@ QString ElementsLocation::fileSystemPath() const
|
||||
@return The path of this location.
|
||||
@deprecated use instead collectionPath(true)
|
||||
*/
|
||||
QString ElementsLocation::path() const {
|
||||
QString ElementsLocation::path() const
|
||||
{
|
||||
return(m_collection_path);
|
||||
}
|
||||
|
||||
@ -343,7 +348,8 @@ bool ElementsLocation::addToPath(const QString &string)
|
||||
@return the location of the parent category, or a copy of this location
|
||||
when it represents a root category.
|
||||
*/
|
||||
ElementsLocation ElementsLocation::parent() const {
|
||||
ElementsLocation ElementsLocation::parent() const
|
||||
{
|
||||
ElementsLocation copy(*this);
|
||||
QRegExp re1("^([a-z]+://)(.*)/*$");
|
||||
if (re1.exactMatch(m_collection_path)) {
|
||||
@ -362,7 +368,8 @@ ElementsLocation ElementsLocation::parent() const {
|
||||
\~French
|
||||
le projet de cet emplacement ou 0 si celui-ci n'est pas lie a un projet.
|
||||
*/
|
||||
QETProject *ElementsLocation::project() const {
|
||||
QETProject *ElementsLocation::project() const
|
||||
{
|
||||
return(m_project);
|
||||
}
|
||||
|
||||
@ -384,7 +391,8 @@ void ElementsLocation::setProject(QETProject *project) {
|
||||
\~French
|
||||
true si l'emplacement semble utilisable (chemin virtuel non vide).
|
||||
*/
|
||||
bool ElementsLocation::isNull() const {
|
||||
bool ElementsLocation::isNull() const
|
||||
{
|
||||
return(m_collection_path.isEmpty());
|
||||
}
|
||||
|
||||
@ -393,7 +401,8 @@ bool ElementsLocation::isNull() const {
|
||||
@return A character string representing the location
|
||||
\~French Une chaine de caracteres representant l'emplacement
|
||||
*/
|
||||
QString ElementsLocation::toString() const {
|
||||
QString ElementsLocation::toString() const
|
||||
{
|
||||
QString result;
|
||||
if (m_project) {
|
||||
int project_id = QETApp::projectId(m_project);
|
||||
@ -409,7 +418,8 @@ QString ElementsLocation::toString() const {
|
||||
@brief ElementsLocation::isElement
|
||||
@return true if this location represent an element
|
||||
*/
|
||||
bool ElementsLocation::isElement() const {
|
||||
bool ElementsLocation::isElement() const
|
||||
{
|
||||
return m_collection_path.endsWith(".elmt");
|
||||
}
|
||||
|
||||
@ -417,7 +427,8 @@ bool ElementsLocation::isElement() const {
|
||||
@brief ElementsLocation::isDirectory
|
||||
@return true if this location represent a directory
|
||||
*/
|
||||
bool ElementsLocation::isDirectory() const {
|
||||
bool ElementsLocation::isDirectory() const
|
||||
{
|
||||
return (!isElement() && !m_collection_path.isEmpty());
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,8 @@ XmlElementCollection::XmlElementCollection(const QDomElement &dom_element,
|
||||
of the dom element is : collection
|
||||
@return The root QDomElement of the collection
|
||||
*/
|
||||
QDomElement XmlElementCollection::root() const {
|
||||
QDomElement XmlElementCollection::root() const
|
||||
{
|
||||
return m_dom_document.documentElement();
|
||||
}
|
||||
|
||||
@ -116,7 +117,8 @@ QDomElement XmlElementCollection::root() const {
|
||||
@return The QDomElement import (the begining of a xml collection) or
|
||||
a null QDomElement if doesn't exist.
|
||||
*/
|
||||
QDomElement XmlElementCollection::importCategory() const {
|
||||
QDomElement XmlElementCollection::importCategory() const
|
||||
{
|
||||
return root().firstChildElement("category");
|
||||
}
|
||||
|
||||
|
@ -24,13 +24,15 @@ int NamesList::MetaTypeId = qRegisterMetaType<NamesList>("NamesList");
|
||||
/**
|
||||
Constructeur
|
||||
*/
|
||||
NamesList::NamesList() {
|
||||
NamesList::NamesList()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
Destructeur
|
||||
*/
|
||||
NamesList::~NamesList() {
|
||||
NamesList::~NamesList()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -56,28 +58,32 @@ void NamesList::removeName(const QString &lang) {
|
||||
/**
|
||||
Supprime tous les noms
|
||||
*/
|
||||
void NamesList::clearNames() {
|
||||
void NamesList::clearNames()
|
||||
{
|
||||
hash_names.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
@return La liste de toutes les langues disponibles
|
||||
*/
|
||||
QList<QString> NamesList::langs() const {
|
||||
QList<QString> NamesList::langs() const
|
||||
{
|
||||
return(hash_names.keys());
|
||||
}
|
||||
|
||||
/**
|
||||
@return true si la liste de noms est vide, false sinon
|
||||
*/
|
||||
bool NamesList::isEmpty() const {
|
||||
bool NamesList::isEmpty() const
|
||||
{
|
||||
return(hash_names.isEmpty());
|
||||
}
|
||||
|
||||
/**
|
||||
@return Le nombre de noms dans la liste
|
||||
*/
|
||||
int NamesList::count() const {
|
||||
int NamesList::count() const
|
||||
{
|
||||
return(hash_names.count());
|
||||
}
|
||||
|
||||
@ -95,7 +101,8 @@ QString &NamesList::operator[](const QString &lang) {
|
||||
@return Le nom dans la langue donnee ou QString() si ce nom n'est pas
|
||||
defini
|
||||
*/
|
||||
const QString NamesList::operator[](const QString &lang) const {
|
||||
const QString NamesList::operator[](const QString &lang) const
|
||||
{
|
||||
return(hash_names.value(lang));
|
||||
}
|
||||
|
||||
@ -166,7 +173,8 @@ void NamesList::fromXml(const pugi::xml_node &xml_element, const QHash<QString,
|
||||
@return L'element XML correspondant a la section "names"
|
||||
@see count()
|
||||
*/
|
||||
QDomElement NamesList::toXml(QDomDocument &xml_document, const QHash<QString, QString> &xml_options) const {
|
||||
QDomElement NamesList::toXml(QDomDocument &xml_document, const QHash<QString, QString> &xml_options) const
|
||||
{
|
||||
QHash<QString, QString> xml_opt = getXmlOptions(xml_options);
|
||||
QDomElement names_elmt = xml_document.createElement(xml_opt["ParentTagName"]);
|
||||
QHashIterator<QString, QString> names_iterator(hash_names);
|
||||
@ -187,7 +195,8 @@ QDomElement NamesList::toXml(QDomDocument &xml_document, const QHash<QString, QS
|
||||
* LanguageAttribute (falls back to "lang")
|
||||
@return the same set, with at least all the known options
|
||||
*/
|
||||
QHash<QString, QString> NamesList::getXmlOptions(const QHash<QString, QString> &xml_options) const {
|
||||
QHash<QString, QString> NamesList::getXmlOptions(const QHash<QString, QString> &xml_options) const
|
||||
{
|
||||
QHash<QString, QString> new_xml_options = xml_options;
|
||||
if (!xml_options.contains("ParentTagName")) {
|
||||
new_xml_options.insert("ParentTagName", "names");
|
||||
@ -205,7 +214,8 @@ QHash<QString, QString> NamesList::getXmlOptions(const QHash<QString, QString> &
|
||||
@param nl une autre liste de noms
|
||||
@return true si les listes de noms sont differentes, false sinon
|
||||
*/
|
||||
bool NamesList::operator!=(const NamesList &nl) const {
|
||||
bool NamesList::operator!=(const NamesList &nl) const
|
||||
{
|
||||
return(hash_names != nl.hash_names);
|
||||
}
|
||||
|
||||
@ -213,7 +223,8 @@ bool NamesList::operator!=(const NamesList &nl) const {
|
||||
@param nl une autre liste de noms
|
||||
@return true si les listes de noms sont identiques, false sinon
|
||||
*/
|
||||
bool NamesList::operator==(const NamesList &nl) const {
|
||||
bool NamesList::operator==(const NamesList &nl) const
|
||||
{
|
||||
return(hash_names == nl.hash_names);
|
||||
}
|
||||
|
||||
@ -228,7 +239,8 @@ bool NamesList::operator==(const NamesList &nl) const {
|
||||
@param fallback_name name to be returned when no adequate name has been found
|
||||
@return The adequate name regarding the current system locale.
|
||||
*/
|
||||
QString NamesList::name(const QString &fallback_name) const {
|
||||
QString NamesList::name(const QString &fallback_name) const
|
||||
{
|
||||
QString system_language = QETApp::langFromSetting();
|
||||
QString returned_name;
|
||||
if (!hash_names[system_language].isEmpty()) {
|
||||
|
@ -35,7 +35,8 @@ NameListDialog::NameListDialog(QWidget *parent) :
|
||||
#endif
|
||||
}
|
||||
|
||||
NameListDialog::~NameListDialog() {
|
||||
NameListDialog::~NameListDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@ -48,7 +49,8 @@ void NameListDialog::setInformationText(const QString &text) {
|
||||
@return the name list widget used by this dialog.
|
||||
The ownership of the namelistwidget stay to this dialog
|
||||
*/
|
||||
NameListWidget *NameListDialog::namelistWidget() const {
|
||||
NameListWidget *NameListDialog::namelistWidget() const
|
||||
{
|
||||
return m_namelist_widget;
|
||||
}
|
||||
|
||||
@ -62,6 +64,7 @@ void NameListDialog::setHelpText(const QString &text)
|
||||
}
|
||||
}
|
||||
|
||||
void NameListDialog::showHelpDialog() {
|
||||
void NameListDialog::showHelpDialog()
|
||||
{
|
||||
QMessageBox::information(this, tr("Variables de cartouche"), m_help_text);
|
||||
}
|
||||
|
@ -122,7 +122,8 @@ void NameListWidget::setReadOnly(bool ro)
|
||||
@return true if empty.
|
||||
An empty dialog, is a dialog without any edited lang.
|
||||
*/
|
||||
bool NameListWidget::isEmpty() const {
|
||||
bool NameListWidget::isEmpty() const
|
||||
{
|
||||
return names().isEmpty();
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,8 @@ bool PropertiesEditorDockWidget::addEditor(PropertiesEditorWidget *editor,
|
||||
@brief PropertiesEditorDockWidget::editors
|
||||
@return all editor used in this dock
|
||||
*/
|
||||
QList<PropertiesEditorWidget *> PropertiesEditorDockWidget::editors() const {
|
||||
QList<PropertiesEditorWidget *> PropertiesEditorDockWidget::editors() const
|
||||
{
|
||||
return m_editor_list;
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,8 @@ QUndoCommand *PropertiesEditorWidget::associatedUndo() const{
|
||||
@brief PropertiesEditorWidget::title
|
||||
@return the title of this editor
|
||||
*/
|
||||
QString PropertiesEditorWidget::title() const {
|
||||
QString PropertiesEditorWidget::title() const
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
|
||||
@ -68,6 +69,7 @@ bool PropertiesEditorWidget::setLiveEdit(bool live_edit) {
|
||||
@return true if this editor is in live edit mode
|
||||
else return fasle.
|
||||
*/
|
||||
bool PropertiesEditorWidget::isLiveEdit() const {
|
||||
bool PropertiesEditorWidget::isLiveEdit() const
|
||||
{
|
||||
return m_live_edit;
|
||||
}
|
||||
|
@ -37,7 +37,8 @@ QetGraphicsHandlerItem::QetGraphicsHandlerItem(qreal size) :
|
||||
@brief QetGraphicsHandlerItem::boundingRect
|
||||
@return
|
||||
*/
|
||||
QRectF QetGraphicsHandlerItem::boundingRect() const {
|
||||
QRectF QetGraphicsHandlerItem::boundingRect() const
|
||||
{
|
||||
return m_br;
|
||||
}
|
||||
|
||||
|
@ -319,7 +319,8 @@ void ReplaceConductorDialog::on_m_neutral_cb_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void ReplaceConductorDialog::on_m_update_preview_pb_clicked() {
|
||||
void ReplaceConductorDialog::on_m_update_preview_pb_clicked()
|
||||
{
|
||||
updatePreview();
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,8 @@ ReplaceFolioDialog::~ReplaceFolioDialog()
|
||||
@brief ReplaceFolioDialog::titleBlockProperties
|
||||
@return The title block properties edited by this dialog
|
||||
*/
|
||||
TitleBlockProperties ReplaceFolioDialog::titleBlockProperties() const {
|
||||
TitleBlockProperties ReplaceFolioDialog::titleBlockProperties() const
|
||||
{
|
||||
return m_widget->titleBlockProperties();
|
||||
}
|
||||
|
||||
@ -152,49 +153,56 @@ void ReplaceFolioDialog::setTitleBlockProperties(
|
||||
const TitleBlockProperties &properties) {
|
||||
m_widget->setTitleBlockProperties(properties);
|
||||
}
|
||||
void ReplaceFolioWidget::on_m_title_cb_clicked() {
|
||||
void ReplaceFolioWidget::on_m_title_cb_clicked()
|
||||
{
|
||||
ui->m_title_le->setText(ui->m_title_cb->isChecked()
|
||||
? SearchAndReplaceWorker::eraseText()
|
||||
: QString());
|
||||
ui->m_title_le->setDisabled(ui->m_title_cb->isChecked());
|
||||
}
|
||||
|
||||
void ReplaceFolioWidget::on_m_author_cb_clicked() {
|
||||
void ReplaceFolioWidget::on_m_author_cb_clicked()
|
||||
{
|
||||
ui->m_author_le->setText(ui->m_author_cb->isChecked()
|
||||
? SearchAndReplaceWorker::eraseText()
|
||||
: QString());
|
||||
ui->m_author_le->setDisabled(ui->m_author_cb->isChecked());
|
||||
}
|
||||
|
||||
void ReplaceFolioWidget::on_m_file_cb_clicked() {
|
||||
void ReplaceFolioWidget::on_m_file_cb_clicked()
|
||||
{
|
||||
ui->m_file_le->setText(ui->m_file_cb->isChecked()
|
||||
? SearchAndReplaceWorker::eraseText()
|
||||
: QString());
|
||||
ui->m_file_le->setDisabled(ui->m_file_cb->isChecked());
|
||||
}
|
||||
|
||||
void ReplaceFolioWidget::on_m_folio_cb_clicked() {
|
||||
void ReplaceFolioWidget::on_m_folio_cb_clicked()
|
||||
{
|
||||
ui->m_folio_le->setText(ui->m_folio_cb->isChecked()
|
||||
? SearchAndReplaceWorker::eraseText()
|
||||
: QString());
|
||||
ui->m_folio_le->setDisabled(ui->m_folio_cb->isChecked());
|
||||
}
|
||||
|
||||
void ReplaceFolioWidget::on_m_plant_cb_clicked() {
|
||||
void ReplaceFolioWidget::on_m_plant_cb_clicked()
|
||||
{
|
||||
ui->m_plant->setText(ui->m_plant_cb->isChecked()
|
||||
? SearchAndReplaceWorker::eraseText()
|
||||
: QString());
|
||||
ui->m_plant->setDisabled(ui->m_plant_cb->isChecked());
|
||||
}
|
||||
|
||||
void ReplaceFolioWidget::on_m_loc_cb_clicked() {
|
||||
void ReplaceFolioWidget::on_m_loc_cb_clicked()
|
||||
{
|
||||
ui->m_loc->setText(ui->m_loc_cb->isChecked()
|
||||
? SearchAndReplaceWorker::eraseText()
|
||||
: QString());
|
||||
ui->m_loc->setDisabled(ui->m_loc_cb->isChecked());
|
||||
}
|
||||
|
||||
void ReplaceFolioWidget::on_m_indice_cb_clicked() {
|
||||
void ReplaceFolioWidget::on_m_indice_cb_clicked()
|
||||
{
|
||||
ui->m_indice->setText(ui->m_indice_cb->isChecked()
|
||||
? SearchAndReplaceWorker::eraseText()
|
||||
: QString());
|
||||
|
@ -70,7 +70,8 @@ SearchAndReplaceWidget::SearchAndReplaceWidget(QWidget *parent) :
|
||||
@brief SearchAndReplaceWidget::~SearchAndReplaceWidget
|
||||
Destructor
|
||||
*/
|
||||
SearchAndReplaceWidget::~SearchAndReplaceWidget() {
|
||||
SearchAndReplaceWidget::~SearchAndReplaceWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,8 @@ namespace autonum
|
||||
hundred_folio = other.hundred_folio;
|
||||
}
|
||||
|
||||
sequentialNumbers::~sequentialNumbers() {}
|
||||
sequentialNumbers::~sequentialNumbers()
|
||||
{}
|
||||
|
||||
sequentialNumbers &sequentialNumbers::operator=(
|
||||
const sequentialNumbers &other)
|
||||
|
@ -23,7 +23,8 @@
|
||||
/**
|
||||
Constructor
|
||||
*/
|
||||
NumerotationContext::NumerotationContext(){
|
||||
NumerotationContext::NumerotationContext()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -36,7 +37,8 @@ NumerotationContext::NumerotationContext(QDomElement &e) {
|
||||
/**
|
||||
@brief NumerotationContext::clear, clear the content
|
||||
*/
|
||||
void NumerotationContext::clear () {
|
||||
void NumerotationContext::clear ()
|
||||
{
|
||||
content_.clear();
|
||||
}
|
||||
|
||||
@ -75,7 +77,8 @@ bool NumerotationContext::addValue(const QString &type,
|
||||
@param i
|
||||
@return the string at position i
|
||||
*/
|
||||
QString NumerotationContext::operator [] (const int &i) const {
|
||||
QString NumerotationContext::operator [] (const int &i) const
|
||||
{
|
||||
return (content_.at(i));
|
||||
}
|
||||
|
||||
@ -90,7 +93,8 @@ void NumerotationContext::operator << (const NumerotationContext &other) {
|
||||
@brief NumerotationContext::size
|
||||
@return size of context
|
||||
*/
|
||||
int NumerotationContext::size() const {
|
||||
int NumerotationContext::size() const
|
||||
{
|
||||
return (content_.size());
|
||||
}
|
||||
|
||||
@ -98,7 +102,8 @@ int NumerotationContext::size() const {
|
||||
@brief NumerotationContext::isEmpty
|
||||
@return true if numerotation contet is empty
|
||||
*/
|
||||
bool NumerotationContext::isEmpty() const {
|
||||
bool NumerotationContext::isEmpty() const
|
||||
{
|
||||
if (content_.size() > 0) return false;
|
||||
return true;
|
||||
}
|
||||
@ -107,7 +112,8 @@ bool NumerotationContext::isEmpty() const {
|
||||
@param i
|
||||
@return the content at position i 1:type 2:value 3:increase
|
||||
*/
|
||||
QStringList NumerotationContext::itemAt(const int i) const {
|
||||
QStringList NumerotationContext::itemAt(const int i) const
|
||||
{
|
||||
return (content_.at(i).split("|"));
|
||||
}
|
||||
|
||||
@ -115,7 +121,8 @@ QStringList NumerotationContext::itemAt(const int i) const {
|
||||
@brief validRegExpNum
|
||||
@return all type use to numerotation
|
||||
*/
|
||||
QString NumerotationContext::validRegExpNum () const {
|
||||
QString NumerotationContext::validRegExpNum () const
|
||||
{
|
||||
return ("unit|unitfolio|ten|tenfolio|hundred|hundredfolio|string|idfolio|folio|plant|locmach|elementline|elementcolumn|elementprefix");
|
||||
}
|
||||
|
||||
@ -123,7 +130,8 @@ QString NumerotationContext::validRegExpNum () const {
|
||||
@brief NumerotationContext::validRegExpNumber
|
||||
@return all type represents a number
|
||||
*/
|
||||
QString NumerotationContext::validRegExpNumber() const {
|
||||
QString NumerotationContext::validRegExpNumber() const
|
||||
{
|
||||
return ("unit|unitfolio|ten|tenfolio|hundred|hundredfolio");
|
||||
}
|
||||
|
||||
@ -131,7 +139,8 @@ QString NumerotationContext::validRegExpNumber() const {
|
||||
@brief NumerotationContext::keyIsAcceptable
|
||||
@return true if type is acceptable
|
||||
*/
|
||||
bool NumerotationContext::keyIsAcceptable(const QString &type) const {
|
||||
bool NumerotationContext::keyIsAcceptable(const QString &type) const
|
||||
{
|
||||
return (type.contains(QRegExp(validRegExpNum())));
|
||||
}
|
||||
|
||||
@ -139,7 +148,8 @@ bool NumerotationContext::keyIsAcceptable(const QString &type) const {
|
||||
@brief NumerotationContext::keyIsNumber
|
||||
@return true if type represent a number
|
||||
*/
|
||||
bool NumerotationContext::keyIsNumber(const QString &type) const {
|
||||
bool NumerotationContext::keyIsNumber(const QString &type) const
|
||||
{
|
||||
return (type.contains(QRegExp(validRegExpNumber())));
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,8 @@ NumerotationContextCommands::NumerotationContextCommands(const NumerotationConte
|
||||
/**
|
||||
@brief Destructor
|
||||
*/
|
||||
NumerotationContextCommands::~NumerotationContextCommands() {
|
||||
NumerotationContextCommands::~NumerotationContextCommands()
|
||||
{
|
||||
if (strategy_) delete strategy_;
|
||||
}
|
||||
|
||||
@ -38,7 +39,8 @@ NumerotationContextCommands::~NumerotationContextCommands() {
|
||||
@brief NumerotationContextCommands::next
|
||||
@return the next numerotation context
|
||||
*/
|
||||
NumerotationContext NumerotationContextCommands::next() {
|
||||
NumerotationContext NumerotationContextCommands::next()
|
||||
{
|
||||
NumerotationContext contextnum;
|
||||
|
||||
for (int i=0; i<context_.size(); ++i) {
|
||||
@ -53,7 +55,8 @@ NumerotationContext NumerotationContextCommands::next() {
|
||||
@brief NumerotationContextCommands::previous
|
||||
@return the previous numerotation context
|
||||
*/
|
||||
NumerotationContext NumerotationContextCommands::previous() {
|
||||
NumerotationContext NumerotationContextCommands::previous()
|
||||
{
|
||||
NumerotationContext contextnum;
|
||||
|
||||
for (int i=0; i<context_.size(); ++i) {
|
||||
@ -68,7 +71,8 @@ NumerotationContext NumerotationContextCommands::previous() {
|
||||
@brief NumerotationContextCommands::toFinalString
|
||||
@return the string represented by the numerotation context
|
||||
*/
|
||||
QString NumerotationContextCommands::toRepresentedString() {
|
||||
QString NumerotationContextCommands::toRepresentedString()
|
||||
{
|
||||
QString num;
|
||||
if (context_.size()) {
|
||||
for (int i=0; i<context_.size(); i++) {
|
||||
@ -155,14 +159,16 @@ NumStrategy::NumStrategy (Diagram *d):
|
||||
diagram_ (d)
|
||||
{}
|
||||
|
||||
NumStrategy::~NumStrategy() {}
|
||||
NumStrategy::~NumStrategy()
|
||||
{}
|
||||
|
||||
/**
|
||||
@brief NumStrategy::nextString
|
||||
@return the next value of nc at position i
|
||||
*/
|
||||
NumerotationContext NumStrategy::nextString (const NumerotationContext &nc,
|
||||
const int i) const {
|
||||
const int i) const
|
||||
{
|
||||
QStringList strl = nc.itemAt(i);
|
||||
NumerotationContext newnc;
|
||||
newnc.addValue(strl.at(0), strl.at(1), strl.at(2).toInt());
|
||||
@ -174,7 +180,8 @@ NumerotationContext NumStrategy::nextString (const NumerotationContext &nc,
|
||||
@return the next value of nc at position i
|
||||
*/
|
||||
NumerotationContext NumStrategy::nextNumber (const NumerotationContext &nc,
|
||||
const int i) const {
|
||||
const int i) const
|
||||
{
|
||||
QStringList strl = nc.itemAt(i);
|
||||
NumerotationContext newnc;
|
||||
QString value = QString::number( (strl.at(1).toInt()) + (strl.at(2).toInt()) );
|
||||
@ -187,7 +194,8 @@ NumerotationContext NumStrategy::nextNumber (const NumerotationContext &nc,
|
||||
@return the previous value of nc at position i
|
||||
*/
|
||||
NumerotationContext NumStrategy::previousNumber(const NumerotationContext &nc,
|
||||
const int i) const {
|
||||
const int i) const
|
||||
{
|
||||
QStringList strl = nc.itemAt(i);
|
||||
NumerotationContext newnc;
|
||||
QString value = QString::number( (strl.at(1).toInt()) - (strl.at(2).toInt()) );
|
||||
@ -206,7 +214,8 @@ UnitNum::UnitNum(Diagram *d):
|
||||
@brief UnitNum::toRepresentedString
|
||||
@return the represented string of num
|
||||
*/
|
||||
QString UnitNum::toRepresentedString(const QString num) const {
|
||||
QString UnitNum::toRepresentedString(const QString num) const
|
||||
{
|
||||
return (num);
|
||||
}
|
||||
|
||||
@ -214,7 +223,8 @@ QString UnitNum::toRepresentedString(const QString num) const {
|
||||
@brief UnitNum::next
|
||||
@return the next NumerotationContext nc at position i
|
||||
*/
|
||||
NumerotationContext UnitNum::next (const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext UnitNum::next (const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextNumber(nc, i));
|
||||
}
|
||||
|
||||
@ -222,7 +232,8 @@ NumerotationContext UnitNum::next (const NumerotationContext &nc, const int i) c
|
||||
@brief UnitNum::previous
|
||||
@return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
NumerotationContext UnitNum::previous(const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext UnitNum::previous(const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (previousNumber(nc, i));
|
||||
}
|
||||
|
||||
@ -237,7 +248,8 @@ UnitFNum::UnitFNum(Diagram *d):
|
||||
@brief UnitFNum::toRepresentedString
|
||||
@return the represented string of num
|
||||
*/
|
||||
QString UnitFNum::toRepresentedString(const QString num) const {
|
||||
QString UnitFNum::toRepresentedString(const QString num) const
|
||||
{
|
||||
return (num);
|
||||
}
|
||||
|
||||
@ -245,7 +257,8 @@ QString UnitFNum::toRepresentedString(const QString num) const {
|
||||
@brief UnitFNum::next
|
||||
@return the next NumerotationContext nc at position i
|
||||
*/
|
||||
NumerotationContext UnitFNum::next (const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext UnitFNum::next (const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextNumber(nc, i));
|
||||
}
|
||||
|
||||
@ -253,7 +266,8 @@ NumerotationContext UnitFNum::next (const NumerotationContext &nc, const int i)
|
||||
@brief UnitFNum::previous
|
||||
@return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
NumerotationContext UnitFNum::previous(const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext UnitFNum::previous(const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (previousNumber(nc, i));
|
||||
}
|
||||
|
||||
@ -268,7 +282,8 @@ TenNum::TenNum (Diagram *d):
|
||||
@brief TenNum::toRepresentedString
|
||||
@return the represented string of num
|
||||
*/
|
||||
QString TenNum::toRepresentedString(const QString num) const {
|
||||
QString TenNum::toRepresentedString(const QString num) const
|
||||
{
|
||||
int numint = num.toInt();
|
||||
QString numstr = num;
|
||||
if (numint<10) numstr.prepend("0");
|
||||
@ -279,7 +294,8 @@ QString TenNum::toRepresentedString(const QString num) const {
|
||||
@brief TenNum::next
|
||||
@return the next NumerotationContext nc at position i
|
||||
*/
|
||||
NumerotationContext TenNum::next (const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext TenNum::next (const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextNumber(nc, i));
|
||||
}
|
||||
|
||||
@ -287,7 +303,8 @@ NumerotationContext TenNum::next (const NumerotationContext &nc, const int i) co
|
||||
@brief TenNum::previous
|
||||
@return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
NumerotationContext TenNum::previous(const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext TenNum::previous(const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (previousNumber(nc, i));
|
||||
}
|
||||
|
||||
@ -302,7 +319,8 @@ TenFNum::TenFNum (Diagram *d):
|
||||
@brief TenFNum::toRepresentedString
|
||||
@return the represented string of num
|
||||
*/
|
||||
QString TenFNum::toRepresentedString(const QString num) const {
|
||||
QString TenFNum::toRepresentedString(const QString num) const
|
||||
{
|
||||
int numint = num.toInt();
|
||||
QString numstr = num;
|
||||
if (numint<10) numstr.prepend("0");
|
||||
@ -313,7 +331,8 @@ QString TenFNum::toRepresentedString(const QString num) const {
|
||||
@brief TenFNum::next
|
||||
@return the next NumerotationContext nc at position i
|
||||
*/
|
||||
NumerotationContext TenFNum::next (const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext TenFNum::next (const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextNumber(nc, i));
|
||||
}
|
||||
|
||||
@ -321,7 +340,8 @@ NumerotationContext TenFNum::next (const NumerotationContext &nc, const int i) c
|
||||
@brief TenFNum::previous
|
||||
@return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
NumerotationContext TenFNum::previous(const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext TenFNum::previous(const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (previousNumber(nc, i));
|
||||
}
|
||||
|
||||
@ -337,7 +357,8 @@ HundredNum::HundredNum (Diagram *d):
|
||||
@brief HundredNum::toRepresentedString
|
||||
@return the represented string of num
|
||||
*/
|
||||
QString HundredNum::toRepresentedString(const QString num) const {
|
||||
QString HundredNum::toRepresentedString(const QString num) const
|
||||
{
|
||||
int numint = num.toInt();
|
||||
QString numstr = num;
|
||||
if (numint<100) {
|
||||
@ -353,7 +374,8 @@ QString HundredNum::toRepresentedString(const QString num) const {
|
||||
@brief HundredNum::next
|
||||
@return the next NumerotationContext nc at position i
|
||||
*/
|
||||
NumerotationContext HundredNum::next (const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext HundredNum::next (const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextNumber(nc, i));
|
||||
}
|
||||
|
||||
@ -361,7 +383,8 @@ NumerotationContext HundredNum::next (const NumerotationContext &nc, const int i
|
||||
@brief HundredNum::previous
|
||||
@return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
NumerotationContext HundredNum::previous(const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext HundredNum::previous(const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (previousNumber(nc, i));
|
||||
}
|
||||
|
||||
@ -376,7 +399,8 @@ HundredFNum::HundredFNum (Diagram *d):
|
||||
@brief HundredFNum::toRepresentedString
|
||||
@return the represented string of num
|
||||
*/
|
||||
QString HundredFNum::toRepresentedString(const QString num) const {
|
||||
QString HundredFNum::toRepresentedString(const QString num) const
|
||||
{
|
||||
int numint = num.toInt();
|
||||
QString numstr = num;
|
||||
if (numint<100) {
|
||||
@ -392,7 +416,8 @@ QString HundredFNum::toRepresentedString(const QString num) const {
|
||||
@brief HundredFNum::next
|
||||
@return the next NumerotationContext nc at position i
|
||||
*/
|
||||
NumerotationContext HundredFNum::next (const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext HundredFNum::next (const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextNumber(nc, i));
|
||||
}
|
||||
|
||||
@ -400,7 +425,8 @@ NumerotationContext HundredFNum::next (const NumerotationContext &nc, const int
|
||||
@brief HundredFNum::previous
|
||||
@return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
NumerotationContext HundredFNum::previous(const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext HundredFNum::previous(const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (previousNumber(nc, i));
|
||||
}
|
||||
|
||||
@ -415,7 +441,8 @@ StringNum::StringNum (Diagram *d):
|
||||
@brief StringNum::toRepresentedString
|
||||
@return the represented string of num
|
||||
*/
|
||||
QString StringNum::toRepresentedString(const QString str) const {
|
||||
QString StringNum::toRepresentedString(const QString str) const
|
||||
{
|
||||
return (str);
|
||||
}
|
||||
|
||||
@ -423,7 +450,8 @@ QString StringNum::toRepresentedString(const QString str) const {
|
||||
@brief StringNum::next
|
||||
@return the next NumerotationContext nc at position i
|
||||
*/
|
||||
NumerotationContext StringNum::next (const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext StringNum::next (const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
@ -431,7 +459,8 @@ NumerotationContext StringNum::next (const NumerotationContext &nc, const int i)
|
||||
@brief StringNum::previous
|
||||
@return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
NumerotationContext StringNum::previous(const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext StringNum::previous(const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
@ -446,7 +475,8 @@ IdFolioNum::IdFolioNum (Diagram *d):
|
||||
@brief IdFolioNum::toRepresentedString
|
||||
@return the represented string of num
|
||||
*/
|
||||
QString IdFolioNum::toRepresentedString(const QString str) const {
|
||||
QString IdFolioNum::toRepresentedString(const QString str) const
|
||||
{
|
||||
Q_UNUSED(str);
|
||||
return ("%id");
|
||||
}
|
||||
@ -455,7 +485,8 @@ QString IdFolioNum::toRepresentedString(const QString str) const {
|
||||
@brief IdFolioNum::next
|
||||
@return the next NumerotationContext nc at position i
|
||||
*/
|
||||
NumerotationContext IdFolioNum::next (const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext IdFolioNum::next (const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
@ -463,7 +494,8 @@ NumerotationContext IdFolioNum::next (const NumerotationContext &nc, const int i
|
||||
@brief IdFolioNum::previous
|
||||
@return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
NumerotationContext IdFolioNum::previous(const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext IdFolioNum::previous(const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
@ -478,7 +510,8 @@ FolioNum::FolioNum (Diagram *d):
|
||||
@brief FolioNum::toRepresentedString
|
||||
@return the represented string of folio
|
||||
*/
|
||||
QString FolioNum::toRepresentedString(const QString str) const {
|
||||
QString FolioNum::toRepresentedString(const QString str) const
|
||||
{
|
||||
Q_UNUSED(str);
|
||||
return ("%F");
|
||||
}
|
||||
@ -487,7 +520,8 @@ QString FolioNum::toRepresentedString(const QString str) const {
|
||||
@brief FolioNum::next
|
||||
@return the next NumerotationContext nc at position i
|
||||
*/
|
||||
NumerotationContext FolioNum::next (const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext FolioNum::next (const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
@ -495,7 +529,8 @@ NumerotationContext FolioNum::next (const NumerotationContext &nc, const int i)
|
||||
@brief FolioNum::previous
|
||||
@return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
NumerotationContext FolioNum::previous(const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext FolioNum::previous(const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
@ -510,7 +545,8 @@ PlantNum::PlantNum (Diagram *d):
|
||||
@brief PlantNum::toRepresentedString
|
||||
@return the represented string of folio
|
||||
*/
|
||||
QString PlantNum::toRepresentedString(const QString str) const {
|
||||
QString PlantNum::toRepresentedString(const QString str) const
|
||||
{
|
||||
Q_UNUSED(str);
|
||||
return "%M";
|
||||
}
|
||||
@ -519,7 +555,8 @@ QString PlantNum::toRepresentedString(const QString str) const {
|
||||
@brief PlantNum::next
|
||||
@return the next NumerotationContext nc at position i
|
||||
*/
|
||||
NumerotationContext PlantNum::next (const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext PlantNum::next (const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
@ -527,7 +564,8 @@ NumerotationContext PlantNum::next (const NumerotationContext &nc, const int i)
|
||||
@brief PlantNum::previous
|
||||
@return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
NumerotationContext PlantNum::previous(const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext PlantNum::previous(const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
@ -543,7 +581,8 @@ LocmachNum::LocmachNum (Diagram *d):
|
||||
@brief LocmachNum::toRepresentedString
|
||||
@return the represented string of folio
|
||||
*/
|
||||
QString LocmachNum::toRepresentedString(const QString str) const {
|
||||
QString LocmachNum::toRepresentedString(const QString str) const
|
||||
{
|
||||
Q_UNUSED(str);
|
||||
return "%LM";
|
||||
}
|
||||
@ -552,7 +591,8 @@ QString LocmachNum::toRepresentedString(const QString str) const {
|
||||
@brief LocmachNum::next
|
||||
@return the next NumerotationContext nc at position i
|
||||
*/
|
||||
NumerotationContext LocmachNum::next (const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext LocmachNum::next (const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
@ -560,7 +600,8 @@ NumerotationContext LocmachNum::next (const NumerotationContext &nc, const int i
|
||||
@brief LocmachNum::previous
|
||||
@return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
NumerotationContext LocmachNum::previous(const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext LocmachNum::previous(const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
@ -576,7 +617,8 @@ ElementLineNum::ElementLineNum (Diagram *d):
|
||||
@brief ElementLineNum::toRepresentedString
|
||||
@return the represented string of folio
|
||||
*/
|
||||
QString ElementLineNum::toRepresentedString(const QString str) const {
|
||||
QString ElementLineNum::toRepresentedString(const QString str) const
|
||||
{
|
||||
Q_UNUSED(str);
|
||||
return "%l";
|
||||
}
|
||||
@ -585,7 +627,8 @@ QString ElementLineNum::toRepresentedString(const QString str) const {
|
||||
@brief ElementLineNum::next
|
||||
@return the next NumerotationContext nc at position i
|
||||
*/
|
||||
NumerotationContext ElementLineNum::next (const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext ElementLineNum::next (const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
@ -593,7 +636,8 @@ NumerotationContext ElementLineNum::next (const NumerotationContext &nc, const i
|
||||
@brief ElementLineNum::previous
|
||||
@return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
NumerotationContext ElementLineNum::previous(const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext ElementLineNum::previous(const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
@ -608,7 +652,8 @@ ElementColumnNum::ElementColumnNum (Diagram *d):
|
||||
@brief ElementColumnNum::toRepresentedString
|
||||
@return the represented string of folio
|
||||
*/
|
||||
QString ElementColumnNum::toRepresentedString(const QString str) const {
|
||||
QString ElementColumnNum::toRepresentedString(const QString str) const
|
||||
{
|
||||
Q_UNUSED(str);
|
||||
return "%c";
|
||||
}
|
||||
@ -617,7 +662,8 @@ QString ElementColumnNum::toRepresentedString(const QString str) const {
|
||||
@brief ElementColumnNum::next
|
||||
@return the next NumerotationContext nc at position i
|
||||
*/
|
||||
NumerotationContext ElementColumnNum::next (const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext ElementColumnNum::next (const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
@ -625,7 +671,8 @@ NumerotationContext ElementColumnNum::next (const NumerotationContext &nc, const
|
||||
@brief ElementColumnNum::previous
|
||||
@return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
NumerotationContext ElementColumnNum::previous(const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext ElementColumnNum::previous(const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
@ -640,7 +687,8 @@ ElementPrefixNum::ElementPrefixNum (Diagram *d):
|
||||
@brief ElementPrefixNum::toRepresentedString
|
||||
@return the represented string of folio
|
||||
*/
|
||||
QString ElementPrefixNum::toRepresentedString(const QString str) const {
|
||||
QString ElementPrefixNum::toRepresentedString(const QString str) const
|
||||
{
|
||||
Q_UNUSED(str);
|
||||
return "%prefix";
|
||||
}
|
||||
@ -649,7 +697,8 @@ QString ElementPrefixNum::toRepresentedString(const QString str) const {
|
||||
@brief ElementPrefixNum::next
|
||||
@return the next NumerotationContext nc at position i
|
||||
*/
|
||||
NumerotationContext ElementPrefixNum::next (const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext ElementPrefixNum::next (const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
@ -657,7 +706,8 @@ NumerotationContext ElementPrefixNum::next (const NumerotationContext &nc, const
|
||||
@brief ElementPrefixNum::previous
|
||||
@return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
NumerotationContext ElementPrefixNum::previous(const NumerotationContext &nc, const int i) const {
|
||||
NumerotationContext ElementPrefixNum::previous(const NumerotationContext &nc, const int i) const
|
||||
{
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,8 @@ void AutoNumberingDockWidget::setProject(QETProject *project,
|
||||
@brief AutoNumberingDockWidget::setContext
|
||||
Add all itens to comboboxes
|
||||
*/
|
||||
void AutoNumberingDockWidget::setContext() {
|
||||
void AutoNumberingDockWidget::setContext()
|
||||
{
|
||||
|
||||
this->clear();
|
||||
|
||||
@ -204,7 +205,8 @@ void AutoNumberingDockWidget::setConductorActive(DiagramView* dv) {
|
||||
@brief AutoNumberingDockWidget::setActive
|
||||
Set current used autonumberings
|
||||
*/
|
||||
void AutoNumberingDockWidget::setActive() {
|
||||
void AutoNumberingDockWidget::setActive()
|
||||
{
|
||||
|
||||
if (m_project_view!=nullptr) {
|
||||
//Conductor
|
||||
@ -233,7 +235,8 @@ void AutoNumberingDockWidget::setActive() {
|
||||
@brief AutoNumberingDockWidget::conductorAutoNumChanged
|
||||
Add new or remove conductor auto num from combobox
|
||||
*/
|
||||
void AutoNumberingDockWidget::conductorAutoNumChanged() {
|
||||
void AutoNumberingDockWidget::conductorAutoNumChanged()
|
||||
{
|
||||
ui->m_conductor_cb->clear();
|
||||
|
||||
//Conductor Combobox
|
||||
@ -263,7 +266,8 @@ void AutoNumberingDockWidget::on_m_conductor_cb_activated(int)
|
||||
@brief AutoNumberingDockWidget::elementAutoNumChanged
|
||||
Add new or remove element auto num from combobox
|
||||
*/
|
||||
void AutoNumberingDockWidget::elementAutoNumChanged() {
|
||||
void AutoNumberingDockWidget::elementAutoNumChanged()
|
||||
{
|
||||
|
||||
ui->m_element_cb->clear();
|
||||
|
||||
@ -290,7 +294,8 @@ void AutoNumberingDockWidget::on_m_element_cb_activated(int)
|
||||
@brief AutoNumberingDockWidget::folioAutoNumChanged
|
||||
Add new or remove folio auto num from combobox
|
||||
*/
|
||||
void AutoNumberingDockWidget::folioAutoNumChanged() {
|
||||
void AutoNumberingDockWidget::folioAutoNumChanged()
|
||||
{
|
||||
|
||||
ui->m_folio_cb->clear();
|
||||
|
||||
|
@ -149,7 +149,8 @@ void NumPartEditorW::setVisibleItems()
|
||||
@brief NumPartEditorW::toNumContext
|
||||
@return the display to NumerotationContext
|
||||
*/
|
||||
NumerotationContext NumPartEditorW::toNumContext() {
|
||||
NumerotationContext NumPartEditorW::toNumContext()
|
||||
{
|
||||
NumerotationContext nc;
|
||||
QString type_str;
|
||||
switch (type_) {
|
||||
@ -214,7 +215,8 @@ NumerotationContext NumPartEditorW::toNumContext() {
|
||||
@brief NumPartEditorW::isValid
|
||||
@return true if value field isn't empty or if type is folio
|
||||
*/
|
||||
bool NumPartEditorW::isValid() {
|
||||
bool NumPartEditorW::isValid()
|
||||
{
|
||||
if (type_ == folio
|
||||
|| type_ == idfolio
|
||||
|| type_ == elementline
|
||||
@ -266,7 +268,8 @@ void NumPartEditorW::on_type_cb_activated(int) {
|
||||
@brief NumPartEditorW::on_value_field_textChanged
|
||||
emit changed when value_field text changed
|
||||
*/
|
||||
void NumPartEditorW::on_value_field_textEdited() {
|
||||
void NumPartEditorW::on_value_field_textEdited()
|
||||
{
|
||||
emit changed();
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,8 @@ BorderProperties::BorderProperties() :
|
||||
@brief BorderProperties::~BorderProperties
|
||||
destructor
|
||||
*/
|
||||
BorderProperties::~BorderProperties() {
|
||||
BorderProperties::~BorderProperties()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -95,7 +96,8 @@ bool BorderProperties::operator!=(const BorderProperties &bp) {
|
||||
XML element to which attributes will be added
|
||||
\~French Element XML auquel seront ajoutes des attributs
|
||||
*/
|
||||
void BorderProperties::toXml(QDomElement &e) const {
|
||||
void BorderProperties::toXml(QDomElement &e) const
|
||||
{
|
||||
e.setAttribute("cols", columns_count);
|
||||
e.setAttribute("colsize", QString("%1").arg(columns_width));
|
||||
e.setAttribute("rows", rows_count);
|
||||
@ -134,7 +136,8 @@ void BorderProperties::fromXml(QDomElement &e) {
|
||||
prefix to be added before the names of the parameters
|
||||
\~French prefixe a ajouter devant les noms des parametres
|
||||
*/
|
||||
void BorderProperties::toSettings(QSettings &settings, const QString &prefix) const {
|
||||
void BorderProperties::toSettings(QSettings &settings, const QString &prefix) const
|
||||
{
|
||||
settings.setValue(prefix + "cols", columns_count);
|
||||
settings.setValue(prefix + "colsize", columns_width);
|
||||
settings.setValue(prefix + "displaycols", display_columns);
|
||||
|
@ -71,7 +71,8 @@ BorderTitleBlock::BorderTitleBlock(QObject *parent) :
|
||||
@brief BorderTitleBlock::~BorderTitleBlock
|
||||
\~French Destructeur - ne fait rien
|
||||
*/
|
||||
BorderTitleBlock::~BorderTitleBlock() {
|
||||
BorderTitleBlock::~BorderTitleBlock()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -96,7 +97,8 @@ QRectF BorderTitleBlock::titleBlockRect() const
|
||||
@brief BorderTitleBlock::titleblockInformation
|
||||
@return
|
||||
*/
|
||||
DiagramContext BorderTitleBlock::titleblockInformation() const {
|
||||
DiagramContext BorderTitleBlock::titleblockInformation() const
|
||||
{
|
||||
return m_titleblock_template_renderer->context();
|
||||
}
|
||||
|
||||
@ -131,7 +133,8 @@ QRectF BorderTitleBlock::titleBlockRectForQPainter() const
|
||||
It's like unite outsideBorderRect and titleBlockRect.
|
||||
The rect is in scene coordinate
|
||||
*/
|
||||
QRectF BorderTitleBlock::borderAndTitleBlockRect() const {
|
||||
QRectF BorderTitleBlock::borderAndTitleBlockRect() const
|
||||
{
|
||||
return diagram_rect_ | titleBlockRect();
|
||||
}
|
||||
|
||||
@ -276,7 +279,8 @@ void BorderTitleBlock::borderFromXml(const QDomElement &xml_elmt) {
|
||||
@return the properties of the titleblock
|
||||
\~French les proprietes du cartouches
|
||||
*/
|
||||
TitleBlockProperties BorderTitleBlock::exportTitleBlock() {
|
||||
TitleBlockProperties BorderTitleBlock::exportTitleBlock()
|
||||
{
|
||||
TitleBlockProperties ip;
|
||||
|
||||
ip.author = author();
|
||||
@ -330,7 +334,8 @@ void BorderTitleBlock::importTitleBlock(const TitleBlockProperties &ip) {
|
||||
@return border properties
|
||||
\~French les proprietes de la bordure
|
||||
*/
|
||||
BorderProperties BorderTitleBlock::exportBorder() {
|
||||
BorderProperties BorderTitleBlock::exportBorder()
|
||||
{
|
||||
BorderProperties bp;
|
||||
bp.columns_count = columnsCount();
|
||||
bp.columns_width = columnsWidth();
|
||||
@ -364,7 +369,8 @@ void BorderTitleBlock::importBorder(const BorderProperties &bp) {
|
||||
@return the titleblock template used to render the titleblock
|
||||
@see TitleBlockTemplateRenderer::titleBlockTemplate()
|
||||
*/
|
||||
const TitleBlockTemplate *BorderTitleBlock::titleBlockTemplate() {
|
||||
const TitleBlockTemplate *BorderTitleBlock::titleBlockTemplate()
|
||||
{
|
||||
return(m_titleblock_template_renderer -> titleBlockTemplate());
|
||||
}
|
||||
|
||||
@ -384,7 +390,8 @@ void BorderTitleBlock::setTitleBlockTemplate(
|
||||
@brief BorderTitleBlock::titleBlockTemplateName
|
||||
@return The name of the template used to render the titleblock.
|
||||
*/
|
||||
QString BorderTitleBlock::titleBlockTemplateName() const {
|
||||
QString BorderTitleBlock::titleBlockTemplateName() const
|
||||
{
|
||||
QString tbt_name = m_titleblock_template_renderer -> titleBlockTemplate() -> name();
|
||||
return((tbt_name == "default") ? "" : tbt_name);
|
||||
}
|
||||
|
@ -79,14 +79,16 @@ class BorderTitleBlock : public QObject
|
||||
@return the diagram width,
|
||||
i.e. the width of the border without title block
|
||||
*/
|
||||
qreal diagramWidth() const {
|
||||
qreal diagramWidth() const
|
||||
{
|
||||
return(columnsTotalWidth() + rowsHeaderWidth()); }
|
||||
/**
|
||||
@brief diagramHeight
|
||||
@return the diagram height,
|
||||
i.e. the height of the border without title block
|
||||
*/
|
||||
qreal diagramHeight() const {
|
||||
qreal diagramHeight() const
|
||||
{
|
||||
return(rowsTotalHeight() + columnsHeaderHeight()); }
|
||||
|
||||
QRectF titleBlockRect () const;
|
||||
|
@ -53,7 +53,8 @@ ConductorAutoNumerotation::ConductorAutoNumerotation(
|
||||
@brief ConductorAutoNumerotation::numerate
|
||||
execute the automatic numerotation
|
||||
*/
|
||||
void ConductorAutoNumerotation::numerate() {
|
||||
void ConductorAutoNumerotation::numerate()
|
||||
{
|
||||
if (!m_conductor) return;
|
||||
if (conductor_list.size() >= 1 ) numeratePotential();
|
||||
else if (m_conductor -> properties().type == ConductorProperties::Multi)
|
||||
|
@ -21,7 +21,8 @@
|
||||
#include "terminal.h"
|
||||
|
||||
/// Constructeur
|
||||
ConductorProfile::ConductorProfile() {
|
||||
ConductorProfile::ConductorProfile()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -64,23 +65,27 @@ ConductorProfile &ConductorProfile::operator=(const ConductorProfile &c) {
|
||||
}
|
||||
|
||||
/// destructeur
|
||||
ConductorProfile::~ConductorProfile() {
|
||||
ConductorProfile::~ConductorProfile()
|
||||
{
|
||||
setNull();
|
||||
}
|
||||
|
||||
/// @return true si le profil est nul
|
||||
bool ConductorProfile::isNull() const {
|
||||
bool ConductorProfile::isNull() const
|
||||
{
|
||||
return(segments.isEmpty());
|
||||
}
|
||||
|
||||
/// supprime les segments du profil de conducteur
|
||||
void ConductorProfile::setNull() {
|
||||
void ConductorProfile::setNull()
|
||||
{
|
||||
foreach(ConductorSegmentProfile *csp, segments) delete csp;
|
||||
segments.clear();
|
||||
}
|
||||
|
||||
/// @return la largeur occupee par le conducteur
|
||||
qreal ConductorProfile::width() const {
|
||||
qreal ConductorProfile::width() const
|
||||
{
|
||||
qreal width = 0.0;
|
||||
foreach(ConductorSegmentProfile *csp, segments) {
|
||||
if (csp -> isHorizontal) width += csp -> length;
|
||||
@ -101,7 +106,8 @@ qreal ConductorProfile::height() const{
|
||||
@param type Type de Segments
|
||||
@return Le nombre de segments composant le conducteur.
|
||||
*/
|
||||
uint ConductorProfile::segmentsCount(QET::ConductorSegmentType type) const {
|
||||
uint ConductorProfile::segmentsCount(QET::ConductorSegmentType type) const
|
||||
{
|
||||
if (type == QET::Both) return(segments.count());
|
||||
uint nb_seg = 0;
|
||||
foreach(ConductorSegmentProfile *csp, segments) {
|
||||
@ -112,7 +118,8 @@ uint ConductorProfile::segmentsCount(QET::ConductorSegmentType type) const {
|
||||
}
|
||||
|
||||
/// @return les segments horizontaux de ce profil
|
||||
QList<ConductorSegmentProfile *> ConductorProfile::horizontalSegments() {
|
||||
QList<ConductorSegmentProfile *> ConductorProfile::horizontalSegments()
|
||||
{
|
||||
QList<ConductorSegmentProfile *> segments_list;
|
||||
foreach(ConductorSegmentProfile *csp, segments) {
|
||||
if (csp -> isHorizontal) segments_list << csp;
|
||||
@ -121,7 +128,8 @@ QList<ConductorSegmentProfile *> ConductorProfile::horizontalSegments() {
|
||||
}
|
||||
|
||||
/// @return les segments verticaux de ce profil
|
||||
QList<ConductorSegmentProfile *> ConductorProfile::verticalSegments() {
|
||||
QList<ConductorSegmentProfile *> ConductorProfile::verticalSegments()
|
||||
{
|
||||
QList<ConductorSegmentProfile *> segments_list;
|
||||
foreach(ConductorSegmentProfile *csp, segments) {
|
||||
if (!csp -> isHorizontal) segments_list << csp;
|
||||
|
@ -31,7 +31,8 @@ SingleLineProperties::SingleLineProperties() :
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
SingleLineProperties::~SingleLineProperties() {
|
||||
SingleLineProperties::~SingleLineProperties()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -43,7 +44,8 @@ void SingleLineProperties::setPhasesCount(int n) {
|
||||
}
|
||||
|
||||
/// @return le nombre de phases (0, 1, 2, ou 3)
|
||||
unsigned short int SingleLineProperties::phasesCount() {
|
||||
unsigned short int SingleLineProperties::phasesCount()
|
||||
{
|
||||
return(phases);
|
||||
}
|
||||
|
||||
@ -52,7 +54,8 @@ unsigned short int SingleLineProperties::phasesCount() {
|
||||
(Protective Earth Neutral) representation and if it features the ground and
|
||||
the neutral.
|
||||
*/
|
||||
bool SingleLineProperties::isPen() const {
|
||||
bool SingleLineProperties::isPen() const
|
||||
{
|
||||
return(hasNeutral && hasGround && is_pen);
|
||||
}
|
||||
|
||||
@ -211,7 +214,8 @@ void SingleLineProperties::drawPen(QPainter *painter,
|
||||
ajoutes a l'element e.
|
||||
@param e Element XML auquel seront ajoutes des attributs
|
||||
*/
|
||||
void SingleLineProperties::toXml(QDomElement &e) const {
|
||||
void SingleLineProperties::toXml(QDomElement &e) const
|
||||
{
|
||||
e.setAttribute("ground", hasGround ? "true" : "false");
|
||||
e.setAttribute("neutral", hasNeutral ? "true" : "false");
|
||||
e.setAttribute("phase", phases);
|
||||
@ -251,7 +255,8 @@ ConductorProperties::ConductorProperties() :
|
||||
/**
|
||||
Destructeur
|
||||
*/
|
||||
ConductorProperties::~ConductorProperties() {
|
||||
ConductorProperties::~ConductorProperties()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -802,7 +807,8 @@ void ConductorProperties::readStyle(const QString &style_string) {
|
||||
Exporte le style du conducteur sous forme d'une chaine de caracteres
|
||||
@return une chaine de caracteres decrivant le style du conducteur
|
||||
*/
|
||||
QString ConductorProperties::writeStyle() const {
|
||||
QString ConductorProperties::writeStyle() const
|
||||
{
|
||||
if (style == Qt::DashLine) {
|
||||
return("line-style: dashed;");
|
||||
} else if (style == Qt::DashDotLine) {
|
||||
@ -816,7 +822,8 @@ QString ConductorProperties::writeStyle() const {
|
||||
@param other l'autre ensemble de proprietes avec lequel il faut effectuer la comparaison
|
||||
@return true si les deux ensembles de proprietes sont identiques, false sinon
|
||||
*/
|
||||
int SingleLineProperties::operator==(const SingleLineProperties &other) const {
|
||||
int SingleLineProperties::operator==(const SingleLineProperties &other) const
|
||||
{
|
||||
return(
|
||||
other.hasGround == hasGround &&\
|
||||
other.hasNeutral == hasNeutral &&\
|
||||
@ -829,7 +836,8 @@ int SingleLineProperties::operator==(const SingleLineProperties &other) const {
|
||||
@param other l'autre ensemble de proprietes avec lequel il faut effectuer la comparaison
|
||||
@return true si les deux ensembles de proprietes sont differents, false sinon
|
||||
*/
|
||||
int SingleLineProperties::operator!=(const SingleLineProperties &other) const {
|
||||
int SingleLineProperties::operator!=(const SingleLineProperties &other) const
|
||||
{
|
||||
return(!(other == (*this)));
|
||||
}
|
||||
|
||||
@ -838,7 +846,8 @@ int SingleLineProperties::operator!=(const SingleLineProperties &other) const {
|
||||
@param prefix prefix a ajouter devant les noms des parametres
|
||||
*/
|
||||
void SingleLineProperties::toSettings(QSettings &settings,
|
||||
const QString &prefix) const {
|
||||
const QString &prefix) const
|
||||
{
|
||||
settings.setValue(prefix + "hasGround", hasGround);
|
||||
settings.setValue(prefix + "hasNeutral", hasNeutral);
|
||||
settings.setValue(prefix + "phases", phases);
|
||||
|
@ -41,7 +41,8 @@ ConductorSegment::ConductorSegment(
|
||||
/**
|
||||
Destructeur - Relie le segment precedent au suivant
|
||||
*/
|
||||
ConductorSegment::~ConductorSegment() {
|
||||
ConductorSegment::~ConductorSegment()
|
||||
{
|
||||
if (hasPreviousSegment()) previousSegment() -> setNextSegment(nextSegment());
|
||||
if (hasNextSegment()) nextSegment() -> setPreviousSegment(previousSegment());
|
||||
}
|
||||
@ -54,7 +55,8 @@ ConductorSegment::~ConductorSegment() {
|
||||
@param possible_dx La valeur du mouvement possible (au maximum)
|
||||
@return true si le mouvement est possible ; false s'il doit etre limite
|
||||
*/
|
||||
bool ConductorSegment::canMove1stPointX(const qreal &asked_dx, qreal &possible_dx) const {
|
||||
bool ConductorSegment::canMove1stPointX(const qreal &asked_dx, qreal &possible_dx) const
|
||||
{
|
||||
|
||||
Q_ASSERT_X(isVertical(), "ConductorSegment::canMove1stPointX", "segment non vertical");
|
||||
|
||||
@ -113,7 +115,8 @@ bool ConductorSegment::canMove1stPointX(const qreal &asked_dx, qreal &possible_d
|
||||
@param possible_dx La valeur du mouvement possible (au maximum)
|
||||
@return true si le mouvement est possible ; false s'il doit etre limite
|
||||
*/
|
||||
bool ConductorSegment::canMove2ndPointX(const qreal &asked_dx, qreal &possible_dx) const {
|
||||
bool ConductorSegment::canMove2ndPointX(const qreal &asked_dx, qreal &possible_dx) const
|
||||
{
|
||||
|
||||
Q_ASSERT_X(isVertical(), "ConductorSegment::canMove2ndPointX", "segment non vertical");
|
||||
|
||||
@ -172,7 +175,8 @@ bool ConductorSegment::canMove2ndPointX(const qreal &asked_dx, qreal &possible_d
|
||||
@param possible_dy La valeur du mouvement possible (au maximum)
|
||||
@return true si le mouvement est possible ; false s'il doit etre limite
|
||||
*/
|
||||
bool ConductorSegment::canMove1stPointY(const qreal &asked_dy, qreal &possible_dy) const {
|
||||
bool ConductorSegment::canMove1stPointY(const qreal &asked_dy, qreal &possible_dy) const
|
||||
{
|
||||
|
||||
Q_ASSERT_X(isHorizontal(), "ConductorSegment::canMove1stPointY", "segment non horizontal");
|
||||
|
||||
@ -231,7 +235,8 @@ bool ConductorSegment::canMove1stPointY(const qreal &asked_dy, qreal &possible_d
|
||||
@param possible_dy La valeur du mouvement possible (au maximum)
|
||||
@return true si le mouvement est possible ; false s'il doit etre limite
|
||||
*/
|
||||
bool ConductorSegment::canMove2ndPointY(const qreal &asked_dy, qreal &possible_dy) const {
|
||||
bool ConductorSegment::canMove2ndPointY(const qreal &asked_dy, qreal &possible_dy) const
|
||||
{
|
||||
|
||||
Q_ASSERT_X(isHorizontal(), "ConductorSegment::canMove2ndPointY", "segment non horizontal");
|
||||
|
||||
@ -401,59 +406,68 @@ void ConductorSegment::setNextSegment(ConductorSegment *ns) {
|
||||
}
|
||||
|
||||
/// @return true si ce segment est un segment statique, cad un segment relie a une borne
|
||||
bool ConductorSegment::isStatic() const {
|
||||
bool ConductorSegment::isStatic() const
|
||||
{
|
||||
return(isFirstSegment() || isLastSegment());
|
||||
}
|
||||
|
||||
/// @return true si ce segment est le premier du conducteur
|
||||
bool ConductorSegment::isFirstSegment() const {
|
||||
bool ConductorSegment::isFirstSegment() const
|
||||
{
|
||||
return(!hasPreviousSegment());
|
||||
}
|
||||
|
||||
/// @return true si ce segment est le dernier du conducteur
|
||||
bool ConductorSegment::isLastSegment() const {
|
||||
bool ConductorSegment::isLastSegment() const
|
||||
{
|
||||
return(!hasNextSegment());
|
||||
}
|
||||
|
||||
/**
|
||||
@return Le segment precedent
|
||||
*/
|
||||
ConductorSegment *ConductorSegment::previousSegment() const {
|
||||
ConductorSegment *ConductorSegment::previousSegment() const
|
||||
{
|
||||
return(previous_segment);
|
||||
}
|
||||
|
||||
/**
|
||||
@return Le segment suivant
|
||||
*/
|
||||
ConductorSegment *ConductorSegment::nextSegment() const {
|
||||
ConductorSegment *ConductorSegment::nextSegment() const
|
||||
{
|
||||
return(next_segment);
|
||||
}
|
||||
|
||||
/**
|
||||
@return true si le segment est vertical, false sinon
|
||||
*/
|
||||
bool ConductorSegment::isVertical() const {
|
||||
bool ConductorSegment::isVertical() const
|
||||
{
|
||||
return(point1.x() == point2.x());
|
||||
}
|
||||
|
||||
/**
|
||||
@return true si le segment est horizontal, false sinon
|
||||
*/
|
||||
bool ConductorSegment::isHorizontal() const {
|
||||
bool ConductorSegment::isHorizontal() const
|
||||
{
|
||||
return(point1.y() == point2.y());
|
||||
}
|
||||
|
||||
/**
|
||||
@return le premier point du segment
|
||||
*/
|
||||
QPointF ConductorSegment::firstPoint() const {
|
||||
QPointF ConductorSegment::firstPoint() const
|
||||
{
|
||||
return(point1);
|
||||
}
|
||||
|
||||
/**
|
||||
@return le second point du segment
|
||||
*/
|
||||
QPointF ConductorSegment::secondPoint() const {
|
||||
QPointF ConductorSegment::secondPoint() const
|
||||
{
|
||||
return(point2);
|
||||
}
|
||||
|
||||
@ -476,21 +490,24 @@ void ConductorSegment::setSecondPoint(const QPointF &p) {
|
||||
/**
|
||||
@return true si le segment a un segment precedent, false sinon
|
||||
*/
|
||||
bool ConductorSegment::hasPreviousSegment() const {
|
||||
bool ConductorSegment::hasPreviousSegment() const
|
||||
{
|
||||
return(previous_segment != nullptr);
|
||||
}
|
||||
|
||||
/**
|
||||
@return true si le segment a un segment suivant, false sinon
|
||||
*/
|
||||
bool ConductorSegment::hasNextSegment() const {
|
||||
bool ConductorSegment::hasNextSegment() const
|
||||
{
|
||||
return(next_segment != nullptr);
|
||||
}
|
||||
|
||||
/**
|
||||
@return Le centre du rectangle delimitant le conducteur
|
||||
*/
|
||||
QPointF ConductorSegment::middle() const {
|
||||
QPointF ConductorSegment::middle() const
|
||||
{
|
||||
return(
|
||||
QPointF(
|
||||
(point1.x()+ point2.x()) / 2.0,
|
||||
@ -502,7 +519,8 @@ QPointF ConductorSegment::middle() const {
|
||||
/**
|
||||
@return La longueur du conducteur
|
||||
*/
|
||||
qreal ConductorSegment::length() const {
|
||||
qreal ConductorSegment::length() const
|
||||
{
|
||||
if (isHorizontal()) {
|
||||
return(secondPoint().x() - firstPoint().x());
|
||||
} else {
|
||||
@ -511,11 +529,13 @@ qreal ConductorSegment::length() const {
|
||||
}
|
||||
|
||||
/// @return QET::Horizontal si le segment est horizontal, QET::Vertical sinon
|
||||
QET::ConductorSegmentType ConductorSegment::type() const {
|
||||
QET::ConductorSegmentType ConductorSegment::type() const
|
||||
{
|
||||
return(isHorizontal() ? QET::Horizontal : QET::Vertical);
|
||||
}
|
||||
|
||||
/// @return true si les deux points constituant le segment sont egaux
|
||||
bool ConductorSegment::isPoint() const {
|
||||
bool ConductorSegment::isPoint() const
|
||||
{
|
||||
return(point1 == point2);
|
||||
}
|
||||
|
@ -92,13 +92,15 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
ConfigDialog::~ConfigDialog() {
|
||||
ConfigDialog::~ConfigDialog()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
Construit la liste des pages sur la gauche
|
||||
*/
|
||||
void ConfigDialog::buildPagesList() {
|
||||
void ConfigDialog::buildPagesList()
|
||||
{
|
||||
pages_list -> clear();
|
||||
foreach(ConfigPage *page, pages) {
|
||||
addPageToList(page);
|
||||
@ -119,7 +121,8 @@ void ConfigDialog::addPageToList(ConfigPage *page) {
|
||||
/**
|
||||
Applique la configuration de toutes les pages
|
||||
*/
|
||||
void ConfigDialog::applyConf() {
|
||||
void ConfigDialog::applyConf()
|
||||
{
|
||||
foreach(ConfigPage *page, pages) {
|
||||
page -> applyConf();
|
||||
}
|
||||
|
@ -103,7 +103,8 @@ NewDiagramPage::NewDiagramPage(QETProject *project,
|
||||
/**
|
||||
@brief NewDiagramPage::~NewDiagramPage
|
||||
*/
|
||||
NewDiagramPage::~NewDiagramPage() {
|
||||
NewDiagramPage::~NewDiagramPage()
|
||||
{
|
||||
disconnect(ipw,SIGNAL(openAutoNumFolioEditor(QString)),this,SLOT(changeToAutoFolioTab()));
|
||||
}
|
||||
|
||||
@ -113,7 +114,8 @@ NewDiagramPage::~NewDiagramPage() {
|
||||
If there is a project, save in the project,
|
||||
else save to the default conf of QElectroTech
|
||||
*/
|
||||
void NewDiagramPage::applyConf() {
|
||||
void NewDiagramPage::applyConf()
|
||||
{
|
||||
if (m_project) { //If project we save to the project
|
||||
if (m_project -> isReadOnly()) return;
|
||||
bool modified_project = false;
|
||||
@ -182,7 +184,8 @@ void NewDiagramPage::applyConf() {
|
||||
@brief NewDiagramPage::icon
|
||||
@return icon of this page
|
||||
*/
|
||||
QIcon NewDiagramPage::icon() const {
|
||||
QIcon NewDiagramPage::icon() const
|
||||
{
|
||||
if (m_project) return(QET::Icons::NewDiagram);
|
||||
return(QET::Icons::Projects);
|
||||
}
|
||||
@ -191,7 +194,8 @@ QIcon NewDiagramPage::icon() const {
|
||||
@brief NewDiagramPage::title
|
||||
@return title of this page
|
||||
*/
|
||||
QString NewDiagramPage::title() const {
|
||||
QString NewDiagramPage::title() const
|
||||
{
|
||||
if (m_project) return(tr("Nouveau folio", "configuration page title"));
|
||||
return(tr("Nouveau projet", "configuration page title"));
|
||||
}
|
||||
@ -200,7 +204,8 @@ QString NewDiagramPage::title() const {
|
||||
@brief NewDiagramPage::changeToAutoFolioTab
|
||||
Set the current tab to Autonum
|
||||
*/
|
||||
void NewDiagramPage::changeToAutoFolioTab(){
|
||||
void NewDiagramPage::changeToAutoFolioTab()
|
||||
{
|
||||
if (m_project){
|
||||
ppd_->setCurrentPage(ProjectPropertiesDialog::Autonum);
|
||||
ppd_->changeToFolio();
|
||||
@ -222,7 +227,8 @@ void NewDiagramPage::setFolioAutonum(QString autoNum){
|
||||
@brief NewDiagramPage::saveCurrentTbp
|
||||
Save current TBP to retrieve after auto folio num
|
||||
*/
|
||||
void NewDiagramPage::saveCurrentTbp(){
|
||||
void NewDiagramPage::saveCurrentTbp()
|
||||
{
|
||||
savedTbp = ipw->properties();
|
||||
}
|
||||
|
||||
@ -230,7 +236,8 @@ void NewDiagramPage::saveCurrentTbp(){
|
||||
@brief NewDiagramPage::loadSavedTbp
|
||||
Retrieve saved auto folio num
|
||||
*/
|
||||
void NewDiagramPage::loadSavedTbp(){
|
||||
void NewDiagramPage::loadSavedTbp()
|
||||
{
|
||||
ipw->setProperties(savedTbp);
|
||||
applyConf();
|
||||
}
|
||||
@ -260,7 +267,8 @@ ExportConfigPage::ExportConfigPage(QWidget *parent) : ConfigPage(parent) {
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
ExportConfigPage::~ExportConfigPage() {
|
||||
ExportConfigPage::~ExportConfigPage()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -273,12 +281,14 @@ void ExportConfigPage::applyConf()
|
||||
}
|
||||
|
||||
/// @return l'icone de cette page
|
||||
QIcon ExportConfigPage::icon() const {
|
||||
QIcon ExportConfigPage::icon() const
|
||||
{
|
||||
return(QET::Icons::DocumentExport);
|
||||
}
|
||||
|
||||
/// @return le titre de cette page
|
||||
QString ExportConfigPage::title() const {
|
||||
QString ExportConfigPage::title() const
|
||||
{
|
||||
return(tr("Export", "configuration page title"));
|
||||
}
|
||||
|
||||
@ -308,7 +318,8 @@ PrintConfigPage::PrintConfigPage(QWidget *parent) : ConfigPage(parent) {
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
PrintConfigPage::~PrintConfigPage() {
|
||||
PrintConfigPage::~PrintConfigPage()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -329,12 +340,14 @@ void PrintConfigPage::applyConf()
|
||||
}
|
||||
|
||||
/// @return l'icone de cette page
|
||||
QIcon PrintConfigPage::icon() const {
|
||||
QIcon PrintConfigPage::icon() const
|
||||
{
|
||||
return(QET::Icons::Printer);
|
||||
}
|
||||
|
||||
/// @return le titre de cette page
|
||||
QString PrintConfigPage::title() const {
|
||||
QString PrintConfigPage::title() const
|
||||
{
|
||||
return(tr("Impression", "configuration page title"));
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ Createdxf::~Createdxf()
|
||||
}
|
||||
|
||||
/* Header section of every DXF file.*/
|
||||
void Createdxf::dxfBegin (const QString& fileName)
|
||||
void Createdxf::dxfBegin (const QString& fileName)
|
||||
{
|
||||
|
||||
// Creation of an output stream object in text mode.
|
||||
@ -75,7 +75,7 @@ void Createdxf::dxfBegin (const QString& fileName)
|
||||
To_Dxf << 30 << "\r\n";
|
||||
To_Dxf << "0.0" << "\r\n";
|
||||
To_Dxf << 9 << "\r\n";
|
||||
|
||||
|
||||
To_Dxf << "$EXTMIN" << "\r\n";
|
||||
To_Dxf << 10 << "\r\n";
|
||||
To_Dxf << "0.0" << "\r\n";
|
||||
@ -87,7 +87,7 @@ void Createdxf::dxfBegin (const QString& fileName)
|
||||
To_Dxf << "4000.0" << "\r\n";
|
||||
To_Dxf << 20 << "\r\n";
|
||||
To_Dxf << "4000.0" << "\r\n";
|
||||
|
||||
|
||||
To_Dxf << 9 << "\r\n";
|
||||
To_Dxf << "$LIMMIN" << "\r\n";
|
||||
To_Dxf << 10 << "\r\n";
|
||||
@ -109,7 +109,7 @@ void Createdxf::dxfBegin (const QString& fileName)
|
||||
To_Dxf << 0 << "\r\n";
|
||||
To_Dxf << "TABLE" << "\r\n";
|
||||
To_Dxf << 2 << "\r\n";
|
||||
|
||||
|
||||
To_Dxf << "VPORT" << "\r\n";
|
||||
To_Dxf << 70 << "\r\n";
|
||||
To_Dxf << 1 << "\r\n";
|
||||
@ -190,7 +190,7 @@ void Createdxf::dxfBegin (const QString& fileName)
|
||||
To_Dxf << 0 << "\r\n";
|
||||
To_Dxf << "TABLE" << "\r\n";
|
||||
To_Dxf << 2 << "\r\n";
|
||||
|
||||
|
||||
To_Dxf << "LTYPE" << "\r\n";
|
||||
To_Dxf << 70 << "\r\n";
|
||||
To_Dxf << 1 << "\r\n";
|
||||
@ -209,7 +209,7 @@ void Createdxf::dxfBegin (const QString& fileName)
|
||||
To_Dxf << 40 << "\r\n";
|
||||
To_Dxf << 0.00 << "\r\n";
|
||||
To_Dxf << 0 << "\r\n";
|
||||
|
||||
|
||||
To_Dxf << "ENDTAB" << "\r\n";
|
||||
To_Dxf << 0 << "\r\n";
|
||||
To_Dxf << "ENDSEC" << "\r\n";
|
||||
@ -228,8 +228,12 @@ void Createdxf::dxfBegin (const QString& fileName)
|
||||
}
|
||||
}
|
||||
|
||||
/* End Section of every DXF File*/
|
||||
void Createdxf::dxfEnd (const QString& fileName)
|
||||
/**
|
||||
@brief Createdxf::dxfEnd
|
||||
End Section of every DXF File
|
||||
@param fileName
|
||||
*/
|
||||
void Createdxf::dxfEnd(const QString& fileName)
|
||||
{
|
||||
// Creation of an output stream object in text mode.
|
||||
if (!fileName.isEmpty()) {
|
||||
@ -251,9 +255,21 @@ void Createdxf::dxfEnd (const QString& fileName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* draw circle in dxf format*/
|
||||
void Createdxf::drawCircle (const QString& fileName, double radius, double x, double y, int colour)
|
||||
/**
|
||||
@brief Createdxf::drawCircle
|
||||
draw circle in dxf format
|
||||
@param fileName
|
||||
@param radius
|
||||
@param x
|
||||
@param y
|
||||
@param colour
|
||||
*/
|
||||
void Createdxf::drawCircle(
|
||||
const QString& fileName,
|
||||
double radius,
|
||||
double x,
|
||||
double y,
|
||||
int colour)
|
||||
{
|
||||
if (!fileName.isEmpty()) {
|
||||
QFile file(fileName);
|
||||
@ -285,9 +301,23 @@ void Createdxf::drawCircle (const QString& fileName, double radius, double x, do
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* draw line in DXF Format*/
|
||||
void Createdxf::drawLine (const QString &fileName, double x1, double y1, double x2, double y2,const int &colour)
|
||||
/**
|
||||
@brief Createdxf::drawLine
|
||||
draw line in DXF Format
|
||||
@param fileName
|
||||
@param x1
|
||||
@param y1
|
||||
@param x2
|
||||
@param y2
|
||||
@param colour
|
||||
*/
|
||||
void Createdxf::drawLine (
|
||||
const QString &fileName,
|
||||
double x1,
|
||||
double y1,
|
||||
double x2,
|
||||
double y2,
|
||||
const int &colour)
|
||||
{
|
||||
if (!fileName.isEmpty()) {
|
||||
QFile file(fileName);
|
||||
@ -323,7 +353,8 @@ void Createdxf::drawLine (const QString &fileName, double x1, double y1, double
|
||||
}
|
||||
}
|
||||
|
||||
long Createdxf::RGBcodeTable[255]{
|
||||
long Createdxf::RGBcodeTable[255]
|
||||
{
|
||||
0x000000, 0xff0000, 0xffff00, 0x00ff00, 0x00ffff,
|
||||
0x0000ff, 0xff00ff, 0xffffff, 0x414141, 0x808080,
|
||||
0xff0000, 0xffaaaa, 0xbd0000, 0xbd7e7e, 0x810000,
|
||||
@ -415,7 +446,11 @@ int Createdxf::getcolorCode (const long red, const long green, const long blue)
|
||||
@param line
|
||||
@param colorcode
|
||||
*/
|
||||
void Createdxf::drawLine(const QString &filepath, const QLineF &line, const int &colorcode) {
|
||||
void Createdxf::drawLine(
|
||||
const QString &filepath,
|
||||
const QLineF &line,
|
||||
const int &colorcode)
|
||||
{
|
||||
drawLine(filepath, line.p1().x() * xScale,
|
||||
sheetHeight - (line.p1().y() * yScale),
|
||||
line.p2().x() * xScale,
|
||||
@ -423,7 +458,19 @@ void Createdxf::drawLine(const QString &filepath, const QLineF &line, const int
|
||||
colorcode);
|
||||
}
|
||||
|
||||
void Createdxf::drawArcEllipse(const QString &file_path, qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal spanAngle, qreal hotspot_x, qreal hotspot_y, qreal rotation_angle, const int &colorcode) {
|
||||
void Createdxf::drawArcEllipse(
|
||||
const QString &file_path,
|
||||
qreal x,
|
||||
qreal y,
|
||||
qreal w,
|
||||
qreal h,
|
||||
qreal startAngle,
|
||||
qreal spanAngle,
|
||||
qreal hotspot_x,
|
||||
qreal hotspot_y,
|
||||
qreal rotation_angle,
|
||||
const int &colorcode)
|
||||
{
|
||||
// vector of parts of arc (stored as a pair of startAngle and spanAngle) for each quadrant.
|
||||
QVector< QPair<qreal,qreal> > arc_parts_vector;
|
||||
|
||||
@ -534,7 +581,12 @@ void Createdxf::drawArcEllipse(const QString &file_path, qreal x, qreal y, qreal
|
||||
arc_endAngle = temp;
|
||||
}
|
||||
|
||||
QPointF transformed_point = ExportDialog::rotation_transformed(center_x, center_y, hotspot_x, hotspot_y, rotation_angle);
|
||||
QPointF transformed_point = ExportDialog::rotation_transformed(
|
||||
center_x,
|
||||
center_y,
|
||||
hotspot_x,
|
||||
hotspot_y,
|
||||
rotation_angle);
|
||||
center_x = transformed_point.x();
|
||||
center_y = transformed_point.y();
|
||||
arc_endAngle *= 180/3.142;
|
||||
@ -542,7 +594,14 @@ void Createdxf::drawArcEllipse(const QString &file_path, qreal x, qreal y, qreal
|
||||
arc_endAngle -= rotation_angle;
|
||||
arc_startAngle -= rotation_angle;
|
||||
|
||||
drawArc(file_path, center_x, center_y, radius, arc_startAngle, arc_endAngle, colorcode);
|
||||
drawArc(
|
||||
file_path,
|
||||
center_x,
|
||||
center_y,
|
||||
radius,
|
||||
arc_startAngle,
|
||||
arc_endAngle,
|
||||
colorcode);
|
||||
}
|
||||
}
|
||||
|
||||
@ -553,16 +612,37 @@ void Createdxf::drawArcEllipse(const QString &file_path, qreal x, qreal y, qreal
|
||||
@param rect
|
||||
@param colorcode
|
||||
*/
|
||||
void Createdxf::drawEllipse(const QString &filepath, const QRectF &rect, const int &colorcode) {
|
||||
drawArcEllipse(filepath, rect.topLeft().x() * xScale,
|
||||
sheetHeight - (rect.topLeft().y() * yScale),
|
||||
rect.width() * xScale,
|
||||
rect.height() * yScale,
|
||||
0, 360, 0, 0, 0, colorcode);
|
||||
void Createdxf::drawEllipse(
|
||||
const QString &filepath,
|
||||
const QRectF &rect,
|
||||
const int &colorcode)
|
||||
{
|
||||
drawArcEllipse(
|
||||
filepath,
|
||||
rect.topLeft().x() * xScale,
|
||||
sheetHeight - (rect.topLeft().y() * yScale),
|
||||
rect.width() * xScale,
|
||||
rect.height() * yScale,
|
||||
0, 360, 0, 0, 0, colorcode);
|
||||
}
|
||||
|
||||
/* draw rectangle in dxf format */
|
||||
void Createdxf::drawRectangle (const QString &fileName, double x1, double y1, double width, double height, const int &colour)
|
||||
/**
|
||||
@brief Createdxf::drawRectangle
|
||||
draw rectangle in dxf format
|
||||
@param fileName
|
||||
@param x1
|
||||
@param y1
|
||||
@param width
|
||||
@param height
|
||||
@param colour
|
||||
*/
|
||||
void Createdxf::drawRectangle (
|
||||
const QString &fileName,
|
||||
double x1,
|
||||
double y1,
|
||||
double width,
|
||||
double height,
|
||||
const int &colour)
|
||||
{
|
||||
if (!fileName.isEmpty()) {
|
||||
QFile file(fileName);
|
||||
@ -654,40 +734,47 @@ void Createdxf::drawRectangle (const QString &fileName, double x1, double y1, do
|
||||
|
||||
/**
|
||||
@brief Createdxf::drawRectangle
|
||||
Convenience function for draw rectangle
|
||||
Convenience function for draw rectangle
|
||||
@param filepath
|
||||
@param rect
|
||||
@param colorcode
|
||||
*/
|
||||
void Createdxf::drawRectangle(const QString &filepath,
|
||||
const QRectF &rect,
|
||||
const int &colorcode) {
|
||||
drawRectangle(filepath, rect.bottomLeft().x() * xScale,
|
||||
sheetHeight - (rect.bottomLeft().y() * yScale),
|
||||
rect.width() * xScale,
|
||||
rect.height() * yScale,
|
||||
colorcode);
|
||||
void Createdxf::drawRectangle(
|
||||
const QString &filepath,
|
||||
const QRectF &rect,
|
||||
const int &colorcode) {
|
||||
drawRectangle(
|
||||
filepath,
|
||||
rect.bottomLeft().x() * xScale,
|
||||
sheetHeight - (rect.bottomLeft().y() * yScale),
|
||||
rect.width() * xScale,
|
||||
rect.height() * yScale,
|
||||
colorcode);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Createdxf::drawPolygon
|
||||
Convenience function for draw polygon
|
||||
@param filepath
|
||||
@param poly
|
||||
@param colorcode
|
||||
@brief Createdxf::drawPolygon
|
||||
Convenience function for draw polygon
|
||||
@param filepath
|
||||
@param poly
|
||||
@param colorcode
|
||||
*/
|
||||
void Createdxf::drawPolygon(const QString &filepath,
|
||||
const QPolygonF &poly,
|
||||
const int &colorcode) {
|
||||
int lc = 0;
|
||||
QPointF plast;
|
||||
foreach(QPointF p, poly) {
|
||||
if(lc++) {
|
||||
QLineF ql(plast,p);
|
||||
drawLine(filepath,ql,colorcode);
|
||||
}
|
||||
plast = p;
|
||||
}
|
||||
void Createdxf::drawPolygon(
|
||||
const QString &filepath,
|
||||
const QPolygonF &poly,
|
||||
const int &colorcode)
|
||||
{
|
||||
int lc = 0;
|
||||
QPointF plast;
|
||||
foreach(QPointF p, poly)
|
||||
{
|
||||
if(lc++)
|
||||
{
|
||||
QLineF ql(plast,p);
|
||||
drawLine(filepath,ql,colorcode);
|
||||
}
|
||||
plast = p;
|
||||
}
|
||||
}
|
||||
/**
|
||||
@brief Createdxf::drawArc
|
||||
@ -700,13 +787,14 @@ void Createdxf::drawPolygon(const QString &filepath,
|
||||
@param endAngle
|
||||
@param color
|
||||
*/
|
||||
void Createdxf::drawArc(const QString& fileName,
|
||||
double x,
|
||||
double y,
|
||||
double rad,
|
||||
double startAngle,
|
||||
double endAngle,
|
||||
int color)
|
||||
void Createdxf::drawArc(
|
||||
const QString& fileName,
|
||||
double x,
|
||||
double y,
|
||||
double rad,
|
||||
double startAngle,
|
||||
double endAngle,
|
||||
int color)
|
||||
{
|
||||
if (!fileName.isEmpty()) {
|
||||
QFile file(fileName);
|
||||
@ -753,13 +841,14 @@ void Createdxf::drawArc(const QString& fileName,
|
||||
@param rotation
|
||||
@param colour
|
||||
*/
|
||||
void Createdxf::drawText(const QString& fileName,
|
||||
const QString& text,
|
||||
double x,
|
||||
double y,
|
||||
double height,
|
||||
double rotation,
|
||||
int colour)
|
||||
void Createdxf::drawText(
|
||||
const QString& fileName,
|
||||
const QString& text,
|
||||
double x,
|
||||
double y,
|
||||
double height,
|
||||
double rotation,
|
||||
int colour)
|
||||
{
|
||||
if (!fileName.isEmpty()) {
|
||||
QFile file(fileName);
|
||||
@ -844,17 +933,17 @@ void Createdxf::drawTextAligned(
|
||||
To_Dxf << 50 << "\r\n";
|
||||
To_Dxf << rotation << "\r\n"; // Text Rotation
|
||||
#if 0
|
||||
// If "Fit to width", then check if width of text < width specified then change it "center align or left align"
|
||||
// If "Fit to width", then check if width of text < width specified then change it "center align or left align"
|
||||
if (hAlign == 5) {
|
||||
int xDiff = xAlign - x;
|
||||
int len = text.length();
|
||||
int t = xDiff/height;
|
||||
int len = text.length();
|
||||
int t = xDiff/height;
|
||||
if (text.length() < xDiff/height && !leftAlign) {
|
||||
hAlign = 1;
|
||||
xAlign = x+ (xAlign / 2);
|
||||
xAlign = x+ (xAlign / 2);
|
||||
} else if (text.length() < xDiff/height && leftAlign) {
|
||||
hAlign = 0;
|
||||
xAlign = x;
|
||||
hAlign = 0;
|
||||
xAlign = x;
|
||||
// file.close();
|
||||
// return;
|
||||
}
|
||||
|
@ -21,99 +21,112 @@
|
||||
#include <QtCore>
|
||||
#include <QtWidgets>
|
||||
|
||||
|
||||
/* This class exports the project to DXF Format */
|
||||
/**
|
||||
@brief The Createdxf class
|
||||
This class exports the project to DXF Format
|
||||
*/
|
||||
class Createdxf
|
||||
{
|
||||
public:
|
||||
Createdxf();
|
||||
~Createdxf();
|
||||
static void dxfBegin (const QString&);
|
||||
static void dxfEnd(const QString&);
|
||||
// you can add more functions to create more drawings.
|
||||
static void drawCircle(const QString&,
|
||||
double,
|
||||
double,
|
||||
double,
|
||||
int);
|
||||
static void drawArc(const QString&,
|
||||
double x,
|
||||
double y,
|
||||
double rad,
|
||||
double startAngle,
|
||||
double endAngle,
|
||||
int color);
|
||||
static void drawDonut(QString,double,double,double,int);
|
||||
{
|
||||
public:
|
||||
Createdxf();
|
||||
~Createdxf();
|
||||
static void dxfBegin (const QString&);
|
||||
static void dxfEnd(const QString&);
|
||||
// you can add more functions to create more drawings.
|
||||
static void drawCircle(
|
||||
const QString&,
|
||||
double,
|
||||
double,
|
||||
double,
|
||||
int);
|
||||
static void drawArc(
|
||||
const QString&,
|
||||
double x,
|
||||
double y,
|
||||
double rad,
|
||||
double startAngle,
|
||||
double endAngle,
|
||||
int color);
|
||||
static void drawDonut(QString,double,double,double,int);
|
||||
|
||||
static void drawArcEllipse (const QString &file_path,
|
||||
qreal x,
|
||||
qreal y,
|
||||
qreal w,
|
||||
qreal h,
|
||||
qreal startAngle,
|
||||
qreal spanAngle,
|
||||
qreal hotspot_x,
|
||||
qreal hotspot_y,
|
||||
qreal rotation_angle,
|
||||
const int &colorcode);
|
||||
static void drawArcEllipse (
|
||||
const QString &file_path,
|
||||
qreal x,
|
||||
qreal y,
|
||||
qreal w,
|
||||
qreal h,
|
||||
qreal startAngle,
|
||||
qreal spanAngle,
|
||||
qreal hotspot_x,
|
||||
qreal hotspot_y,
|
||||
qreal rotation_angle,
|
||||
const int &colorcode);
|
||||
|
||||
static void drawEllipse (const QString &filepath,
|
||||
const QRectF &rect,
|
||||
const int &colorcode);
|
||||
|
||||
static void drawRectangle(const QString &filepath,
|
||||
double,
|
||||
double,
|
||||
double,
|
||||
double,
|
||||
const int &colorcode);
|
||||
static void drawRectangle(const QString &filepath,
|
||||
const QRectF &rect,
|
||||
const int &colorcode);
|
||||
static void drawRectangle(
|
||||
const QString &filepath,
|
||||
double,
|
||||
double,
|
||||
double,
|
||||
double,
|
||||
const int &colorcode);
|
||||
static void drawRectangle(
|
||||
const QString &filepath,
|
||||
const QRectF &rect,
|
||||
const int &colorcode);
|
||||
|
||||
static void drawPolygon(const QString &filepath,
|
||||
const QPolygonF &poly,
|
||||
const int &colorcode);
|
||||
static void drawPolygon(
|
||||
const QString &filepath,
|
||||
const QPolygonF &poly,
|
||||
const int &colorcode);
|
||||
|
||||
static void drawLine(const QString &filapath,
|
||||
double,
|
||||
double,
|
||||
double,
|
||||
double,
|
||||
const int &clorcode);
|
||||
static void drawLine(const QString &filepath,
|
||||
const QLineF &line,
|
||||
const int &colorcode);
|
||||
static void drawLine(
|
||||
const QString &filapath,
|
||||
double,
|
||||
double,
|
||||
double,
|
||||
double,
|
||||
const int &clorcode);
|
||||
static void drawLine(
|
||||
const QString &filepath,
|
||||
const QLineF &line,
|
||||
const int &colorcode);
|
||||
|
||||
static void drawText(const QString&,
|
||||
const QString&,
|
||||
double,double,
|
||||
double,
|
||||
double,
|
||||
int);
|
||||
static void drawTextAligned(const QString& fileName,
|
||||
const QString& text,
|
||||
double x,
|
||||
double y,
|
||||
double height,
|
||||
double rotation,
|
||||
double oblique,
|
||||
int hAlign,
|
||||
int vAlign,
|
||||
double xAlign,
|
||||
double xScale,
|
||||
int colour);
|
||||
static void drawText(
|
||||
const QString&,
|
||||
const QString&,
|
||||
double,double,
|
||||
double,
|
||||
double,
|
||||
int);
|
||||
static void drawTextAligned(
|
||||
const QString& fileName,
|
||||
const QString& text,
|
||||
double x,
|
||||
double y,
|
||||
double height,
|
||||
double rotation,
|
||||
double oblique,
|
||||
int hAlign,
|
||||
int vAlign,
|
||||
double xAlign,
|
||||
double xScale,
|
||||
int colour);
|
||||
|
||||
|
||||
static int getcolorCode (const long red,
|
||||
const long green,
|
||||
const long blue);
|
||||
static long RGBcodeTable[];
|
||||
static int getcolorCode (
|
||||
const long red,
|
||||
const long green,
|
||||
const long blue);
|
||||
static long RGBcodeTable[];
|
||||
|
||||
static const double sheetWidth;
|
||||
static const double sheetHeight;
|
||||
static double xScale;
|
||||
static double yScale;
|
||||
static const double sheetWidth;
|
||||
static const double sheetHeight;
|
||||
static double xScale;
|
||||
static double yScale;
|
||||
};
|
||||
|
||||
#endif // CREATEDXF_H
|
||||
|
@ -49,7 +49,8 @@ projectDataBase::projectDataBase(QETProject *project, const QString &connection_
|
||||
@brief projectDataBase::~projectDataBase
|
||||
Destructor
|
||||
*/
|
||||
projectDataBase::~projectDataBase() {
|
||||
projectDataBase::~projectDataBase()
|
||||
{
|
||||
m_data_base.close();
|
||||
}
|
||||
|
||||
@ -71,7 +72,8 @@ void projectDataBase::updateDB()
|
||||
@brief projectDataBase::project
|
||||
@return the project of this database
|
||||
*/
|
||||
QETProject *projectDataBase::project() const {
|
||||
QETProject *projectDataBase::project() const
|
||||
{
|
||||
return m_project;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,8 @@ ElementQueryWidget::ElementQueryWidget(QWidget *parent) :
|
||||
/**
|
||||
@brief ElementQueryWidget::~ElementQueryWidget
|
||||
*/
|
||||
ElementQueryWidget::~ElementQueryWidget() {
|
||||
ElementQueryWidget::~ElementQueryWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@ -413,7 +414,8 @@ void ElementQueryWidget::setCount(QString text, bool set)
|
||||
/**
|
||||
@brief ElementQueryWidget::updateQueryLine
|
||||
*/
|
||||
void ElementQueryWidget::updateQueryLine() {
|
||||
void ElementQueryWidget::updateQueryLine()
|
||||
{
|
||||
ui->m_sql_query->setText(queryStr());
|
||||
}
|
||||
|
||||
@ -464,7 +466,8 @@ void ElementQueryWidget::setUpItems()
|
||||
@param key
|
||||
@return the filter associated to key
|
||||
*/
|
||||
QPair<int, QString> ElementQueryWidget::FilterFor(const QString &key) const {
|
||||
QPair<int, QString> ElementQueryWidget::FilterFor(const QString &key) const
|
||||
{
|
||||
return m_filter.value(key, qMakePair(0, QString()));
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,8 @@ void SummaryQueryWidget::fillSavedQuery()
|
||||
/**
|
||||
@brief SummaryQueryWidget::updateQueryLine
|
||||
*/
|
||||
void SummaryQueryWidget::updateQueryLine() {
|
||||
void SummaryQueryWidget::updateQueryLine()
|
||||
{
|
||||
ui->m_user_query_le->setText(queryStr());
|
||||
}
|
||||
|
||||
|
@ -516,7 +516,8 @@ void Diagram::keyReleaseEvent(QKeyEvent *e)
|
||||
@brief Diagram::uuid
|
||||
@return the uuid of this diagram
|
||||
*/
|
||||
QUuid Diagram::uuid() {
|
||||
QUuid Diagram::uuid()
|
||||
{
|
||||
return m_uuid;
|
||||
}
|
||||
|
||||
@ -561,7 +562,8 @@ void Diagram::clearEventInterface()
|
||||
@brief Diagram::conductorsAutonumName
|
||||
@return the name of autonum to use.
|
||||
*/
|
||||
QString Diagram::conductorsAutonumName() const {
|
||||
QString Diagram::conductorsAutonumName() const
|
||||
{
|
||||
return m_conductors_autonum_name;
|
||||
}
|
||||
|
||||
@ -648,7 +650,8 @@ bool Diagram::toPaintDevice(QPaintDevice &pix,
|
||||
\~ @return The size of the image generated by toImage()
|
||||
\~French La taille de l'image generee par toImage()
|
||||
*/
|
||||
QSize Diagram::imageSize() const {
|
||||
QSize Diagram::imageSize() const
|
||||
{
|
||||
// determine la zone source = contenu du schema + marges
|
||||
qreal image_width, image_height;
|
||||
if (!use_border_) {
|
||||
@ -677,7 +680,8 @@ QSize Diagram::imageSize() const {
|
||||
\~French true si le schema est considere comme vide, false sinon.
|
||||
Un schema vide ne contient ni element, ni conducteur, ni champ de texte
|
||||
*/
|
||||
bool Diagram::isEmpty() const {
|
||||
bool Diagram::isEmpty() const
|
||||
{
|
||||
return(!items().count());
|
||||
}
|
||||
|
||||
@ -687,7 +691,8 @@ bool Diagram::isEmpty() const {
|
||||
each potential are in the QList
|
||||
and each conductors of one potential are in the QSet
|
||||
*/
|
||||
QList < QSet <Conductor *> > Diagram::potentials() {
|
||||
QList < QSet <Conductor *> > Diagram::potentials()
|
||||
{
|
||||
QList < QSet <Conductor *> > potential_List;
|
||||
if (content().conductors().size() == 0)
|
||||
return (potential_List); //return an empty potential
|
||||
@ -1673,7 +1678,8 @@ void Diagram::setTitleBlockTemplate(const QString &template_name)
|
||||
Select all schema objects
|
||||
\~French Selectionne tous les objets du schema
|
||||
*/
|
||||
void Diagram::selectAll() {
|
||||
void Diagram::selectAll()
|
||||
{
|
||||
if (items().isEmpty()) return;
|
||||
|
||||
blockSignals(true);
|
||||
@ -1687,7 +1693,8 @@ void Diagram::selectAll() {
|
||||
Deselects all selected objects
|
||||
\~French Deslectionne tous les objets selectionnes
|
||||
*/
|
||||
void Diagram::deselectAll() {
|
||||
void Diagram::deselectAll()
|
||||
{
|
||||
if (items().isEmpty()) return;
|
||||
|
||||
clearSelection();
|
||||
@ -1698,7 +1705,8 @@ void Diagram::deselectAll() {
|
||||
Reverses the selection state of all schema objects
|
||||
Inverse l'etat de selection de tous les objets du schema
|
||||
*/
|
||||
void Diagram::invertSelection() {
|
||||
void Diagram::invertSelection()
|
||||
{
|
||||
if (items().isEmpty()) return;
|
||||
|
||||
blockSignals(true);
|
||||
@ -1854,7 +1862,8 @@ void Diagram::changeZValue(QET::DepthOption option)
|
||||
This class loads all folio sequential variables related
|
||||
to the current autonum
|
||||
*/
|
||||
void Diagram::loadElmtFolioSeq() {
|
||||
void Diagram::loadElmtFolioSeq()
|
||||
{
|
||||
QString title = project()->elementCurrentAutoNum();
|
||||
NumerotationContext nc = project()->elementAutoNum(title);
|
||||
|
||||
@ -1939,7 +1948,8 @@ void Diagram::loadElmtFolioSeq() {
|
||||
This class loads all conductor folio sequential variables related
|
||||
to the current autonum
|
||||
*/
|
||||
void Diagram::loadCndFolioSeq() {
|
||||
void Diagram::loadCndFolioSeq()
|
||||
{
|
||||
//Conductor
|
||||
QString title = project()->conductorCurrentAutoNum();
|
||||
NumerotationContext nc = project()->conductorAutoNum(title);
|
||||
@ -2020,7 +2030,8 @@ void Diagram::loadCndFolioSeq() {
|
||||
@return title of the titleblock
|
||||
\~Frenchle titre du cartouche
|
||||
*/
|
||||
QString Diagram::title() const {
|
||||
QString Diagram::title() const
|
||||
{
|
||||
return(border_and_titleblock.title());
|
||||
}
|
||||
|
||||
@ -2028,7 +2039,8 @@ QString Diagram::title() const {
|
||||
@brief Diagram::elements
|
||||
@return the list containing all elements
|
||||
*/
|
||||
QList <Element *> Diagram::elements() const {
|
||||
QList <Element *> Diagram::elements() const
|
||||
{
|
||||
QList<Element *> element_list;
|
||||
foreach (QGraphicsItem *qgi, items()) {
|
||||
if (Element *elmt = qgraphicsitem_cast<Element *>(qgi))
|
||||
@ -2041,7 +2053,8 @@ QList <Element *> Diagram::elements() const {
|
||||
@brief Diagram::conductors
|
||||
@return the list containing all conductors
|
||||
*/
|
||||
QList <Conductor *> Diagram::conductors() const {
|
||||
QList <Conductor *> Diagram::conductors() const
|
||||
{
|
||||
QList<Conductor *> cnd_list;
|
||||
foreach (QGraphicsItem *qgi, items()) {
|
||||
if (Conductor *cnd = qgraphicsitem_cast<Conductor *>(qgi))
|
||||
@ -2054,7 +2067,8 @@ QList <Conductor *> Diagram::conductors() const {
|
||||
@brief Diagram::elementsMover
|
||||
@return
|
||||
*/
|
||||
ElementsMover &Diagram::elementsMover() {
|
||||
ElementsMover &Diagram::elementsMover()
|
||||
{
|
||||
return m_elements_mover;
|
||||
}
|
||||
|
||||
@ -2062,7 +2076,8 @@ ElementsMover &Diagram::elementsMover() {
|
||||
@brief Diagram::elementTextsMover
|
||||
@return
|
||||
*/
|
||||
ElementTextsMover &Diagram::elementTextsMover() {
|
||||
ElementTextsMover &Diagram::elementTextsMover()
|
||||
{
|
||||
return m_element_texts_mover;
|
||||
}
|
||||
|
||||
@ -2111,7 +2126,8 @@ void Diagram::freezeElements(bool freeze) {
|
||||
@brief Diagram::unfreezeElements
|
||||
Unfreeze every existent element label.
|
||||
*/
|
||||
void Diagram::unfreezeElements() {
|
||||
void Diagram::unfreezeElements()
|
||||
{
|
||||
foreach (Element *elmt, elements()) {
|
||||
elmt->freezeLabel(false);
|
||||
}
|
||||
@ -2129,7 +2145,8 @@ void Diagram::setFreezeNewElements(bool b) {
|
||||
@brief Diagram::freezeNewElements
|
||||
@return current freeze new element status .
|
||||
*/
|
||||
bool Diagram::freezeNewElements() {
|
||||
bool Diagram::freezeNewElements()
|
||||
{
|
||||
return m_freeze_new_elements;
|
||||
}
|
||||
|
||||
@ -2155,7 +2172,8 @@ void Diagram::setFreezeNewConductors(bool b) {
|
||||
@brief Diagram::freezeNewConductors
|
||||
@return current freeze new conductor status .
|
||||
*/
|
||||
bool Diagram::freezeNewConductors() {
|
||||
bool Diagram::freezeNewConductors()
|
||||
{
|
||||
return m_freeze_new_conductors_;
|
||||
}
|
||||
|
||||
@ -2294,7 +2312,8 @@ void Diagram::setDrawColoredConductors(bool dcc) {
|
||||
@return the list of conductors selected on the diagram
|
||||
\~French la liste des conducteurs selectionnes sur le schema
|
||||
*/
|
||||
QSet<Conductor *> Diagram::selectedConductors() const {
|
||||
QSet<Conductor *> Diagram::selectedConductors() const
|
||||
{
|
||||
QSet<Conductor *> conductors_set;
|
||||
foreach(QGraphicsItem *qgi, selectedItems()) {
|
||||
if (Conductor *c = qgraphicsitem_cast<Conductor *>(qgi)) {
|
||||
@ -2309,7 +2328,8 @@ QSet<Conductor *> Diagram::selectedConductors() const {
|
||||
@return true if the clipboard appears to contain a schema
|
||||
\~French true si le presse-papier semble contenir un schema
|
||||
*/
|
||||
bool Diagram::clipboardMayContainDiagram() {
|
||||
bool Diagram::clipboardMayContainDiagram()
|
||||
{
|
||||
QString clipboard_text = QApplication::clipboard() -> text().trimmed();
|
||||
bool may_be_diagram = clipboard_text.startsWith("<diagram")
|
||||
&& clipboard_text.endsWith("</diagram>");
|
||||
@ -2323,7 +2343,8 @@ bool Diagram::clipboardMayContainDiagram() {
|
||||
\~French le projet auquel ce schema appartient
|
||||
ou 0 s'il s'agit d'un schema independant.
|
||||
*/
|
||||
QETProject *Diagram::project() const {
|
||||
QETProject *Diagram::project() const
|
||||
{
|
||||
return(m_project);
|
||||
}
|
||||
|
||||
@ -2332,7 +2353,8 @@ QETProject *Diagram::project() const {
|
||||
@return the folio number of this diagram within its parent project,
|
||||
or -1 if it is has no parent project
|
||||
*/
|
||||
int Diagram::folioIndex() const {
|
||||
int Diagram::folioIndex() const
|
||||
{
|
||||
if (!m_project) return(-1);
|
||||
return(m_project -> folioIndex(this));
|
||||
}
|
||||
@ -2345,7 +2367,8 @@ int Diagram::folioIndex() const {
|
||||
fallback_to_project is true.
|
||||
@return the declared QElectroTech version of this diagram
|
||||
*/
|
||||
qreal Diagram::declaredQElectroTechVersion(bool fallback_to_project) const {
|
||||
qreal Diagram::declaredQElectroTechVersion(bool fallback_to_project) const
|
||||
{
|
||||
if (diagram_qet_version_ != -1) {
|
||||
return diagram_qet_version_;
|
||||
}
|
||||
@ -2372,7 +2395,8 @@ bool Diagram::isReadOnly() const
|
||||
\~French Le contenu du schema. Les conducteurs sont tous places dans
|
||||
conductorsToMove.
|
||||
*/
|
||||
DiagramContent Diagram::content() const {
|
||||
DiagramContent Diagram::content() const
|
||||
{
|
||||
DiagramContent dc;
|
||||
foreach(QGraphicsItem *qgi, items()) {
|
||||
if (Element *e = qgraphicsitem_cast<Element *>(qgi)) {
|
||||
|
@ -410,7 +410,8 @@ inline QGIManager &Diagram::qgiManager() {
|
||||
@brief Diagram::drawTerminals
|
||||
@return true if terminals are rendered, false otherwise
|
||||
*/
|
||||
inline bool Diagram::drawTerminals() const {
|
||||
inline bool Diagram::drawTerminals() const
|
||||
{
|
||||
return(draw_terminals_);
|
||||
}
|
||||
|
||||
@ -418,7 +419,8 @@ inline bool Diagram::drawTerminals() const {
|
||||
@brief Diagram::drawColoredConductors
|
||||
@return true if conductors colors are rendered, false otherwise.
|
||||
*/
|
||||
inline bool Diagram::drawColoredConductors() const {
|
||||
inline bool Diagram::drawColoredConductors() const
|
||||
{
|
||||
return(draw_colored_conductors_);
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,8 @@ PasteDiagramCommand::PasteDiagramCommand( Diagram *dia, const DiagramContent &c,
|
||||
@brief PasteDiagramCommand::~PasteDiagramCommand
|
||||
Destructor
|
||||
*/
|
||||
PasteDiagramCommand::~PasteDiagramCommand() {
|
||||
PasteDiagramCommand::~PasteDiagramCommand()
|
||||
{
|
||||
diagram -> qgiManager().release(content.items(filter));
|
||||
}
|
||||
|
||||
@ -162,7 +163,8 @@ CutDiagramCommand::CutDiagramCommand(
|
||||
@brief CutDiagramCommand::~CutDiagramCommand
|
||||
Destructeur
|
||||
*/
|
||||
CutDiagramCommand::~CutDiagramCommand() {
|
||||
CutDiagramCommand::~CutDiagramCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -210,14 +212,16 @@ MoveElementsCommand::MoveElementsCommand(
|
||||
@brief MoveElementsCommand::~MoveElementsCommand
|
||||
Destructor
|
||||
*/
|
||||
MoveElementsCommand::~MoveElementsCommand() {
|
||||
MoveElementsCommand::~MoveElementsCommand()
|
||||
{
|
||||
delete m_anim_group;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief MoveElementsCommand::undo
|
||||
*/
|
||||
void MoveElementsCommand::undo() {
|
||||
void MoveElementsCommand::undo()
|
||||
{
|
||||
diagram -> showMe();
|
||||
m_anim_group->setDirection(QAnimationGroup::Forward);
|
||||
m_anim_group->start();
|
||||
@ -227,7 +231,8 @@ void MoveElementsCommand::undo() {
|
||||
/**
|
||||
@brief MoveElementsCommand::redo
|
||||
*/
|
||||
void MoveElementsCommand::redo() {
|
||||
void MoveElementsCommand::redo()
|
||||
{
|
||||
diagram -> showMe();
|
||||
if (first_redo) {
|
||||
first_redo = false;
|
||||
@ -329,14 +334,16 @@ MoveConductorsTextsCommand::MoveConductorsTextsCommand(
|
||||
@brief MoveConductorsTextsCommand::~MoveConductorsTextsCommand
|
||||
Destructeur
|
||||
*/
|
||||
MoveConductorsTextsCommand::~MoveConductorsTextsCommand() {
|
||||
MoveConductorsTextsCommand::~MoveConductorsTextsCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@brief MoveConductorsTextsCommand::undo
|
||||
annule le deplacement
|
||||
*/
|
||||
void MoveConductorsTextsCommand::undo() {
|
||||
void MoveConductorsTextsCommand::undo()
|
||||
{
|
||||
diagram -> showMe();
|
||||
foreach(ConductorTextItem *cti, texts_to_move_.keys()) {
|
||||
QPointF movement = texts_to_move_[cti].first;
|
||||
@ -353,7 +360,8 @@ void MoveConductorsTextsCommand::undo() {
|
||||
@brief MoveConductorsTextsCommand::redo
|
||||
refait le deplacement
|
||||
*/
|
||||
void MoveConductorsTextsCommand::redo() {
|
||||
void MoveConductorsTextsCommand::redo()
|
||||
{
|
||||
diagram -> showMe();
|
||||
if (first_redo) {
|
||||
first_redo = false;
|
||||
@ -397,7 +405,8 @@ void MoveConductorsTextsCommand::addTextMovement(ConductorTextItem *text_item,
|
||||
@brief MoveConductorsTextsCommand::regenerateTextLabel
|
||||
Genere la description de l'objet d'annulation
|
||||
*/
|
||||
void MoveConductorsTextsCommand::regenerateTextLabel() {
|
||||
void MoveConductorsTextsCommand::regenerateTextLabel()
|
||||
{
|
||||
QString moved_content_sentence = QET::ElementsAndConductorsSentence(0, 0, texts_to_move_.count());
|
||||
|
||||
setText(
|
||||
@ -437,14 +446,16 @@ ChangeDiagramTextCommand::ChangeDiagramTextCommand(
|
||||
@brief ChangeDiagramTextCommand::~ChangeDiagramTextCommand
|
||||
destructeur
|
||||
*/
|
||||
ChangeDiagramTextCommand::~ChangeDiagramTextCommand() {
|
||||
ChangeDiagramTextCommand::~ChangeDiagramTextCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@brief ChangeDiagramTextCommand::undo
|
||||
annule la modification de texte
|
||||
*/
|
||||
void ChangeDiagramTextCommand::undo() {
|
||||
void ChangeDiagramTextCommand::undo()
|
||||
{
|
||||
diagram -> showMe();
|
||||
text_item -> setHtml(text_before);
|
||||
}
|
||||
@ -488,14 +499,16 @@ ChangeConductorCommand::ChangeConductorCommand(
|
||||
@brief ChangeConductorCommand::~ChangeConductorCommand
|
||||
Destructeur
|
||||
*/
|
||||
ChangeConductorCommand::~ChangeConductorCommand() {
|
||||
ChangeConductorCommand::~ChangeConductorCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@brief ChangeConductorCommand::undo
|
||||
Annule la modification du conducteur
|
||||
*/
|
||||
void ChangeConductorCommand::undo() {
|
||||
void ChangeConductorCommand::undo()
|
||||
{
|
||||
diagram -> showMe();
|
||||
conductor -> setProfile(old_profile, path_type);
|
||||
conductor -> textItem() -> setPos(text_pos_before_mov_);
|
||||
@ -505,7 +518,8 @@ void ChangeConductorCommand::undo() {
|
||||
@brief ChangeConductorCommand::redo
|
||||
Refait la modification du conducteur
|
||||
*/
|
||||
void ChangeConductorCommand::redo() {
|
||||
void ChangeConductorCommand::redo()
|
||||
{
|
||||
diagram -> showMe();
|
||||
if (first_redo) {
|
||||
first_redo = false;
|
||||
@ -551,13 +565,15 @@ ResetConductorCommand::ResetConductorCommand(
|
||||
/**
|
||||
@brief ResetConductorCommand::~ResetConductorCommand
|
||||
*/
|
||||
ResetConductorCommand::~ResetConductorCommand() {
|
||||
ResetConductorCommand::~ResetConductorCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@brief ResetConductorCommand::undo
|
||||
*/
|
||||
void ResetConductorCommand::undo() {
|
||||
void ResetConductorCommand::undo()
|
||||
{
|
||||
diagram -> showMe();
|
||||
foreach(Conductor *c, conductors_profiles.keys()) {
|
||||
c -> setProfiles(conductors_profiles[c]);
|
||||
@ -567,7 +583,8 @@ void ResetConductorCommand::undo() {
|
||||
/**
|
||||
@brief ResetConductorCommand::redo
|
||||
*/
|
||||
void ResetConductorCommand::redo() {
|
||||
void ResetConductorCommand::redo()
|
||||
{
|
||||
diagram -> showMe();
|
||||
foreach(Conductor *c, conductors_profiles.keys()) {
|
||||
c -> textItem() -> forceMovedByUser (false);
|
||||
@ -601,14 +618,16 @@ ChangeBorderCommand::ChangeBorderCommand(Diagram *dia,
|
||||
@brief ChangeBorderCommand::~ChangeBorderCommand
|
||||
Destructeur
|
||||
*/
|
||||
ChangeBorderCommand::~ChangeBorderCommand() {
|
||||
ChangeBorderCommand::~ChangeBorderCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@brief ChangeBorderCommand::undo
|
||||
Annule les changements apportes au schema
|
||||
*/
|
||||
void ChangeBorderCommand::undo() {
|
||||
void ChangeBorderCommand::undo()
|
||||
{
|
||||
diagram -> showMe();
|
||||
diagram -> border_and_titleblock.importBorder(old_properties);
|
||||
}
|
||||
@ -617,7 +636,8 @@ void ChangeBorderCommand::undo() {
|
||||
@brief ChangeBorderCommand::redo
|
||||
Refait les changements apportes au schema
|
||||
*/
|
||||
void ChangeBorderCommand::redo() {
|
||||
void ChangeBorderCommand::redo()
|
||||
{
|
||||
diagram -> showMe();
|
||||
diagram -> border_and_titleblock.importBorder(new_properties);
|
||||
}
|
||||
|
@ -32,7 +32,8 @@
|
||||
/**
|
||||
@brief DiagramContent::DiagramContent
|
||||
*/
|
||||
DiagramContent::DiagramContent() {}
|
||||
DiagramContent::DiagramContent()
|
||||
{}
|
||||
|
||||
/**
|
||||
@brief DiagramContent::DiagramContent
|
||||
|
@ -67,14 +67,16 @@ QList<QString> DiagramContext::keys(DiagramContext::KeyOrder order) const
|
||||
@param key string key
|
||||
@return true if that key is known to the diagram context, false otherwise
|
||||
*/
|
||||
bool DiagramContext::contains(const QString &key) const {
|
||||
bool DiagramContext::contains(const QString &key) const
|
||||
{
|
||||
return(m_content.contains(key));
|
||||
}
|
||||
|
||||
/**
|
||||
@param key
|
||||
*/
|
||||
const QVariant DiagramContext::operator[](const QString &key) const {
|
||||
const QVariant DiagramContext::operator[](const QString &key) const
|
||||
{
|
||||
return(m_content[key]);
|
||||
}
|
||||
|
||||
@ -97,14 +99,16 @@ bool DiagramContext::addValue(const QString &key, const QVariant &value, bool sh
|
||||
return(false);
|
||||
}
|
||||
|
||||
QVariant DiagramContext::value(const QString &key) const {
|
||||
QVariant DiagramContext::value(const QString &key) const
|
||||
{
|
||||
return m_content.value(key);
|
||||
}
|
||||
|
||||
/**
|
||||
Clear the content of this diagram context.
|
||||
*/
|
||||
void DiagramContext::clear() {
|
||||
void DiagramContext::clear()
|
||||
{
|
||||
m_content.clear();
|
||||
m_content_show.clear();
|
||||
}
|
||||
@ -112,7 +116,8 @@ void DiagramContext::clear() {
|
||||
/**
|
||||
@return the number of key/value pairs stored in this object.
|
||||
*/
|
||||
int DiagramContext::count() {
|
||||
int DiagramContext::count()
|
||||
{
|
||||
return(m_content.count());
|
||||
}
|
||||
|
||||
@ -120,18 +125,21 @@ int DiagramContext::count() {
|
||||
@brief DiagramContext::keyMustShow
|
||||
@return the value pairs with key, if key no found, return false
|
||||
*/
|
||||
bool DiagramContext::keyMustShow(const QString &key) const {
|
||||
bool DiagramContext::keyMustShow(const QString &key) const
|
||||
{
|
||||
if (m_content_show.contains(key))
|
||||
return m_content_show[key];
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DiagramContext::operator==(const DiagramContext &dc) const {
|
||||
bool DiagramContext::operator==(const DiagramContext &dc) const
|
||||
{
|
||||
return(m_content == dc.m_content &&
|
||||
m_content_show == dc.m_content_show);
|
||||
}
|
||||
|
||||
bool DiagramContext::operator!=(const DiagramContext &dc) const {
|
||||
bool DiagramContext::operator!=(const DiagramContext &dc) const
|
||||
{
|
||||
return(!(*this == dc));
|
||||
}
|
||||
|
||||
@ -139,7 +147,8 @@ bool DiagramContext::operator!=(const DiagramContext &dc) const {
|
||||
Export this context properties under the \a e XML element, using tags
|
||||
named \a tag_name (defaults to "property").
|
||||
*/
|
||||
void DiagramContext::toXml(QDomElement &e, const QString &tag_name) const {
|
||||
void DiagramContext::toXml(QDomElement &e, const QString &tag_name) const
|
||||
{
|
||||
foreach (QString key, keys()) {
|
||||
QDomElement property = e.ownerDocument().createElement(tag_name);
|
||||
property.setAttribute("name", key);
|
||||
@ -182,7 +191,8 @@ void DiagramContext::fromXml(const pugi::xml_node &dom_element, const QString &t
|
||||
Export this context properties to \a settings by creating an array named \a
|
||||
array_name.
|
||||
*/
|
||||
void DiagramContext::toSettings(QSettings &settings, const QString &array_name) const {
|
||||
void DiagramContext::toSettings(QSettings &settings, const QString &array_name) const
|
||||
{
|
||||
settings.beginWriteArray(array_name);
|
||||
int i = 0;
|
||||
foreach (QString key, m_content.keys()) {
|
||||
@ -213,7 +223,8 @@ void DiagramContext::fromSettings(QSettings &settings, const QString &array_name
|
||||
@return the regular expression used to check whether a given key is acceptable.
|
||||
@see keyIsAcceptable()
|
||||
*/
|
||||
QString DiagramContext::validKeyRegExp() {
|
||||
QString DiagramContext::validKeyRegExp()
|
||||
{
|
||||
return("^[a-z0-9-_]+$");
|
||||
}
|
||||
|
||||
@ -228,7 +239,8 @@ bool DiagramContext::stringLongerThan(const QString &a, const QString &b) {
|
||||
@param key a key string
|
||||
@return true if that key is acceptable, false otherwise
|
||||
*/
|
||||
bool DiagramContext::keyIsAcceptable(const QString &key) const {
|
||||
bool DiagramContext::keyIsAcceptable(const QString &key) const
|
||||
{
|
||||
QRegExp re(DiagramContext::validKeyRegExp());
|
||||
return(re.exactMatch(key));
|
||||
}
|
||||
|
@ -29,7 +29,8 @@ DiagramEventInterface::DiagramEventInterface(Diagram *diagram) :
|
||||
m_diagram -> clearSelection();
|
||||
}
|
||||
|
||||
DiagramEventInterface::~DiagramEventInterface() {};
|
||||
DiagramEventInterface::~DiagramEventInterface()
|
||||
{};
|
||||
|
||||
void DiagramEventInterface::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
|
||||
Q_UNUSED (event);
|
||||
@ -71,7 +72,8 @@ void DiagramEventInterface::keyReleaseEvent(QKeyEvent *event){
|
||||
Q_UNUSED (event);
|
||||
}
|
||||
|
||||
bool DiagramEventInterface::isRunning() const {
|
||||
bool DiagramEventInterface::isRunning() const
|
||||
{
|
||||
return m_running;
|
||||
}
|
||||
|
||||
|
@ -36,13 +36,15 @@ DiagramPosition::DiagramPosition(const QString &letter, unsigned int number) {
|
||||
/**
|
||||
Destructeur
|
||||
*/
|
||||
DiagramPosition::~DiagramPosition() {
|
||||
DiagramPosition::~DiagramPosition()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@return les coordonnees stockees dans cet objet, ou un QPointF nul sinon.
|
||||
*/
|
||||
QPointF DiagramPosition::position() const {
|
||||
QPointF DiagramPosition::position() const
|
||||
{
|
||||
return(position_);
|
||||
}
|
||||
|
||||
@ -56,7 +58,8 @@ void DiagramPosition::setPosition(const QPointF &position) {
|
||||
/**
|
||||
@return une representation textuelle de la position
|
||||
*/
|
||||
QString DiagramPosition::toString() {
|
||||
QString DiagramPosition::toString()
|
||||
{
|
||||
if (isOutOfBounds()) {
|
||||
return("-");
|
||||
}
|
||||
@ -72,6 +75,7 @@ QString DiagramPosition::toString() {
|
||||
/**
|
||||
@return true si l'element est en dehors des bords du schema
|
||||
*/
|
||||
bool DiagramPosition::isOutOfBounds() const {
|
||||
bool DiagramPosition::isOutOfBounds() const
|
||||
{
|
||||
return(letter_.isEmpty() || !number_);
|
||||
}
|
||||
|
@ -48,7 +48,8 @@ DiagramPrintDialog::DiagramPrintDialog(QETProject *project, QWidget *parent) :
|
||||
/**
|
||||
Destructeur
|
||||
*/
|
||||
DiagramPrintDialog::~DiagramPrintDialog() {
|
||||
DiagramPrintDialog::~DiagramPrintDialog()
|
||||
{
|
||||
delete dialog_;
|
||||
delete printer_;
|
||||
Diagram::background_color = backup_diagram_background_color;
|
||||
@ -64,7 +65,8 @@ void DiagramPrintDialog::setFileName(const QString &name) {
|
||||
/**
|
||||
@return le nom du PDF
|
||||
*/
|
||||
QString DiagramPrintDialog::fileName() const {
|
||||
QString DiagramPrintDialog::fileName() const
|
||||
{
|
||||
return(file_name_);
|
||||
}
|
||||
|
||||
@ -78,7 +80,8 @@ void DiagramPrintDialog::setDocName(const QString &name) {
|
||||
/**
|
||||
@return le nom du document
|
||||
*/
|
||||
QString DiagramPrintDialog::docName() const {
|
||||
QString DiagramPrintDialog::docName() const
|
||||
{
|
||||
return(doc_name_);
|
||||
}
|
||||
|
||||
@ -89,7 +92,8 @@ QString DiagramPrintDialog::docName() const {
|
||||
@return the rectangle to be printed
|
||||
*/
|
||||
QRect DiagramPrintDialog::diagramRect(Diagram *diagram,
|
||||
const ExportProperties &options) const {
|
||||
const ExportProperties &options) const
|
||||
{
|
||||
if (!diagram) return(QRect());
|
||||
|
||||
QRectF diagram_rect = diagram -> border_and_titleblock.borderAndTitleBlockRect();
|
||||
@ -107,7 +111,8 @@ QRect DiagramPrintDialog::diagramRect(Diagram *diagram,
|
||||
/**
|
||||
Execute le dialogue d'impression
|
||||
*/
|
||||
void DiagramPrintDialog::exec() {
|
||||
void DiagramPrintDialog::exec()
|
||||
{
|
||||
|
||||
// prise en compte du nom du document
|
||||
if (!doc_name_.isEmpty()) printer_ -> setDocName(doc_name_);
|
||||
@ -172,7 +177,8 @@ void DiagramPrintDialog::exec() {
|
||||
@return Le nombre de pages necessaires pour imprimer le schema
|
||||
avec l'orientation et le format papier utilise dans l'imprimante en cours.
|
||||
*/
|
||||
int DiagramPrintDialog::pagesCount(Diagram *diagram, const ExportProperties &options, bool fullpage) const {
|
||||
int DiagramPrintDialog::pagesCount(Diagram *diagram, const ExportProperties &options, bool fullpage) const
|
||||
{
|
||||
return(horizontalPagesCount(diagram, options, fullpage) * verticalPagesCount(diagram, options, fullpage));
|
||||
}
|
||||
|
||||
@ -183,7 +189,8 @@ int DiagramPrintDialog::pagesCount(Diagram *diagram, const ExportProperties &opt
|
||||
@return La largeur du "poster" en nombre de pages pour imprimer le schema
|
||||
avec l'orientation et le format papier utilise dans l'imprimante en cours.
|
||||
*/
|
||||
int DiagramPrintDialog::horizontalPagesCount(Diagram *diagram, const ExportProperties &options, bool fullpage) const {
|
||||
int DiagramPrintDialog::horizontalPagesCount(Diagram *diagram, const ExportProperties &options, bool fullpage) const
|
||||
{
|
||||
// note : pageRect et Paper Rect tiennent compte de l'orientation du papier
|
||||
QRect printable_area = fullpage ? printer_ -> paperRect() : printer_ -> pageRect();
|
||||
QRect diagram_rect = diagramRect(diagram, options);
|
||||
@ -199,7 +206,8 @@ int DiagramPrintDialog::horizontalPagesCount(Diagram *diagram, const ExportPrope
|
||||
@return La largeur du "poster" en nombre de pages pour imprimer le schema
|
||||
avec l'orientation et le format papier utilise dans l'imprimante en cours.
|
||||
*/
|
||||
int DiagramPrintDialog::verticalPagesCount(Diagram *diagram, const ExportProperties &options, bool fullpage) const {
|
||||
int DiagramPrintDialog::verticalPagesCount(Diagram *diagram, const ExportProperties &options, bool fullpage) const
|
||||
{
|
||||
// note : pageRect et Paper Rect tiennent compte de l'orientation du papier
|
||||
QRect printable_area = fullpage ? printer_ -> paperRect() : printer_ -> pageRect();
|
||||
QRect diagram_rect = diagramRect(diagram, options);
|
||||
@ -212,7 +220,8 @@ int DiagramPrintDialog::verticalPagesCount(Diagram *diagram, const ExportPropert
|
||||
Construit un dialogue non standard pour demander a l'utilisateur quelle type
|
||||
d'impression il souhaite effectuer : PDF, PS ou imprimante physique
|
||||
*/
|
||||
void DiagramPrintDialog::buildPrintTypeDialog() {
|
||||
void DiagramPrintDialog::buildPrintTypeDialog()
|
||||
{
|
||||
// initialisation des widgets
|
||||
dialog_ = new QDialog(parentWidget());
|
||||
#ifdef Q_OS_MACOS
|
||||
@ -273,7 +282,8 @@ void DiagramPrintDialog::buildPrintTypeDialog() {
|
||||
/**
|
||||
Assure la coherence du dialogue permettant le choix du type d'impression
|
||||
*/
|
||||
void DiagramPrintDialog::updatePrintTypeDialog() {
|
||||
void DiagramPrintDialog::updatePrintTypeDialog()
|
||||
{
|
||||
// imprime-t-on vers un fichier ?
|
||||
bool file_print = !(printer_choice_ -> isChecked());
|
||||
|
||||
@ -301,7 +311,8 @@ void DiagramPrintDialog::updatePrintTypeDialog() {
|
||||
Verifie l'etat du dialogue permettant le choix du type d'impression lorsque
|
||||
l'utilisateur le valide.
|
||||
*/
|
||||
void DiagramPrintDialog::acceptPrintTypeDialog() {
|
||||
void DiagramPrintDialog::acceptPrintTypeDialog()
|
||||
{
|
||||
bool file_print = !(printer_choice_ -> isChecked());
|
||||
if (file_print) {
|
||||
// un fichier doit avoir ete entre
|
||||
@ -322,7 +333,8 @@ void DiagramPrintDialog::acceptPrintTypeDialog() {
|
||||
/**
|
||||
Permet a l'utilisateur de choisir un fichier
|
||||
*/
|
||||
void DiagramPrintDialog::browseFilePrintTypeDialog() {
|
||||
void DiagramPrintDialog::browseFilePrintTypeDialog()
|
||||
{
|
||||
QString extension;
|
||||
QString filter;
|
||||
if (printer_choice_ -> isChecked()) return;
|
||||
|
@ -47,20 +47,23 @@ DiagramsChooser::DiagramsChooser(QETProject *project, QWidget *parent) :
|
||||
/**
|
||||
Destructeur
|
||||
*/
|
||||
DiagramsChooser::~DiagramsChooser() {
|
||||
DiagramsChooser::~DiagramsChooser()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@return le projet dont ce widget affiche les schemas
|
||||
*/
|
||||
QETProject *DiagramsChooser::project() const {
|
||||
QETProject *DiagramsChooser::project() const
|
||||
{
|
||||
return(project_);
|
||||
}
|
||||
|
||||
/**
|
||||
@return la liste des schemas selectionnes
|
||||
*/
|
||||
QList<Diagram *> DiagramsChooser::selectedDiagrams() const {
|
||||
QList<Diagram *> DiagramsChooser::selectedDiagrams() const
|
||||
{
|
||||
QList<Diagram *> selected_diagrams;
|
||||
foreach(Diagram *diagram, project_ -> diagrams()) {
|
||||
QCheckBox *check_box = diagrams_[diagram];
|
||||
@ -74,7 +77,8 @@ QList<Diagram *> DiagramsChooser::selectedDiagrams() const {
|
||||
/**
|
||||
@return la liste des schemas qui ne sont pas selectionnes
|
||||
*/
|
||||
QList<Diagram *> DiagramsChooser::nonSelectedDiagrams() const {
|
||||
QList<Diagram *> DiagramsChooser::nonSelectedDiagrams() const
|
||||
{
|
||||
QList<Diagram *> selected_diagrams;
|
||||
foreach(Diagram *diagram, diagrams_.keys()) {
|
||||
if (!(diagrams_[diagram] -> isChecked())) {
|
||||
@ -87,7 +91,8 @@ QList<Diagram *> DiagramsChooser::nonSelectedDiagrams() const {
|
||||
/**
|
||||
@param diagram Un schema cense etre present dans ce widget
|
||||
*/
|
||||
bool DiagramsChooser::diagramIsSelected(Diagram *const diagram) const {
|
||||
bool DiagramsChooser::diagramIsSelected(Diagram *const diagram) const
|
||||
{
|
||||
QCheckBox *checkbox = diagrams_.value(diagram);
|
||||
if (!checkbox) return(false);
|
||||
return(checkbox -> isChecked());
|
||||
@ -146,7 +151,8 @@ void DiagramsChooser::setSelectedAllDiagrams(bool select) {
|
||||
/**
|
||||
Met a jour la liste des schemas du projet
|
||||
*/
|
||||
void DiagramsChooser::updateList() {
|
||||
void DiagramsChooser::updateList()
|
||||
{
|
||||
if (!project_) return;
|
||||
|
||||
// retient la liste des schemas deja selectionnes
|
||||
@ -176,7 +182,8 @@ void DiagramsChooser::updateList() {
|
||||
/**
|
||||
Met en place la disposition du widget
|
||||
*/
|
||||
void DiagramsChooser::buildLayout() {
|
||||
void DiagramsChooser::buildLayout()
|
||||
{
|
||||
if (vlayout0_) return;
|
||||
vlayout0_ = new QVBoxLayout();
|
||||
widget0_ = new QWidget();
|
||||
|
@ -113,27 +113,31 @@ DiagramView::DiagramView(Diagram *diagram, QWidget *parent) :
|
||||
/**
|
||||
Destructeur
|
||||
*/
|
||||
DiagramView::~DiagramView() {
|
||||
DiagramView::~DiagramView()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
Selectionne tous les objets du schema
|
||||
*/
|
||||
void DiagramView::selectAll() {
|
||||
void DiagramView::selectAll()
|
||||
{
|
||||
m_diagram -> selectAll();
|
||||
}
|
||||
|
||||
/**
|
||||
Deslectionne tous les objets selectionnes
|
||||
*/
|
||||
void DiagramView::selectNothing() {
|
||||
void DiagramView::selectNothing()
|
||||
{
|
||||
m_diagram -> deselectAll();
|
||||
}
|
||||
|
||||
/**
|
||||
Inverse l'etat de selection de tous les objets du schema
|
||||
*/
|
||||
void DiagramView::selectInvert() {
|
||||
void DiagramView::selectInvert()
|
||||
{
|
||||
m_diagram -> invertSelection();
|
||||
}
|
||||
|
||||
@ -267,7 +271,8 @@ void DiagramView::handleTextDrop(QDropEvent *e) {
|
||||
/**
|
||||
Set the Diagram in visualisation mode
|
||||
*/
|
||||
void DiagramView::setVisualisationMode() {
|
||||
void DiagramView::setVisualisationMode()
|
||||
{
|
||||
setDragMode(ScrollHandDrag);
|
||||
applyReadOnly();
|
||||
setInteractive(false);
|
||||
@ -277,7 +282,8 @@ void DiagramView::setVisualisationMode() {
|
||||
/**
|
||||
Set the Diagram in Selection mode
|
||||
*/
|
||||
void DiagramView::setSelectionMode() {
|
||||
void DiagramView::setSelectionMode()
|
||||
{
|
||||
setDragMode(RubberBandDrag);
|
||||
setInteractive(true);
|
||||
applyReadOnly();
|
||||
@ -315,7 +321,8 @@ void DiagramView::zoom(const qreal zoom_factor)
|
||||
schema soient visibles a l'ecran. S'il n'y a aucun element sur le schema,
|
||||
le zoom est reinitialise
|
||||
*/
|
||||
void DiagramView::zoomFit() {
|
||||
void DiagramView::zoomFit()
|
||||
{
|
||||
adjustSceneRect();
|
||||
fitInView(m_diagram->sceneRect(), Qt::KeepAspectRatio);
|
||||
adjustGridToZoom();
|
||||
@ -324,7 +331,8 @@ void DiagramView::zoomFit() {
|
||||
/**
|
||||
Adjust zoom to fit all elements in the view, regardless of diagram borders.
|
||||
*/
|
||||
void DiagramView::zoomContent() {
|
||||
void DiagramView::zoomContent()
|
||||
{
|
||||
fitInView(m_diagram -> itemsBoundingRect(), Qt::KeepAspectRatio);
|
||||
adjustGridToZoom();
|
||||
}
|
||||
@ -332,7 +340,8 @@ void DiagramView::zoomContent() {
|
||||
/**
|
||||
Reinitialise le zoom
|
||||
*/
|
||||
void DiagramView::zoomReset() {
|
||||
void DiagramView::zoomReset()
|
||||
{
|
||||
resetTransform();
|
||||
adjustGridToZoom();
|
||||
}
|
||||
@ -340,7 +349,8 @@ void DiagramView::zoomReset() {
|
||||
/**
|
||||
Copie les elements selectionnes du schema dans le presse-papier puis les supprime
|
||||
*/
|
||||
void DiagramView::cut() {
|
||||
void DiagramView::cut()
|
||||
{
|
||||
copy();
|
||||
DiagramContent cut_content(m_diagram);
|
||||
m_diagram -> clearSelection();
|
||||
@ -350,7 +360,8 @@ void DiagramView::cut() {
|
||||
/**
|
||||
Copie les elements selectionnes du schema dans le presse-papier
|
||||
*/
|
||||
void DiagramView::copy() {
|
||||
void DiagramView::copy()
|
||||
{
|
||||
QClipboard *presse_papier = QApplication::clipboard();
|
||||
QString contenu_presse_papier = m_diagram -> toXml(false).toString(4);
|
||||
if (presse_papier -> supportsSelection()) presse_papier -> setText(contenu_presse_papier, QClipboard::Selection);
|
||||
@ -387,7 +398,8 @@ void DiagramView::paste(const QPointF &pos, QClipboard::Mode clipboard_mode) {
|
||||
/**
|
||||
Colle le contenu du presse-papier sur le schema a la position de la souris
|
||||
*/
|
||||
void DiagramView::pasteHere() {
|
||||
void DiagramView::pasteHere()
|
||||
{
|
||||
paste(mapToScene(m_paste_here_pos));
|
||||
}
|
||||
|
||||
@ -811,7 +823,8 @@ void DiagramView::scrollOnMovement(QKeyEvent *e)
|
||||
la mention "Schema sans titre" est utilisee
|
||||
@see Diagram::title()
|
||||
*/
|
||||
QString DiagramView::title() const {
|
||||
QString DiagramView::title() const
|
||||
{
|
||||
QString view_title;
|
||||
QString diagram_title(m_diagram -> title());
|
||||
if (diagram_title.isEmpty()) {
|
||||
@ -826,7 +839,8 @@ QString DiagramView::title() const {
|
||||
@brief DiagramView::editDiagramProperties
|
||||
Edit the properties of the viewed digram
|
||||
*/
|
||||
void DiagramView::editDiagramProperties() {
|
||||
void DiagramView::editDiagramProperties()
|
||||
{
|
||||
DiagramPropertiesDialog::diagramPropertiesDialog(m_diagram, diagramEditor());
|
||||
}
|
||||
|
||||
@ -854,14 +868,16 @@ void DiagramView::adjustSceneRect()
|
||||
/**
|
||||
Met a jour le titre du widget
|
||||
*/
|
||||
void DiagramView::updateWindowTitle() {
|
||||
void DiagramView::updateWindowTitle()
|
||||
{
|
||||
emit(titleChanged(this, title()));
|
||||
}
|
||||
|
||||
/**
|
||||
Enables or disables the drawing grid according to the amount of pixels display
|
||||
*/
|
||||
void DiagramView::adjustGridToZoom() {
|
||||
void DiagramView::adjustGridToZoom()
|
||||
{
|
||||
QRectF viewed_scene = viewedSceneRect();
|
||||
if (diagramEditor()->drawGrid())
|
||||
m_diagram->setDisplayGrid(viewed_scene.width() < 2000 || viewed_scene.height() < 2000);
|
||||
@ -872,7 +888,8 @@ void DiagramView::adjustGridToZoom() {
|
||||
/**
|
||||
@return le rectangle du schema (classe Diagram) visualise par ce DiagramView
|
||||
*/
|
||||
QRectF DiagramView::viewedSceneRect() const {
|
||||
QRectF DiagramView::viewedSceneRect() const
|
||||
{
|
||||
// recupere la taille du widget viewport
|
||||
QSize viewport_size = viewport() -> size();
|
||||
|
||||
@ -893,7 +910,8 @@ QRectF DiagramView::viewedSceneRect() const {
|
||||
parent project before being applied to the current diagram, or false if it
|
||||
can be directly applied
|
||||
*/
|
||||
bool DiagramView::mustIntegrateTitleBlockTemplate(const TitleBlockTemplateLocation &tbt_loc) const {
|
||||
bool DiagramView::mustIntegrateTitleBlockTemplate(const TitleBlockTemplateLocation &tbt_loc) const
|
||||
{
|
||||
// unlike elements, the integration of title block templates is mandatory, so we simply check whether the parent project of the template is also the parent project of the diagram
|
||||
QETProject *tbt_parent_project = tbt_loc.parentProject();
|
||||
if (!tbt_parent_project) return(true);
|
||||
@ -905,7 +923,8 @@ bool DiagramView::mustIntegrateTitleBlockTemplate(const TitleBlockTemplateLocati
|
||||
Fait en sorte que le schema ne soit editable que s'il n'est pas en lecture
|
||||
seule
|
||||
*/
|
||||
void DiagramView::applyReadOnly() {
|
||||
void DiagramView::applyReadOnly()
|
||||
{
|
||||
if (!m_diagram) return;
|
||||
|
||||
bool is_writable = !m_diagram -> isReadOnly();
|
||||
@ -970,7 +989,8 @@ void DiagramView::editConductorColor(Conductor *edited_conductor)
|
||||
/**
|
||||
Reinitialise le profil des conducteurs selectionnes
|
||||
*/
|
||||
void DiagramView::resetConductors() {
|
||||
void DiagramView::resetConductors()
|
||||
{
|
||||
if (m_diagram -> isReadOnly()) return;
|
||||
// recupere les conducteurs selectionnes
|
||||
QSet<Conductor *> selected_conductors = m_diagram -> selectedConductors();
|
||||
@ -1103,7 +1123,8 @@ bool DiagramView::isCtrlShifting(QInputEvent *e) {
|
||||
/**
|
||||
@return true if there is a selected item and that item has the focus.
|
||||
*/
|
||||
bool DiagramView::selectedItemHasFocus() {
|
||||
bool DiagramView::selectedItemHasFocus()
|
||||
{
|
||||
return(
|
||||
m_diagram -> hasFocus() &&
|
||||
m_diagram -> focusItem() &&
|
||||
@ -1115,7 +1136,8 @@ bool DiagramView::selectedItemHasFocus() {
|
||||
@brief DiagramView::editSelection
|
||||
Edit the selected item if he can be edited and if only one item is selected
|
||||
*/
|
||||
void DiagramView::editSelection() {
|
||||
void DiagramView::editSelection()
|
||||
{
|
||||
if (m_diagram -> isReadOnly() || m_diagram -> selectedItems().size() != 1 ) return;
|
||||
|
||||
QGraphicsItem *item = m_diagram->selectedItems().first();
|
||||
@ -1225,7 +1247,8 @@ void DiagramView::contextMenuEvent(QContextMenuEvent *e)
|
||||
/**
|
||||
@return l'editeur de schemas parent ou 0
|
||||
*/
|
||||
QETDiagramEditor *DiagramView::diagramEditor() const {
|
||||
QETDiagramEditor *DiagramView::diagramEditor() const
|
||||
{
|
||||
// remonte la hierarchie des widgets
|
||||
QWidget *w = const_cast<DiagramView *>(this);
|
||||
while (w -> parentWidget() && !w -> isWindow()) {
|
||||
|
@ -28,7 +28,8 @@ DVEventInterface::DVEventInterface(DiagramView *dv) :
|
||||
{
|
||||
}
|
||||
|
||||
DVEventInterface::~DVEventInterface() {
|
||||
DVEventInterface::~DVEventInterface()
|
||||
{
|
||||
}
|
||||
|
||||
bool DVEventInterface::mouseDoubleClickEvent(QMouseEvent *event) {
|
||||
@ -80,10 +81,12 @@ bool DVEventInterface::KeyReleaseEvent(QKeyEvent *event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DVEventInterface::isRunning() const {
|
||||
bool DVEventInterface::isRunning() const
|
||||
{
|
||||
return m_running;
|
||||
}
|
||||
|
||||
bool DVEventInterface::isFinish() const {
|
||||
bool DVEventInterface::isFinish() const
|
||||
{
|
||||
return !m_running;
|
||||
}
|
||||
|
@ -75,7 +75,8 @@ ArcEditor::ArcEditor(QETElementEditor *editor, PartArc *arc, QWidget *parent) :
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
ArcEditor::~ArcEditor() {}
|
||||
ArcEditor::~ArcEditor()
|
||||
{}
|
||||
|
||||
void ArcEditor::setUpChangeConnections()
|
||||
{
|
||||
@ -140,11 +141,13 @@ bool ArcEditor::setParts(QList <CustomElementPart *> parts)
|
||||
@brief ArcEditor::currentPart
|
||||
@return the curent edited part, or 0 if there is no edited part
|
||||
*/
|
||||
CustomElementPart *ArcEditor::currentPart() const {
|
||||
CustomElementPart *ArcEditor::currentPart() const
|
||||
{
|
||||
return(part);
|
||||
}
|
||||
|
||||
QList<CustomElementPart*> ArcEditor::currentParts() const {
|
||||
QList<CustomElementPart*> ArcEditor::currentParts() const
|
||||
{
|
||||
return style_->currentParts();
|
||||
}
|
||||
|
||||
|
@ -56,13 +56,15 @@ ElementEditionCommand::ElementEditionCommand(const QString &text,
|
||||
/**
|
||||
Destructor
|
||||
*/
|
||||
ElementEditionCommand::~ElementEditionCommand() {
|
||||
ElementEditionCommand::~ElementEditionCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@return the element editor/scene the command should take place on
|
||||
*/
|
||||
ElementScene *ElementEditionCommand::elementScene() const {
|
||||
ElementScene *ElementEditionCommand::elementScene() const
|
||||
{
|
||||
return(m_scene);
|
||||
}
|
||||
|
||||
@ -76,7 +78,8 @@ void ElementEditionCommand::setElementScene(ElementScene *scene) {
|
||||
/**
|
||||
@return the view the effect of the command should be rendered on
|
||||
*/
|
||||
ElementView *ElementEditionCommand::elementView() const {
|
||||
ElementView *ElementEditionCommand::elementView() const
|
||||
{
|
||||
return(m_view);
|
||||
}
|
||||
|
||||
@ -108,14 +111,16 @@ DeletePartsCommand::DeletePartsCommand(
|
||||
}
|
||||
|
||||
/// Destructeur : detruit egalement les parties supprimees
|
||||
DeletePartsCommand::~DeletePartsCommand() {
|
||||
DeletePartsCommand::~DeletePartsCommand()
|
||||
{
|
||||
foreach(QGraphicsItem *qgi, deleted_parts) {
|
||||
m_scene -> qgiManager().release(qgi);
|
||||
}
|
||||
}
|
||||
|
||||
/// Restaure les parties supprimees
|
||||
void DeletePartsCommand::undo() {
|
||||
void DeletePartsCommand::undo()
|
||||
{
|
||||
m_scene -> blockSignals(true);
|
||||
foreach(QGraphicsItem *qgi, deleted_parts) {
|
||||
m_scene -> addItem(qgi);
|
||||
@ -124,7 +129,8 @@ void DeletePartsCommand::undo() {
|
||||
}
|
||||
|
||||
/// Supprime les parties
|
||||
void DeletePartsCommand::redo() {
|
||||
void DeletePartsCommand::redo()
|
||||
{
|
||||
m_scene -> blockSignals(true);
|
||||
foreach(QGraphicsItem *qgi, deleted_parts) {
|
||||
m_scene -> removeItem(qgi);
|
||||
@ -150,7 +156,8 @@ CutPartsCommand::CutPartsCommand(
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
CutPartsCommand::~CutPartsCommand() {
|
||||
CutPartsCommand::~CutPartsCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/*** MovePartsCommand ***/
|
||||
@ -175,16 +182,19 @@ MovePartsCommand::MovePartsCommand(
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
MovePartsCommand::~MovePartsCommand() {
|
||||
MovePartsCommand::~MovePartsCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/// Annule le deplacement
|
||||
void MovePartsCommand::undo() {
|
||||
void MovePartsCommand::undo()
|
||||
{
|
||||
foreach(QGraphicsItem *qgi, moved_parts) qgi -> moveBy(-movement.x(), -movement.y());
|
||||
}
|
||||
|
||||
/// Refait le deplacement
|
||||
void MovePartsCommand::redo() {
|
||||
void MovePartsCommand::redo()
|
||||
{
|
||||
// le premier appel a redo, lors de la construction de l'objet, ne doit pas se faire
|
||||
if (first_redo) {
|
||||
first_redo = false;
|
||||
@ -215,17 +225,20 @@ AddPartCommand::AddPartCommand(
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
AddPartCommand::~AddPartCommand() {
|
||||
AddPartCommand::~AddPartCommand()
|
||||
{
|
||||
m_scene -> qgiManager().release(part);
|
||||
}
|
||||
|
||||
/// Annule l'ajout
|
||||
void AddPartCommand::undo() {
|
||||
void AddPartCommand::undo()
|
||||
{
|
||||
m_scene -> removeItem(part);
|
||||
}
|
||||
|
||||
/// Refait l'ajout
|
||||
void AddPartCommand::redo() {
|
||||
void AddPartCommand::redo()
|
||||
{
|
||||
// le premier appel a redo, lors de la construction de l'objet, ne doit pas se faire
|
||||
if (first_redo) {
|
||||
if (!part -> zValue()) {
|
||||
@ -262,16 +275,19 @@ ChangeNamesCommand::ChangeNamesCommand(
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
ChangeNamesCommand::~ChangeNamesCommand() {
|
||||
ChangeNamesCommand::~ChangeNamesCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/// Annule le changement
|
||||
void ChangeNamesCommand::undo() {
|
||||
void ChangeNamesCommand::undo()
|
||||
{
|
||||
m_scene -> setNames(names_before);
|
||||
}
|
||||
|
||||
/// Refait le changement
|
||||
void ChangeNamesCommand::redo() {
|
||||
void ChangeNamesCommand::redo()
|
||||
{
|
||||
m_scene -> setNames(names_after);
|
||||
}
|
||||
|
||||
@ -312,16 +328,19 @@ ChangeZValueCommand::ChangeZValueCommand(
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
ChangeZValueCommand::~ChangeZValueCommand() {
|
||||
ChangeZValueCommand::~ChangeZValueCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/// Annule les changements de zValue
|
||||
void ChangeZValueCommand::undo() {
|
||||
void ChangeZValueCommand::undo()
|
||||
{
|
||||
foreach(QGraphicsItem *qgi, undo_hash.keys()) qgi -> setZValue(undo_hash[qgi]);
|
||||
}
|
||||
|
||||
/// Refait les changements de zValue
|
||||
void ChangeZValueCommand::redo() {
|
||||
void ChangeZValueCommand::redo()
|
||||
{
|
||||
foreach(QGraphicsItem *qgi, redo_hash.keys()) qgi -> setZValue(redo_hash[qgi]);
|
||||
}
|
||||
|
||||
@ -423,16 +442,19 @@ ChangeInformationsCommand::ChangeInformationsCommand(ElementScene *elmt, const Q
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
ChangeInformationsCommand::~ChangeInformationsCommand() {
|
||||
ChangeInformationsCommand::~ChangeInformationsCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/// Annule le changement d'autorisation pour les connexions internes
|
||||
void ChangeInformationsCommand::undo() {
|
||||
void ChangeInformationsCommand::undo()
|
||||
{
|
||||
m_scene -> setInformations(old_informations_);
|
||||
}
|
||||
|
||||
/// Refait le changement d'autorisation pour les connexions internes
|
||||
void ChangeInformationsCommand::redo() {
|
||||
void ChangeInformationsCommand::redo()
|
||||
{
|
||||
m_scene -> setInformations(new_informations_);
|
||||
}
|
||||
|
||||
@ -449,20 +471,23 @@ ScalePartsCommand::ScalePartsCommand(ElementScene *scene, QUndoCommand * parent)
|
||||
/**
|
||||
Destructor
|
||||
*/
|
||||
ScalePartsCommand::~ScalePartsCommand() {
|
||||
ScalePartsCommand::~ScalePartsCommand()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
Undo the scaling operation
|
||||
*/
|
||||
void ScalePartsCommand::undo() {
|
||||
void ScalePartsCommand::undo()
|
||||
{
|
||||
scale(new_rect_, original_rect_);
|
||||
}
|
||||
|
||||
/**
|
||||
Redo the scaling operation
|
||||
*/
|
||||
void ScalePartsCommand::redo() {
|
||||
void ScalePartsCommand::redo()
|
||||
{
|
||||
if (first_redo) {
|
||||
first_redo = false;
|
||||
return;
|
||||
@ -473,7 +498,8 @@ void ScalePartsCommand::redo() {
|
||||
/**
|
||||
@return the element editor/scene the command should take place on
|
||||
*/
|
||||
ElementScene *ScalePartsCommand::elementScene() const {
|
||||
ElementScene *ScalePartsCommand::elementScene() const
|
||||
{
|
||||
return(m_scene);
|
||||
}
|
||||
|
||||
@ -488,7 +514,8 @@ void ScalePartsCommand::setScaledPrimitives(const QList<CustomElementPart *> &pr
|
||||
/**
|
||||
@return the list of primitives to be scaled by this command
|
||||
*/
|
||||
QList<CustomElementPart *> ScalePartsCommand::scaledPrimitives() const {
|
||||
QList<CustomElementPart *> ScalePartsCommand::scaledPrimitives() const
|
||||
{
|
||||
return(scaled_primitives_);
|
||||
}
|
||||
|
||||
@ -511,7 +538,8 @@ void ScalePartsCommand::setTransformation(const QRectF &original_rect,
|
||||
are the bounding rectangles for all scaled primitives respectively before
|
||||
and after the operation.
|
||||
*/
|
||||
QPair<QRectF, QRectF> ScalePartsCommand::transformation() {
|
||||
QPair<QRectF, QRectF> ScalePartsCommand::transformation()
|
||||
{
|
||||
return(QPair<QRectF, QRectF>(original_rect_, new_rect_));
|
||||
}
|
||||
|
||||
@ -532,7 +560,8 @@ void ScalePartsCommand::scale(const QRectF &before, const QRectF &after) {
|
||||
/**
|
||||
Generate the text describing what this command does exactly.
|
||||
*/
|
||||
void ScalePartsCommand::adjustText() {
|
||||
void ScalePartsCommand::adjustText()
|
||||
{
|
||||
if (scaled_primitives_.count() == 1) {
|
||||
setText(QObject::tr("redimensionnement %1", "undo caption -- %1 is the resized primitive type name").arg(scaled_primitives_.first() -> name()));
|
||||
} else {
|
||||
@ -562,7 +591,8 @@ ChangePropertiesCommand::ChangePropertiesCommand(
|
||||
setText(QObject::tr("Modifier les propriétés"));
|
||||
}
|
||||
|
||||
ChangePropertiesCommand::~ChangePropertiesCommand() {}
|
||||
ChangePropertiesCommand::~ChangePropertiesCommand()
|
||||
{}
|
||||
|
||||
void ChangePropertiesCommand::undo()
|
||||
{
|
||||
|
@ -31,22 +31,26 @@ ElementItemEditor::ElementItemEditor(QETElementEditor *editor, QWidget *parent)
|
||||
}
|
||||
|
||||
/// @return le QETElementEditor auquel cet editeur appartient
|
||||
QETElementEditor *ElementItemEditor::elementEditor() const {
|
||||
QETElementEditor *ElementItemEditor::elementEditor() const
|
||||
{
|
||||
return(element_editor);
|
||||
}
|
||||
|
||||
/// @return l'ElementScene contenant les parties editees par cet editeur
|
||||
ElementScene *ElementItemEditor::elementScene() const {
|
||||
ElementScene *ElementItemEditor::elementScene() const
|
||||
{
|
||||
return(element_editor -> elementScene());
|
||||
}
|
||||
|
||||
/// @return la QUndoStack a utiliser pour les annulations
|
||||
QUndoStack &ElementItemEditor::undoStack() const {
|
||||
QUndoStack &ElementItemEditor::undoStack() const
|
||||
{
|
||||
return(elementScene() -> undoStack());
|
||||
}
|
||||
|
||||
/// @return Le nom du type d'element edite
|
||||
QString ElementItemEditor::elementTypeName() const {
|
||||
QString ElementItemEditor::elementTypeName() const
|
||||
{
|
||||
return(element_type_name);
|
||||
}
|
||||
|
||||
@ -60,6 +64,7 @@ void ElementItemEditor::setElementTypeName(const QString &name) {
|
||||
Equivaut a setPart(0)
|
||||
@see setPart
|
||||
*/
|
||||
void ElementItemEditor::detach() {
|
||||
void ElementItemEditor::detach()
|
||||
{
|
||||
setPart(nullptr);
|
||||
}
|
||||
|
@ -48,7 +48,8 @@ ElementPrimitiveDecorator::~ElementPrimitiveDecorator()
|
||||
@return the internal bouding rect, i.e. the smallest rectangle containing
|
||||
the bounding rectangle of every selected item.
|
||||
*/
|
||||
QRectF ElementPrimitiveDecorator::internalBoundingRect() const {
|
||||
QRectF ElementPrimitiveDecorator::internalBoundingRect() const
|
||||
{
|
||||
if (!decorated_items_.count() || !scene()) return(QRectF());
|
||||
|
||||
//if @decorated_items_ contain one item and if this item is a vertical or horizontal partline, apply a specific methode
|
||||
@ -139,14 +140,16 @@ void ElementPrimitiveDecorator::setItems(const QList<QGraphicsItem *> &items)
|
||||
/**
|
||||
@return the list of items this decorator is supposed to manipulate
|
||||
*/
|
||||
QList<CustomElementPart *> ElementPrimitiveDecorator::items() const {
|
||||
QList<CustomElementPart *> ElementPrimitiveDecorator::items() const
|
||||
{
|
||||
return(decorated_items_);
|
||||
}
|
||||
|
||||
/**
|
||||
@return the list of items this decorator is supposed to manipulate
|
||||
*/
|
||||
QList<QGraphicsItem *> ElementPrimitiveDecorator::graphicsItems() const {
|
||||
QList<QGraphicsItem *> ElementPrimitiveDecorator::graphicsItems() const
|
||||
{
|
||||
QList<QGraphicsItem *> list;
|
||||
foreach (CustomElementPart *part_item, decorated_items_) {
|
||||
if (QGraphicsItem *item = dynamic_cast<QGraphicsItem *>(part_item)) {
|
||||
@ -337,7 +340,8 @@ void ElementPrimitiveDecorator::init()
|
||||
/**
|
||||
Save the original bounding rectangle.
|
||||
*/
|
||||
void ElementPrimitiveDecorator::saveOriginalBoundingRect() {
|
||||
void ElementPrimitiveDecorator::saveOriginalBoundingRect()
|
||||
{
|
||||
original_bounding_rect_ = internalBoundingRect();
|
||||
}
|
||||
|
||||
@ -345,7 +349,8 @@ void ElementPrimitiveDecorator::saveOriginalBoundingRect() {
|
||||
Adjust the effective bounding rect. This method should be called after the
|
||||
modified_bouding_rect_ attribute was modified.
|
||||
*/
|
||||
void ElementPrimitiveDecorator::adjustEffectiveBoundingRect() {
|
||||
void ElementPrimitiveDecorator::adjustEffectiveBoundingRect()
|
||||
{
|
||||
prepareGeometryChange();
|
||||
effective_bounding_rect_ = modified_bounding_rect_ | effective_bounding_rect_;
|
||||
update();
|
||||
@ -355,7 +360,8 @@ void ElementPrimitiveDecorator::adjustEffectiveBoundingRect() {
|
||||
/**
|
||||
Start a movement (i.e. either a move or scaling operation)
|
||||
*/
|
||||
void ElementPrimitiveDecorator::startMovement() {
|
||||
void ElementPrimitiveDecorator::startMovement()
|
||||
{
|
||||
adjust();
|
||||
|
||||
foreach(CustomElementPart *item, decorated_items_) {
|
||||
@ -409,7 +415,8 @@ void ElementPrimitiveDecorator::applyMovementToRect(int movement_type, const QPo
|
||||
}
|
||||
}
|
||||
|
||||
CustomElementPart *ElementPrimitiveDecorator::singleItem() const {
|
||||
CustomElementPart *ElementPrimitiveDecorator::singleItem() const
|
||||
{
|
||||
if (decorated_items_.count() == 1) {
|
||||
return(decorated_items_.first());
|
||||
}
|
||||
@ -450,7 +457,8 @@ void ElementPrimitiveDecorator::scaleItems(const QRectF &original_rect, const QR
|
||||
/**
|
||||
@return the bounding rectangle of \a item, in scene coordinates
|
||||
*/
|
||||
QRectF ElementPrimitiveDecorator::getSceneBoundingRect(QGraphicsItem *item) const {
|
||||
QRectF ElementPrimitiveDecorator::getSceneBoundingRect(QGraphicsItem *item) const
|
||||
{
|
||||
if (!item) return(QRectF());
|
||||
return(item -> mapRectToScene(item -> boundingRect()));
|
||||
}
|
||||
@ -655,7 +663,8 @@ QPointF ElementPrimitiveDecorator::deltaForRoundScaling(const QRectF &original,
|
||||
Round the coordinates of \a point so it is snapped to the grid defined by the
|
||||
grid_step_x_ and grid_step_y_ attributes.
|
||||
*/
|
||||
QPointF ElementPrimitiveDecorator::snapConstPointToGrid(const QPointF &point) const {
|
||||
QPointF ElementPrimitiveDecorator::snapConstPointToGrid(const QPointF &point) const
|
||||
{
|
||||
return(
|
||||
QPointF(
|
||||
qRound(point.x() / grid_step_x_) * grid_step_x_,
|
||||
@ -668,7 +677,8 @@ QPointF ElementPrimitiveDecorator::snapConstPointToGrid(const QPointF &point) co
|
||||
Round the coordinates of \a point so it is snapped to the grid defined by the
|
||||
grid_step_x_ and grid_step_y_ attributes.
|
||||
*/
|
||||
void ElementPrimitiveDecorator::snapPointToGrid(QPointF &point) const {
|
||||
void ElementPrimitiveDecorator::snapPointToGrid(QPointF &point) const
|
||||
{
|
||||
point.rx() = qRound(point.x() / grid_step_x_) * grid_step_x_;
|
||||
point.ry() = qRound(point.y() / grid_step_y_) * grid_step_y_;
|
||||
}
|
||||
|
@ -347,7 +347,8 @@ void ElementScene::setBehavior(ElementScene::Behavior b) {
|
||||
m_behavior = b;
|
||||
}
|
||||
|
||||
ElementScene::Behavior ElementScene::behavior() const {
|
||||
ElementScene::Behavior ElementScene::behavior() const
|
||||
{
|
||||
return m_behavior;
|
||||
}
|
||||
|
||||
@ -356,7 +357,8 @@ ElementScene::Behavior ElementScene::behavior() const {
|
||||
@return the horizontal size of the grid
|
||||
\~French la taille horizontale de la grille
|
||||
*/
|
||||
int ElementScene::xGrid() const {
|
||||
int ElementScene::xGrid() const
|
||||
{
|
||||
return(m_x_grid);
|
||||
}
|
||||
|
||||
@ -365,7 +367,8 @@ int ElementScene::xGrid() const {
|
||||
@return vertical grid size
|
||||
\~French la taille verticale de la grille
|
||||
*/
|
||||
int ElementScene::yGrid() const {
|
||||
int ElementScene::yGrid() const
|
||||
{
|
||||
return(m_y_grid);
|
||||
}
|
||||
|
||||
@ -580,7 +583,8 @@ QRectF ElementScene::elementSceneGeometricRect() const{
|
||||
\~French true si l'element comporte au moins une borne,
|
||||
false s'il n'en a aucune.
|
||||
*/
|
||||
bool ElementScene::containsTerminals() const {
|
||||
bool ElementScene::containsTerminals() const
|
||||
{
|
||||
foreach(QGraphicsItem *qgi,items()) {
|
||||
if (qgraphicsitem_cast<PartTerminal *>(qgi)) {
|
||||
return(true);
|
||||
@ -594,7 +598,8 @@ bool ElementScene::containsTerminals() const {
|
||||
@return the undo stack of this element editor
|
||||
\~French la pile d'annulations de cet editeur d'element
|
||||
*/
|
||||
QUndoStack &ElementScene::undoStack() {
|
||||
QUndoStack &ElementScene::undoStack()
|
||||
{
|
||||
return(m_undo_stack);
|
||||
}
|
||||
|
||||
@ -603,7 +608,8 @@ QUndoStack &ElementScene::undoStack() {
|
||||
@return the QGraphicsItem manager of this item editor
|
||||
\~French le gestionnaire de QGraphicsItem de cet editeur d'element
|
||||
*/
|
||||
QGIManager &ElementScene::qgiManager() {
|
||||
QGIManager &ElementScene::qgiManager()
|
||||
{
|
||||
return(m_qgi_manager);
|
||||
}
|
||||
|
||||
@ -612,7 +618,8 @@ QGIManager &ElementScene::qgiManager() {
|
||||
@return true if the clipboard appears to contain an element
|
||||
\~French true si le presse-papier semble contenir un element
|
||||
*/
|
||||
bool ElementScene::clipboardMayContainElement() {
|
||||
bool ElementScene::clipboardMayContainElement()
|
||||
{
|
||||
QString clipboard_text = QApplication::clipboard() -> text().trimmed();
|
||||
bool may_be_element = clipboard_text.startsWith("<definition")
|
||||
&& clipboard_text.endsWith("</definition>");
|
||||
@ -639,7 +646,8 @@ bool ElementScene::wasCopiedFromThisElement(const QString &clipboard_content) {
|
||||
\~French Gere le fait de couper la selection
|
||||
= l'exporter en XML dans le presse-papier puis la supprimer.
|
||||
*/
|
||||
void ElementScene::cut() {
|
||||
void ElementScene::cut()
|
||||
{
|
||||
copy();
|
||||
QList<QGraphicsItem *> cut_content = selectedItems();
|
||||
clearSelection();
|
||||
@ -653,7 +661,8 @@ void ElementScene::cut() {
|
||||
\~French Gere le fait de copier la selection
|
||||
= l'exporter en XML dans lepresse-papier.
|
||||
*/
|
||||
void ElementScene::copy() {
|
||||
void ElementScene::copy()
|
||||
{
|
||||
// accede au presse-papier
|
||||
QClipboard *clipboard = QApplication::clipboard();
|
||||
|
||||
@ -674,7 +683,8 @@ void ElementScene::copy() {
|
||||
@brief ElementScene::editor
|
||||
@return
|
||||
*/
|
||||
QETElementEditor* ElementScene::editor() const {
|
||||
QETElementEditor* ElementScene::editor() const
|
||||
{
|
||||
return m_element_editor;
|
||||
}
|
||||
|
||||
@ -727,7 +737,8 @@ void ElementScene::slot_select(const ElementContent &content)
|
||||
@brief ElementScene::slot_selectAll
|
||||
Select all items
|
||||
*/
|
||||
void ElementScene::slot_selectAll() {
|
||||
void ElementScene::slot_selectAll()
|
||||
{
|
||||
slot_select(items());
|
||||
}
|
||||
|
||||
@ -735,7 +746,8 @@ void ElementScene::slot_selectAll() {
|
||||
@brief ElementScene::slot_deselectAll
|
||||
deselect all item
|
||||
*/
|
||||
void ElementScene::slot_deselectAll() {
|
||||
void ElementScene::slot_deselectAll()
|
||||
{
|
||||
slot_select(ElementContent());
|
||||
}
|
||||
|
||||
@ -744,7 +756,8 @@ void ElementScene::slot_deselectAll() {
|
||||
Inverse Selection
|
||||
\~French Inverse la selection
|
||||
*/
|
||||
void ElementScene::slot_invertSelection() {
|
||||
void ElementScene::slot_invertSelection()
|
||||
{
|
||||
blockSignals(true);
|
||||
foreach(QGraphicsItem *qgi,
|
||||
items()) qgi -> setSelected(!qgi -> isSelected());
|
||||
@ -757,7 +770,8 @@ void ElementScene::slot_invertSelection() {
|
||||
Delete selected items
|
||||
\~French Supprime les elements selectionnes
|
||||
*/
|
||||
void ElementScene::slot_delete() {
|
||||
void ElementScene::slot_delete()
|
||||
{
|
||||
// check that there is something selected
|
||||
// verifie qu'il y a qqc de selectionne
|
||||
QList<QGraphicsItem *> selected_items = selectedItems();
|
||||
@ -781,7 +795,8 @@ void ElementScene::slot_delete() {
|
||||
de cet element. Concretement, ce champ libre est destine a accueillir
|
||||
des informations sur l'auteur de l'element, sa licence, etc.
|
||||
*/
|
||||
void ElementScene::slot_editAuthorInformations() {
|
||||
void ElementScene::slot_editAuthorInformations()
|
||||
{
|
||||
bool is_read_only = m_element_editor && m_element_editor -> isReadOnly();
|
||||
|
||||
// create a dialogue
|
||||
@ -886,7 +901,8 @@ void ElementScene::slot_editNames()
|
||||
@brief ElementScene::primitives
|
||||
@return the list of primitives currently present on the scene.
|
||||
*/
|
||||
QList<CustomElementPart *> ElementScene::primitives() const {
|
||||
QList<CustomElementPart *> ElementScene::primitives() const
|
||||
{
|
||||
QList<CustomElementPart *> primitives_list;
|
||||
foreach (QGraphicsItem *item, items()) {
|
||||
if (CustomElementPart *primitive = dynamic_cast<CustomElementPart *>(item)) {
|
||||
@ -902,7 +918,8 @@ QList<CustomElementPart *> ElementScene::primitives() const {
|
||||
@return the parts of the element ordered by increasing zValue
|
||||
\~French les parties de l'element ordonnes par zValue croissante
|
||||
*/
|
||||
QList<QGraphicsItem *> ElementScene::zItems(ItemOptions options) const {
|
||||
QList<QGraphicsItem *> ElementScene::zItems(ItemOptions options) const
|
||||
{
|
||||
// handle dummy request, i.e. when neither Selected nor NonSelected are set
|
||||
if (!(options & ElementScene::Selected)
|
||||
&&
|
||||
@ -968,7 +985,8 @@ QList<QGraphicsItem *> ElementScene::zItems(ItemOptions options) const {
|
||||
@return the selected graphic parts
|
||||
\~French les parties graphiques selectionnees
|
||||
*/
|
||||
ElementContent ElementScene::selectedContent() const {
|
||||
ElementContent ElementScene::selectedContent() const
|
||||
{
|
||||
ElementContent content;
|
||||
foreach(QGraphicsItem *qgi, zItems()) {
|
||||
if (qgi -> isSelected()) content << qgi;
|
||||
@ -1031,7 +1049,8 @@ void ElementScene::reset()
|
||||
exprime dans les coordonnes de la scene
|
||||
*/
|
||||
QRectF ElementScene::elementContentBoundingRect(
|
||||
const ElementContent &content) const {
|
||||
const ElementContent &content) const
|
||||
{
|
||||
QRectF bounding_rect;
|
||||
foreach(QGraphicsItem *qgi, content) {
|
||||
// skip non-primitives QGraphicsItems (paste area, selection decorator)
|
||||
@ -1234,7 +1253,8 @@ void ElementScene::addPrimitive(QGraphicsItem *primitive) {
|
||||
Initializes the paste area
|
||||
\~French Initialise la zone de collage
|
||||
*/
|
||||
void ElementScene::initPasteArea() {
|
||||
void ElementScene::initPasteArea()
|
||||
{
|
||||
m_paste_area = new QGraphicsRectItem();
|
||||
m_paste_area -> setZValue(1000000);
|
||||
|
||||
@ -1282,7 +1302,8 @@ bool ElementScene::zValueLessThan(QGraphicsItem *item1, QGraphicsItem *item2) {
|
||||
try to center better is possible the element to the scene
|
||||
(the calcul isn't optimal but work good)
|
||||
*/
|
||||
void ElementScene::centerElementToOrigine() {
|
||||
void ElementScene::centerElementToOrigine()
|
||||
{
|
||||
QRectF size= elementSceneGeometricRect();
|
||||
int center_x = qRound(size.center().x());
|
||||
int center_y = qRound(size.center().y());
|
||||
|
@ -192,7 +192,8 @@ inline void ElementScene::setNames(const NamesList &nameslist) {
|
||||
@brief ElementScene::names
|
||||
@return the list of names of the currently edited element
|
||||
*/
|
||||
inline NamesList ElementScene::names() const {
|
||||
inline NamesList ElementScene::names() const
|
||||
{
|
||||
return(m_names_list);
|
||||
}
|
||||
|
||||
@ -200,7 +201,8 @@ inline NamesList ElementScene::names() const {
|
||||
@brief ElementScene::informations
|
||||
@return extra informations of the currently edited element
|
||||
*/
|
||||
inline QString ElementScene::informations() const {
|
||||
inline QString ElementScene::informations() const
|
||||
{
|
||||
return(m_informations);
|
||||
}
|
||||
|
||||
|
@ -41,18 +41,21 @@ ElementView::ElementView(ElementScene *scene, QWidget *parent) :
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
ElementView::~ElementView() {
|
||||
ElementView::~ElementView()
|
||||
{
|
||||
}
|
||||
|
||||
/// @return l'ElementScene visualisee par cette ElementView
|
||||
ElementScene *ElementView::scene() const {
|
||||
ElementScene *ElementView::scene() const
|
||||
{
|
||||
return(m_scene);
|
||||
}
|
||||
|
||||
/**
|
||||
@return le rectangle de l'element visualise par cet ElementView
|
||||
*/
|
||||
QRectF ElementView::viewedSceneRect() const {
|
||||
QRectF ElementView::viewedSceneRect() const
|
||||
{
|
||||
// recupere la taille du widget viewport
|
||||
QSize viewport_size = viewport() -> size();
|
||||
|
||||
@ -79,7 +82,8 @@ void ElementView::setScene(ElementScene *s) {
|
||||
/**
|
||||
Set the Diagram in visualisation mode
|
||||
*/
|
||||
void ElementView::setVisualisationMode() {
|
||||
void ElementView::setVisualisationMode()
|
||||
{
|
||||
setDragMode(ScrollHandDrag);
|
||||
setInteractive(false);
|
||||
emit(modeChanged());
|
||||
@ -88,7 +92,8 @@ void ElementView::setVisualisationMode() {
|
||||
/**
|
||||
Set the Diagram in Selection mode
|
||||
*/
|
||||
void ElementView::setSelectionMode() {
|
||||
void ElementView::setSelectionMode()
|
||||
{
|
||||
setDragMode(RubberBandDrag);
|
||||
setInteractive(true);
|
||||
emit(modeChanged());
|
||||
@ -97,7 +102,8 @@ void ElementView::setSelectionMode() {
|
||||
/**
|
||||
Agrandit le schema (+33% = inverse des -25 % de zoomMoins())
|
||||
*/
|
||||
void ElementView::zoomIn() {
|
||||
void ElementView::zoomIn()
|
||||
{
|
||||
adjustSceneRect();
|
||||
scale(4.0/3.0, 4.0/3.0);
|
||||
}
|
||||
@ -105,7 +111,8 @@ void ElementView::zoomIn() {
|
||||
/**
|
||||
Retrecit le schema (-25% = inverse des +33 % de zoomPlus())
|
||||
*/
|
||||
void ElementView::zoomOut() {
|
||||
void ElementView::zoomOut()
|
||||
{
|
||||
adjustSceneRect();
|
||||
scale(0.75, 0.75);
|
||||
}
|
||||
@ -113,14 +120,16 @@ void ElementView::zoomOut() {
|
||||
/**
|
||||
Agrandit le schema avec le trackpad
|
||||
*/
|
||||
void ElementView::zoomInSlowly() {
|
||||
void ElementView::zoomInSlowly()
|
||||
{
|
||||
scale(1.02, 1.02);
|
||||
}
|
||||
|
||||
/**
|
||||
Retrecit le schema avec le trackpad
|
||||
*/
|
||||
void ElementView::zoomOutSlowly() {
|
||||
void ElementView::zoomOutSlowly()
|
||||
{
|
||||
scale(0.98, 0.98);
|
||||
}
|
||||
|
||||
@ -129,7 +138,8 @@ void ElementView::zoomOutSlowly() {
|
||||
schema soient visibles a l'ecran. S'il n'y a aucun element sur le schema,
|
||||
le zoom est reinitialise
|
||||
*/
|
||||
void ElementView::zoomFit() {
|
||||
void ElementView::zoomFit()
|
||||
{
|
||||
resetSceneRect();
|
||||
fitInView(sceneRect(), Qt::KeepAspectRatio);
|
||||
}
|
||||
@ -137,7 +147,8 @@ void ElementView::zoomFit() {
|
||||
/**
|
||||
Reinitialise le zoom
|
||||
*/
|
||||
void ElementView::zoomReset() {
|
||||
void ElementView::zoomReset()
|
||||
{
|
||||
resetSceneRect();
|
||||
resetTransform();
|
||||
scale(4.0, 4.0);
|
||||
@ -148,7 +159,8 @@ void ElementView::zoomReset() {
|
||||
Adjust the scenRect, so that he include all primitives of element
|
||||
plus the viewport of the scene with a margin of 1/3 of herself
|
||||
*/
|
||||
void ElementView::adjustSceneRect() {
|
||||
void ElementView::adjustSceneRect()
|
||||
{
|
||||
QRectF esgr = m_scene -> elementSceneGeometricRect();
|
||||
QRectF vpbr = mapToScene(this -> viewport()->rect()).boundingRect();
|
||||
QRectF new_scene_rect = vpbr.adjusted(-vpbr.width()/3, -vpbr.height()/3, vpbr.width()/3, vpbr.height()/3);
|
||||
@ -160,7 +172,8 @@ void ElementView::adjustSceneRect() {
|
||||
reset le sceneRect (zone du schéma visualisée par l'ElementView) afin que
|
||||
celui-ci inclut uniquement les primitives de l'élément dessiné.
|
||||
*/
|
||||
void ElementView::resetSceneRect() {
|
||||
void ElementView::resetSceneRect()
|
||||
{
|
||||
setSceneRect(m_scene -> elementSceneGeometricRect());
|
||||
}
|
||||
|
||||
@ -168,7 +181,8 @@ void ElementView::resetSceneRect() {
|
||||
Gere le fait de couper la selection = l'exporter en XML dans le
|
||||
presse-papier puis la supprimer.
|
||||
*/
|
||||
void ElementView::cut() {
|
||||
void ElementView::cut()
|
||||
{
|
||||
// delegue cette action a la scene
|
||||
m_scene -> cut();
|
||||
offset_paste_count_ = -1;
|
||||
@ -178,7 +192,8 @@ void ElementView::cut() {
|
||||
Gere le fait de copier la selection = l'exporter en XML dans le
|
||||
presse-papier.
|
||||
*/
|
||||
void ElementView::copy() {
|
||||
void ElementView::copy()
|
||||
{
|
||||
// delegue cette action a la scene
|
||||
m_scene -> copy();
|
||||
offset_paste_count_ = 0;
|
||||
@ -194,7 +209,8 @@ void ElementView::copy() {
|
||||
collage devra s'effectuer.
|
||||
@see pasteAreaDefined(const QRectF &)
|
||||
*/
|
||||
void ElementView::paste() {
|
||||
void ElementView::paste()
|
||||
{
|
||||
QString clipboard_text = QApplication::clipboard() -> text();
|
||||
if (clipboard_text.isEmpty()) return;
|
||||
|
||||
@ -218,7 +234,8 @@ void ElementView::paste() {
|
||||
Colle le contenu du presse-papier en demandant systematiquement a
|
||||
l'utilisateur de choisir une zone de collage
|
||||
*/
|
||||
void ElementView::pasteInArea() {
|
||||
void ElementView::pasteInArea()
|
||||
{
|
||||
QString clipboard_text = QApplication::clipboard() -> text();
|
||||
if (clipboard_text.isEmpty()) return;
|
||||
|
||||
|
@ -67,7 +67,8 @@ EllipseEditor::EllipseEditor(QETElementEditor *editor, PartEllipse *ellipse, QWi
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
EllipseEditor::~EllipseEditor() {
|
||||
EllipseEditor::~EllipseEditor()
|
||||
{
|
||||
}
|
||||
|
||||
void EllipseEditor::setUpChangeConnections()
|
||||
@ -126,11 +127,13 @@ bool EllipseEditor::setParts(QList <CustomElementPart *> parts)
|
||||
/**
|
||||
@return la primitive actuellement editee, ou 0 si ce widget n'en edite pas
|
||||
*/
|
||||
CustomElementPart *EllipseEditor::currentPart() const {
|
||||
CustomElementPart *EllipseEditor::currentPart() const
|
||||
{
|
||||
return(part);
|
||||
}
|
||||
|
||||
QList<CustomElementPart*> EllipseEditor::currentParts() const {
|
||||
QList<CustomElementPart*> EllipseEditor::currentParts() const
|
||||
{
|
||||
return style_->currentParts();
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,8 @@ ESEventAddArc::ESEventAddArc(ElementScene *scene) :
|
||||
/**
|
||||
@brief ESEventAddArc::~ESEventAddArc
|
||||
*/
|
||||
ESEventAddArc::~ESEventAddArc() {
|
||||
ESEventAddArc::~ESEventAddArc()
|
||||
{
|
||||
if (m_running || m_abort)
|
||||
delete m_arc;
|
||||
}
|
||||
|
@ -37,7 +37,8 @@ ESEventAddDynamicTextField::ESEventAddDynamicTextField(ElementScene *scene) :
|
||||
/**
|
||||
@brief ESEventAddDynamicTextField::~ESEventAddDynamicTextField
|
||||
*/
|
||||
ESEventAddDynamicTextField::~ESEventAddDynamicTextField() {
|
||||
ESEventAddDynamicTextField::~ESEventAddDynamicTextField()
|
||||
{
|
||||
delete m_text;
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,8 @@ ESEventAddEllipse::ESEventAddEllipse(ElementScene *scene) :
|
||||
/**
|
||||
@brief ESEventAddEllipse::~ESEventAddEllipse
|
||||
*/
|
||||
ESEventAddEllipse::~ESEventAddEllipse() {
|
||||
ESEventAddEllipse::~ESEventAddEllipse()
|
||||
{
|
||||
if (m_running || m_abort){
|
||||
delete m_ellipse;
|
||||
}
|
||||
|
@ -38,7 +38,8 @@ ESEventAddLine::ESEventAddLine(ElementScene *scene) :
|
||||
@brief ESEventAddLine::~ESEventAddLine
|
||||
destructor
|
||||
*/
|
||||
ESEventAddLine::~ESEventAddLine() {
|
||||
ESEventAddLine::~ESEventAddLine()
|
||||
{
|
||||
if (m_running || m_abort)
|
||||
delete m_line;
|
||||
}
|
||||
|
@ -34,7 +34,8 @@ ESEventAddPolygon::ESEventAddPolygon(ElementScene *scene) :
|
||||
/**
|
||||
@brief ESEventAddPolygon::~ESEventAddPolygon
|
||||
*/
|
||||
ESEventAddPolygon::~ESEventAddPolygon() {
|
||||
ESEventAddPolygon::~ESEventAddPolygon()
|
||||
{
|
||||
if (m_running || m_abort)
|
||||
delete m_polygon;
|
||||
}
|
||||
|
@ -34,7 +34,8 @@ ESEventAddRect::ESEventAddRect(ElementScene *scene) :
|
||||
/**
|
||||
@brief ESEventAddRect::~ESEventAddRect
|
||||
*/
|
||||
ESEventAddRect::~ESEventAddRect() {
|
||||
ESEventAddRect::~ESEventAddRect()
|
||||
{
|
||||
if (m_running || m_abort)
|
||||
delete m_rect;
|
||||
}
|
||||
|
@ -37,7 +37,8 @@ ESEventAddTerminal::ESEventAddTerminal(ElementScene *scene) :
|
||||
/**
|
||||
@brief ESEventAddTerminal::~ESEventAddTerminal
|
||||
*/
|
||||
ESEventAddTerminal::~ESEventAddTerminal() {
|
||||
ESEventAddTerminal::~ESEventAddTerminal()
|
||||
{
|
||||
delete m_terminal;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,8 @@ ESEventAddText::ESEventAddText(ElementScene *scene) :
|
||||
/**
|
||||
@brief ESEventAddText::~ESEventAddText
|
||||
*/
|
||||
ESEventAddText::~ESEventAddText() {
|
||||
ESEventAddText::~ESEventAddText()
|
||||
{
|
||||
delete m_text;
|
||||
}
|
||||
|
||||
|
@ -99,11 +99,13 @@ bool ESEventInterface::KeyReleaseEvent(QKeyEvent *event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ESEventInterface::isRunning() const {
|
||||
bool ESEventInterface::isRunning() const
|
||||
{
|
||||
return m_running;
|
||||
}
|
||||
|
||||
bool ESEventInterface::isFinish() const {
|
||||
bool ESEventInterface::isFinish() const
|
||||
{
|
||||
return !m_running;
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,8 @@ QRectF AbstractPartEllipse::boundingRect() const
|
||||
and it is different from shape because it is a regular
|
||||
rectangle, not a complex shape.
|
||||
*/
|
||||
QRectF AbstractPartEllipse::sceneGeometricRect() const {
|
||||
QRectF AbstractPartEllipse::sceneGeometricRect() const
|
||||
{
|
||||
return(mapToScene(rect()).boundingRect());
|
||||
}
|
||||
|
||||
@ -95,7 +96,8 @@ QRectF AbstractPartEllipse::sceneGeometricRect() const {
|
||||
@brief AbstractPartEllipse::sceneTopLeft
|
||||
@return return the top left of rectangle, in scene coordinate
|
||||
*/
|
||||
QPointF AbstractPartEllipse::sceneTopLeft() const {
|
||||
QPointF AbstractPartEllipse::sceneTopLeft() const
|
||||
{
|
||||
return(mapToScene(rect().topLeft()));
|
||||
}
|
||||
|
||||
@ -103,7 +105,8 @@ QPointF AbstractPartEllipse::sceneTopLeft() const {
|
||||
@brief AbstractPartEllipse::rect
|
||||
Returns the item's ellipse geometry as a QRectF.
|
||||
*/
|
||||
QRectF AbstractPartEllipse::rect() const {
|
||||
QRectF AbstractPartEllipse::rect() const
|
||||
{
|
||||
return m_rect;
|
||||
}
|
||||
|
||||
@ -131,7 +134,8 @@ void AbstractPartEllipse::setRect(const QRectF &rect)
|
||||
and does not deserve to be Retained / registered.
|
||||
An ellipse is relevant when is rect is not null.
|
||||
*/
|
||||
bool AbstractPartEllipse::isUseless() const {
|
||||
bool AbstractPartEllipse::isUseless() const
|
||||
{
|
||||
return(rect().isNull());
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,8 @@
|
||||
#include "qetelementeditor.h"
|
||||
|
||||
/// @return le QETElementEditor auquel cet editeur appartient
|
||||
QETElementEditor *CustomElementPart::elementEditor() const {
|
||||
QETElementEditor *CustomElementPart::elementEditor() const
|
||||
{
|
||||
return(element_editor);
|
||||
}
|
||||
|
||||
@ -27,24 +28,28 @@ QETElementEditor *CustomElementPart::elementEditor() const {
|
||||
Appelle le slot updateCurrentPartEditor de l'editeur
|
||||
@see QETElementEditor::updateCurrentPartEditor()
|
||||
*/
|
||||
void CustomElementPart::updateCurrentPartEditor() const {
|
||||
void CustomElementPart::updateCurrentPartEditor() const
|
||||
{
|
||||
if (element_editor) {
|
||||
element_editor -> updateCurrentPartEditor();
|
||||
}
|
||||
}
|
||||
|
||||
/// @return l'ElementScene contenant les parties editees par cet editeur
|
||||
ElementScene *CustomElementPart::elementScene() const {
|
||||
ElementScene *CustomElementPart::elementScene() const
|
||||
{
|
||||
return(element_editor -> elementScene());
|
||||
}
|
||||
|
||||
/// @return la QUndoStack a utiliser pour les annulations
|
||||
QUndoStack &CustomElementPart::undoStack() const {
|
||||
QUndoStack &CustomElementPart::undoStack() const
|
||||
{
|
||||
return(elementScene() -> undoStack());
|
||||
}
|
||||
|
||||
/// @return this primitive as a QGraphicsItem
|
||||
QGraphicsItem *CustomElementPart::toItem() {
|
||||
QGraphicsItem *CustomElementPart::toItem()
|
||||
{
|
||||
return(dynamic_cast<QGraphicsItem *>(this));
|
||||
}
|
||||
|
||||
@ -55,7 +60,8 @@ QGraphicsItem *CustomElementPart::toItem() {
|
||||
The default implementation systematically returns
|
||||
QET::SnapScalingPointToGrid
|
||||
*/
|
||||
QET::ScalingMethod CustomElementPart::preferredScalingMethod() const {
|
||||
QET::ScalingMethod CustomElementPart::preferredScalingMethod() const
|
||||
{
|
||||
return(QET::SnapScalingPointToGrid);
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,8 @@ void PartArc::paint(QPainter *painter, const QStyleOptionGraphicsItem *options,
|
||||
@param xml_document : Xml document to use for create the xml element.
|
||||
@return : an xml element that describe this arc
|
||||
*/
|
||||
const QDomElement PartArc::toXml(QDomDocument &xml_document) const {
|
||||
const QDomElement PartArc::toXml(QDomDocument &xml_document) const
|
||||
{
|
||||
QDomElement xml_element = xml_document.createElement("arc");
|
||||
QPointF top_left(sceneTopLeft());
|
||||
xml_element.setAttribute("x", QString("%1").arg(top_left.x()));
|
||||
|
@ -49,11 +49,13 @@ PartDynamicTextField::PartDynamicTextField(QETElementEditor *editor, QGraphicsIt
|
||||
document() -> setDefaultTextOption(option);
|
||||
}
|
||||
|
||||
QString PartDynamicTextField::name() const {
|
||||
QString PartDynamicTextField::name() const
|
||||
{
|
||||
return tr("Champ de texte dynamique", "element part name");
|
||||
}
|
||||
|
||||
QString PartDynamicTextField::xmlName() const {
|
||||
QString PartDynamicTextField::xmlName() const
|
||||
{
|
||||
return QString("dynamic_text");
|
||||
}
|
||||
|
||||
@ -90,7 +92,8 @@ void PartDynamicTextField::handleUserTransformation(
|
||||
@param dom_doc
|
||||
@return
|
||||
*/
|
||||
const QDomElement PartDynamicTextField::toXml(QDomDocument &dom_doc) const {
|
||||
const QDomElement PartDynamicTextField::toXml(QDomDocument &dom_doc) const
|
||||
{
|
||||
QDomElement root_element = dom_doc.createElement(xmlName());
|
||||
|
||||
root_element.setAttribute("x", QString::number(pos().x()));
|
||||
@ -260,7 +263,8 @@ void PartDynamicTextField::fromTextFieldXml(const QDomElement &dom_element)
|
||||
@brief PartDynamicTextField::textFrom
|
||||
@return what the final text is created from.
|
||||
*/
|
||||
DynamicElementTextItem::TextFrom PartDynamicTextField::textFrom() const {
|
||||
DynamicElementTextItem::TextFrom PartDynamicTextField::textFrom() const
|
||||
{
|
||||
return m_text_from;
|
||||
}
|
||||
|
||||
@ -291,7 +295,8 @@ void PartDynamicTextField::setTextFrom(DynamicElementTextItem::TextFrom text_fro
|
||||
@brief PartDynamicTextField::text
|
||||
@return the text of this text
|
||||
*/
|
||||
QString PartDynamicTextField::text() const {
|
||||
QString PartDynamicTextField::text() const
|
||||
{
|
||||
return m_text;
|
||||
}
|
||||
|
||||
@ -337,7 +342,8 @@ void PartDynamicTextField::setCompositeText(const QString &text) {
|
||||
@brief PartDynamicTextField::compositeText
|
||||
@return the composite text of this text
|
||||
*/
|
||||
QString PartDynamicTextField::compositeText() const {
|
||||
QString PartDynamicTextField::compositeText() const
|
||||
{
|
||||
return m_composite_text;
|
||||
}
|
||||
|
||||
@ -354,7 +360,8 @@ void PartDynamicTextField::setColor(const QColor& color) {
|
||||
@brief PartDynamicTextField::color
|
||||
@return The color of this text
|
||||
*/
|
||||
QColor PartDynamicTextField::color() const {
|
||||
QColor PartDynamicTextField::color() const
|
||||
{
|
||||
return defaultTextColor();
|
||||
}
|
||||
|
||||
@ -364,7 +371,8 @@ void PartDynamicTextField::setFrame(bool frame) {
|
||||
emit frameChanged(m_frame);
|
||||
}
|
||||
|
||||
bool PartDynamicTextField::frame() const {
|
||||
bool PartDynamicTextField::frame() const
|
||||
{
|
||||
return m_frame;
|
||||
}
|
||||
|
||||
@ -403,7 +411,8 @@ void PartDynamicTextField::setAlignment(Qt::Alignment alignment) {
|
||||
emit alignmentChanged(m_alignment);
|
||||
}
|
||||
|
||||
Qt::Alignment PartDynamicTextField::alignment() const {
|
||||
Qt::Alignment PartDynamicTextField::alignment() const
|
||||
{
|
||||
return m_alignment;
|
||||
}
|
||||
|
||||
@ -532,7 +541,8 @@ void PartDynamicTextField::paint(QPainter *painter, const QStyleOptionGraphicsIt
|
||||
Used to up to date this text field,
|
||||
when the element information (see elementScene) changed
|
||||
*/
|
||||
void PartDynamicTextField::elementInfoChanged() {
|
||||
void PartDynamicTextField::elementInfoChanged()
|
||||
{
|
||||
if(!elementScene())
|
||||
return;
|
||||
|
||||
@ -543,11 +553,13 @@ void PartDynamicTextField::elementInfoChanged() {
|
||||
m_composite_text, elementScene() -> elementInformation()));
|
||||
}
|
||||
|
||||
void PartDynamicTextField::prepareAlignment() {
|
||||
void PartDynamicTextField::prepareAlignment()
|
||||
{
|
||||
m_alignment_rect = boundingRect();
|
||||
}
|
||||
|
||||
void PartDynamicTextField::finishAlignment() {
|
||||
void PartDynamicTextField::finishAlignment()
|
||||
{
|
||||
if(m_block_alignment)
|
||||
return;
|
||||
|
||||
|
@ -346,7 +346,8 @@ void PartLine::removeHandler()
|
||||
@brief PartLine::sceneP1
|
||||
@return the point p1 in scene coordinate
|
||||
*/
|
||||
QPointF PartLine::sceneP1() const {
|
||||
QPointF PartLine::sceneP1() const
|
||||
{
|
||||
return(mapToScene(m_line.p1()));
|
||||
}
|
||||
|
||||
@ -354,7 +355,8 @@ QPointF PartLine::sceneP1() const {
|
||||
@brief PartLine::sceneP2
|
||||
@return the point p2 in scen coordinate
|
||||
*/
|
||||
QPointF PartLine::sceneP2() const {
|
||||
QPointF PartLine::sceneP2() const
|
||||
{
|
||||
return(mapToScene(m_line.p2()));
|
||||
}
|
||||
|
||||
@ -473,7 +475,8 @@ QRectF PartLine::firstEndCircleRect() const
|
||||
@brief PartLine::secondEndCircleRect
|
||||
@return the rectangle bordering the entirety of the second extremity
|
||||
*/
|
||||
QRectF PartLine::secondEndCircleRect() const {
|
||||
QRectF PartLine::secondEndCircleRect() const
|
||||
{
|
||||
QList<QPointF> interesting_points = fourEndPoints(m_line.p2(),
|
||||
m_line.p1(),
|
||||
second_length);
|
||||
@ -543,7 +546,8 @@ QRectF PartLine::boundingRect() const
|
||||
@return true if this part is irrelevant and does not deserve to be Retained / registered.
|
||||
A line is relevant when is two point is different
|
||||
*/
|
||||
bool PartLine::isUseless() const {
|
||||
bool PartLine::isUseless() const
|
||||
{
|
||||
return(m_line.p1() == m_line.p2());
|
||||
}
|
||||
|
||||
@ -554,7 +558,8 @@ bool PartLine::isUseless() const {
|
||||
to imply any margin, and it is different from shape because it is a regular
|
||||
rectangle, not a complex shape.
|
||||
*/
|
||||
QRectF PartLine::sceneGeometricRect() const {
|
||||
QRectF PartLine::sceneGeometricRect() const
|
||||
{
|
||||
return(QRectF(sceneP1(), sceneP2()));
|
||||
}
|
||||
|
||||
@ -617,7 +622,8 @@ QList<QPointF> PartLine::fourEndPoints(const QPointF &end_point, const QPointF &
|
||||
return(QList<QPointF>() << o << a << b << c);
|
||||
}
|
||||
|
||||
QLineF PartLine::line() const {
|
||||
QLineF PartLine::line() const
|
||||
{
|
||||
return m_line;
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,8 @@ bool PartPolygon::isUseless() const
|
||||
to imply any margin, and it is different from shape because it is a regular
|
||||
rectangle, not a complex shape.
|
||||
*/
|
||||
QRectF PartPolygon::sceneGeometricRect() const {
|
||||
QRectF PartPolygon::sceneGeometricRect() const
|
||||
{
|
||||
return(mapToScene(m_polygon.boundingRect()).boundingRect());
|
||||
}
|
||||
|
||||
@ -185,7 +186,8 @@ void PartPolygon::handleUserTransformation(const QRectF &initial_selection_rect,
|
||||
single primitive is being scaled.
|
||||
@return : This reimplementation systematically returns QET::RoundScaleRatios.
|
||||
*/
|
||||
QET::ScalingMethod PartPolygon::preferredScalingMethod() const {
|
||||
QET::ScalingMethod PartPolygon::preferredScalingMethod() const
|
||||
{
|
||||
return(QET::RoundScaleRatios);
|
||||
}
|
||||
|
||||
@ -193,7 +195,8 @@ QET::ScalingMethod PartPolygon::preferredScalingMethod() const {
|
||||
@brief PartPolygon::polygon
|
||||
@return the item's polygon, or an empty polygon if no polygon has been set.
|
||||
*/
|
||||
QPolygonF PartPolygon::polygon() const {
|
||||
QPolygonF PartPolygon::polygon() const
|
||||
{
|
||||
return m_polygon;
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,8 @@ PartRectangle::PartRectangle(QETElementEditor *editor, QGraphicsItem *parent) :
|
||||
/**
|
||||
@brief PartRectangle::~PartRectangle
|
||||
*/
|
||||
PartRectangle::~PartRectangle() {
|
||||
PartRectangle::~PartRectangle()
|
||||
{
|
||||
removeHandler();
|
||||
}
|
||||
|
||||
@ -126,7 +127,8 @@ void PartRectangle::fromXml(const QDomElement &qde)
|
||||
@brief PartRectangle::rect
|
||||
@return : Returns the item's rectangle.
|
||||
*/
|
||||
QRectF PartRectangle::rect() const {
|
||||
QRectF PartRectangle::rect() const
|
||||
{
|
||||
return m_rect;
|
||||
}
|
||||
|
||||
@ -167,7 +169,8 @@ void PartRectangle::setYRadius(qreal Y)
|
||||
to imply any margin, and it is different from shape because it is a regular
|
||||
rectangle, not a complex shape.
|
||||
*/
|
||||
QRectF PartRectangle::sceneGeometricRect() const {
|
||||
QRectF PartRectangle::sceneGeometricRect() const
|
||||
{
|
||||
return(mapToScene(rect()).boundingRect());
|
||||
}
|
||||
|
||||
@ -175,7 +178,8 @@ QRectF PartRectangle::sceneGeometricRect() const {
|
||||
@brief PartRectangle::sceneTopLeft
|
||||
@return the top left of rectangle, in scene coordinate
|
||||
*/
|
||||
QPointF PartRectangle::sceneTopLeft() const {
|
||||
QPointF PartRectangle::sceneTopLeft() const
|
||||
{
|
||||
return(mapToScene(rect().topLeft()));
|
||||
}
|
||||
|
||||
@ -228,7 +232,8 @@ QRectF PartRectangle::boundingRect() const
|
||||
@return true if this part is irrelevant and does not deserve to be Retained / registered.
|
||||
An rectangle is relevant when he's not null.
|
||||
*/
|
||||
bool PartRectangle::isUseless() const {
|
||||
bool PartRectangle::isUseless() const
|
||||
{
|
||||
return(rect().isNull());
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,8 @@ PartTerminal::PartTerminal(QETElementEditor *editor, QGraphicsItem *parent) :
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
PartTerminal::~PartTerminal() {
|
||||
PartTerminal::~PartTerminal()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -54,7 +55,8 @@ void PartTerminal::fromXml(const QDomElement &xml_elmt) {
|
||||
@param xml_document Document XML a utiliser pour creer l'element XML
|
||||
@return un element XML decrivant la borne
|
||||
*/
|
||||
const QDomElement PartTerminal::toXml(QDomDocument &xml_document) const {
|
||||
const QDomElement PartTerminal::toXml(QDomDocument &xml_document) const
|
||||
{
|
||||
return d -> toXml(xml_document);
|
||||
}
|
||||
|
||||
@ -97,7 +99,8 @@ void PartTerminal::paint(QPainter *p, const QStyleOptionGraphicsItem *options, Q
|
||||
@brief PartTerminal::shape
|
||||
@return the shape of this item
|
||||
*/
|
||||
QPainterPath PartTerminal::shape() const {
|
||||
QPainterPath PartTerminal::shape() const
|
||||
{
|
||||
QPainterPath shape;
|
||||
shape.lineTo(d -> second_point);
|
||||
|
||||
@ -111,7 +114,8 @@ QPainterPath PartTerminal::shape() const {
|
||||
@brief PartTerminal::boundingRect
|
||||
@return the bounding rect of this item
|
||||
*/
|
||||
QRectF PartTerminal::boundingRect() const {
|
||||
QRectF PartTerminal::boundingRect() const
|
||||
{
|
||||
QRectF br(QPointF(0, 0), d -> second_point);
|
||||
br = br.normalized();
|
||||
|
||||
@ -141,7 +145,8 @@ void PartTerminal::setName(QString& name) {
|
||||
emit nameChanged();
|
||||
}
|
||||
|
||||
void PartTerminal::setNewUuid() {
|
||||
void PartTerminal::setNewUuid()
|
||||
{
|
||||
d -> m_uuid = QUuid::createUuid();
|
||||
}
|
||||
|
||||
@ -149,7 +154,8 @@ void PartTerminal::setNewUuid() {
|
||||
Met a jour la position du second point en fonction de la position et de
|
||||
l'orientation de la borne.
|
||||
*/
|
||||
void PartTerminal::updateSecondPoint() {
|
||||
void PartTerminal::updateSecondPoint()
|
||||
{
|
||||
qreal ts = 4.0; // terminal size
|
||||
switch(d -> m_orientation) {
|
||||
case Qet::North: d -> second_point = QPointF(0.0, ts); break;
|
||||
@ -165,7 +171,8 @@ void PartTerminal::updateSecondPoint() {
|
||||
Une borne est toujours pertinente ; cette fonction renvoie donc
|
||||
toujours false
|
||||
*/
|
||||
bool PartTerminal::isUseless() const {
|
||||
bool PartTerminal::isUseless() const
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
@ -175,7 +182,8 @@ bool PartTerminal::isUseless() const {
|
||||
to imply any margin, and it is different from shape because it is a regular
|
||||
rectangle, not a complex shape.
|
||||
*/
|
||||
QRectF PartTerminal::sceneGeometricRect() const {
|
||||
QRectF PartTerminal::sceneGeometricRect() const
|
||||
{
|
||||
return(sceneBoundingRect());
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,8 @@ PartText::PartText(QETElementEditor *editor, QGraphicsItem *parent) :
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
PartText::~PartText() {
|
||||
PartText::~PartText()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -95,7 +96,8 @@ void PartText::fromXml(const QDomElement &xml_element) {
|
||||
@param xml_document Document XML a utiliser pour creer l'element XML
|
||||
@return un element XML decrivant le texte statique
|
||||
*/
|
||||
const QDomElement PartText::toXml(QDomDocument &xml_document) const {
|
||||
const QDomElement PartText::toXml(QDomDocument &xml_document) const
|
||||
{
|
||||
QDomElement xml_element = xml_document.createElement(xmlName());
|
||||
|
||||
xml_element.setAttribute("x", QString::number(pos().x()));
|
||||
@ -111,7 +113,8 @@ const QDomElement PartText::toXml(QDomDocument &xml_document) const {
|
||||
/**
|
||||
@return Les coordonnees du point situe en bas a gauche du texte.
|
||||
*/
|
||||
QPointF PartText::margin() const {
|
||||
QPointF PartText::margin() const
|
||||
{
|
||||
QFont used_font = font();
|
||||
QFontMetrics qfm(used_font);
|
||||
qreal document_margin = document() -> documentMargin();
|
||||
@ -191,7 +194,8 @@ QVariant PartText::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||
/**
|
||||
@return le rectangle delimitant cette partie.
|
||||
*/
|
||||
QRectF PartText::boundingRect() const {
|
||||
QRectF PartText::boundingRect() const
|
||||
{
|
||||
QRectF r = QGraphicsTextItem::boundingRect();
|
||||
r.adjust(0.0, -1.1, 0.0, 0.0);
|
||||
return(r);
|
||||
@ -202,7 +206,8 @@ QRectF PartText::boundingRect() const {
|
||||
conservee / enregistree.
|
||||
Un texte statique n'est pas pertinent lorsque son texte est vide.
|
||||
*/
|
||||
bool PartText::isUseless() const {
|
||||
bool PartText::isUseless() const
|
||||
{
|
||||
return(toPlainText().isEmpty());
|
||||
}
|
||||
|
||||
@ -212,7 +217,8 @@ bool PartText::isUseless() const {
|
||||
to imply any margin, and it is different from shape because it is a regular
|
||||
rectangle, not a complex shape.
|
||||
*/
|
||||
QRectF PartText::sceneGeometricRect() const {
|
||||
QRectF PartText::sceneGeometricRect() const
|
||||
{
|
||||
return(sceneBoundingRect());
|
||||
}
|
||||
|
||||
@ -327,7 +333,8 @@ void PartText::setEditable(bool editable) {
|
||||
/**
|
||||
Start text edition by storing the former value of the text.
|
||||
*/
|
||||
void PartText::startEdition() {
|
||||
void PartText::startEdition()
|
||||
{
|
||||
// !previous_text.isNull() means the text is being edited
|
||||
previous_text = toPlainText();
|
||||
}
|
||||
@ -336,7 +343,8 @@ void PartText::startEdition() {
|
||||
End text edition, potentially generating a ChangePartCommand if the text
|
||||
has changed.
|
||||
*/
|
||||
void PartText::endEdition() {
|
||||
void PartText::endEdition()
|
||||
{
|
||||
if (!previous_text.isNull()) {
|
||||
// the text was being edited
|
||||
QString new_text = toPlainText();
|
||||
|
@ -89,7 +89,8 @@ LineEditor::LineEditor(QETElementEditor *editor, PartLine *line, QWidget *parent
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
LineEditor::~LineEditor() {
|
||||
LineEditor::~LineEditor()
|
||||
{
|
||||
}
|
||||
|
||||
void LineEditor::setUpChangeConnections()
|
||||
@ -155,11 +156,13 @@ bool LineEditor::setParts(QList <CustomElementPart *> parts)
|
||||
/**
|
||||
@return la primitive actuellement editee, ou 0 si ce widget n'en edite pas
|
||||
*/
|
||||
CustomElementPart *LineEditor::currentPart() const {
|
||||
CustomElementPart *LineEditor::currentPart() const
|
||||
{
|
||||
return(part);
|
||||
}
|
||||
|
||||
QList<CustomElementPart*> LineEditor::currentParts() const {
|
||||
QList<CustomElementPart*> LineEditor::currentParts() const
|
||||
{
|
||||
return style_->currentParts();
|
||||
}
|
||||
|
||||
@ -167,7 +170,8 @@ QList<CustomElementPart*> LineEditor::currentParts() const {
|
||||
@brief LineEditor::editedP1
|
||||
@return The edited P1 in item coordinate
|
||||
*/
|
||||
QPointF LineEditor::editedP1() const {
|
||||
QPointF LineEditor::editedP1() const
|
||||
{
|
||||
return part -> mapFromScene(x1->value(), y1->value());
|
||||
}
|
||||
|
||||
@ -175,7 +179,8 @@ QPointF LineEditor::editedP1() const {
|
||||
@brief LineEditor::editedP2
|
||||
@return The edited P2 in item coordinate
|
||||
*/
|
||||
QPointF LineEditor::editedP2() const {
|
||||
QPointF LineEditor::editedP2() const
|
||||
{
|
||||
return part -> mapFromScene(x2->value(), y2->value());
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,8 @@ QETElementEditor::QETElementEditor(QWidget *parent) :
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
QETElementEditor::~QETElementEditor() {
|
||||
QETElementEditor::~QETElementEditor()
|
||||
{
|
||||
/*
|
||||
retire le widget d'edition de primitives affiche par le dock
|
||||
cela evite qu'il ne soit supprime par son widget parent
|
||||
@ -135,7 +136,8 @@ void QETElementEditor::setFileName(const QString &fn) {
|
||||
@brief QETElementEditor::setupActions
|
||||
Create action used in Element editor
|
||||
*/
|
||||
void QETElementEditor::setupActions() {
|
||||
void QETElementEditor::setupActions()
|
||||
{
|
||||
new_element = new QAction(QET::Icons::DocumentNew, tr("&Nouveau"), this);
|
||||
open = new QAction(QET::Icons::FolderOpen, tr("&Ouvrir"), this);
|
||||
open_file = new QAction(QET::Icons::FolderOpen, tr("&Ouvrir depuis un fichier"), this);
|
||||
@ -361,7 +363,8 @@ void QETElementEditor::setupActions() {
|
||||
/**
|
||||
@brief QETElementEditor::setupMenus
|
||||
*/
|
||||
void QETElementEditor::setupMenus() {
|
||||
void QETElementEditor::setupMenus()
|
||||
{
|
||||
file_menu = new QMenu(tr("&Fichier"), this);
|
||||
edit_menu = new QMenu(tr("&Édition"), this);
|
||||
display_menu = new QMenu(tr("Afficha&ge"), this);
|
||||
@ -461,7 +464,8 @@ void QETElementEditor::contextMenu(QPoint p, QList<QAction *> actions) {
|
||||
/**
|
||||
Met a jour les menus
|
||||
*/
|
||||
void QETElementEditor::slot_updateMenus() {
|
||||
void QETElementEditor::slot_updateMenus()
|
||||
{
|
||||
bool selected_items = !read_only && !m_elmt_scene -> selectedItems().isEmpty();
|
||||
bool clipboard_elmt = !read_only && ElementScene::clipboardMayContainElement();
|
||||
|
||||
@ -497,7 +501,8 @@ void QETElementEditor::slot_updateMenus() {
|
||||
/**
|
||||
Met a jour le titre de la fenetre
|
||||
*/
|
||||
void QETElementEditor::slot_updateTitle() {
|
||||
void QETElementEditor::slot_updateTitle()
|
||||
{
|
||||
QString title = min_title;
|
||||
title += " - " + m_elmt_scene -> names().name() + " ";
|
||||
if (!filename_.isEmpty() || !location_.isNull()) {
|
||||
@ -514,7 +519,8 @@ void QETElementEditor::slot_updateTitle() {
|
||||
/**
|
||||
@brief QETElementEditor::setupInterface
|
||||
*/
|
||||
void QETElementEditor::setupInterface() {
|
||||
void QETElementEditor::setupInterface()
|
||||
{
|
||||
// editeur
|
||||
m_elmt_scene = new ElementScene(this, this);
|
||||
m_view = new ElementView(m_elmt_scene, this);
|
||||
@ -592,14 +598,16 @@ void QETElementEditor::setupInterface() {
|
||||
Passe l'editeur d'element en mode selection : le pointeur deplace les
|
||||
elements selectionnes et il est possible d'utiliser un rectangle de selection.
|
||||
*/
|
||||
void QETElementEditor::slot_setRubberBandToView() {
|
||||
void QETElementEditor::slot_setRubberBandToView()
|
||||
{
|
||||
m_view -> setDragMode(QGraphicsView::RubberBandDrag);
|
||||
}
|
||||
|
||||
/**
|
||||
Passe l'editeur d'element en mode immobile (utilise pour la lecture seule)
|
||||
*/
|
||||
void QETElementEditor::slot_setNoDragToView() {
|
||||
void QETElementEditor::slot_setNoDragToView()
|
||||
{
|
||||
m_view -> setDragMode(QGraphicsView::NoDrag);
|
||||
}
|
||||
|
||||
@ -608,7 +616,8 @@ void QETElementEditor::slot_setNoDragToView() {
|
||||
Si plusieurs primitives sont selectionnees, seule leur quantite est
|
||||
affichee. Sinon, un widget d'edition approprie est mis en place.
|
||||
*/
|
||||
void QETElementEditor::slot_updateInformations() {
|
||||
void QETElementEditor::slot_updateInformations()
|
||||
{
|
||||
QList<QGraphicsItem *> selected_qgis = m_elmt_scene -> selectedItems();
|
||||
if (selected_qgis.isEmpty()) {
|
||||
clearToolsDock();
|
||||
@ -752,7 +761,8 @@ void QETElementEditor::slot_updateInformations() {
|
||||
Do several check about element.
|
||||
If error is occurred return false
|
||||
*/
|
||||
bool QETElementEditor::checkElement() {
|
||||
bool QETElementEditor::checkElement()
|
||||
{
|
||||
//List of warning and error
|
||||
typedef QPair<QString, QString> QETWarning;
|
||||
QList<QETWarning> warnings;
|
||||
@ -998,7 +1008,8 @@ void QETElementEditor::setReadOnly(bool ro) {
|
||||
/**
|
||||
@return true si l'editeur d'element est en mode lecture seule
|
||||
*/
|
||||
bool QETElementEditor::isReadOnly() const {
|
||||
bool QETElementEditor::isReadOnly() const
|
||||
{
|
||||
return(read_only);
|
||||
}
|
||||
|
||||
@ -1006,7 +1017,8 @@ bool QETElementEditor::isReadOnly() const {
|
||||
@brief QETElementEditor::addLine
|
||||
Set line creation interface to scene
|
||||
*/
|
||||
void QETElementEditor::addLine() {
|
||||
void QETElementEditor::addLine()
|
||||
{
|
||||
m_elmt_scene -> setEventInterface(new ESEventAddLine(m_elmt_scene));
|
||||
}
|
||||
|
||||
@ -1014,7 +1026,8 @@ void QETElementEditor::addLine() {
|
||||
@brief QETElementEditor::addRect
|
||||
Set rectangle creation interface to scene
|
||||
*/
|
||||
void QETElementEditor::addRect() {
|
||||
void QETElementEditor::addRect()
|
||||
{
|
||||
m_elmt_scene -> setEventInterface(new ESEventAddRect(m_elmt_scene));
|
||||
}
|
||||
|
||||
@ -1022,7 +1035,8 @@ void QETElementEditor::addRect() {
|
||||
@brief QETElementEditor::addEllipse
|
||||
Set ellipse creation interface to scene
|
||||
*/
|
||||
void QETElementEditor::addEllipse() {
|
||||
void QETElementEditor::addEllipse()
|
||||
{
|
||||
m_elmt_scene -> setEventInterface(new ESEventAddEllipse(m_elmt_scene));
|
||||
}
|
||||
|
||||
@ -1030,7 +1044,8 @@ void QETElementEditor::addEllipse() {
|
||||
@brief QETElementEditor::addPolygon
|
||||
Set polygon creation interface to scene
|
||||
*/
|
||||
void QETElementEditor::addPolygon() {
|
||||
void QETElementEditor::addPolygon()
|
||||
{
|
||||
m_elmt_scene -> setEventInterface(new ESEventAddPolygon(m_elmt_scene));
|
||||
}
|
||||
|
||||
@ -1038,7 +1053,8 @@ void QETElementEditor::addPolygon() {
|
||||
@brief QETElementEditor::addArc
|
||||
Set arc creation interface to scene
|
||||
*/
|
||||
void QETElementEditor::addArc() {
|
||||
void QETElementEditor::addArc()
|
||||
{
|
||||
m_elmt_scene -> setEventInterface(new ESEventAddArc(m_elmt_scene));
|
||||
}
|
||||
|
||||
@ -1046,7 +1062,8 @@ void QETElementEditor::addArc() {
|
||||
@brief QETElementEditor::addText
|
||||
Set text creation interface to scene
|
||||
*/
|
||||
void QETElementEditor::addText() {
|
||||
void QETElementEditor::addText()
|
||||
{
|
||||
m_elmt_scene -> setEventInterface(new ESEventAddText(m_elmt_scene));
|
||||
}
|
||||
|
||||
@ -1054,7 +1071,8 @@ void QETElementEditor::addText() {
|
||||
@brief QETElementEditor::addTerminal
|
||||
Set terminal creation interface to scene
|
||||
*/
|
||||
void QETElementEditor::addTerminal() {
|
||||
void QETElementEditor::addTerminal()
|
||||
{
|
||||
m_elmt_scene -> setEventInterface(new ESEventAddTerminal(m_elmt_scene));
|
||||
}
|
||||
|
||||
@ -1062,7 +1080,8 @@ void QETElementEditor::addTerminal() {
|
||||
@brief QETElementEditor::addDynamicTextField
|
||||
Set dynamic text field creation interface to scene
|
||||
*/
|
||||
void QETElementEditor::addDynamicTextField() {
|
||||
void QETElementEditor::addDynamicTextField()
|
||||
{
|
||||
m_elmt_scene -> setEventInterface(new ESEventAddDynamicTextField(m_elmt_scene));
|
||||
}
|
||||
|
||||
@ -1070,7 +1089,8 @@ void QETElementEditor::addDynamicTextField() {
|
||||
@brief QETElementEditor::UncheckAddPrimitive
|
||||
Uncheck all action related to primitive
|
||||
*/
|
||||
void QETElementEditor::UncheckAddPrimitive() {
|
||||
void QETElementEditor::UncheckAddPrimitive()
|
||||
{
|
||||
foreach(QAction *action, parts -> actions()) {
|
||||
action -> setChecked(false);
|
||||
}
|
||||
@ -1079,7 +1099,8 @@ void QETElementEditor::UncheckAddPrimitive() {
|
||||
/**
|
||||
Lance l'assistant de creation d'un nouvel element.
|
||||
*/
|
||||
void QETElementEditor::slot_new() {
|
||||
void QETElementEditor::slot_new()
|
||||
{
|
||||
NewElementWizard new_element_wizard(this);
|
||||
new_element_wizard.exec();
|
||||
}
|
||||
@ -1087,7 +1108,8 @@ void QETElementEditor::slot_new() {
|
||||
/**
|
||||
Ouvre un element
|
||||
*/
|
||||
void QETElementEditor::slot_open() {
|
||||
void QETElementEditor::slot_open()
|
||||
{
|
||||
// demande le chemin virtuel de l'element a ouvrir a l'utilisateur
|
||||
ElementsLocation location = ElementDialog::getOpenElementLocation(this);
|
||||
if (location.isNull()) {
|
||||
@ -1100,7 +1122,8 @@ void QETElementEditor::slot_open() {
|
||||
Ouvre un fichier
|
||||
Demande un fichier a l'utilisateur et ouvre ce fichier
|
||||
*/
|
||||
void QETElementEditor::slot_openFile() {
|
||||
void QETElementEditor::slot_openFile()
|
||||
{
|
||||
// repertoire a afficher initialement dans le dialogue
|
||||
QString open_dir = filename_.isEmpty() ? QETApp::customElementsDir() : QDir(filename_).absolutePath();
|
||||
|
||||
@ -1129,7 +1152,8 @@ void QETElementEditor::openRecentFile(const QString &filepath) {
|
||||
/**
|
||||
@brief QETElementEditor::slot_openDxf
|
||||
*/
|
||||
void QETElementEditor::slot_openDxf (){
|
||||
void QETElementEditor::slot_openDxf ()
|
||||
{
|
||||
|
||||
#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
|
||||
QString program = (QDir::homePath() + "/Application Data/qet/DXFtoQET.exe");
|
||||
@ -1174,7 +1198,8 @@ void QETElementEditor::openElement(const QString &filepath) {
|
||||
@brief QETElementEditor::slot_reload
|
||||
Reload the element from the file or location
|
||||
*/
|
||||
void QETElementEditor::slot_reload() {
|
||||
void QETElementEditor::slot_reload()
|
||||
{
|
||||
//If user already edit the element, ask confirmation to reload
|
||||
if (!m_elmt_scene -> undoStack().isClean()) {
|
||||
QMessageBox::StandardButton answer = QET::QetMessageBox::question(this,
|
||||
@ -1203,7 +1228,8 @@ void QETElementEditor::slot_reload() {
|
||||
If the filepath or location is unknown, use save_as instead
|
||||
@return true if save with success
|
||||
*/
|
||||
bool QETElementEditor::slot_save() {
|
||||
bool QETElementEditor::slot_save()
|
||||
{
|
||||
// Check element befor writing
|
||||
if (checkElement()) {
|
||||
//If we don't know the name of the current file, use save as instead
|
||||
@ -1242,7 +1268,8 @@ bool QETElementEditor::slot_save() {
|
||||
to this location
|
||||
@return true if save with success
|
||||
*/
|
||||
bool QETElementEditor::slot_saveAs() {
|
||||
bool QETElementEditor::slot_saveAs()
|
||||
{
|
||||
// Check element befor writing
|
||||
if (checkElement()) {
|
||||
//Ask a location to user
|
||||
@ -1269,7 +1296,8 @@ bool QETElementEditor::slot_saveAs() {
|
||||
Ask a file to user and save the current edited element to this file
|
||||
@return true if save with success
|
||||
*/
|
||||
bool QETElementEditor::slot_saveAsFile() {
|
||||
bool QETElementEditor::slot_saveAsFile()
|
||||
{
|
||||
// Check element befor writing
|
||||
if (checkElement()) {
|
||||
//Ask a filename to user, for save the element
|
||||
@ -1312,7 +1340,8 @@ bool QETElementEditor::slot_saveAsFile() {
|
||||
Si l'element comporte des modifications, la question est posee a
|
||||
l'utilisateur.
|
||||
*/
|
||||
bool QETElementEditor::canClose() {
|
||||
bool QETElementEditor::canClose()
|
||||
{
|
||||
if (m_elmt_scene -> undoStack().isClean()) {
|
||||
return(true);
|
||||
}
|
||||
@ -1351,7 +1380,8 @@ bool QETElementEditor::canClose() {
|
||||
parties.
|
||||
@return le widget enleve, ou 0 s'il n'y avait pas de widget a enlever
|
||||
*/
|
||||
QWidget *QETElementEditor::clearToolsDock() {
|
||||
QWidget *QETElementEditor::clearToolsDock()
|
||||
{
|
||||
if (QWidget *previous_widget = m_tools_dock_stack -> widget(1)) {
|
||||
m_tools_dock_stack -> removeWidget(previous_widget);
|
||||
previous_widget -> setParent(nullptr);
|
||||
@ -1410,7 +1440,8 @@ void QETElementEditor::firstActivation(QEvent *event) {
|
||||
/**
|
||||
Remplit la liste des parties
|
||||
*/
|
||||
void QETElementEditor::slot_createPartsList() {
|
||||
void QETElementEditor::slot_createPartsList()
|
||||
{
|
||||
m_parts_list -> blockSignals(true);
|
||||
m_parts_list -> clear();
|
||||
QList<QGraphicsItem *> qgis = m_elmt_scene -> zItems();
|
||||
@ -1441,7 +1472,8 @@ void QETElementEditor::slot_createPartsList() {
|
||||
/**
|
||||
Met a jour la selection dans la liste des parties
|
||||
*/
|
||||
void QETElementEditor::slot_updatePartsList() {
|
||||
void QETElementEditor::slot_updatePartsList()
|
||||
{
|
||||
int items_count = m_elmt_scene -> items().count();
|
||||
if (m_parts_list -> count() != items_count) {
|
||||
slot_createPartsList();
|
||||
@ -1464,7 +1496,8 @@ void QETElementEditor::slot_updatePartsList() {
|
||||
Met a jour la selection des parties de l'element a partir de la liste des
|
||||
parties
|
||||
*/
|
||||
void QETElementEditor::slot_updateSelectionFromPartsList() {
|
||||
void QETElementEditor::slot_updateSelectionFromPartsList()
|
||||
{
|
||||
m_elmt_scene -> blockSignals(true);
|
||||
m_parts_list -> blockSignals(true);
|
||||
for (int i = 0 ; i < m_parts_list -> count() ; ++ i) {
|
||||
@ -1484,7 +1517,8 @@ void QETElementEditor::slot_updateSelectionFromPartsList() {
|
||||
@brief QETElementEditor::readSettings
|
||||
Read settings
|
||||
*/
|
||||
void QETElementEditor::readSettings() {
|
||||
void QETElementEditor::readSettings()
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
// dimensions et position de la fenetre
|
||||
@ -1507,7 +1541,8 @@ void QETElementEditor::readSettings() {
|
||||
@brief QETElementEditor::writeSettings
|
||||
Write the settings
|
||||
*/
|
||||
void QETElementEditor::writeSettings() {
|
||||
void QETElementEditor::writeSettings()
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("elementeditor/geometry", saveGeometry());
|
||||
settings.setValue("elementeditor/state", saveState());
|
||||
@ -1517,7 +1552,8 @@ void QETElementEditor::writeSettings() {
|
||||
@return les decalages horizontaux et verticaux (sous la forme d'un point) a
|
||||
utiliser lors d'un copier/coller avec decalage.
|
||||
*/
|
||||
QPointF QETElementEditor::pasteOffset() {
|
||||
QPointF QETElementEditor::pasteOffset()
|
||||
{
|
||||
QPointF paste_offset(5.0, 0.0);
|
||||
return(paste_offset);
|
||||
}
|
||||
@ -1594,7 +1630,8 @@ void QETElementEditor::fromLocation(const ElementsLocation &location) {
|
||||
Demande un fichier a l'utilisateur, l'ouvre en tant que fichier element,
|
||||
met son contenu dans le presse-papiers, et appelle ElementView::PasteInArea
|
||||
*/
|
||||
void QETElementEditor::pasteFromFile() {
|
||||
void QETElementEditor::pasteFromFile()
|
||||
{
|
||||
// demande le chemin du fichier a ouvrir a l'utilisateur
|
||||
QString element_file_path = getOpenElementFileName(this);
|
||||
if (element_file_path.isEmpty()) {
|
||||
@ -1627,7 +1664,8 @@ void QETElementEditor::pasteFromFile() {
|
||||
Ask an element to user, copy the xml definition of the element
|
||||
to the clipboard and call ElementView::PasteInArea
|
||||
*/
|
||||
void QETElementEditor::pasteFromElement() {
|
||||
void QETElementEditor::pasteFromElement()
|
||||
{
|
||||
//Ask for a location
|
||||
ElementsLocation location = ElementDialog::getOpenElementLocation(this);
|
||||
if (location.isNull()) {
|
||||
@ -1659,7 +1697,8 @@ void QETElementEditor::pasteFromElement() {
|
||||
Met a jour l'editeur de primitive actuellement visible.
|
||||
Si aucun editeur de primitive n'est visible, ce slot ne fait rien.
|
||||
*/
|
||||
void QETElementEditor::updateCurrentPartEditor() {
|
||||
void QETElementEditor::updateCurrentPartEditor()
|
||||
{
|
||||
// si aucun widget d'edition n'est affiche, on ne fait rien
|
||||
if (!m_tools_dock_stack -> currentIndex()) {
|
||||
return;
|
||||
|
@ -166,21 +166,24 @@ inline void QETElementEditor::setNames(const NamesList &nameslist) {
|
||||
/**
|
||||
@return the location of the currently edited element
|
||||
*/
|
||||
inline ElementsLocation QETElementEditor::location() const {
|
||||
inline ElementsLocation QETElementEditor::location() const
|
||||
{
|
||||
return(location_);
|
||||
}
|
||||
|
||||
/**
|
||||
@return the filename of the currently edited element
|
||||
*/
|
||||
inline QString QETElementEditor::fileName() const {
|
||||
inline QString QETElementEditor::fileName() const
|
||||
{
|
||||
return(filename_);
|
||||
}
|
||||
|
||||
/**
|
||||
@return the editing scene
|
||||
*/
|
||||
inline ElementScene *QETElementEditor::elementScene() const {
|
||||
inline ElementScene *QETElementEditor::elementScene() const
|
||||
{
|
||||
return(m_elmt_scene);
|
||||
}
|
||||
|
||||
|
@ -403,31 +403,37 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p,
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
StyleEditor::~StyleEditor() {
|
||||
StyleEditor::~StyleEditor()
|
||||
{
|
||||
}
|
||||
|
||||
/// Update antialiasing with undo command
|
||||
void StyleEditor::updatePartAntialiasing() {
|
||||
void StyleEditor::updatePartAntialiasing()
|
||||
{
|
||||
makeUndo(tr("style antialiasing"), "antialias", antialiasing -> isChecked());
|
||||
}
|
||||
|
||||
/// Update color with undo command
|
||||
void StyleEditor::updatePartColor() {
|
||||
void StyleEditor::updatePartColor()
|
||||
{
|
||||
makeUndo(tr("style couleur"),"color", outline_color->itemData(outline_color -> currentIndex()));
|
||||
}
|
||||
|
||||
/// Update style with undo command
|
||||
void StyleEditor::updatePartLineStyle() {
|
||||
void StyleEditor::updatePartLineStyle()
|
||||
{
|
||||
makeUndo(tr("style ligne"), "line_style", line_style->itemData(line_style -> currentIndex()));
|
||||
}
|
||||
|
||||
/// Update weight with undo command
|
||||
void StyleEditor::updatePartLineWeight() {
|
||||
void StyleEditor::updatePartLineWeight()
|
||||
{
|
||||
makeUndo(tr("style epaisseur"), "line_weight", size_weight->itemData(size_weight -> currentIndex()));
|
||||
}
|
||||
|
||||
/// Update color filling with undo command
|
||||
void StyleEditor::updatePartFilling() {
|
||||
void StyleEditor::updatePartFilling()
|
||||
{
|
||||
makeUndo(tr("style remplissage"), "filling", filling_color->itemData(filling_color -> currentIndex()));
|
||||
}
|
||||
|
||||
@ -536,11 +542,13 @@ bool StyleEditor::setParts(QList<CustomElementPart *> part_list)
|
||||
/**
|
||||
@return la primitive actuellement editee, ou 0 si ce widget n'en edite pas
|
||||
*/
|
||||
CustomElementPart *StyleEditor::currentPart() const {
|
||||
CustomElementPart *StyleEditor::currentPart() const
|
||||
{
|
||||
return(part);
|
||||
}
|
||||
|
||||
QList<CustomElementPart*> StyleEditor::currentParts() const {
|
||||
QList<CustomElementPart*> StyleEditor::currentParts() const
|
||||
{
|
||||
return m_cep_list;
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,8 @@ TerminalEditor::TerminalEditor(QETElementEditor *editor,
|
||||
/**
|
||||
@brief TerminalEditor::init
|
||||
*/
|
||||
void TerminalEditor::init() {
|
||||
void TerminalEditor::init()
|
||||
{
|
||||
qle_x = new QDoubleSpinBox();
|
||||
qle_y = new QDoubleSpinBox();
|
||||
|
||||
@ -98,7 +99,8 @@ void TerminalEditor::init() {
|
||||
@brief TerminalEditor::~TerminalEditor
|
||||
Destructeur
|
||||
*/
|
||||
TerminalEditor::~TerminalEditor() {
|
||||
TerminalEditor::~TerminalEditor()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -161,11 +163,13 @@ bool TerminalEditor::setParts(QList<CustomElementPart *> parts) {
|
||||
/**
|
||||
@return la primitive actuellement editee, ou 0 si ce widget n'en edite pas
|
||||
*/
|
||||
CustomElementPart *TerminalEditor::currentPart() const {
|
||||
CustomElementPart *TerminalEditor::currentPart() const
|
||||
{
|
||||
return(m_part);
|
||||
}
|
||||
|
||||
QList<CustomElementPart*> TerminalEditor::currentParts() const {
|
||||
QList<CustomElementPart*> TerminalEditor::currentParts() const
|
||||
{
|
||||
QList<CustomElementPart*> parts;
|
||||
for (auto term: m_terminals) {
|
||||
parts.append(static_cast<CustomElementPart*>(term));
|
||||
@ -174,7 +178,8 @@ QList<CustomElementPart*> TerminalEditor::currentParts() const {
|
||||
}
|
||||
|
||||
/// Met a jour l'orientation de la borne et cree un objet d'annulation
|
||||
void TerminalEditor::updateTerminalO() {
|
||||
void TerminalEditor::updateTerminalO()
|
||||
{
|
||||
if (m_locked) return;
|
||||
m_locked = true;
|
||||
QVariant var(orientation -> itemData(orientation -> currentIndex()));
|
||||
@ -194,7 +199,8 @@ void TerminalEditor::updateTerminalO() {
|
||||
/**
|
||||
@brief TerminalEditor::updateXPos
|
||||
*/
|
||||
void TerminalEditor::updateXPos() {
|
||||
void TerminalEditor::updateXPos()
|
||||
{
|
||||
if (m_locked) return;
|
||||
m_locked = true;
|
||||
QPointF new_pos(qle_x->value(), 0);
|
||||
@ -215,7 +221,8 @@ void TerminalEditor::updateXPos() {
|
||||
/**
|
||||
@brief TerminalEditor::updateYPos
|
||||
*/
|
||||
void TerminalEditor::updateYPos() {
|
||||
void TerminalEditor::updateYPos()
|
||||
{
|
||||
if (m_locked) return;
|
||||
m_locked = true;
|
||||
QPointF new_pos(0, qle_y->value()); // change only y value
|
||||
@ -237,7 +244,8 @@ void TerminalEditor::updateYPos() {
|
||||
/**
|
||||
Met a jour le formulaire d'edition
|
||||
*/
|
||||
void TerminalEditor::updateForm() {
|
||||
void TerminalEditor::updateForm()
|
||||
{
|
||||
if (!m_part) return;
|
||||
activeConnections(false);
|
||||
qle_x -> setValue(m_part->property("x").toReal());
|
||||
|
@ -43,7 +43,8 @@ DynamicTextFieldEditor::DynamicTextFieldEditor(
|
||||
fillInfoComboBox();
|
||||
}
|
||||
|
||||
DynamicTextFieldEditor::~DynamicTextFieldEditor() {
|
||||
DynamicTextFieldEditor::~DynamicTextFieldEditor()
|
||||
{
|
||||
delete ui;
|
||||
if(!m_connection_list.isEmpty()) {
|
||||
for(const QMetaObject::Connection& con : m_connection_list) {
|
||||
@ -108,11 +109,13 @@ bool DynamicTextFieldEditor::setParts(QList <CustomElementPart *> parts) {
|
||||
@return The current edited part, note they can return nullptr if
|
||||
there is not a currently edited part.
|
||||
*/
|
||||
CustomElementPart *DynamicTextFieldEditor::currentPart() const {
|
||||
CustomElementPart *DynamicTextFieldEditor::currentPart() const
|
||||
{
|
||||
return m_text_field.data();
|
||||
}
|
||||
|
||||
QList<CustomElementPart*> DynamicTextFieldEditor::currentParts() const {
|
||||
QList<CustomElementPart*> DynamicTextFieldEditor::currentParts() const
|
||||
{
|
||||
QList<CustomElementPart*> parts;
|
||||
for (auto part: m_parts) {
|
||||
parts.append(static_cast<CustomElementPart*>(part));
|
||||
@ -120,7 +123,8 @@ QList<CustomElementPart*> DynamicTextFieldEditor::currentParts() const {
|
||||
return parts;
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::updateForm() {
|
||||
void DynamicTextFieldEditor::updateForm()
|
||||
{
|
||||
if(m_text_field) {
|
||||
ui -> m_x_sb -> setValue(m_text_field.data() -> x());
|
||||
ui -> m_y_sb -> setValue(m_text_field.data() ->y ());
|
||||
@ -152,7 +156,8 @@ void DynamicTextFieldEditor::updateForm() {
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::setUpConnections() {
|
||||
void DynamicTextFieldEditor::setUpConnections()
|
||||
{
|
||||
assert(m_connection_list.isEmpty());
|
||||
//Setup the connection
|
||||
m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::colorChanged,
|
||||
@ -177,7 +182,8 @@ void DynamicTextFieldEditor::setUpConnections() {
|
||||
[this](){this -> updateForm();});
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::disconnectConnections() {
|
||||
void DynamicTextFieldEditor::disconnectConnections()
|
||||
{
|
||||
//Remove previous connection
|
||||
if(!m_connection_list.isEmpty())
|
||||
for(const QMetaObject::Connection& con : m_connection_list) {
|
||||
@ -190,7 +196,8 @@ void DynamicTextFieldEditor::disconnectConnections() {
|
||||
@brief DynamicTextFieldEditor::fillInfoComboBox
|
||||
Fill the combo box "element information"
|
||||
*/
|
||||
void DynamicTextFieldEditor::fillInfoComboBox() {
|
||||
void DynamicTextFieldEditor::fillInfoComboBox()
|
||||
{
|
||||
ui -> m_elmt_info_cb -> clear();
|
||||
|
||||
QStringList strl;
|
||||
@ -212,7 +219,8 @@ void DynamicTextFieldEditor::fillInfoComboBox() {
|
||||
ui -> m_elmt_info_cb -> addItem(key, info_map.value(key));
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::on_m_x_sb_editingFinished() {
|
||||
void DynamicTextFieldEditor::on_m_x_sb_editingFinished()
|
||||
{
|
||||
double value = ui -> m_x_sb -> value();
|
||||
for (int i = 0; i < m_parts.length(); i++) {
|
||||
QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_parts[i], "x", m_parts[i] -> x(), value);
|
||||
@ -222,7 +230,8 @@ void DynamicTextFieldEditor::on_m_x_sb_editingFinished() {
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::on_m_y_sb_editingFinished() {
|
||||
void DynamicTextFieldEditor::on_m_y_sb_editingFinished()
|
||||
{
|
||||
double value = ui -> m_y_sb -> value();
|
||||
for (int i = 0; i < m_parts.length(); i++) {
|
||||
QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_parts[i], "y", m_parts[i] -> y(), value);
|
||||
@ -232,7 +241,8 @@ void DynamicTextFieldEditor::on_m_y_sb_editingFinished() {
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::on_m_rotation_sb_editingFinished() {
|
||||
void DynamicTextFieldEditor::on_m_rotation_sb_editingFinished()
|
||||
{
|
||||
int value = ui -> m_rotation_sb -> value();
|
||||
for (int i = 0; i < m_parts.length(); i++) {
|
||||
QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_parts[i], "rotation", m_parts[i] -> rotation(), value);
|
||||
@ -242,7 +252,8 @@ void DynamicTextFieldEditor::on_m_rotation_sb_editingFinished() {
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::on_m_user_text_le_editingFinished() {
|
||||
void DynamicTextFieldEditor::on_m_user_text_le_editingFinished()
|
||||
{
|
||||
QString text = ui -> m_user_text_le -> text();
|
||||
for (int i = 0; i < m_parts.length(); i++) {
|
||||
QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_parts[i], "text", m_parts[i] -> text(), text);
|
||||
@ -251,7 +262,8 @@ void DynamicTextFieldEditor::on_m_user_text_le_editingFinished() {
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::on_m_size_sb_editingFinished() {
|
||||
void DynamicTextFieldEditor::on_m_size_sb_editingFinished()
|
||||
{
|
||||
QFont font_ = m_text_field -> font();
|
||||
font_.setPointSize(ui -> m_size_sb -> value());
|
||||
for (int i = 0; i < m_parts.length(); i++) {
|
||||
@ -261,7 +273,8 @@ void DynamicTextFieldEditor::on_m_size_sb_editingFinished() {
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::on_m_frame_cb_clicked() {
|
||||
void DynamicTextFieldEditor::on_m_frame_cb_clicked()
|
||||
{
|
||||
bool frame = ui -> m_frame_cb -> isChecked();
|
||||
|
||||
for (int i = 0; i < m_parts.length(); i++) {
|
||||
@ -273,7 +286,8 @@ void DynamicTextFieldEditor::on_m_frame_cb_clicked() {
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::on_m_width_sb_editingFinished() {
|
||||
void DynamicTextFieldEditor::on_m_width_sb_editingFinished()
|
||||
{
|
||||
qreal width = (qreal)ui -> m_width_sb -> value();
|
||||
|
||||
for (int i = 0; i < m_parts.length(); i++) {
|
||||
@ -335,7 +349,8 @@ void DynamicTextFieldEditor::on_m_text_from_cb_activated(int index) {
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::on_m_composite_text_pb_clicked() {
|
||||
void DynamicTextFieldEditor::on_m_composite_text_pb_clicked()
|
||||
{
|
||||
CompositeTextEditDialog ctd(m_text_field.data() -> compositeText(), this);
|
||||
if(ctd.exec()) {
|
||||
QString ct = ctd.plainText();
|
||||
@ -349,7 +364,8 @@ void DynamicTextFieldEditor::on_m_composite_text_pb_clicked() {
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::on_m_alignment_pb_clicked() {
|
||||
void DynamicTextFieldEditor::on_m_alignment_pb_clicked()
|
||||
{
|
||||
AlignmentTextDialog atd(m_text_field.data() -> alignment(), this);
|
||||
atd.exec();
|
||||
|
||||
@ -364,7 +380,8 @@ void DynamicTextFieldEditor::on_m_alignment_pb_clicked() {
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::on_m_font_pb_clicked() {
|
||||
void DynamicTextFieldEditor::on_m_font_pb_clicked()
|
||||
{
|
||||
bool ok;
|
||||
QFont font_ = QFontDialog::getFont(&ok, m_text_field -> font(), this);
|
||||
if (ok && font_ != this -> font()) {
|
||||
|
@ -48,7 +48,8 @@ PolygonEditor::PolygonEditor(QETElementEditor *editor,
|
||||
/**
|
||||
@brief PolygonEditor::~PolygonEditor
|
||||
*/
|
||||
PolygonEditor::~PolygonEditor() {
|
||||
PolygonEditor::~PolygonEditor()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@ -115,11 +116,13 @@ bool PolygonEditor::setPart(CustomElementPart *new_part)
|
||||
@brief PolygonEditor::currentPart
|
||||
@return the curent edited part
|
||||
*/
|
||||
CustomElementPart *PolygonEditor::currentPart() const {
|
||||
CustomElementPart *PolygonEditor::currentPart() const
|
||||
{
|
||||
return m_part;
|
||||
}
|
||||
|
||||
QList<CustomElementPart*> PolygonEditor::currentParts() const {
|
||||
QList<CustomElementPart*> PolygonEditor::currentParts() const
|
||||
{
|
||||
return m_style->currentParts();
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,8 @@ RectangleEditor::RectangleEditor(QETElementEditor *editor, PartRectangle *rect,
|
||||
/**
|
||||
@brief RectangleEditor::~RectangleEditor
|
||||
*/
|
||||
RectangleEditor::~RectangleEditor() {
|
||||
RectangleEditor::~RectangleEditor()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@ -112,11 +113,13 @@ bool RectangleEditor::setParts(QList <CustomElementPart *> parts)
|
||||
@brief RectangleEditor::currentPart
|
||||
@return
|
||||
*/
|
||||
CustomElementPart *RectangleEditor::currentPart() const {
|
||||
CustomElementPart *RectangleEditor::currentPart() const
|
||||
{
|
||||
return m_part;
|
||||
}
|
||||
|
||||
QList<CustomElementPart*> RectangleEditor::currentParts() const {
|
||||
QList<CustomElementPart*> RectangleEditor::currentParts() const
|
||||
{
|
||||
return m_style->currentParts();
|
||||
}
|
||||
|
||||
@ -124,7 +127,8 @@ QList<CustomElementPart*> RectangleEditor::currentParts() const {
|
||||
@brief RectangleEditor::topLeft
|
||||
@return The edited topLeft already mapped to part coordinate
|
||||
*/
|
||||
QPointF RectangleEditor::editedTopLeft() const {
|
||||
QPointF RectangleEditor::editedTopLeft() const
|
||||
{
|
||||
return m_part->mapFromScene(ui->m_x_sb->value(), ui->m_y_sb->value());
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,8 @@ TextEditor::TextEditor(QETElementEditor *editor, PartText *text, QWidget *paren
|
||||
/**
|
||||
@brief TextEditor::~TextEditor
|
||||
*/
|
||||
TextEditor::~TextEditor() {
|
||||
TextEditor::~TextEditor()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@ -79,14 +80,16 @@ void TextEditor::setUpChangeConnection(QPointer<PartText> part) {
|
||||
m_change_connection << connect(part, &PartText::colorChanged, this, &TextEditor::updateForm);
|
||||
}
|
||||
|
||||
void TextEditor::disconnectChangeConnection() {
|
||||
void TextEditor::disconnectChangeConnection()
|
||||
{
|
||||
for (QMetaObject::Connection c : m_change_connection) {
|
||||
disconnect(c);
|
||||
}
|
||||
m_change_connection.clear();
|
||||
}
|
||||
|
||||
void TextEditor::disconnectEditConnection() {
|
||||
void TextEditor::disconnectEditConnection()
|
||||
{
|
||||
for (QMetaObject::Connection c : m_edit_connection) {
|
||||
disconnect(c);
|
||||
}
|
||||
@ -150,11 +153,13 @@ bool TextEditor::setParts(QList <CustomElementPart *> parts) {
|
||||
@brief TextEditor::currentPart
|
||||
@return The current part
|
||||
*/
|
||||
CustomElementPart *TextEditor::currentPart() const {
|
||||
CustomElementPart *TextEditor::currentPart() const
|
||||
{
|
||||
return m_text;
|
||||
}
|
||||
|
||||
QList<CustomElementPart*> TextEditor::currentParts() const {
|
||||
QList<CustomElementPart*> TextEditor::currentParts() const
|
||||
{
|
||||
QList<CustomElementPart*> parts;
|
||||
for (auto part: m_parts) {
|
||||
parts.append(static_cast<CustomElementPart*>(part));
|
||||
@ -167,7 +172,8 @@ QList<CustomElementPart*> TextEditor::currentParts() const {
|
||||
Setup the connection between the widgets of this editor and the undo command
|
||||
use to apply the change to the edited text.
|
||||
*/
|
||||
void TextEditor::setUpEditConnection() {
|
||||
void TextEditor::setUpEditConnection()
|
||||
{
|
||||
disconnectEditConnection();
|
||||
|
||||
m_edit_connection << connect(ui -> m_line_edit, &QLineEdit::editingFinished, [this]() {
|
||||
@ -236,7 +242,8 @@ void TextEditor::setUpEditConnection() {
|
||||
/**
|
||||
@brief TextEditor::on_m_font_pb_clicked
|
||||
*/
|
||||
void TextEditor::on_m_font_pb_clicked() {
|
||||
void TextEditor::on_m_font_pb_clicked()
|
||||
{
|
||||
bool ok;
|
||||
QFont font_ = QFontDialog::getFont(&ok, m_text -> font(), this);
|
||||
|
||||
|
@ -72,7 +72,8 @@ QList <Element *> ElementProvider::freeElement(const int filter) const{
|
||||
@param uuid_list list of uuid must be found
|
||||
@return all elements with uuid corresponding to uuid in uuid_list
|
||||
*/
|
||||
QList <Element *> ElementProvider::fromUuids(QList<QUuid> uuid_list) const {
|
||||
QList <Element *> ElementProvider::fromUuids(QList<QUuid> uuid_list) const
|
||||
{
|
||||
QList <Element *> found_element;
|
||||
|
||||
foreach (Diagram *d, m_diagram_list) {
|
||||
@ -93,7 +94,8 @@ QList <Element *> ElementProvider::fromUuids(QList<QUuid> uuid_list) const {
|
||||
the filter for search element
|
||||
(You can find all filter with the define in Element.h)
|
||||
*/
|
||||
QList <Element *> ElementProvider::find(const int filter) const {
|
||||
QList <Element *> ElementProvider::find(const int filter) const
|
||||
{
|
||||
QList <Element *> elmt_;
|
||||
|
||||
//serch in all diagram
|
||||
|
@ -87,7 +87,8 @@ ElementsCategoryEditor::ElementsCategoryEditor(const ElementsLocation &location,
|
||||
@brief ElementsCategoryEditor::~ElementsCategoryEditor
|
||||
Destructor
|
||||
*/
|
||||
ElementsCategoryEditor::~ElementsCategoryEditor() {
|
||||
ElementsCategoryEditor::~ElementsCategoryEditor()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -104,7 +104,8 @@ ElementsCollectionCache::ElementsCollectionCache(const QString &database_path, Q
|
||||
/**
|
||||
Destructor
|
||||
*/
|
||||
ElementsCollectionCache::~ElementsCollectionCache() {
|
||||
ElementsCollectionCache::~ElementsCollectionCache()
|
||||
{
|
||||
delete select_name_;
|
||||
delete select_pixmap_;
|
||||
delete insert_name_;
|
||||
@ -123,7 +124,8 @@ void ElementsCollectionCache::setLocale(const QString &locale) {
|
||||
/**
|
||||
@return The locale to be used when dealing with names.
|
||||
*/
|
||||
QString ElementsCollectionCache::locale() const {
|
||||
QString ElementsCollectionCache::locale() const
|
||||
{
|
||||
return(locale_);
|
||||
}
|
||||
|
||||
@ -145,7 +147,8 @@ bool ElementsCollectionCache::setPixmapStorageFormat(const QString &format) {
|
||||
@return the pixmap storage format. Default is "PNG"
|
||||
@see setPixmapStorageFormat()
|
||||
*/
|
||||
QString ElementsCollectionCache::pixmapStorageFormat() const {
|
||||
QString ElementsCollectionCache::pixmapStorageFormat() const
|
||||
{
|
||||
return(pixmap_storage_format_);
|
||||
}
|
||||
|
||||
@ -190,14 +193,16 @@ bool ElementsCollectionCache::fetchElement(ElementsLocation &location)
|
||||
/**
|
||||
@return The last name fetched through fetchElement().
|
||||
*/
|
||||
QString ElementsCollectionCache::name() const {
|
||||
QString ElementsCollectionCache::name() const
|
||||
{
|
||||
return(current_name_);
|
||||
}
|
||||
|
||||
/**
|
||||
@return The last pixmap fetched through fetchElement().
|
||||
*/
|
||||
QPixmap ElementsCollectionCache::pixmap() const {
|
||||
QPixmap ElementsCollectionCache::pixmap() const
|
||||
{
|
||||
return(current_pixmap_);
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,8 @@ ElementsMover::ElementsMover() :
|
||||
/**
|
||||
@brief ElementsMover::~ElementsMover Destructor
|
||||
*/
|
||||
ElementsMover::~ElementsMover() {
|
||||
ElementsMover::~ElementsMover()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,7 +52,8 @@ ElementsMover::~ElementsMover() {
|
||||
@return True if this element mover is ready to be used.
|
||||
A element mover is ready when the previous managed movement is finish.
|
||||
*/
|
||||
bool ElementsMover::isReady() const {
|
||||
bool ElementsMover::isReady() const
|
||||
{
|
||||
return(!movement_running_);
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,8 @@ ElementsPanel::ElementsPanel(QWidget *parent) :
|
||||
/**
|
||||
Destructeur
|
||||
*/
|
||||
ElementsPanel::~ElementsPanel() {
|
||||
ElementsPanel::~ElementsPanel()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -111,7 +112,8 @@ void ElementsPanel::startTitleBlockTemplateDrag(const TitleBlockTemplateLocation
|
||||
/**
|
||||
Ensure the filter is applied again after the panel content has changed.
|
||||
*/
|
||||
void ElementsPanel::panelContentChange() {
|
||||
void ElementsPanel::panelContentChange()
|
||||
{
|
||||
if (!filter_.isEmpty()) {
|
||||
filter(filter_);
|
||||
}
|
||||
@ -373,7 +375,8 @@ void ElementsPanel::projectWasClosed(QETProject *project) {
|
||||
/**
|
||||
Build filter list for multiple filter
|
||||
*/
|
||||
void ElementsPanel::buildFilterList() {
|
||||
void ElementsPanel::buildFilterList()
|
||||
{
|
||||
if (filter_.isEmpty()) return;
|
||||
filter_list_ = filter_.split( '+' );
|
||||
/*
|
||||
|
@ -124,14 +124,16 @@ ElementsPanelWidget::ElementsPanelWidget(QWidget *parent) : QWidget(parent) {
|
||||
/**
|
||||
Destructeur
|
||||
*/
|
||||
ElementsPanelWidget::~ElementsPanelWidget() {
|
||||
ElementsPanelWidget::~ElementsPanelWidget()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
Require the desktop environment to open the directory containing the file
|
||||
represented by the selected item, if any.
|
||||
*/
|
||||
void ElementsPanelWidget::openDirectoryForSelectedItem() {
|
||||
void ElementsPanelWidget::openDirectoryForSelectedItem()
|
||||
{
|
||||
if (QTreeWidgetItem *qtwi = elements_panel -> currentItem()) {
|
||||
QString dir_path = elements_panel -> dirPathForItem(qtwi);
|
||||
if (!dir_path.isEmpty()) {
|
||||
@ -144,7 +146,8 @@ void ElementsPanelWidget::openDirectoryForSelectedItem() {
|
||||
Copy the full path to the file represented by the selected item to the
|
||||
clipboard.
|
||||
*/
|
||||
void ElementsPanelWidget::copyPathForSelectedItem() {
|
||||
void ElementsPanelWidget::copyPathForSelectedItem()
|
||||
{
|
||||
if (QTreeWidgetItem *qtwi = elements_panel -> currentItem()) {
|
||||
QString file_path = elements_panel -> filePathForItem(qtwi);
|
||||
file_path = QDir::toNativeSeparators(file_path);
|
||||
@ -157,7 +160,8 @@ void ElementsPanelWidget::copyPathForSelectedItem() {
|
||||
/**
|
||||
Recharge le panel d'elements
|
||||
*/
|
||||
void ElementsPanelWidget::reloadAndFilter() {
|
||||
void ElementsPanelWidget::reloadAndFilter()
|
||||
{
|
||||
// recharge tous les elements
|
||||
elements_panel -> reload();
|
||||
// reapplique le filtre
|
||||
@ -169,7 +173,8 @@ void ElementsPanelWidget::reloadAndFilter() {
|
||||
/**
|
||||
* Emit the requestForProject signal with te selected project
|
||||
*/
|
||||
void ElementsPanelWidget::activateProject() {
|
||||
void ElementsPanelWidget::activateProject()
|
||||
{
|
||||
if (QETProject *selected_project = elements_panel -> selectedProject()) {
|
||||
emit(requestForProject(selected_project));
|
||||
}
|
||||
@ -178,7 +183,8 @@ void ElementsPanelWidget::activateProject() {
|
||||
/**
|
||||
Emet le signal requestForProjectClosing avec le projet selectionne
|
||||
*/
|
||||
void ElementsPanelWidget::closeProject() {
|
||||
void ElementsPanelWidget::closeProject()
|
||||
{
|
||||
if (QETProject *selected_project = elements_panel -> selectedProject()) {
|
||||
emit(requestForProjectClosing(selected_project));
|
||||
}
|
||||
@ -187,7 +193,8 @@ void ElementsPanelWidget::closeProject() {
|
||||
/**
|
||||
Emet le signal requestForProjectPropertiesEdition avec le projet selectionne
|
||||
*/
|
||||
void ElementsPanelWidget::editProjectProperties() {
|
||||
void ElementsPanelWidget::editProjectProperties()
|
||||
{
|
||||
if (QETProject *selected_project = elements_panel -> selectedProject()) {
|
||||
emit(requestForProjectPropertiesEdition(selected_project));
|
||||
}
|
||||
@ -196,7 +203,8 @@ void ElementsPanelWidget::editProjectProperties() {
|
||||
/**
|
||||
Emet le signal requestForDiagramPropertiesEdition avec le schema selectionne
|
||||
*/
|
||||
void ElementsPanelWidget::editDiagramProperties() {
|
||||
void ElementsPanelWidget::editDiagramProperties()
|
||||
{
|
||||
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
|
||||
emit(requestForDiagramPropertiesEdition(selected_diagram));
|
||||
}
|
||||
@ -205,7 +213,8 @@ void ElementsPanelWidget::editDiagramProperties() {
|
||||
/**
|
||||
Emet le signal requestForNewDiagram avec le projet selectionne
|
||||
*/
|
||||
void ElementsPanelWidget::newDiagram() {
|
||||
void ElementsPanelWidget::newDiagram()
|
||||
{
|
||||
if (QETProject *selected_project = elements_panel -> selectedProject()) {
|
||||
emit(requestForNewDiagram(selected_project));
|
||||
}
|
||||
@ -214,7 +223,8 @@ void ElementsPanelWidget::newDiagram() {
|
||||
/**
|
||||
Emet le signal requestForDiagramDeletion avec le schema selectionne
|
||||
*/
|
||||
void ElementsPanelWidget::deleteDiagram() {
|
||||
void ElementsPanelWidget::deleteDiagram()
|
||||
{
|
||||
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
|
||||
emit(requestForDiagramDeletion(selected_diagram));
|
||||
}
|
||||
@ -223,7 +233,8 @@ void ElementsPanelWidget::deleteDiagram() {
|
||||
/**
|
||||
Emet le signal requestForDiagramMoveUpTop avec le schema selectionne
|
||||
+*/
|
||||
void ElementsPanelWidget::moveDiagramUpTop() {
|
||||
void ElementsPanelWidget::moveDiagramUpTop()
|
||||
{
|
||||
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
|
||||
emit(requestForDiagramMoveUpTop(selected_diagram));
|
||||
}
|
||||
@ -234,7 +245,8 @@ void ElementsPanelWidget::moveDiagramUpTop() {
|
||||
/**
|
||||
Emet le signal requestForDiagramMoveUp avec le schema selectionne
|
||||
*/
|
||||
void ElementsPanelWidget::moveDiagramUp() {
|
||||
void ElementsPanelWidget::moveDiagramUp()
|
||||
{
|
||||
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
|
||||
emit(requestForDiagramMoveUp(selected_diagram));
|
||||
}
|
||||
@ -243,7 +255,8 @@ void ElementsPanelWidget::moveDiagramUp() {
|
||||
/**
|
||||
Emet le signal requestForDiagramMoveDown avec le schema selectionne
|
||||
*/
|
||||
void ElementsPanelWidget::moveDiagramDown() {
|
||||
void ElementsPanelWidget::moveDiagramDown()
|
||||
{
|
||||
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
|
||||
emit(requestForDiagramMoveDown(selected_diagram));
|
||||
}
|
||||
@ -252,7 +265,8 @@ void ElementsPanelWidget::moveDiagramDown() {
|
||||
/**
|
||||
Emet le signal requestForDiagramMoveUpx10 avec le schema selectionne
|
||||
*/
|
||||
void ElementsPanelWidget::moveDiagramUpx10() {
|
||||
void ElementsPanelWidget::moveDiagramUpx10()
|
||||
{
|
||||
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
|
||||
emit(requestForDiagramMoveUpx10(selected_diagram));
|
||||
}
|
||||
@ -261,7 +275,8 @@ void ElementsPanelWidget::moveDiagramUpx10() {
|
||||
/**
|
||||
Emet le signal requestForDiagramMoveDownx10 avec le schema selectionne
|
||||
*/
|
||||
void ElementsPanelWidget::moveDiagramDownx10() {
|
||||
void ElementsPanelWidget::moveDiagramDownx10()
|
||||
{
|
||||
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
|
||||
emit(requestForDiagramMoveDownx10(selected_diagram));
|
||||
}
|
||||
@ -271,7 +286,8 @@ void ElementsPanelWidget::moveDiagramDownx10() {
|
||||
/**
|
||||
Opens a template editor to create a new title block template.
|
||||
*/
|
||||
void ElementsPanelWidget::addTitleBlockTemplate() {
|
||||
void ElementsPanelWidget::addTitleBlockTemplate()
|
||||
{
|
||||
QTreeWidgetItem *current_item = elements_panel -> currentItem();
|
||||
if (!current_item) return;
|
||||
|
||||
@ -285,7 +301,8 @@ void ElementsPanelWidget::addTitleBlockTemplate() {
|
||||
/**
|
||||
Opens an editor to edit the currently selected title block template, if any.
|
||||
*/
|
||||
void ElementsPanelWidget::editTitleBlockTemplate() {
|
||||
void ElementsPanelWidget::editTitleBlockTemplate()
|
||||
{
|
||||
QTreeWidgetItem *current_item = elements_panel -> currentItem();
|
||||
if (current_item && current_item -> type() == QET::TitleBlockTemplate) {
|
||||
QETApp::instance() -> openTitleBlockTemplate(
|
||||
@ -297,7 +314,8 @@ void ElementsPanelWidget::editTitleBlockTemplate() {
|
||||
/**
|
||||
Delete the currently selected title block template, if any.
|
||||
*/
|
||||
void ElementsPanelWidget::removeTitleBlockTemplate() {
|
||||
void ElementsPanelWidget::removeTitleBlockTemplate()
|
||||
{
|
||||
QTreeWidgetItem *current_item = elements_panel -> currentItem();
|
||||
if (current_item && current_item -> type() == QET::TitleBlockTemplate) {
|
||||
TitleBlockTemplateDeleter(
|
||||
@ -310,7 +328,8 @@ void ElementsPanelWidget::removeTitleBlockTemplate() {
|
||||
/**
|
||||
Met a jour les boutons afin d'assurer la coherence de l'interface
|
||||
*/
|
||||
void ElementsPanelWidget::updateButtons() {
|
||||
void ElementsPanelWidget::updateButtons()
|
||||
{
|
||||
QTreeWidgetItem *current_item = elements_panel -> currentItem();
|
||||
int current_type = elements_panel -> currentItemType();
|
||||
|
||||
|
@ -107,7 +107,8 @@ class ElementsPanelWidget : public QWidget {
|
||||
@brief ElementsPanelWidget::elementsPanel
|
||||
@return The elements panel embedded within this widget.
|
||||
*/
|
||||
inline ElementsPanel &ElementsPanelWidget::elementsPanel() const {
|
||||
inline ElementsPanel &ElementsPanelWidget::elementsPanel() const
|
||||
{
|
||||
return(*elements_panel);
|
||||
}
|
||||
|
||||
|
@ -25,14 +25,16 @@
|
||||
/**
|
||||
@brief ElementTextsMover::ElementTextsMover
|
||||
*/
|
||||
ElementTextsMover::ElementTextsMover() {}
|
||||
ElementTextsMover::ElementTextsMover()
|
||||
{}
|
||||
|
||||
/**
|
||||
@brief ElementTextsMover::isReady
|
||||
@return true if this ElementTextsMover is ready to process a new movement.
|
||||
False if this ElementTextsMover is actually process a movement
|
||||
*/
|
||||
bool ElementTextsMover::isReady() const {
|
||||
bool ElementTextsMover::isReady() const
|
||||
{
|
||||
return(!m_movement_running);
|
||||
}
|
||||
|
||||
|
@ -45,14 +45,16 @@ ExportPropertiesWidget::ExportPropertiesWidget(const ExportProperties &export_pr
|
||||
@brief ExportPropertiesWidget::~ExportPropertiesWidget
|
||||
Destructeur
|
||||
*/
|
||||
ExportPropertiesWidget::~ExportPropertiesWidget() {
|
||||
ExportPropertiesWidget::~ExportPropertiesWidget()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@brief ExportPropertiesWidget::exportProperties
|
||||
@return les parametres d'export definis via le widget
|
||||
*/
|
||||
ExportProperties ExportPropertiesWidget::exportProperties() const {
|
||||
ExportProperties ExportPropertiesWidget::exportProperties() const
|
||||
{
|
||||
ExportProperties export_properties;
|
||||
|
||||
export_properties.destination_directory = QDir(dirpath -> text());
|
||||
@ -120,7 +122,8 @@ void ExportPropertiesWidget::setPrintingMode(bool mode) {
|
||||
Slot asking the user to choose a folder
|
||||
/ Slot demandant a l'utilisateur de choisir un dossier
|
||||
*/
|
||||
void ExportPropertiesWidget::slot_chooseADirectory() {
|
||||
void ExportPropertiesWidget::slot_chooseADirectory()
|
||||
{
|
||||
QString user_dir = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
tr("Exporter dans le dossier", "dialog title"),
|
||||
@ -136,7 +139,8 @@ void ExportPropertiesWidget::slot_chooseADirectory() {
|
||||
Generated the ExportPropertiesWidget ui
|
||||
/ Cette methode construit le widget en lui-meme
|
||||
*/
|
||||
void ExportPropertiesWidget::build() {
|
||||
void ExportPropertiesWidget::build()
|
||||
{
|
||||
// le dialogue est un empilement vertical d'elements
|
||||
QVBoxLayout *vboxLayout = new QVBoxLayout();
|
||||
vboxLayout -> setContentsMargins(0, 0, 0, 0);
|
||||
|
@ -126,7 +126,8 @@ ElementPictureFactory::primitives ElementPictureFactory::getPrimitives(
|
||||
return m_primitives_H.value(location.uuid());
|
||||
}
|
||||
|
||||
ElementPictureFactory::~ElementPictureFactory() {
|
||||
ElementPictureFactory::~ElementPictureFactory()
|
||||
{
|
||||
for (primitives p : m_primitives_H.values()) {
|
||||
qDeleteAll(p.m_texts);
|
||||
}
|
||||
|
@ -48,7 +48,8 @@ AddTableDialog::AddTableDialog(QWidget *content_widget, QWidget *parent) :
|
||||
/**
|
||||
@brief AddTableDialog::~AddNomenclatureDialog
|
||||
*/
|
||||
AddTableDialog::~AddTableDialog() {
|
||||
AddTableDialog::~AddTableDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@ -65,7 +66,8 @@ void AddTableDialog::setQueryWidget(QWidget *widget) {
|
||||
@brief AddTableDialog::adjustTableToFolio
|
||||
@return
|
||||
*/
|
||||
bool AddTableDialog::adjustTableToFolio() const {
|
||||
bool AddTableDialog::adjustTableToFolio() const
|
||||
{
|
||||
return ui->m_adjust_table_size_cb->isChecked();
|
||||
}
|
||||
|
||||
@ -73,7 +75,8 @@ bool AddTableDialog::adjustTableToFolio() const {
|
||||
@brief AddTableDialog::addNewTableToNewDiagram
|
||||
@return
|
||||
*/
|
||||
bool AddTableDialog::addNewTableToNewDiagram() const {
|
||||
bool AddTableDialog::addNewTableToNewDiagram() const
|
||||
{
|
||||
return ui->m_add_table_and_folio->isChecked();
|
||||
}
|
||||
|
||||
@ -81,7 +84,8 @@ bool AddTableDialog::addNewTableToNewDiagram() const {
|
||||
@brief AddTableDialog::tableName
|
||||
@return
|
||||
*/
|
||||
QString AddTableDialog::tableName() const {
|
||||
QString AddTableDialog::tableName() const
|
||||
{
|
||||
return ui->m_table_name_le->text();
|
||||
}
|
||||
|
||||
@ -89,7 +93,8 @@ QString AddTableDialog::tableName() const {
|
||||
@brief AddTableDialog::headerMargins
|
||||
@return
|
||||
*/
|
||||
QMargins AddTableDialog::headerMargins() const {
|
||||
QMargins AddTableDialog::headerMargins() const
|
||||
{
|
||||
return m_header_margins;
|
||||
}
|
||||
|
||||
@ -113,7 +118,8 @@ Qt::Alignment AddTableDialog::headerAlignment() const
|
||||
@brief AddTableDialog::headerFont
|
||||
@return
|
||||
*/
|
||||
QFont AddTableDialog::headerFont() const {
|
||||
QFont AddTableDialog::headerFont() const
|
||||
{
|
||||
return m_header_font;
|
||||
}
|
||||
|
||||
@ -121,7 +127,8 @@ QFont AddTableDialog::headerFont() const {
|
||||
@brief AddTableDialog::tableMargins
|
||||
@return
|
||||
*/
|
||||
QMargins AddTableDialog::tableMargins() const {
|
||||
QMargins AddTableDialog::tableMargins() const
|
||||
{
|
||||
return m_table_margins;
|
||||
}
|
||||
|
||||
@ -145,11 +152,13 @@ Qt::Alignment AddTableDialog::tableAlignment() const
|
||||
@brief AddTableDialog::tableFont
|
||||
@return
|
||||
*/
|
||||
QFont AddTableDialog::tableFont() const {
|
||||
QFont AddTableDialog::tableFont() const
|
||||
{
|
||||
return m_table_font;
|
||||
}
|
||||
|
||||
QWidget *AddTableDialog::contentWidget() const {
|
||||
QWidget *AddTableDialog::contentWidget() const
|
||||
{
|
||||
return m_content_widget;
|
||||
}
|
||||
|
||||
|
@ -39,13 +39,15 @@ GenericPanel::GenericPanel(QWidget *parent) :
|
||||
/**
|
||||
Destructor
|
||||
*/
|
||||
GenericPanel::~GenericPanel() {
|
||||
GenericPanel::~GenericPanel()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@return the type of the current item
|
||||
*/
|
||||
int GenericPanel::currentItemType() {
|
||||
int GenericPanel::currentItemType()
|
||||
{
|
||||
QTreeWidgetItem *current_qtwi = currentItem();
|
||||
if (!current_qtwi) return(0);
|
||||
return(current_qtwi -> type());
|
||||
@ -56,7 +58,8 @@ int GenericPanel::currentItemType() {
|
||||
@param item
|
||||
@return nullptr
|
||||
*/
|
||||
QETProject *GenericPanel::projectForItem(QTreeWidgetItem *item) const {
|
||||
QETProject *GenericPanel::projectForItem(QTreeWidgetItem *item) const
|
||||
{
|
||||
if (item && item -> type() == QET::Project) {
|
||||
return(valueForItem<QETProject *>(item));
|
||||
}
|
||||
@ -69,7 +72,8 @@ QETProject *GenericPanel::projectForItem(QTreeWidgetItem *item) const {
|
||||
@param item
|
||||
@return nullptr
|
||||
*/
|
||||
Diagram *GenericPanel::diagramForItem(QTreeWidgetItem *item) const {
|
||||
Diagram *GenericPanel::diagramForItem(QTreeWidgetItem *item) const
|
||||
{
|
||||
if (item && item -> type() == QET::Diagram) {
|
||||
return(valueForItem<Diagram *>(item));
|
||||
}
|
||||
@ -82,7 +86,8 @@ Diagram *GenericPanel::diagramForItem(QTreeWidgetItem *item) const {
|
||||
@return TitleBlockTemplateLocation()
|
||||
*/
|
||||
TitleBlockTemplateLocation GenericPanel::templateLocationForItem(
|
||||
QTreeWidgetItem *item) const {
|
||||
QTreeWidgetItem *item) const
|
||||
{
|
||||
if (item && item -> type() & QET::TitleBlockTemplatesCollectionItem) {
|
||||
return(valueForItem<TitleBlockTemplateLocation>(item));
|
||||
}
|
||||
@ -93,7 +98,8 @@ TitleBlockTemplateLocation GenericPanel::templateLocationForItem(
|
||||
@brief GenericPanel::selectedProject
|
||||
@return projectForItem(currentItem())
|
||||
*/
|
||||
QETProject *GenericPanel::selectedProject() const {
|
||||
QETProject *GenericPanel::selectedProject() const
|
||||
{
|
||||
return(projectForItem(currentItem()));
|
||||
}
|
||||
|
||||
@ -101,7 +107,8 @@ QETProject *GenericPanel::selectedProject() const {
|
||||
@brief GenericPanel::selectedDiagram
|
||||
@return diagramForItem(currentItem())
|
||||
*/
|
||||
Diagram *GenericPanel::selectedDiagram() const {
|
||||
Diagram *GenericPanel::selectedDiagram() const
|
||||
{
|
||||
return(diagramForItem(currentItem()));
|
||||
}
|
||||
|
||||
@ -109,7 +116,8 @@ Diagram *GenericPanel::selectedDiagram() const {
|
||||
@brief GenericPanel::selectedTemplateLocation
|
||||
@return templateLocationForItem(currentItem())
|
||||
*/
|
||||
TitleBlockTemplateLocation GenericPanel::selectedTemplateLocation() const {
|
||||
TitleBlockTemplateLocation GenericPanel::selectedTemplateLocation() const
|
||||
{
|
||||
return(templateLocationForItem(currentItem()));
|
||||
}
|
||||
|
||||
@ -931,7 +939,8 @@ void GenericPanel::reparent(QTreeWidgetItem *item, QTreeWidgetItem *parent) {
|
||||
QList<QTreeWidgetItem *> GenericPanel::childItems(
|
||||
QTreeWidgetItem *item,
|
||||
QET::ItemType type,
|
||||
bool recursive) const {
|
||||
bool recursive) const
|
||||
{
|
||||
QList<QTreeWidgetItem *> items;
|
||||
if (!item) return(items);
|
||||
for (int i = 0 ; i < item -> childCount() ; ++ i) {
|
||||
@ -976,7 +985,8 @@ void GenericPanel::removeObsoleteItems(
|
||||
@return the value stored in \a item
|
||||
*/
|
||||
template<typename T>
|
||||
T GenericPanel::valueForItem(QTreeWidgetItem *item) const {
|
||||
T GenericPanel::valueForItem(QTreeWidgetItem *item) const
|
||||
{
|
||||
return item -> data(0, GenericPanel::Item).value<T>();
|
||||
}
|
||||
template TitleBlockTemplateLocation
|
||||
@ -1027,6 +1037,7 @@ bool GenericPanel::event(QEvent *event) {
|
||||
@brief GenericPanel::emitFirstActivated
|
||||
Emit the signal firstActivated().
|
||||
*/
|
||||
void GenericPanel::emitFirstActivated() {
|
||||
void GenericPanel::emitFirstActivated()
|
||||
{
|
||||
emit(firstActivated());
|
||||
}
|
||||
|
@ -51,7 +51,8 @@ NewElementWizard::NewElementWizard(QWidget *parent, Qt::WindowFlags f) :
|
||||
/**
|
||||
Destructeur
|
||||
*/
|
||||
NewElementWizard::~NewElementWizard() {
|
||||
NewElementWizard::~NewElementWizard()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -99,7 +100,8 @@ QWizardPage *NewElementWizard::buildStep1()
|
||||
@brief NewElementWizard::buildStep2
|
||||
@return
|
||||
*/
|
||||
QWizardPage *NewElementWizard::buildStep2() {
|
||||
QWizardPage *NewElementWizard::buildStep2()
|
||||
{
|
||||
QWizardPage *page = new QWizardPage();
|
||||
page -> setProperty("WizardState", Filename);
|
||||
page -> setTitle(tr("Étape 2/3 : Nom du fichier", "wizard page title"));
|
||||
@ -123,7 +125,8 @@ QWizardPage *NewElementWizard::buildStep2() {
|
||||
@brief NewElementWizard::buildStep3
|
||||
@return
|
||||
*/
|
||||
QWizardPage *NewElementWizard::buildStep3() {
|
||||
QWizardPage *NewElementWizard::buildStep3()
|
||||
{
|
||||
QWizardPage *page = new QWizardPage();
|
||||
page -> setProperty("WizardState", Names);
|
||||
page -> setTitle(tr("Étape 3/3 : Noms de l'élément", "wizard page title"));
|
||||
@ -202,7 +205,8 @@ bool NewElementWizard::validStep1()
|
||||
Valid the step 2
|
||||
@return true if step is valid
|
||||
*/
|
||||
bool NewElementWizard::validStep2() {
|
||||
bool NewElementWizard::validStep2()
|
||||
{
|
||||
QString file_name = m_qle_filename -> text();
|
||||
|
||||
if (file_name.isEmpty()) {
|
||||
@ -233,7 +237,8 @@ bool NewElementWizard::validStep2() {
|
||||
@brief NewElementWizard::createNewElement
|
||||
Lauch an element editor for create the new element
|
||||
*/
|
||||
void NewElementWizard::createNewElement() {
|
||||
void NewElementWizard::createNewElement()
|
||||
{
|
||||
QETElementEditor *edit_new_element = new QETElementEditor(parentWidget());
|
||||
edit_new_element -> setNames(m_names_list -> names());
|
||||
|
||||
|
@ -46,13 +46,15 @@ ProjectConfigPage::ProjectConfigPage(QETProject *project, QWidget *parent) :
|
||||
/**
|
||||
Destructor
|
||||
*/
|
||||
ProjectConfigPage::~ProjectConfigPage() {
|
||||
ProjectConfigPage::~ProjectConfigPage()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@return the project being edited by this page
|
||||
*/
|
||||
QETProject *ProjectConfigPage::project() const {
|
||||
QETProject *ProjectConfigPage::project() const
|
||||
{
|
||||
return(m_project);
|
||||
}
|
||||
|
||||
@ -81,7 +83,8 @@ QETProject *ProjectConfigPage::setProject(QETProject *new_project,
|
||||
/**
|
||||
Apply the configuration after user input
|
||||
*/
|
||||
void ProjectConfigPage::applyConf() {
|
||||
void ProjectConfigPage::applyConf()
|
||||
{
|
||||
if (!m_project || m_project -> isReadOnly()) return;
|
||||
applyProjectConf();
|
||||
}
|
||||
@ -91,7 +94,8 @@ void ProjectConfigPage::applyConf() {
|
||||
readValuesFromProject() and adjustReadOnly() if a non-zero project has been
|
||||
set. Typically, you should call this function in your subclass constructor.
|
||||
*/
|
||||
void ProjectConfigPage::init() {
|
||||
void ProjectConfigPage::init()
|
||||
{
|
||||
initWidgets();
|
||||
initLayout();
|
||||
if (m_project) {
|
||||
@ -116,27 +120,31 @@ ProjectMainConfigPage::ProjectMainConfigPage(QETProject *project, QWidget *paren
|
||||
/**
|
||||
Destructor
|
||||
*/
|
||||
ProjectMainConfigPage::~ProjectMainConfigPage() {
|
||||
ProjectMainConfigPage::~ProjectMainConfigPage()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@return the title for this page
|
||||
*/
|
||||
QString ProjectMainConfigPage::title() const {
|
||||
QString ProjectMainConfigPage::title() const
|
||||
{
|
||||
return(tr("Général", "configuration page title"));
|
||||
}
|
||||
|
||||
/**
|
||||
@return the icon for this page
|
||||
*/
|
||||
QIcon ProjectMainConfigPage::icon() const {
|
||||
QIcon ProjectMainConfigPage::icon() const
|
||||
{
|
||||
return(QET::Icons::Settings);
|
||||
}
|
||||
|
||||
/**
|
||||
Apply the configuration after user input
|
||||
*/
|
||||
void ProjectMainConfigPage::applyProjectConf() {
|
||||
void ProjectMainConfigPage::applyProjectConf()
|
||||
{
|
||||
bool modified_project = false;
|
||||
|
||||
QString new_title = title_value_ -> text();
|
||||
@ -158,14 +166,16 @@ void ProjectMainConfigPage::applyProjectConf() {
|
||||
/**
|
||||
@return the project title entered by the user
|
||||
*/
|
||||
QString ProjectMainConfigPage::projectTitle() const {
|
||||
QString ProjectMainConfigPage::projectTitle() const
|
||||
{
|
||||
return(title_value_ -> text());
|
||||
}
|
||||
|
||||
/**
|
||||
Initialize widgets displayed by the page.
|
||||
*/
|
||||
void ProjectMainConfigPage::initWidgets() {
|
||||
void ProjectMainConfigPage::initWidgets()
|
||||
{
|
||||
title_label_ = new QLabel(tr("Titre du projet :", "label when configuring"));
|
||||
title_value_ = new QLineEdit();
|
||||
title_information_ = new QLabel(tr("Ce titre sera disponible pour tous les folios de ce projet en tant que %projecttitle.", "informative label"));
|
||||
@ -183,7 +193,8 @@ void ProjectMainConfigPage::initWidgets() {
|
||||
/**
|
||||
Initialize the layout of this page.
|
||||
*/
|
||||
void ProjectMainConfigPage::initLayout() {
|
||||
void ProjectMainConfigPage::initLayout()
|
||||
{
|
||||
QVBoxLayout *main_layout0 = new QVBoxLayout();
|
||||
QHBoxLayout *title_layout0 = new QHBoxLayout();
|
||||
title_layout0 -> addWidget(title_label_);
|
||||
@ -201,7 +212,8 @@ void ProjectMainConfigPage::initLayout() {
|
||||
/**
|
||||
Read properties from the edited project then fill widgets with them.
|
||||
*/
|
||||
void ProjectMainConfigPage::readValuesFromProject() {
|
||||
void ProjectMainConfigPage::readValuesFromProject()
|
||||
{
|
||||
title_value_ -> setText(m_project -> title());
|
||||
project_variables_ -> setContext(m_project -> projectProperties());
|
||||
}
|
||||
@ -210,7 +222,8 @@ void ProjectMainConfigPage::readValuesFromProject() {
|
||||
Set the content of this page read only if the project is read only,
|
||||
editable if the project is editable.
|
||||
*/
|
||||
void ProjectMainConfigPage::adjustReadOnly() {
|
||||
void ProjectMainConfigPage::adjustReadOnly()
|
||||
{
|
||||
bool is_read_only = m_project -> isReadOnly();
|
||||
title_value_ -> setReadOnly(is_read_only);
|
||||
}
|
||||
@ -237,7 +250,8 @@ ProjectAutoNumConfigPage::ProjectAutoNumConfigPage (QETProject *project,
|
||||
Title of this config page
|
||||
@return
|
||||
*/
|
||||
QString ProjectAutoNumConfigPage::title() const {
|
||||
QString ProjectAutoNumConfigPage::title() const
|
||||
{
|
||||
return tr("Numérotation auto");
|
||||
}
|
||||
|
||||
@ -246,14 +260,16 @@ QString ProjectAutoNumConfigPage::title() const {
|
||||
Icon of this config pafe
|
||||
@return
|
||||
*/
|
||||
QIcon ProjectAutoNumConfigPage::icon() const {
|
||||
QIcon ProjectAutoNumConfigPage::icon() const
|
||||
{
|
||||
return QIcon (QET::Icons::AutoNum);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief ProjectAutoNumConfigPage::applyProjectConf
|
||||
*/
|
||||
void ProjectAutoNumConfigPage::applyProjectConf() {}
|
||||
void ProjectAutoNumConfigPage::applyProjectConf()
|
||||
{}
|
||||
|
||||
/**
|
||||
@brief ProjectAutoNumConfigPage::initWidgets
|
||||
@ -314,7 +330,8 @@ void ProjectAutoNumConfigPage::readValuesFromProject()
|
||||
@brief ProjectAutoNumConfigPage::adjustReadOnly
|
||||
set this config page disable if project is read only
|
||||
*/
|
||||
void ProjectAutoNumConfigPage::adjustReadOnly() {
|
||||
void ProjectAutoNumConfigPage::adjustReadOnly()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -460,7 +477,8 @@ void ProjectAutoNumConfigPage::saveContextConductor()
|
||||
@brief ProjectAutoNumConfigPage::saveContext_folio
|
||||
Save the current displayed folio context in project
|
||||
*/
|
||||
void ProjectAutoNumConfigPage::saveContextFolio() {
|
||||
void ProjectAutoNumConfigPage::saveContextFolio()
|
||||
{
|
||||
// If the text is the default text "Name of new numerotation" save the edited context
|
||||
// With the the name "No name"
|
||||
if (m_saw_folio->contextComboBox() -> currentText() == tr("Nom de la nouvelle numérotation")) {
|
||||
@ -483,7 +501,8 @@ void ProjectAutoNumConfigPage::saveContextFolio() {
|
||||
@brief ProjectAutoNumConfigPage::applyAutoNum
|
||||
Apply auto folio numbering, New Folios or Selected Folios
|
||||
*/
|
||||
void ProjectAutoNumConfigPage::applyAutoNum() {
|
||||
void ProjectAutoNumConfigPage::applyAutoNum()
|
||||
{
|
||||
|
||||
if (m_faw->newFolios){
|
||||
int foliosRemaining = m_faw->newFoliosNumber();
|
||||
@ -507,7 +526,8 @@ void ProjectAutoNumConfigPage::applyAutoNum() {
|
||||
@brief ProjectAutoNumConfigPage::applyAutoManagement
|
||||
Apply Management Options in Selected Folios
|
||||
*/
|
||||
void ProjectAutoNumConfigPage::applyManagement() {
|
||||
void ProjectAutoNumConfigPage::applyManagement()
|
||||
{
|
||||
int from;
|
||||
int to;
|
||||
//Apply to Entire Project
|
||||
@ -601,7 +621,8 @@ void ProjectAutoNumConfigPage::applyManagement() {
|
||||
@brief ProjectAutoNumConfigPage::removeContext
|
||||
Remove from project the current conductor numerotation context
|
||||
*/
|
||||
void ProjectAutoNumConfigPage::removeContextConductor() {
|
||||
void ProjectAutoNumConfigPage::removeContextConductor()
|
||||
{
|
||||
//if default text, return
|
||||
if ( m_saw_conductor->contextComboBox()-> currentText() == tr("Nom de la nouvelle numérotation") ) return;
|
||||
m_project -> removeConductorAutoNum (m_saw_conductor->contextComboBox()-> currentText() );
|
||||
@ -613,7 +634,8 @@ void ProjectAutoNumConfigPage::removeContextConductor() {
|
||||
@brief ProjectAutoNumConfigPage::removeContext_folio
|
||||
Remove from project the current folio numerotation context
|
||||
*/
|
||||
void ProjectAutoNumConfigPage::removeContextFolio() {
|
||||
void ProjectAutoNumConfigPage::removeContextFolio()
|
||||
{
|
||||
//if default text, return
|
||||
if ( m_saw_folio->contextComboBox() -> currentText() == tr("Nom de la nouvelle numérotation") ) return;
|
||||
m_project -> removeFolioAutoNum (m_saw_folio->contextComboBox() -> currentText() );
|
||||
|
@ -54,7 +54,8 @@ ProjectView::ProjectView(QETProject *project, QWidget *parent) :
|
||||
Destructeur
|
||||
Supprime les DiagramView embarquees
|
||||
*/
|
||||
ProjectView::~ProjectView() {
|
||||
ProjectView::~ProjectView()
|
||||
{
|
||||
for (auto dv_ : m_diagram_ids.values())
|
||||
dv_->deleteLater();
|
||||
}
|
||||
@ -62,7 +63,8 @@ ProjectView::~ProjectView() {
|
||||
/**
|
||||
@return le projet actuellement visualise par le ProjectView
|
||||
*/
|
||||
QETProject *ProjectView::project() {
|
||||
QETProject *ProjectView::project()
|
||||
{
|
||||
return(m_project);
|
||||
}
|
||||
|
||||
@ -94,7 +96,8 @@ void ProjectView::setProject(QETProject *project)
|
||||
/**
|
||||
@return la liste des schemas ouverts dans le projet
|
||||
*/
|
||||
QList<DiagramView *> ProjectView::diagram_views() const {
|
||||
QList<DiagramView *> ProjectView::diagram_views() const
|
||||
{
|
||||
return(m_diagram_view_list);
|
||||
}
|
||||
|
||||
@ -102,7 +105,8 @@ QList<DiagramView *> ProjectView::diagram_views() const {
|
||||
@brief ProjectView::currentDiagram
|
||||
@return The current active diagram view or nullptr if there isn't diagramView in this project view.
|
||||
*/
|
||||
DiagramView *ProjectView::currentDiagram() const {
|
||||
DiagramView *ProjectView::currentDiagram() const
|
||||
{
|
||||
int current_tab_index = m_tab -> currentIndex();
|
||||
if (current_tab_index == -1)
|
||||
return nullptr;
|
||||
@ -126,7 +130,8 @@ void ProjectView::closeEvent(QCloseEvent *qce) {
|
||||
/**
|
||||
@brief change current diagramview to next folio
|
||||
*/
|
||||
void ProjectView::changeTabDown(){
|
||||
void ProjectView::changeTabDown()
|
||||
{
|
||||
DiagramView *nextDiagramView = this->nextDiagram();
|
||||
if (nextDiagramView!=nullptr){
|
||||
rebuildDiagramsMap();
|
||||
@ -137,7 +142,8 @@ void ProjectView::changeTabDown(){
|
||||
/**
|
||||
@return next folio of current diagramview
|
||||
*/
|
||||
DiagramView *ProjectView::nextDiagram() {
|
||||
DiagramView *ProjectView::nextDiagram()
|
||||
{
|
||||
int current_tab_index = m_tab -> currentIndex();
|
||||
int next_tab_index = current_tab_index + 1; //get next tab index
|
||||
if (next_tab_index<m_diagram_ids.count()) //if next tab index >= greatest tab the last tab is activated so no need to change tab.
|
||||
@ -149,7 +155,8 @@ DiagramView *ProjectView::nextDiagram() {
|
||||
/**
|
||||
@brief change current diagramview to previous tab
|
||||
*/
|
||||
void ProjectView::changeTabUp(){
|
||||
void ProjectView::changeTabUp()
|
||||
{
|
||||
DiagramView *previousDiagramView = this->previousDiagram();
|
||||
if (previousDiagramView!=nullptr){
|
||||
rebuildDiagramsMap();
|
||||
@ -160,7 +167,8 @@ void ProjectView::changeTabUp(){
|
||||
/**
|
||||
@return previous folio of current diagramview
|
||||
*/
|
||||
DiagramView *ProjectView::previousDiagram() {
|
||||
DiagramView *ProjectView::previousDiagram()
|
||||
{
|
||||
int current_tab_index = m_tab -> currentIndex();
|
||||
int previous_tab_index = current_tab_index - 1; //get previous tab index
|
||||
if (previous_tab_index>=0) //if previous tab index = 0 then the first tab is activated so no need to change tab.
|
||||
@ -172,7 +180,8 @@ DiagramView *ProjectView::previousDiagram() {
|
||||
/**
|
||||
@brief change current diagramview to last tab
|
||||
*/
|
||||
void ProjectView::changeLastTab(){
|
||||
void ProjectView::changeLastTab()
|
||||
{
|
||||
DiagramView *lastDiagramView = this->lastDiagram();
|
||||
m_tab->setCurrentWidget(lastDiagramView);
|
||||
}
|
||||
@ -180,14 +189,16 @@ void ProjectView::changeLastTab(){
|
||||
/**
|
||||
@return last folio of current project
|
||||
*/
|
||||
DiagramView *ProjectView::lastDiagram(){
|
||||
DiagramView *ProjectView::lastDiagram()
|
||||
{
|
||||
return(m_diagram_ids.last());
|
||||
}
|
||||
|
||||
/**
|
||||
@brief change current diagramview to first tab
|
||||
*/
|
||||
void ProjectView::changeFirstTab(){
|
||||
void ProjectView::changeFirstTab()
|
||||
{
|
||||
DiagramView *firstDiagramView = this->firstDiagram();
|
||||
m_tab->setCurrentWidget(firstDiagramView);
|
||||
}
|
||||
@ -195,7 +206,8 @@ void ProjectView::changeFirstTab(){
|
||||
/**
|
||||
@return first folio of current project
|
||||
*/
|
||||
DiagramView *ProjectView::firstDiagram(){
|
||||
DiagramView *ProjectView::firstDiagram()
|
||||
{
|
||||
return(m_diagram_ids.first());
|
||||
}
|
||||
|
||||
@ -208,7 +220,8 @@ DiagramView *ProjectView::firstDiagram(){
|
||||
@see tryClosingElementEditors()
|
||||
@see tryClosingDiagrams()
|
||||
*/
|
||||
bool ProjectView::tryClosing() {
|
||||
bool ProjectView::tryClosing()
|
||||
{
|
||||
if (!m_project) return(true);
|
||||
|
||||
// First step: require external editors closing -- users may either cancel
|
||||
@ -257,7 +270,8 @@ bool ProjectView::tryClosing() {
|
||||
d'un editeur d'element.
|
||||
@return true si tous les editeurs d'element ont pu etre fermes, false sinon
|
||||
*/
|
||||
bool ProjectView::tryClosingElementEditors() {
|
||||
bool ProjectView::tryClosingElementEditors()
|
||||
{
|
||||
if (!m_project) return(true);
|
||||
/*
|
||||
La QETApp permet d'acceder rapidement aux editeurs d'element
|
||||
@ -281,7 +295,8 @@ bool ProjectView::tryClosingElementEditors() {
|
||||
a dialog ask if user want to save the modification.
|
||||
@return the answer of dialog or discard if no change.
|
||||
*/
|
||||
int ProjectView::tryClosingDiagrams() {
|
||||
int ProjectView::tryClosingDiagrams()
|
||||
{
|
||||
if (!m_project) return(QMessageBox::Discard);
|
||||
|
||||
if (!project()->projectOptionsWereModified() &&
|
||||
@ -339,7 +354,8 @@ QString ProjectView::askUserForFilePath(bool assign) {
|
||||
@return the QETResult object to be returned when it appears this project
|
||||
view is not associated to any project.
|
||||
*/
|
||||
QETResult ProjectView::noProjectResult() const {
|
||||
QETResult ProjectView::noProjectResult() const
|
||||
{
|
||||
QETResult no_project(tr("aucun projet affiché", "error message"), false);
|
||||
return(no_project);
|
||||
}
|
||||
@ -421,7 +437,8 @@ void ProjectView::showDiagram(Diagram *diagram) {
|
||||
Enable the user to edit properties of the current project through a
|
||||
configuration dialog.
|
||||
*/
|
||||
void ProjectView::editProjectProperties() {
|
||||
void ProjectView::editProjectProperties()
|
||||
{
|
||||
if (!m_project) return;
|
||||
ProjectPropertiesDialog dialog(m_project, parentWidget());
|
||||
dialog.exec();
|
||||
@ -430,7 +447,8 @@ void ProjectView::editProjectProperties() {
|
||||
/**
|
||||
Edite les proprietes du schema courant
|
||||
*/
|
||||
void ProjectView::editCurrentDiagramProperties() {
|
||||
void ProjectView::editCurrentDiagramProperties()
|
||||
{
|
||||
editDiagramProperties(currentDiagram());
|
||||
}
|
||||
|
||||
@ -561,7 +579,8 @@ void ProjectView::moveDiagramDownx10(Diagram *diagram) {
|
||||
Ce slot demarre un dialogue permettant a l'utilisateur de parametrer et de
|
||||
lancer l'impression de toute ou partie du projet.
|
||||
*/
|
||||
void ProjectView::printProject() {
|
||||
void ProjectView::printProject()
|
||||
{
|
||||
if (!m_project) return;
|
||||
|
||||
// transforme le titre du projet en nom utilisable pour le document
|
||||
@ -591,7 +610,8 @@ void ProjectView::printProject() {
|
||||
/**
|
||||
Exporte le schema.
|
||||
*/
|
||||
void ProjectView::exportProject() {
|
||||
void ProjectView::exportProject()
|
||||
{
|
||||
if (!m_project) return;
|
||||
|
||||
ExportDialog ed(m_project, parentWidget());
|
||||
@ -607,7 +627,8 @@ void ProjectView::exportProject() {
|
||||
@see setFilePath()
|
||||
@return a QETResult object reflecting the situation
|
||||
*/
|
||||
QETResult ProjectView::save() {
|
||||
QETResult ProjectView::save()
|
||||
{
|
||||
return(doSave());
|
||||
}
|
||||
|
||||
@ -658,7 +679,8 @@ QETResult ProjectView::doSave()
|
||||
@return an integer value above zero if elements and/or categories were
|
||||
cleaned.
|
||||
*/
|
||||
int ProjectView::cleanProject() {
|
||||
int ProjectView::cleanProject()
|
||||
{
|
||||
if (!m_project) return(0);
|
||||
|
||||
// s'assure que le schema n'est pas en lecture seule
|
||||
@ -733,7 +755,8 @@ void ProjectView::initActions()
|
||||
/**
|
||||
Initialize child widgets for this widget.
|
||||
*/
|
||||
void ProjectView::initWidgets() {
|
||||
void ProjectView::initWidgets()
|
||||
{
|
||||
setObjectName("ProjectView");
|
||||
setWindowIcon(QET::Icons::ProjectFileGP);
|
||||
|
||||
@ -790,7 +813,8 @@ void ProjectView::initWidgets() {
|
||||
/**
|
||||
Initialize layout for this widget.
|
||||
*/
|
||||
void ProjectView::initLayout() {
|
||||
void ProjectView::initLayout()
|
||||
{
|
||||
QVBoxLayout *fallback_widget_layout_ = new QVBoxLayout(fallback_widget_);
|
||||
fallback_widget_layout_ -> addWidget(fallback_label_);
|
||||
|
||||
@ -849,7 +873,8 @@ void ProjectView::loadDiagrams()
|
||||
@brief ProjectView::updateWindowTitle
|
||||
Update the project view title
|
||||
*/
|
||||
void ProjectView::updateWindowTitle() {
|
||||
void ProjectView::updateWindowTitle()
|
||||
{
|
||||
QString title;
|
||||
if (m_project) {
|
||||
title = m_project -> pathNameTitle();
|
||||
@ -863,7 +888,8 @@ void ProjectView::updateWindowTitle() {
|
||||
Effectue les actions necessaires lorsque le projet visualise entre ou sort
|
||||
du mode lecture seule.
|
||||
*/
|
||||
void ProjectView::adjustReadOnlyState() {
|
||||
void ProjectView::adjustReadOnlyState()
|
||||
{
|
||||
bool editable = !(m_project -> isReadOnly());
|
||||
|
||||
// prevent users from moving existing diagrams
|
||||
@ -984,7 +1010,8 @@ DiagramView *ProjectView::findDiagram(Diagram *diagram) {
|
||||
/**
|
||||
Reconstruit la map associant les index des onglets avec les DiagramView
|
||||
*/
|
||||
void ProjectView::rebuildDiagramsMap() {
|
||||
void ProjectView::rebuildDiagramsMap()
|
||||
{
|
||||
// vide la map
|
||||
m_diagram_ids.clear();
|
||||
|
||||
|
@ -15,7 +15,8 @@ TerminalData::TerminalData(QGraphicsObject *parent):
|
||||
init();
|
||||
}
|
||||
|
||||
void TerminalData::init() {
|
||||
void TerminalData::init()
|
||||
{
|
||||
}
|
||||
|
||||
TerminalData::~TerminalData()
|
||||
|
@ -42,7 +42,8 @@ XRefProperties::XRefProperties()
|
||||
@param prefix: prefix before properties name
|
||||
*/
|
||||
void XRefProperties::toSettings(QSettings &settings,
|
||||
const QString prefix) const {
|
||||
const QString prefix) const
|
||||
{
|
||||
settings.setValue(prefix + "showpowerctc", m_show_power_ctc);
|
||||
QString display = m_display == Cross? "cross" : "contacts";
|
||||
settings.setValue(prefix + "displayhas", display);
|
||||
@ -96,7 +97,8 @@ void XRefProperties::fromSettings(const QSettings &settings,
|
||||
@param xml_document : QDomElement to use for saving
|
||||
@return QDomElement
|
||||
*/
|
||||
QDomElement XRefProperties::toXml(QDomDocument &xml_document) const {
|
||||
QDomElement XRefProperties::toXml(QDomDocument &xml_document) const
|
||||
{
|
||||
|
||||
QDomElement xml_element = xml_document.createElement("xref");
|
||||
xml_element.setAttribute("type", m_key);
|
||||
@ -191,7 +193,8 @@ bool XRefProperties::operator ==(const XRefProperties &xrp) const{
|
||||
m_xref_pos == xrp.m_xref_pos );
|
||||
}
|
||||
|
||||
bool XRefProperties::operator !=(const XRefProperties &xrp) const {
|
||||
bool XRefProperties::operator !=(const XRefProperties &xrp) const
|
||||
{
|
||||
return (! (*this == xrp));
|
||||
}
|
||||
|
||||
|
@ -371,7 +371,8 @@ QList<QDomElement> QET::findInDomElement(const QDomElement &e,
|
||||
}
|
||||
|
||||
/// @return le texte de la licence de QElectroTech (GNU/GPL)
|
||||
QString QET::license() {
|
||||
QString QET::license()
|
||||
{
|
||||
// Recuperation du texte de la GNU/GPL dans un fichier integre a l'application
|
||||
QFile *file_license = new QFile(":/LICENSE");
|
||||
QString txt_license;
|
||||
@ -399,7 +400,8 @@ QString QET::license() {
|
||||
@return la liste des caracteres interdits dans les noms de fichiers sous
|
||||
Windows
|
||||
*/
|
||||
QList<QChar> QET::forbiddenCharacters() {
|
||||
QList<QChar> QET::forbiddenCharacters()
|
||||
{
|
||||
return(QList<QChar>() << '\\' << '/' << ':' << '*' << '?' << '"'
|
||||
<< '<' << '>' << '|');
|
||||
}
|
||||
|
@ -261,7 +261,8 @@ void QETApp::systray(QSystemTrayIcon::ActivationReason reason) {
|
||||
Minimizes all application windows in the systray
|
||||
\~French Reduit toutes les fenetres de l'application dans le systray
|
||||
*/
|
||||
void QETApp::reduceEveryEditor() {
|
||||
void QETApp::reduceEveryEditor()
|
||||
{
|
||||
reduceDiagramEditors();
|
||||
reduceElementEditors();
|
||||
reduceTitleBlockTemplateEditors();
|
||||
@ -273,7 +274,8 @@ void QETApp::reduceEveryEditor() {
|
||||
Restores all application windows in the systray
|
||||
\~French Restaure toutes les fenetres de l'application dans le systray
|
||||
*/
|
||||
void QETApp::restoreEveryEditor() {
|
||||
void QETApp::restoreEveryEditor()
|
||||
{
|
||||
restoreDiagramEditors();
|
||||
restoreElementEditors();
|
||||
restoreTitleBlockTemplateEditors();
|
||||
@ -285,7 +287,8 @@ void QETApp::restoreEveryEditor() {
|
||||
Minimize all schema editors in the systray
|
||||
\~French Reduit tous les editeurs de schemas dans le systray
|
||||
*/
|
||||
void QETApp::reduceDiagramEditors() {
|
||||
void QETApp::reduceDiagramEditors()
|
||||
{
|
||||
setMainWindowsVisible<QETDiagramEditor>(false);
|
||||
}
|
||||
|
||||
@ -294,7 +297,8 @@ void QETApp::reduceDiagramEditors() {
|
||||
Restore all schema editors in the systray
|
||||
\~French Restaure tous les editeurs de schemas dans le systray
|
||||
*/
|
||||
void QETApp::restoreDiagramEditors() {
|
||||
void QETApp::restoreDiagramEditors()
|
||||
{
|
||||
setMainWindowsVisible<QETDiagramEditor>(true);
|
||||
}
|
||||
|
||||
@ -304,7 +308,8 @@ void QETApp::restoreDiagramEditors() {
|
||||
Minimize all element editors in systray
|
||||
\~French Reduit tous les editeurs d'element dans le systray
|
||||
*/
|
||||
void QETApp::reduceElementEditors() {
|
||||
void QETApp::reduceElementEditors()
|
||||
{
|
||||
setMainWindowsVisible<QETElementEditor>(false);
|
||||
}
|
||||
|
||||
@ -313,7 +318,8 @@ void QETApp::reduceElementEditors() {
|
||||
Restore all element editors in the systray
|
||||
\~French Restaure tous les editeurs d'element dans le systray
|
||||
*/
|
||||
void QETApp::restoreElementEditors() {
|
||||
void QETApp::restoreElementEditors()
|
||||
{
|
||||
setMainWindowsVisible<QETElementEditor>(true);
|
||||
}
|
||||
|
||||
@ -321,7 +327,8 @@ void QETApp::restoreElementEditors() {
|
||||
@brief QETApp::reduceTitleBlockTemplateEditors
|
||||
Reduce all known template editors
|
||||
*/
|
||||
void QETApp::reduceTitleBlockTemplateEditors() {
|
||||
void QETApp::reduceTitleBlockTemplateEditors()
|
||||
{
|
||||
setMainWindowsVisible<QETTitleBlockTemplateEditor>(false);
|
||||
}
|
||||
|
||||
@ -329,7 +336,8 @@ void QETApp::reduceTitleBlockTemplateEditors() {
|
||||
@brief QETApp::restoreTitleBlockTemplateEditors
|
||||
Restore all known template editors
|
||||
*/
|
||||
void QETApp::restoreTitleBlockTemplateEditors() {
|
||||
void QETApp::restoreTitleBlockTemplateEditors()
|
||||
{
|
||||
setMainWindowsVisible<QETTitleBlockTemplateEditor>(true);
|
||||
}
|
||||
|
||||
@ -338,7 +346,8 @@ void QETApp::restoreTitleBlockTemplateEditors() {
|
||||
launches a new schema editor
|
||||
\~French lance un nouvel editeur de schemas
|
||||
*/
|
||||
void QETApp::newDiagramEditor() {
|
||||
void QETApp::newDiagramEditor()
|
||||
{
|
||||
new QETDiagramEditor();
|
||||
}
|
||||
|
||||
@ -347,7 +356,8 @@ void QETApp::newDiagramEditor() {
|
||||
launches a new element editor
|
||||
\~French lance un nouvel editeur d'element
|
||||
*/
|
||||
void QETApp::newElementEditor() {
|
||||
void QETApp::newElementEditor()
|
||||
{
|
||||
new QETElementEditor();
|
||||
}
|
||||
|
||||
@ -355,7 +365,8 @@ void QETApp::newElementEditor() {
|
||||
@brief QETApp::collectionCache
|
||||
@return the collection cache provided by the application itself.
|
||||
*/
|
||||
ElementsCollectionCache *QETApp::collectionCache() {
|
||||
ElementsCollectionCache *QETApp::collectionCache()
|
||||
{
|
||||
return(collections_cache_);
|
||||
}
|
||||
|
||||
@ -510,7 +521,8 @@ QString QETApp::diagramTranslatedInfoKey(const QString &key)
|
||||
@return the common title block templates collection,
|
||||
i.e. the one provided by QElecrotTech
|
||||
*/
|
||||
TitleBlockTemplatesFilesCollection *QETApp::commonTitleBlockTemplatesCollection() {
|
||||
TitleBlockTemplatesFilesCollection *QETApp::commonTitleBlockTemplatesCollection()
|
||||
{
|
||||
if (!m_common_tbt_collection) {
|
||||
m_common_tbt_collection =
|
||||
new TitleBlockTemplatesFilesCollection(
|
||||
@ -530,7 +542,8 @@ TitleBlockTemplatesFilesCollection *QETApp::commonTitleBlockTemplatesCollection(
|
||||
@return the custom title block templates collection,
|
||||
i.e. the one managed by the end user
|
||||
*/
|
||||
TitleBlockTemplatesFilesCollection *QETApp::customTitleBlockTemplatesCollection() {
|
||||
TitleBlockTemplatesFilesCollection *QETApp::customTitleBlockTemplatesCollection()
|
||||
{
|
||||
if (!m_custom_tbt_collection) {
|
||||
m_custom_tbt_collection =
|
||||
new TitleBlockTemplatesFilesCollection(
|
||||
@ -549,7 +562,8 @@ TitleBlockTemplatesFilesCollection *QETApp::customTitleBlockTemplatesCollection(
|
||||
@return the list of all available title block tempaltes collections,
|
||||
beginning with the common and custom ones, plus the projects-embedded ones.
|
||||
*/
|
||||
QList<TitleBlockTemplatesCollection *> QETApp::availableTitleBlockTemplatesCollections() {
|
||||
QList<TitleBlockTemplatesCollection *> QETApp::availableTitleBlockTemplatesCollections()
|
||||
{
|
||||
QList<TitleBlockTemplatesCollection *> collections_list;
|
||||
|
||||
collections_list << commonTitleBlockTemplatesCollection();
|
||||
@ -718,7 +732,8 @@ void QETApp::resetUserElementsDir()
|
||||
@return the path of the directory containing the common title block
|
||||
templates collection.
|
||||
*/
|
||||
QString QETApp::commonTitleBlockTemplatesDir() {
|
||||
QString QETApp::commonTitleBlockTemplatesDir()
|
||||
{
|
||||
#ifdef QET_ALLOW_OVERRIDE_CTBTD_OPTION
|
||||
if (common_tbt_dir_ != QString()) return(common_tbt_dir_);
|
||||
#endif
|
||||
@ -747,7 +762,8 @@ QString QETApp::commonTitleBlockTemplatesDir() {
|
||||
@return the path of the directory containing the custom title block
|
||||
templates collection.
|
||||
*/
|
||||
QString QETApp::customTitleBlockTemplatesDir() {
|
||||
QString QETApp::customTitleBlockTemplatesDir()
|
||||
{
|
||||
if (m_user_custom_tbt_dir.isEmpty())
|
||||
{
|
||||
QSettings settings;
|
||||
@ -794,7 +810,8 @@ QString QETApp::customTitleBlockTemplatesDir() {
|
||||
\~ @return The path of the QElectroTech configuration folder
|
||||
\~French Le chemin du dossier de configuration de QElectroTech
|
||||
*/
|
||||
QString QETApp::configDir() {
|
||||
QString QETApp::configDir()
|
||||
{
|
||||
#ifdef QET_ALLOW_OVERRIDE_CD_OPTION
|
||||
if (config_dir != QString()) return(config_dir);
|
||||
#endif
|
||||
@ -888,7 +905,8 @@ QString QETApp::symbolicPath(const QString &real_path) {
|
||||
@return the list of file extensions QElectroTech is able to open and
|
||||
supposed to handle. Note they are provided with no leading point.
|
||||
*/
|
||||
QStringList QETApp::handledFileExtensions() {
|
||||
QStringList QETApp::handledFileExtensions()
|
||||
{
|
||||
static QStringList ext;
|
||||
if (!ext.count()) {
|
||||
ext << "qet";
|
||||
@ -1036,7 +1054,8 @@ void QETApp::overrideLangDir(const QString &new_ld) {
|
||||
@return The path of the folder containing the language files
|
||||
\~French Le chemin du dossier contenant les fichiers de langue
|
||||
*/
|
||||
QString QETApp::languagesPath() {
|
||||
QString QETApp::languagesPath()
|
||||
{
|
||||
if (!lang_dir.isEmpty()) {
|
||||
return(lang_dir);
|
||||
} else {
|
||||
@ -1076,7 +1095,8 @@ QString QETApp::languagesPath() {
|
||||
\~French true si l'utilisateur a accepte toutes les fermetures,
|
||||
false sinon
|
||||
*/
|
||||
bool QETApp::closeEveryEditor() {
|
||||
bool QETApp::closeEveryEditor()
|
||||
{
|
||||
// make sure all windows are visible before leaving
|
||||
// s'assure que toutes les fenetres soient visibles avant de quitter
|
||||
restoreEveryEditor();
|
||||
@ -1203,7 +1223,8 @@ QFont QETApp::indiTextsItemFont(qreal size)
|
||||
@return schema editors
|
||||
\~French les editeurs de schemas
|
||||
*/
|
||||
QList<QETDiagramEditor *> QETApp::diagramEditors() {
|
||||
QList<QETDiagramEditor *> QETApp::diagramEditors()
|
||||
{
|
||||
return(QETApp::instance() -> detectWindows<QETDiagramEditor>());
|
||||
}
|
||||
|
||||
@ -1212,7 +1233,8 @@ QList<QETDiagramEditor *> QETApp::diagramEditors() {
|
||||
@return element editors
|
||||
\~French les editeurs d'elements
|
||||
*/
|
||||
QList<QETElementEditor *> QETApp::elementEditors() {
|
||||
QList<QETElementEditor *> QETApp::elementEditors()
|
||||
{
|
||||
return(QETApp::instance() -> detectWindows<QETElementEditor>());
|
||||
}
|
||||
|
||||
@ -1220,7 +1242,8 @@ QList<QETElementEditor *> QETApp::elementEditors() {
|
||||
@brief QETApp::titleBlockTemplateEditors
|
||||
@return the title block template editors
|
||||
*/
|
||||
QList<QETTitleBlockTemplateEditor *> QETApp::titleBlockTemplateEditors() {
|
||||
QList<QETTitleBlockTemplateEditor *> QETApp::titleBlockTemplateEditors()
|
||||
{
|
||||
return(QETApp::instance() -> detectWindows<QETTitleBlockTemplateEditor>());
|
||||
}
|
||||
|
||||
@ -1261,7 +1284,8 @@ QList<QETTitleBlockTemplateEditor *> QETApp::titleBlockTemplateEditors(
|
||||
\~ @return
|
||||
\~ @see QTextOrientationSpinBoxWidget
|
||||
*/
|
||||
QTextOrientationSpinBoxWidget *QETApp::createTextOrientationSpinBoxWidget() {
|
||||
QTextOrientationSpinBoxWidget *QETApp::createTextOrientationSpinBoxWidget()
|
||||
{
|
||||
QTextOrientationSpinBoxWidget *widget = new QTextOrientationSpinBoxWidget();
|
||||
widget -> orientationWidget() -> setFont(QETApp::diagramTextsFont());
|
||||
widget -> orientationWidget() -> setUsableTexts(QList<QString>()
|
||||
@ -1283,7 +1307,8 @@ QTextOrientationSpinBoxWidget *QETApp::createTextOrientationSpinBoxWidget() {
|
||||
@brief QETApp::defaultTitleBlockTemplate
|
||||
@return the default titleblock template for diagrams
|
||||
*/
|
||||
TitleBlockTemplate *QETApp::defaultTitleBlockTemplate() {
|
||||
TitleBlockTemplate *QETApp::defaultTitleBlockTemplate()
|
||||
{
|
||||
if (!QETApp::default_titleblock_template_) {
|
||||
TitleBlockTemplate *titleblock_template = new TitleBlockTemplate(QETApp::instance());
|
||||
if (titleblock_template -> loadFromXmlFile(":/titleblocks/default.titleblock")) {
|
||||
@ -1349,7 +1374,8 @@ void QETApp::receiveMessage(int instanceId, QByteArray message)
|
||||
@param T a class inheriting QMainWindow
|
||||
@return the list of windows of type T
|
||||
*/
|
||||
template <class T> QList<T *> QETApp::detectWindows() const {
|
||||
template <class T> QList<T *> QETApp::detectWindows() const
|
||||
{
|
||||
QList<T *> windows;
|
||||
foreach(QWidget *widget, qApp->topLevelWidgets()) {
|
||||
if (!widget -> isWindow()) continue;
|
||||
@ -1375,7 +1401,8 @@ template <class T> void QETApp::setMainWindowsVisible(bool visible) {
|
||||
@return The list of recent files for projects
|
||||
\~French La liste des fichiers recents pour les projets
|
||||
*/
|
||||
RecentFiles *QETApp::projectsRecentFiles() {
|
||||
RecentFiles *QETApp::projectsRecentFiles()
|
||||
{
|
||||
return(m_projects_recent_files);
|
||||
}
|
||||
|
||||
@ -1384,7 +1411,8 @@ RecentFiles *QETApp::projectsRecentFiles() {
|
||||
@return The list of recent files for the elements
|
||||
\~French La liste des fichiers recents pour les elements
|
||||
*/
|
||||
RecentFiles *QETApp::elementsRecentFiles() {
|
||||
RecentFiles *QETApp::elementsRecentFiles()
|
||||
{
|
||||
return(m_elements_recent_files);
|
||||
}
|
||||
|
||||
@ -1464,7 +1492,8 @@ void QETApp::useSystemPalette(bool use) {
|
||||
\~French Demande la fermeture de toutes les fenetres ;
|
||||
si l'utilisateur les accepte, l'application quitte
|
||||
*/
|
||||
void QETApp::quitQET() {
|
||||
void QETApp::quitQET()
|
||||
{
|
||||
#pragma message("@TODO Segmentation fault when closing program before loading elements is finished")
|
||||
if (closeEveryEditor()) {
|
||||
qApp->quit();
|
||||
@ -1478,7 +1507,8 @@ void QETApp::quitQET() {
|
||||
\~French Verifie s'il reste des fenetres (cachees ou non)
|
||||
et quitte s'il n'en reste plus.
|
||||
*/
|
||||
void QETApp::checkRemainingWindows() {
|
||||
void QETApp::checkRemainingWindows()
|
||||
{
|
||||
/* little hack:
|
||||
* the slot remembers after 500 ms of waiting in order to compensate
|
||||
* for the fact that some windows can still appear alive when they
|
||||
@ -1733,7 +1763,8 @@ void QETApp::openTitleBlockTemplateFiles(const QStringList &files_list) {
|
||||
en lancant un dialogue approprie.
|
||||
\~ @see ConfigDialog
|
||||
*/
|
||||
void QETApp::configureQET() {
|
||||
void QETApp::configureQET()
|
||||
{
|
||||
// determine the parent widget to use for the dialog
|
||||
// determine le widget parent a utiliser pour le dialogue
|
||||
QWidget *parent_widget = qApp->activeWindow();
|
||||
@ -1783,7 +1814,8 @@ void QETApp::aboutQET()
|
||||
\~French les barres d'outils et dock flottants de la fenetre
|
||||
*/
|
||||
QList<QWidget *> QETApp::floatingToolbarsAndDocksForMainWindow(
|
||||
QMainWindow *window) const {
|
||||
QMainWindow *window) const
|
||||
{
|
||||
QList<QWidget *> widgets;
|
||||
foreach(QWidget *qw, qApp->topLevelWidgets()) {
|
||||
if (!qw -> isWindow()) continue;
|
||||
@ -1822,7 +1854,8 @@ QList<QWidget *> QETApp::floatingToolbarsAndDocksForMainWindow(
|
||||
S'ils existent, ils sont juste memorises dans l'attribut arguments_files_.
|
||||
Sinon, ils sont memorises dans l'attribut arguments_options_.
|
||||
*/
|
||||
void QETApp::parseArguments() {
|
||||
void QETApp::parseArguments()
|
||||
{
|
||||
// get the arguments
|
||||
// recupere les arguments
|
||||
QList<QString> arguments_list(qApp->arguments());
|
||||
@ -1877,7 +1910,8 @@ void QETApp::parseArguments() {
|
||||
\~French Initialise le splash screen si et seulement si l'execution est
|
||||
interactive. Autrement, l'attribut splash_screen_ vaut 0.
|
||||
*/
|
||||
void QETApp::initSplashScreen() {
|
||||
void QETApp::initSplashScreen()
|
||||
{
|
||||
if (non_interactive_execution_) return;
|
||||
m_splash_screen = new QSplashScreen(QPixmap(":/ico/splash.png"));
|
||||
m_splash_screen -> show();
|
||||
@ -1909,7 +1943,8 @@ void QETApp::setSplashScreenStep(const QString &message) {
|
||||
Determine and apply the language to use for the application
|
||||
\~French Determine et applique le langage a utiliser pour l'application
|
||||
*/
|
||||
void QETApp::initLanguage() {
|
||||
void QETApp::initLanguage()
|
||||
{
|
||||
setLanguage(langFromSetting());
|
||||
}
|
||||
|
||||
@ -1917,7 +1952,8 @@ void QETApp::initLanguage() {
|
||||
@brief QETApp::initStyle
|
||||
Setup the gui style
|
||||
*/
|
||||
void QETApp::initStyle() {
|
||||
void QETApp::initStyle()
|
||||
{
|
||||
initial_palette_ = qApp->palette();
|
||||
|
||||
//Apply or not the system style
|
||||
@ -1939,7 +1975,8 @@ void QETApp::initStyle() {
|
||||
- le dossier de la collection perso
|
||||
- the directory for custom title blocks
|
||||
*/
|
||||
void QETApp::initConfiguration() {
|
||||
void QETApp::initConfiguration()
|
||||
{
|
||||
// create configuration files if necessary
|
||||
// cree les dossiers de configuration si necessaire
|
||||
QDir config_dir(QETApp::configDir());
|
||||
@ -1974,7 +2011,8 @@ void QETApp::initConfiguration() {
|
||||
Build the icon in the systray and its menu
|
||||
\~French Construit l'icone dans le systray et son menu
|
||||
*/
|
||||
void QETApp::initSystemTray() {
|
||||
void QETApp::initSystemTray()
|
||||
{
|
||||
setSplashScreenStep(tr("Chargement... icône du systray",
|
||||
"splash screen caption"));
|
||||
// initialization of the icon menus in the systray
|
||||
@ -2093,7 +2131,8 @@ QETProject *QETApp::projectFromString(const QString &url) {
|
||||
builds the icon menu in the systray
|
||||
\~French construit le menu de l'icone dans le systray
|
||||
*/
|
||||
void QETApp::buildSystemTrayMenu() {
|
||||
void QETApp::buildSystemTrayMenu()
|
||||
{
|
||||
menu_systray -> clear();
|
||||
|
||||
// get editors
|
||||
@ -2295,7 +2334,8 @@ bool QETApp::eventFiltrer(QObject *object, QEvent *e) {
|
||||
Display help and usage on standard output
|
||||
\~French Affiche l'aide et l'usage sur la sortie standard
|
||||
*/
|
||||
void QETApp::printHelp() {
|
||||
void QETApp::printHelp()
|
||||
{
|
||||
QString help(
|
||||
tr("Usage : ")
|
||||
+ QFileInfo(qApp->applicationFilePath()).fileName()
|
||||
@ -2324,7 +2364,8 @@ void QETApp::printHelp() {
|
||||
Print version to standard output
|
||||
\~French Affiche la version sur la sortie standard
|
||||
*/
|
||||
void QETApp::printVersion() {
|
||||
void QETApp::printVersion()
|
||||
{
|
||||
std::cout << qPrintable(QET::displayedVersion) << std::endl;
|
||||
}
|
||||
|
||||
@ -2333,7 +2374,8 @@ void QETApp::printVersion() {
|
||||
Display license on standard output
|
||||
\~French Affiche la licence sur la sortie standard
|
||||
*/
|
||||
void QETApp::printLicense() {
|
||||
void QETApp::printLicense()
|
||||
{
|
||||
std::cout << qPrintable(QET::license()) << std::endl;
|
||||
}
|
||||
|
||||
@ -2342,7 +2384,8 @@ void QETApp::printLicense() {
|
||||
@return the list of projects with their associated ids
|
||||
\~French la liste des projets avec leurs ids associes
|
||||
*/
|
||||
QMap<uint, QETProject *> QETApp::registeredProjects() {
|
||||
QMap<uint, QETProject *> QETApp::registeredProjects()
|
||||
{
|
||||
return(registered_projects_);
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,8 @@ QETArguments &QETArguments::operator=(const QETArguments &qet_arguments) {
|
||||
/**
|
||||
Destructeur
|
||||
*/
|
||||
QETArguments::~QETArguments() {
|
||||
QETArguments::~QETArguments()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@ -117,7 +118,8 @@ void QETArguments::setArguments(const QList<QString> &args) {
|
||||
dans l'ordre suivant : options connues puis inconnues, fichiers de types
|
||||
projet puis element.
|
||||
*/
|
||||
QList<QString> QETArguments::arguments() const {
|
||||
QList<QString> QETArguments::arguments() const
|
||||
{
|
||||
return(options_ + unknown_options_ + project_files_ + element_files_ + tbt_files_);
|
||||
}
|
||||
|
||||
@ -125,49 +127,56 @@ QList<QString> QETArguments::arguments() const {
|
||||
@return tous les fichiers (projets et elements) passes en parametres.
|
||||
Les fichiers de type projet viennent avant les fichiers de type element.
|
||||
*/
|
||||
QList<QString> QETArguments::files() const {
|
||||
QList<QString> QETArguments::files() const
|
||||
{
|
||||
return(project_files_ + element_files_ + tbt_files_);
|
||||
}
|
||||
|
||||
/**
|
||||
@return les fichiers de type projet
|
||||
*/
|
||||
QList<QString> QETArguments::projectFiles() const {
|
||||
QList<QString> QETArguments::projectFiles() const
|
||||
{
|
||||
return(project_files_);
|
||||
}
|
||||
|
||||
/**
|
||||
@return les fichiers de type element
|
||||
*/
|
||||
QList<QString> QETArguments::elementFiles() const {
|
||||
QList<QString> QETArguments::elementFiles() const
|
||||
{
|
||||
return(element_files_);
|
||||
}
|
||||
|
||||
/**
|
||||
@return title block template files
|
||||
*/
|
||||
QList<QString> QETArguments::titleBlockTemplateFiles() const {
|
||||
QList<QString> QETArguments::titleBlockTemplateFiles() const
|
||||
{
|
||||
return(tbt_files_);
|
||||
}
|
||||
|
||||
/**
|
||||
@return les options reconnues
|
||||
*/
|
||||
QList<QString> QETArguments::options() const {
|
||||
QList<QString> QETArguments::options() const
|
||||
{
|
||||
return(options_);
|
||||
}
|
||||
|
||||
/**
|
||||
@return les options non reconnues
|
||||
*/
|
||||
QList<QString> QETArguments::unknownOptions() const {
|
||||
QList<QString> QETArguments::unknownOptions() const
|
||||
{
|
||||
return(unknown_options_);
|
||||
}
|
||||
|
||||
/**
|
||||
Oublie tous les arguments de cet objet
|
||||
*/
|
||||
void QETArguments::clear() {
|
||||
void QETArguments::clear()
|
||||
{
|
||||
project_files_.clear();
|
||||
element_files_.clear();
|
||||
options_.clear();
|
||||
@ -290,7 +299,8 @@ void QETArguments::handleOptionArgument(const QString &option) {
|
||||
@return true si l'utilisateur a specifie un dossier pour la collection
|
||||
commune.
|
||||
*/
|
||||
bool QETArguments::commonElementsDirSpecified() const {
|
||||
bool QETArguments::commonElementsDirSpecified() const
|
||||
{
|
||||
return(!common_elements_dir_.isEmpty());
|
||||
}
|
||||
|
||||
@ -298,7 +308,8 @@ bool QETArguments::commonElementsDirSpecified() const {
|
||||
@return le dossier de la collection commune specifie par l'utilisateur.
|
||||
Si l'utilisateur n'en a pas specifie, une chaine vide est retournee.
|
||||
*/
|
||||
QString QETArguments::commonElementsDir() const {
|
||||
QString QETArguments::commonElementsDir() const
|
||||
{
|
||||
return(common_elements_dir_);
|
||||
}
|
||||
#endif
|
||||
@ -308,7 +319,8 @@ QString QETArguments::commonElementsDir() const {
|
||||
@return true if the user has specified a directory for the common title
|
||||
block templates collection
|
||||
*/
|
||||
bool QETArguments::commonTitleBlockTemplatesDirSpecified() const {
|
||||
bool QETArguments::commonTitleBlockTemplatesDirSpecified() const
|
||||
{
|
||||
return(!common_tbt_dir_.isEmpty());
|
||||
}
|
||||
|
||||
@ -316,7 +328,8 @@ bool QETArguments::commonTitleBlockTemplatesDirSpecified() const {
|
||||
@return the directory of the common title block templates collection
|
||||
specified by the user. If none were specified, return an empty string.
|
||||
*/
|
||||
QString QETArguments::commonTitleBlockTemplatesDir() const {
|
||||
QString QETArguments::commonTitleBlockTemplatesDir() const
|
||||
{
|
||||
return(common_tbt_dir_);
|
||||
}
|
||||
#endif
|
||||
@ -325,7 +338,8 @@ QString QETArguments::commonTitleBlockTemplatesDir() const {
|
||||
/**
|
||||
@return true si l'utilisateur a specifie un dossier pour la configuration.
|
||||
*/
|
||||
bool QETArguments::configDirSpecified() const {
|
||||
bool QETArguments::configDirSpecified() const
|
||||
{
|
||||
return(!config_dir_.isEmpty());
|
||||
}
|
||||
|
||||
@ -333,7 +347,8 @@ bool QETArguments::configDirSpecified() const {
|
||||
@return le dossier de configuration specifie par l'utilisateur.
|
||||
Si l'utilisateur n'en a pas specifie, une chaine vide est retournee.
|
||||
*/
|
||||
QString QETArguments::configDir() const {
|
||||
QString QETArguments::configDir() const
|
||||
{
|
||||
return(config_dir_);
|
||||
}
|
||||
#endif
|
||||
@ -341,7 +356,8 @@ QString QETArguments::configDir() const {
|
||||
/**
|
||||
@return true si l'utilisateur a specifie un dossier pour les fichiers de langue
|
||||
*/
|
||||
bool QETArguments::langDirSpecified() const {
|
||||
bool QETArguments::langDirSpecified() const
|
||||
{
|
||||
return(!lang_dir_.isEmpty());
|
||||
}
|
||||
|
||||
@ -349,7 +365,8 @@ bool QETArguments::langDirSpecified() const {
|
||||
@return le dossier de langue specifie par l'utilisateur.
|
||||
Si l'utilisateur n'en a pas specifie, une chaine vide est retournee.
|
||||
*/
|
||||
QString QETArguments::langDir() const {
|
||||
QString QETArguments::langDir() const
|
||||
{
|
||||
return(lang_dir_);
|
||||
}
|
||||
|
||||
@ -357,7 +374,8 @@ QString QETArguments::langDir() const {
|
||||
@return true si les arguments comportent une demande d'affichage de l'aide,
|
||||
false sinon
|
||||
*/
|
||||
bool QETArguments::printHelpRequested() const {
|
||||
bool QETArguments::printHelpRequested() const
|
||||
{
|
||||
return(print_help_);
|
||||
}
|
||||
|
||||
@ -365,7 +383,8 @@ bool QETArguments::printHelpRequested() const {
|
||||
@return true si les arguments comportent une demande d'affichage de la
|
||||
licence, false sinon
|
||||
*/
|
||||
bool QETArguments::printLicenseRequested() const {
|
||||
bool QETArguments::printLicenseRequested() const
|
||||
{
|
||||
return(print_license_);
|
||||
}
|
||||
|
||||
@ -373,6 +392,7 @@ bool QETArguments::printLicenseRequested() const {
|
||||
@return true si les arguments comportent une demande d'affichage de la
|
||||
version, false sinon
|
||||
*/
|
||||
bool QETArguments::printVersionRequested() const {
|
||||
bool QETArguments::printVersionRequested() const
|
||||
{
|
||||
return(print_version_);
|
||||
}
|
||||
|
@ -106,8 +106,14 @@ QETDiagramEditor::QETDiagramEditor(const QStringList &files, QWidget *parent) :
|
||||
setMinimumSize(QSize(500, 350));
|
||||
setWindowState(Qt::WindowMaximized);
|
||||
|
||||
connect (&m_workspace, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(subWindowActivated(QMdiSubWindow*)));
|
||||
connect (QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(slot_updatePasteAction()));
|
||||
connect (&m_workspace,
|
||||
SIGNAL(subWindowActivated(QMdiSubWindow *)),
|
||||
this,
|
||||
SLOT(subWindowActivated(QMdiSubWindow*)));
|
||||
connect (QApplication::clipboard(),
|
||||
SIGNAL(dataChanged()),
|
||||
this,
|
||||
SLOT(slot_updatePasteAction()));
|
||||
|
||||
readSettings();
|
||||
show();
|
||||
@ -128,14 +134,16 @@ QETDiagramEditor::QETDiagramEditor(const QStringList &files, QWidget *parent) :
|
||||
/**
|
||||
Destructeur
|
||||
*/
|
||||
QETDiagramEditor::~QETDiagramEditor() {
|
||||
QETDiagramEditor::~QETDiagramEditor()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@brief QETDiagramEditor::setUpElementsPanel
|
||||
Setup the element panel and element panel widget
|
||||
*/
|
||||
void QETDiagramEditor::setUpElementsPanel() {
|
||||
void QETDiagramEditor::setUpElementsPanel()
|
||||
{
|
||||
//Add the element panel as a QDockWidget
|
||||
qdw_pa = new QDockWidget(tr("Projets", "dock title"), this);
|
||||
|
||||
@ -184,7 +192,8 @@ void QETDiagramEditor::setUpElementsCollectionWidget()
|
||||
@brief QETDiagramEditor::setUpUndoStack
|
||||
Setup the undostack and undo stack widget
|
||||
*/
|
||||
void QETDiagramEditor::setUpUndoStack() {
|
||||
void QETDiagramEditor::setUpUndoStack()
|
||||
{
|
||||
|
||||
QUndoView *undo_view = new QUndoView(&undo_group, this);
|
||||
|
||||
@ -498,10 +507,10 @@ void QETDiagramEditor::setUpActions()
|
||||
m_close_file ->setShortcut(QKeySequence::Close);
|
||||
m_save_file ->setShortcut(QKeySequence::Save);
|
||||
|
||||
new_file ->setStatusTip( tr("Crée un nouveau projet", "status bar tip") );
|
||||
open_file ->setStatusTip( tr("Ouvre un projet existant", "status bar tip") );
|
||||
m_close_file ->setStatusTip( tr("Ferme le projet courant", "status bar tip") );
|
||||
m_save_file ->setStatusTip( tr("Enregistre le projet courant et tous ses folios", "status bar tip") );
|
||||
new_file ->setStatusTip( tr("Crée un nouveau projet", "status bar tip") );
|
||||
open_file ->setStatusTip( tr("Ouvre un projet existant", "status bar tip") );
|
||||
m_close_file ->setStatusTip( tr("Ferme le projet courant", "status bar tip") );
|
||||
m_save_file ->setStatusTip( tr("Enregistre le projet courant et tous ses folios", "status bar tip") );
|
||||
m_save_file_as ->setStatusTip( tr("Enregistre le projet courant avec un autre nom de fichier", "status bar tip") );
|
||||
|
||||
connect(m_save_file_as, &QAction::triggered, this, &QETDiagramEditor::saveAs);
|
||||
@ -568,8 +577,8 @@ void QETDiagramEditor::setUpActions()
|
||||
select_nothing->setShortcut(QKeySequence::Deselect);
|
||||
select_invert ->setShortcut(QKeySequence( tr("Ctrl+I")));
|
||||
|
||||
select_all ->setStatusTip( tr("Sélectionne tous les éléments du folio", "status bar tip") );
|
||||
select_nothing->setStatusTip( tr("Désélectionne tous les éléments du folio", "status bar tip") );
|
||||
select_all ->setStatusTip( tr("Sélectionne tous les éléments du folio", "status bar tip") );
|
||||
select_nothing->setStatusTip( tr("Désélectionne tous les éléments du folio", "status bar tip") );
|
||||
select_invert ->setStatusTip( tr("Désélectionne les éléments sélectionnés et sélectionne les éléments non sélectionnés", "status bar tip") );
|
||||
|
||||
select_all ->setData("select_all");
|
||||
@ -711,7 +720,8 @@ void QETDiagramEditor::setUpToolBar()
|
||||
/**
|
||||
@brief QETDiagramEditor::setUpMenu
|
||||
*/
|
||||
void QETDiagramEditor::setUpMenu() {
|
||||
void QETDiagramEditor::setUpMenu()
|
||||
{
|
||||
|
||||
QMenu *menu_fichier = new QMenu(tr("&Fichier"));
|
||||
QMenu *menu_edition = new QMenu(tr("&Édition"));
|
||||
@ -729,7 +739,8 @@ void QETDiagramEditor::setUpMenu() {
|
||||
// File menu
|
||||
QMenu *recentfile = menu_fichier -> addMenu(QET::Icons::DocumentOpenRecent, tr("&Récemment ouverts"));
|
||||
recentfile->addActions(QETApp::projectsRecentFiles()->menu()->actions());
|
||||
connect(QETApp::projectsRecentFiles(), SIGNAL(fileOpeningRequested(const QString &)), this, SLOT(openRecentFile(const QString &)));
|
||||
connect(QETApp::projectsRecentFiles(), SIGNAL(fileOpeningRequested(const QString &)),
|
||||
this, SLOT(openRecentFile(const QString &)));
|
||||
menu_fichier -> addActions(m_file_actions_group.actions());
|
||||
menu_fichier -> addSeparator();
|
||||
//menu_fichier -> addAction(import_diagram);
|
||||
@ -804,7 +815,8 @@ void QETDiagramEditor::setUpMenu() {
|
||||
Permet de quitter l'application lors de la fermeture de la fenetre principale
|
||||
@param qce Le QCloseEvent correspondant a l'evenement de fermeture
|
||||
*/
|
||||
void QETDiagramEditor::closeEvent(QCloseEvent *qce) {
|
||||
void QETDiagramEditor::closeEvent(QCloseEvent *qce)
|
||||
{
|
||||
// quitte directement s'il n'y a aucun projet ouvert
|
||||
bool can_quit = true;
|
||||
if (openedProjects().count()) {
|
||||
@ -850,7 +862,8 @@ bool QETDiagramEditor::event(QEvent *e)
|
||||
@brief QETDiagramEditor::save
|
||||
Ask the current active project to save
|
||||
*/
|
||||
void QETDiagramEditor::save() {
|
||||
void QETDiagramEditor::save()
|
||||
{
|
||||
if (ProjectView *project_view = currentProjectView()) {
|
||||
QETResult saved = project_view -> save();
|
||||
|
||||
@ -874,7 +887,8 @@ void QETDiagramEditor::save() {
|
||||
@brief QETDiagramEditor::saveAs
|
||||
Ask the current active project to save as
|
||||
*/
|
||||
void QETDiagramEditor::saveAs() {
|
||||
void QETDiagramEditor::saveAs()
|
||||
{
|
||||
if (ProjectView *project_view = currentProjectView()) {
|
||||
QETResult save_file = project_view -> saveAs();
|
||||
if (save_file.isOk()) {
|
||||
@ -914,7 +928,8 @@ bool QETDiagramEditor::newProject()
|
||||
@param filepath Fichier a ouvrir
|
||||
@see openAndAddDiagram
|
||||
*/
|
||||
bool QETDiagramEditor::openRecentFile(const QString &filepath) {
|
||||
bool QETDiagramEditor::openRecentFile(const QString &filepath)
|
||||
{
|
||||
// small hack to prevent all diagram editors from trying to topen the required
|
||||
// recent file at the same time
|
||||
if (qApp -> activeWindow() != this) return(false);
|
||||
@ -925,7 +940,8 @@ bool QETDiagramEditor::openRecentFile(const QString &filepath) {
|
||||
Cette fonction demande un nom de fichier a ouvrir a l'utilisateur
|
||||
@return true si l'ouverture a reussi, false sinon
|
||||
*/
|
||||
bool QETDiagramEditor::openProject() {
|
||||
bool QETDiagramEditor::openProject()
|
||||
{
|
||||
// demande un chemin de fichier a ouvrir a l'utilisateur
|
||||
QString filepath = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
@ -948,7 +964,8 @@ bool QETDiagramEditor::openProject() {
|
||||
@return true si la fermeture du projet a reussi, false sinon
|
||||
Note : cette methode renvoie true si project est nul
|
||||
*/
|
||||
bool QETDiagramEditor::closeProject(ProjectView *project_view) {
|
||||
bool QETDiagramEditor::closeProject(ProjectView *project_view)
|
||||
{
|
||||
if (project_view) {
|
||||
activateProject(project_view);
|
||||
if (QMdiSubWindow *sub_window = subWindowForWidget(project_view)){
|
||||
@ -964,7 +981,8 @@ bool QETDiagramEditor::closeProject(ProjectView *project_view) {
|
||||
@return true si la fermeture du fichier a reussi, false sinon
|
||||
Note : cette methode renvoie true si project est nul
|
||||
*/
|
||||
bool QETDiagramEditor::closeProject(QETProject *project) {
|
||||
bool QETDiagramEditor::closeProject(QETProject *project)
|
||||
{
|
||||
if (ProjectView *project_view = findProject(project)) {
|
||||
return(closeProject(project_view));
|
||||
}
|
||||
@ -977,13 +995,15 @@ bool QETDiagramEditor::closeProject(QETProject *project) {
|
||||
@param interactive true pour afficher des messages a l'utilisateur, false sinon
|
||||
@return true si l'ouverture a reussi, false sinon
|
||||
*/
|
||||
bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interactive)
|
||||
bool QETDiagramEditor::openAndAddProject(
|
||||
const QString &filepath,
|
||||
bool interactive)
|
||||
{
|
||||
if (filepath.isEmpty()) return(false);
|
||||
|
||||
QFileInfo filepath_info(filepath);
|
||||
|
||||
//Check if project is not open in another editor
|
||||
//Check if project is not open in another editor
|
||||
if (QETDiagramEditor *diagram_editor = QETApp::diagramEditorForFile(filepath))
|
||||
{
|
||||
if (diagram_editor == this)
|
||||
@ -1003,7 +1023,7 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti
|
||||
}
|
||||
}
|
||||
|
||||
// check the file exists
|
||||
// check the file exists
|
||||
if (!filepath_info.exists())
|
||||
{
|
||||
if (interactive)
|
||||
@ -1019,8 +1039,8 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
//Check if file readable
|
||||
|
||||
//Check if file readable
|
||||
if (!filepath_info.isReadable())
|
||||
{
|
||||
if (interactive) {
|
||||
@ -1035,7 +1055,7 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti
|
||||
return(false);
|
||||
}
|
||||
|
||||
//Check if file is read only
|
||||
//Check if file is read only
|
||||
if (!filepath_info.isWritable())
|
||||
{
|
||||
if (interactive) {
|
||||
@ -1049,7 +1069,7 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti
|
||||
}
|
||||
}
|
||||
|
||||
//Create the project
|
||||
//Create the project
|
||||
DialogWaiting::instance(this);
|
||||
|
||||
QETProject *project = new QETProject(filepath);
|
||||
@ -1086,10 +1106,11 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti
|
||||
@param update_panel Whether the elements panel should be warned this
|
||||
project has been added. Defaults to true.
|
||||
*/
|
||||
bool QETDiagramEditor::addProject(QETProject *project, bool update_panel) {
|
||||
bool QETDiagramEditor::addProject(QETProject *project, bool update_panel)
|
||||
{
|
||||
// enregistre le projet
|
||||
QETApp::registerProject(project);
|
||||
|
||||
|
||||
// cree un ProjectView pour visualiser le projet
|
||||
ProjectView *project_view = new ProjectView(project);
|
||||
addProjectView(project_view);
|
||||
@ -1111,7 +1132,8 @@ bool QETDiagramEditor::addProject(QETProject *project, bool update_panel) {
|
||||
/**
|
||||
@return la liste des projets ouverts dans cette fenetre
|
||||
*/
|
||||
QList<ProjectView *> QETDiagramEditor::openedProjects() const {
|
||||
QList<ProjectView *> QETDiagramEditor::openedProjects() const
|
||||
{
|
||||
QList<ProjectView *> result;
|
||||
QList<QMdiSubWindow *> window_list(m_workspace.subWindowList());
|
||||
foreach(QMdiSubWindow *window, window_list) {
|
||||
@ -1126,7 +1148,8 @@ QList<ProjectView *> QETDiagramEditor::openedProjects() const {
|
||||
@return Le projet actuellement edite (= qui a le focus dans l'interface
|
||||
MDI) ou 0 s'il n'y en a pas
|
||||
*/
|
||||
ProjectView *QETDiagramEditor::currentProjectView() const {
|
||||
ProjectView *QETDiagramEditor::currentProjectView() const
|
||||
{
|
||||
QMdiSubWindow *current_window = m_workspace.activeSubWindow();
|
||||
if (!current_window) return(nullptr);
|
||||
|
||||
@ -1159,7 +1182,8 @@ QETProject *QETDiagramEditor::currentProject() const
|
||||
@return Le schema actuellement edite (= l'onglet ouvert dans le projet
|
||||
courant) ou 0 s'il n'y en a pas
|
||||
*/
|
||||
DiagramView *QETDiagramEditor::currentDiagramView() const {
|
||||
DiagramView *QETDiagramEditor::currentDiagramView() const
|
||||
{
|
||||
if (ProjectView *project_view = currentProjectView()) {
|
||||
return(project_view -> currentDiagram());
|
||||
}
|
||||
@ -1190,7 +1214,8 @@ Element *QETDiagramEditor::currentElement() const
|
||||
@param diagram_view Schema dont il faut retrouver
|
||||
@return la vue sur le projet contenant ce schema ou 0 s'il n'y en a pas
|
||||
*/
|
||||
ProjectView *QETDiagramEditor::findProject(DiagramView *diagram_view) const {
|
||||
ProjectView *QETDiagramEditor::findProject(DiagramView *diagram_view) const
|
||||
{
|
||||
foreach(ProjectView *project_view, openedProjects()) {
|
||||
if (project_view -> diagram_views().contains(diagram_view)) {
|
||||
return(project_view);
|
||||
@ -1204,7 +1229,8 @@ ProjectView *QETDiagramEditor::findProject(DiagramView *diagram_view) const {
|
||||
@param diagram Schema dont il faut retrouver
|
||||
@return la vue sur le projet contenant ce schema ou 0 s'il n'y en a pas
|
||||
*/
|
||||
ProjectView *QETDiagramEditor::findProject(Diagram *diagram) const {
|
||||
ProjectView *QETDiagramEditor::findProject(Diagram *diagram) const
|
||||
{
|
||||
foreach(ProjectView *project_view, openedProjects()) {
|
||||
foreach(DiagramView *diagram_view, project_view -> diagram_views()) {
|
||||
if (diagram_view -> diagram() == diagram) {
|
||||
@ -1219,7 +1245,8 @@ ProjectView *QETDiagramEditor::findProject(Diagram *diagram) const {
|
||||
@param project Projet dont il faut trouver la vue
|
||||
@return la vue du projet passe en parametre
|
||||
*/
|
||||
ProjectView *QETDiagramEditor::findProject(QETProject *project) const {
|
||||
ProjectView *QETDiagramEditor::findProject(QETProject *project) const
|
||||
{
|
||||
foreach(ProjectView *opened_project, openedProjects()) {
|
||||
if (opened_project -> project() == project) {
|
||||
return(opened_project);
|
||||
@ -1233,7 +1260,8 @@ ProjectView *QETDiagramEditor::findProject(QETProject *project) const {
|
||||
@return le ProjectView correspondant au chemin passe en parametre, ou 0 si
|
||||
celui-ci n'a pas ete trouve
|
||||
*/
|
||||
ProjectView *QETDiagramEditor::findProject(const QString &filepath) const {
|
||||
ProjectView *QETDiagramEditor::findProject(const QString &filepath) const
|
||||
{
|
||||
foreach(ProjectView *opened_project, openedProjects()) {
|
||||
if (QETProject *project = opened_project -> project()) {
|
||||
if (project -> filePath() == filepath) {
|
||||
@ -1249,7 +1277,8 @@ ProjectView *QETDiagramEditor::findProject(const QString &filepath) const {
|
||||
@return La sous-fenetre accueillant le widget passe en parametre, ou 0 si
|
||||
celui-ci n'a pas ete trouve.
|
||||
*/
|
||||
QMdiSubWindow *QETDiagramEditor::subWindowForWidget(QWidget *widget) const {
|
||||
QMdiSubWindow *QETDiagramEditor::subWindowForWidget(QWidget *widget) const
|
||||
{
|
||||
foreach(QMdiSubWindow *sub_window, m_workspace.subWindowList()) {
|
||||
if (sub_window -> widget() == widget) {
|
||||
return(sub_window);
|
||||
@ -1470,7 +1499,8 @@ void QETDiagramEditor::slot_updateActions()
|
||||
@brief QETDiagramEditor::slot_updateAutoNumDock
|
||||
Update Auto Num Dock Widget when changing Project
|
||||
*/
|
||||
void QETDiagramEditor::slot_updateAutoNumDock() {
|
||||
void QETDiagramEditor::slot_updateAutoNumDock()
|
||||
{
|
||||
if ( m_workspace.subWindowList().indexOf(m_workspace.activeSubWindow()) != activeSubWindowIndex) {
|
||||
activeSubWindowIndex = m_workspace.subWindowList().indexOf(m_workspace.activeSubWindow());
|
||||
if (currentProjectView() != nullptr && currentDiagramView() != nullptr) {
|
||||
@ -1543,7 +1573,7 @@ void QETDiagramEditor::slot_updateComplexActions()
|
||||
for(DiagramTextItem *dti : texts)
|
||||
{
|
||||
if(dti->type() == ConductorTextItem::Type)
|
||||
selected_conductor_texts++;
|
||||
selected_conductor_texts++;
|
||||
}
|
||||
int selected_dynamic_elmt_text = 0;
|
||||
for(DiagramTextItem *dti : texts)
|
||||
@ -1672,7 +1702,8 @@ void QETDiagramEditor::slot_updateModeActions()
|
||||
@brief QETDiagramEditor::slot_updatePasteAction
|
||||
Gere les actions ayant besoin du presse-papier
|
||||
*/
|
||||
void QETDiagramEditor::slot_updatePasteAction() {
|
||||
void QETDiagramEditor::slot_updatePasteAction()
|
||||
{
|
||||
DiagramView *dv = currentDiagramView();
|
||||
bool editable_diagram = (dv && !dv -> diagram() -> isReadOnly());
|
||||
|
||||
@ -1742,7 +1773,8 @@ void QETDiagramEditor::addProjectView(ProjectView *project_view)
|
||||
/**
|
||||
@return la liste des fichiers edites par cet editeur de schemas
|
||||
*/
|
||||
QList<QString> QETDiagramEditor::editedFiles() const {
|
||||
QList<QString> QETDiagramEditor::editedFiles() const
|
||||
{
|
||||
QList<QString> edited_files_list;
|
||||
foreach (ProjectView *project_view, openedProjects()) {
|
||||
QString diagram_file(project_view -> project() -> filePath());
|
||||
@ -1759,7 +1791,8 @@ QList<QString> QETDiagramEditor::editedFiles() const {
|
||||
@return le ProjectView editant le fichier filepath, ou 0 si ce fichier n'est
|
||||
pas edite par cet editeur de schemas.
|
||||
*/
|
||||
ProjectView *QETDiagramEditor::viewForFile(const QString &filepath) const {
|
||||
ProjectView *QETDiagramEditor::viewForFile(const QString &filepath) const
|
||||
{
|
||||
if (filepath.isEmpty()) return(nullptr);
|
||||
|
||||
QString searched_can_file_path = QFileInfo(filepath).canonicalFilePath();
|
||||
@ -1780,7 +1813,8 @@ ProjectView *QETDiagramEditor::viewForFile(const QString &filepath) const {
|
||||
@brief QETDiagramEditor::drawGrid
|
||||
@return true if the grid of folio must be displayed
|
||||
*/
|
||||
bool QETDiagramEditor::drawGrid() const {
|
||||
bool QETDiagramEditor::drawGrid() const
|
||||
{
|
||||
return m_draw_grid->isChecked();
|
||||
}
|
||||
|
||||
@ -1800,9 +1834,12 @@ void QETDiagramEditor::openBackupFiles(QList<KAutoSaveFile *> backup_files)
|
||||
{
|
||||
if (project -> state() != QETProject::FileOpenDiscard)
|
||||
{
|
||||
QET::QetMessageBox::warning(this, tr("Échec de l'ouverture du projet", "message box title"),
|
||||
QString(tr("Une erreur est survenue lors de l'ouverture du fichier %1.",
|
||||
"message box content")).arg(file->managedFile().fileName()));
|
||||
QET::QetMessageBox::warning(
|
||||
this,
|
||||
tr("Échec de l'ouverture du projet", "message box title"),
|
||||
QString(tr(
|
||||
"Une erreur est survenue lors de l'ouverture du fichier %1.",
|
||||
"message box content")).arg(file->managedFile().fileName()));
|
||||
}
|
||||
delete project;
|
||||
DialogWaiting::dropInstance();
|
||||
@ -1815,7 +1852,8 @@ void QETDiagramEditor::openBackupFiles(QList<KAutoSaveFile *> backup_files)
|
||||
/**
|
||||
met a jour le menu "Fenetres"
|
||||
*/
|
||||
void QETDiagramEditor::slot_updateWindowsMenu() {
|
||||
void QETDiagramEditor::slot_updateWindowsMenu()
|
||||
{
|
||||
// nettoyage du menu
|
||||
foreach(QAction *a, windows_menu -> actions()) windows_menu -> removeAction(a);
|
||||
|
||||
@ -1859,7 +1897,8 @@ void QETDiagramEditor::slot_updateWindowsMenu() {
|
||||
Edite les proprietes du schema diagram
|
||||
@param diagram_view schema dont il faut editer les proprietes
|
||||
*/
|
||||
void QETDiagramEditor::editDiagramProperties(DiagramView *diagram_view) {
|
||||
void QETDiagramEditor::editDiagramProperties(DiagramView *diagram_view)
|
||||
{
|
||||
if (ProjectView *project_view = findProject(diagram_view)) {
|
||||
activateProject(project_view);
|
||||
project_view -> editDiagramProperties(diagram_view);
|
||||
@ -1870,7 +1909,8 @@ void QETDiagramEditor::editDiagramProperties(DiagramView *diagram_view) {
|
||||
Edite les proprietes du schema diagram
|
||||
@param diagram schema dont il faut editer les proprietes
|
||||
*/
|
||||
void QETDiagramEditor::editDiagramProperties(Diagram *diagram) {
|
||||
void QETDiagramEditor::editDiagramProperties(Diagram *diagram)
|
||||
{
|
||||
if (ProjectView *project_view = findProject(diagram)) {
|
||||
activateProject(project_view);
|
||||
project_view -> editDiagramProperties(diagram);
|
||||
@ -1880,7 +1920,8 @@ void QETDiagramEditor::editDiagramProperties(Diagram *diagram) {
|
||||
/**
|
||||
Affiche les projets dans des fenetres.
|
||||
*/
|
||||
void QETDiagramEditor::setWindowedMode() {
|
||||
void QETDiagramEditor::setWindowedMode()
|
||||
{
|
||||
m_workspace.setViewMode(QMdiArea::SubWindowView);
|
||||
m_windowed_view_mode -> setChecked(true);
|
||||
slot_updateWindowsMenu();
|
||||
@ -1889,7 +1930,8 @@ void QETDiagramEditor::setWindowedMode() {
|
||||
/**
|
||||
Affiche les projets dans des onglets.
|
||||
*/
|
||||
void QETDiagramEditor::setTabbedMode() {
|
||||
void QETDiagramEditor::setTabbedMode()
|
||||
{
|
||||
m_workspace.setViewMode(QMdiArea::TabbedView);
|
||||
m_tabbed_view_mode -> setChecked(true);
|
||||
slot_updateWindowsMenu();
|
||||
@ -1935,7 +1977,8 @@ void QETDiagramEditor::writeSettings()
|
||||
Active le schema passe en parametre
|
||||
@param diagram Schema a activer
|
||||
*/
|
||||
void QETDiagramEditor::activateDiagram(Diagram *diagram) {
|
||||
void QETDiagramEditor::activateDiagram(Diagram *diagram)
|
||||
{
|
||||
if (QETProject *project = diagram -> project()) {
|
||||
if (ProjectView *project_view = findProject(project)) {
|
||||
activateWidget(project_view);
|
||||
@ -1950,7 +1993,8 @@ void QETDiagramEditor::activateDiagram(Diagram *diagram) {
|
||||
Active le projet passe en parametre
|
||||
@param project Projet a activer
|
||||
*/
|
||||
void QETDiagramEditor::activateProject(QETProject *project) {
|
||||
void QETDiagramEditor::activateProject(QETProject *project)
|
||||
{
|
||||
activateProject(findProject(project));
|
||||
}
|
||||
|
||||
@ -1958,12 +2002,14 @@ void QETDiagramEditor::activateProject(QETProject *project) {
|
||||
Active le projet passe en parametre
|
||||
@param project_view Projet a activer
|
||||
*/
|
||||
void QETDiagramEditor::activateProject(ProjectView *project_view) {
|
||||
void QETDiagramEditor::activateProject(ProjectView *project_view)
|
||||
{
|
||||
if (!project_view) return;
|
||||
activateWidget(project_view);
|
||||
}
|
||||
|
||||
/*** @brief QETDiagramEditor::projectWasClosed
|
||||
/**
|
||||
@brief QETDiagramEditor::projectWasClosed
|
||||
Manage the close of a project.
|
||||
@param project_view
|
||||
*/
|
||||
@ -1976,11 +2022,11 @@ void QETDiagramEditor::projectWasClosed(ProjectView *project_view)
|
||||
m_element_collection_widget->removeProject(project);
|
||||
undo_group.removeStack(project -> undoStack());
|
||||
QETApp::unregisterProject(project);
|
||||
}
|
||||
//When project is closed, a lot of signal are emited, notably if there is an item selected in a diagram.
|
||||
//In some special case, since signal/slot connection can be direct or queued, some signal are handled after QObject is deleted, and crash qet
|
||||
//notably in the function Diagram::elements when she call items() (I don't know exactly why).
|
||||
//set nullptr to "m_selection_properties_editor->setDiagram()" fix this crash
|
||||
}
|
||||
//When project is closed, a lot of signal are emited, notably if there is an item selected in a diagram.
|
||||
//In some special case, since signal/slot connection can be direct or queued, some signal are handled after QObject is deleted, and crash qet
|
||||
//notably in the function Diagram::elements when she call items() (I don't know exactly why).
|
||||
//set nullptr to "m_selection_properties_editor->setDiagram()" fix this crash
|
||||
m_selection_properties_editor->setDiagram(nullptr);
|
||||
project_view -> deleteLater();
|
||||
project -> deleteLater();
|
||||
@ -1990,7 +2036,8 @@ void QETDiagramEditor::projectWasClosed(ProjectView *project_view)
|
||||
Edite les proprietes du projet project_view.
|
||||
@param project_view Vue sur le projet dont il faut editer les proprietes
|
||||
*/
|
||||
void QETDiagramEditor::editProjectProperties(ProjectView *project_view) {
|
||||
void QETDiagramEditor::editProjectProperties(ProjectView *project_view)
|
||||
{
|
||||
if (!project_view) return;
|
||||
activateProject(project_view);
|
||||
project_view -> editProjectProperties();
|
||||
@ -2000,7 +2047,8 @@ void QETDiagramEditor::editProjectProperties(ProjectView *project_view) {
|
||||
Edite les proprietes du projet project.
|
||||
@param project Projet dont il faut editer les proprietes
|
||||
*/
|
||||
void QETDiagramEditor::editProjectProperties(QETProject *project) {
|
||||
void QETDiagramEditor::editProjectProperties(QETProject *project)
|
||||
{
|
||||
editProjectProperties(findProject(project));
|
||||
}
|
||||
|
||||
@ -2026,7 +2074,8 @@ void QETDiagramEditor::addDiagramToProject(QETProject *project)
|
||||
Supprime un schema de son projet
|
||||
@param diagram Schema a supprimer
|
||||
*/
|
||||
void QETDiagramEditor::removeDiagram(Diagram *diagram) {
|
||||
void QETDiagramEditor::removeDiagram(Diagram *diagram)
|
||||
{
|
||||
if (!diagram) return;
|
||||
|
||||
// recupere le projet contenant le schema
|
||||
@ -2048,7 +2097,8 @@ void QETDiagramEditor::removeDiagram(Diagram *diagram) {
|
||||
la gauche
|
||||
@param diagram Schema a decaler vers le haut / la gauche
|
||||
*/
|
||||
void QETDiagramEditor::moveDiagramUp(Diagram *diagram) {
|
||||
void QETDiagramEditor::moveDiagramUp(Diagram *diagram)
|
||||
{
|
||||
if (!diagram) return;
|
||||
|
||||
// recupere le projet contenant le schema
|
||||
@ -2067,7 +2117,8 @@ void QETDiagramEditor::moveDiagramUp(Diagram *diagram) {
|
||||
la droite
|
||||
@param diagram Schema a decaler vers le bas / la droite
|
||||
*/
|
||||
void QETDiagramEditor::moveDiagramDown(Diagram *diagram) {
|
||||
void QETDiagramEditor::moveDiagramDown(Diagram *diagram)
|
||||
{
|
||||
if (!diagram) return;
|
||||
|
||||
// recupere le projet contenant le schema
|
||||
@ -2086,7 +2137,8 @@ void QETDiagramEditor::moveDiagramDown(Diagram *diagram) {
|
||||
la gauche en position 0
|
||||
@param diagram Schema a decaler vers le haut / la gauche en position 0
|
||||
*/
|
||||
void QETDiagramEditor::moveDiagramUpTop(Diagram *diagram) {
|
||||
void QETDiagramEditor::moveDiagramUpTop(Diagram *diagram)
|
||||
{
|
||||
if (!diagram) return;
|
||||
|
||||
// recupere le projet contenant le schema
|
||||
@ -2106,7 +2158,8 @@ void QETDiagramEditor::moveDiagramUpTop(Diagram *diagram) {
|
||||
la gauche x10
|
||||
@param diagram Schema a decaler vers le haut / la gauche x10
|
||||
*/
|
||||
void QETDiagramEditor::moveDiagramUpx10(Diagram *diagram) {
|
||||
void QETDiagramEditor::moveDiagramUpx10(Diagram *diagram)
|
||||
{
|
||||
if (!diagram) return;
|
||||
|
||||
// recupere le projet contenant le schema
|
||||
@ -2125,7 +2178,8 @@ void QETDiagramEditor::moveDiagramUpx10(Diagram *diagram) {
|
||||
la droite x10
|
||||
@param diagram Schema a decaler vers le bas / la droite x10
|
||||
*/
|
||||
void QETDiagramEditor::moveDiagramDownx10(Diagram *diagram) {
|
||||
void QETDiagramEditor::moveDiagramDownx10(Diagram *diagram)
|
||||
{
|
||||
if (!diagram) return;
|
||||
|
||||
// recupere le projet contenant le schema
|
||||
@ -2139,7 +2193,8 @@ void QETDiagramEditor::moveDiagramDownx10(Diagram *diagram) {
|
||||
}
|
||||
}
|
||||
|
||||
void QETDiagramEditor::reloadOldElementPanel() {
|
||||
void QETDiagramEditor::reloadOldElementPanel()
|
||||
{
|
||||
pa->reloadAndFilter();
|
||||
}
|
||||
|
||||
@ -2187,7 +2242,8 @@ void QETDiagramEditor::findElementInPanel(const ElementsLocation &location)
|
||||
Lance l'editeur d'element pour l'element filename
|
||||
@param location Emplacement de l'element a editer
|
||||
*/
|
||||
void QETDiagramEditor::editElementInEditor(const ElementsLocation &location) {
|
||||
void QETDiagramEditor::editElementInEditor(const ElementsLocation &location)
|
||||
{
|
||||
QETApp::instance() -> openElementLocations(QList<ElementsLocation>()
|
||||
<< location);
|
||||
}
|
||||
@ -2196,7 +2252,8 @@ void QETDiagramEditor::editElementInEditor(const ElementsLocation &location) {
|
||||
Launch an element editor to edit the selected element in the current
|
||||
diagram view.
|
||||
*/
|
||||
void QETDiagramEditor::editSelectedElementInEditor() {
|
||||
void QETDiagramEditor::editSelectedElementInEditor()
|
||||
{
|
||||
if (Element *selected_element = currentElement()) {
|
||||
editElementInEditor(selected_element -> location());
|
||||
}
|
||||
@ -2205,7 +2262,8 @@ void QETDiagramEditor::editSelectedElementInEditor() {
|
||||
/**
|
||||
Show the error message contained in \a result.
|
||||
*/
|
||||
void QETDiagramEditor::showError(const QETResult &result) {
|
||||
void QETDiagramEditor::showError(const QETResult &result)
|
||||
{
|
||||
if (result.isOk()) return;
|
||||
showError(result.errorMessage());
|
||||
}
|
||||
@ -2213,7 +2271,8 @@ void QETDiagramEditor::showError(const QETResult &result) {
|
||||
/**
|
||||
Show the \a error message.
|
||||
*/
|
||||
void QETDiagramEditor::showError(const QString &error) {
|
||||
void QETDiagramEditor::showError(const QString &error)
|
||||
{
|
||||
if (error.isEmpty()) return;
|
||||
QET::QetMessageBox::critical(this, tr("Erreur", "message box title"), error);
|
||||
}
|
||||
|
@ -52,14 +52,10 @@ class QETDiagramEditor : public QETMainWindow
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QETDiagramEditor(const QStringList & = QStringList(),
|
||||
QWidget * = nullptr);
|
||||
QETDiagramEditor(
|
||||
const QStringList & = QStringList(),
|
||||
QWidget * = nullptr);
|
||||
~QETDiagramEditor() override;
|
||||
|
||||
private:
|
||||
QETDiagramEditor(const QETDiagramEditor &);
|
||||
|
||||
public:
|
||||
void closeEvent (QCloseEvent *) override;
|
||||
QList<ProjectView *> openedProjects () const;
|
||||
void addProjectView (ProjectView *);
|
||||
@ -73,8 +69,8 @@ class QETDiagramEditor : public QETMainWindow
|
||||
|
||||
protected:
|
||||
bool event(QEvent *) override;
|
||||
|
||||
private:
|
||||
QETDiagramEditor(const QETDiagramEditor &);
|
||||
void setUpElementsPanel ();
|
||||
void setUpElementsCollectionWidget();
|
||||
void setUpUndoStack ();
|
||||
@ -148,70 +144,78 @@ class QETDiagramEditor : public QETMainWindow
|
||||
void selectionChanged();
|
||||
|
||||
public:
|
||||
QAction *m_edit_diagram_properties; ///< Show a dialog to edit diagram properties
|
||||
QAction *m_conductor_reset; ///< Reset paths of selected conductors
|
||||
QAction *m_cut; ///< Cut selection to clipboard
|
||||
QAction *m_copy; ///< Copy selection to clipboard
|
||||
QAction
|
||||
*m_edit_diagram_properties, ///< Show a dialog to edit diagram properties
|
||||
*m_conductor_reset, ///< Reset paths of selected conductors
|
||||
*m_cut, ///< Cut selection to clipboard
|
||||
*m_copy; ///< Copy selection to clipboard
|
||||
|
||||
QActionGroup m_row_column_actions_group; /// Action related to add/remove rows/column in diagram
|
||||
QActionGroup m_selection_actions_group; ///Action related to edit a selected item
|
||||
QActionGroup *m_depth_action_group = nullptr;
|
||||
QActionGroup
|
||||
m_row_column_actions_group, /// Action related to add/remove rows/column in diagram
|
||||
m_selection_actions_group, ///Action related to edit a selected item
|
||||
*m_depth_action_group = nullptr;
|
||||
|
||||
private:
|
||||
QActionGroup *grp_visu_sel; ///< Action group for visualisation vs edition mode
|
||||
QActionGroup *m_group_view_mode; ///< Action group for project
|
||||
QActionGroup m_add_item_actions_group; ///Action related to adding (add text image shape...)
|
||||
QActionGroup m_zoom_actions_group; ///Action related to zoom for diagram
|
||||
QActionGroup m_select_actions_group; ///Action related to global selections
|
||||
QActionGroup m_file_actions_group; ///Actions related to file (open, close, save...)
|
||||
QActionGroup
|
||||
*grp_visu_sel, ///< Action group for visualisation vs edition mode
|
||||
*m_group_view_mode, ///< Action group for project
|
||||
m_add_item_actions_group, ///Action related to adding (add text image shape...)
|
||||
m_zoom_actions_group, ///Action related to zoom for diagram
|
||||
m_select_actions_group, ///Action related to global selections
|
||||
m_file_actions_group; ///Actions related to file (open, close, save...)
|
||||
|
||||
QAction *m_tabbed_view_mode; ///< Display projects as tabs
|
||||
QAction *m_windowed_view_mode; ///< Display projects as windows
|
||||
QAction *m_mode_selection; ///< Set edition mode
|
||||
QAction *m_mode_visualise; ///< Set visualisation mode
|
||||
QAction *m_export_diagram; ///< Export diagrams of the current project as imagess
|
||||
QAction *m_print; ///< Print diagrams of the current project
|
||||
QAction *m_quit_editor; ///< Quit the diagram editor
|
||||
QAction *undo; ///< Cancel the latest action
|
||||
QAction *redo; ///< Redo the latest cancelled operation
|
||||
QAction *m_paste; ///< Paste clipboard content on the current diagram
|
||||
QAction *m_auto_conductor; ///< Enable/Disable the use of auto conductor
|
||||
QAction *conductor_default; ///< Show a dialog to edit default conductor properties
|
||||
QAction *m_grey_background; ///< Switch the background color in white or grey
|
||||
QAction *m_draw_grid; ///< Switch the background grid display or not
|
||||
QAction *m_project_edit_properties; ///< Edit the properties of the current project.
|
||||
QAction *m_project_add_diagram; ///< Add a diagram to the current project.
|
||||
QAction *m_remove_diagram_from_project; ///< Delete a diagram from the current project
|
||||
QAction *m_clean_project; ///< Clean the content of the curent project by removing useless items
|
||||
QAction *m_project_folio_list; ///< Sommaire des schemas
|
||||
QAction *m_csv_export; ///< generate nomenclature
|
||||
QAction *m_add_nomenclature; ///< Add nomenclature graphics item;
|
||||
QAction *m_add_summary; ///<Add summary graphics item
|
||||
QAction *m_project_terminalBloc; ///< generate terminal block
|
||||
QAction *m_project_export_conductor_num; ///<Export the wire num to csv
|
||||
QAction *m_export_project_db; ///Export to file the internal database of the current project
|
||||
QAction *m_tile_window; ///< Show MDI subwindows as tile
|
||||
QAction *m_cascade_window; ///< Show MDI subwindows as cascade
|
||||
QAction *m_previous_window; ///< Switch to the previous document
|
||||
QAction *m_next_window; ///< Switch to the next document
|
||||
QAction *m_edit_selection; ///< To edit selected item
|
||||
QAction
|
||||
*m_tabbed_view_mode, ///< Display projects as tabs
|
||||
*m_windowed_view_mode, ///< Display projects as windows
|
||||
*m_mode_selection, ///< Set edition mode
|
||||
*m_mode_visualise, ///< Set visualisation mode
|
||||
*m_export_diagram, ///< Export diagrams of the current project as imagess
|
||||
*m_print, ///< Print diagrams of the current project
|
||||
*m_quit_editor, ///< Quit the diagram editor
|
||||
*undo, ///< Cancel the latest action
|
||||
*redo, ///< Redo the latest cancelled operation
|
||||
*m_paste, ///< Paste clipboard content on the current diagram
|
||||
*m_auto_conductor, ///< Enable/Disable the use of auto conductor
|
||||
*conductor_default, ///< Show a dialog to edit default conductor properties
|
||||
*m_grey_background, ///< Switch the background color in white or grey
|
||||
*m_draw_grid, ///< Switch the background grid display or not
|
||||
*m_project_edit_properties, ///< Edit the properties of the current project.
|
||||
*m_project_add_diagram, ///< Add a diagram to the current project.
|
||||
*m_remove_diagram_from_project, ///< Delete a diagram from the current project
|
||||
*m_clean_project, ///< Clean the content of the curent project by removing useless items
|
||||
*m_project_folio_list, ///< Sommaire des schemas
|
||||
*m_csv_export, ///< generate nomenclature
|
||||
*m_add_nomenclature, ///< Add nomenclature graphics item;
|
||||
*m_add_summary, ///<Add summary graphics item
|
||||
*m_project_terminalBloc, ///< generate terminal block
|
||||
*m_project_export_conductor_num,///<Export the wire num to csv
|
||||
*m_export_project_db, ///Export to file the internal database of the current project
|
||||
*m_tile_window, ///< Show MDI subwindows as tile
|
||||
*m_cascade_window, ///< Show MDI subwindows as cascade
|
||||
*m_previous_window, ///< Switch to the previous document
|
||||
*m_next_window, ///< Switch to the next document
|
||||
*m_edit_selection, ///< To edit selected item
|
||||
*m_delete_selection, ///< Delete selection
|
||||
*m_rotate_selection, ///< Rotate selected elements and text items by 90 degrees
|
||||
*m_rotate_texts, ///< Direct selected text items to a specific angle
|
||||
*m_find_element, ///< Find the selected element in the panel
|
||||
*m_group_selected_texts = nullptr,
|
||||
*m_close_file, ///< Close current project file
|
||||
*m_save_file, ///< Save current project
|
||||
*m_save_file_as, ///< Save current project as a specific file
|
||||
*m_find = nullptr;
|
||||
|
||||
QList <QAction *> m_zoom_action_toolBar; ///Only zoom action must displayed in the toolbar
|
||||
QAction *m_delete_selection; ///< Delete selection
|
||||
QAction *m_rotate_selection; ///< Rotate selected elements and text items by 90 degrees
|
||||
QAction *m_rotate_texts; ///< Direct selected text items to a specific angle
|
||||
QAction *m_find_element; ///< Find the selected element in the panel
|
||||
QAction *m_group_selected_texts = nullptr;
|
||||
QAction *m_close_file; ///< Close current project file
|
||||
QAction *m_save_file; ///< Save current project
|
||||
QAction *m_save_file_as; ///< Save current project as a specific file
|
||||
QAction *m_find = nullptr;
|
||||
|
||||
QMdiArea m_workspace;
|
||||
QSignalMapper windowMapper;
|
||||
QDir open_dialog_dir; /// Directory to use for file dialogs such as File > save
|
||||
QDockWidget *qdw_pa; /// Dock for the elements panel
|
||||
QDockWidget *m_qdw_elmt_collection;
|
||||
QDockWidget *qdw_undo; /// Dock for the undo list
|
||||
|
||||
QDockWidget
|
||||
*qdw_pa, /// Dock for the elements panel
|
||||
*m_qdw_elmt_collection,
|
||||
*qdw_undo; /// Dock for the undo list
|
||||
|
||||
ElementsCollectionWidget *m_element_collection_widget;
|
||||
|
||||
DiagramPropertiesEditorDockWidget *m_selection_properties_editor;
|
||||
@ -219,11 +223,12 @@ class QETDiagramEditor : public QETMainWindow
|
||||
ElementsPanelWidget *pa;
|
||||
QMenu *windows_menu;
|
||||
|
||||
QToolBar *main_tool_bar = nullptr,
|
||||
*view_tool_bar = nullptr,
|
||||
*diagram_tool_bar = nullptr,
|
||||
*m_add_item_tool_bar = nullptr,
|
||||
*m_depth_tool_bar = nullptr;
|
||||
QToolBar
|
||||
*main_tool_bar = nullptr,
|
||||
*view_tool_bar = nullptr,
|
||||
*diagram_tool_bar = nullptr,
|
||||
*m_add_item_tool_bar = nullptr,
|
||||
*m_depth_tool_bar = nullptr;
|
||||
|
||||
QUndoGroup undo_group;
|
||||
AutoNumberingDockWidget *m_autonumbering_dock;
|
||||
|
@ -215,11 +215,13 @@ void ProjectDBModel::setQuery(const QString &query)
|
||||
@brief ProjectDBModel::queryString
|
||||
@return the current query used by this model
|
||||
*/
|
||||
QString ProjectDBModel::queryString() const {
|
||||
QString ProjectDBModel::queryString() const
|
||||
{
|
||||
return m_query;
|
||||
}
|
||||
|
||||
QETProject *ProjectDBModel::project() const {
|
||||
QETProject *ProjectDBModel::project() const
|
||||
{
|
||||
return m_project.data();
|
||||
}
|
||||
|
||||
|
@ -34,11 +34,13 @@
|
||||
@param table
|
||||
@param parent
|
||||
*/
|
||||
GraphicsTablePropertiesEditor::GraphicsTablePropertiesEditor(QetGraphicsTableItem *table, QWidget *parent) :
|
||||
GraphicsTablePropertiesEditor::GraphicsTablePropertiesEditor(
|
||||
QetGraphicsTableItem *table,
|
||||
QWidget *parent) :
|
||||
PropertiesEditorWidget(parent),
|
||||
ui(new Ui::GraphicsTablePropertiesEditor)
|
||||
ui(new Ui::GraphicsTablePropertiesEditor)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
m_header_button_group = new QButtonGroup(this);
|
||||
m_header_button_group->addButton(ui->m_header_align_left_rb, Qt::AlignLeft);
|
||||
m_header_button_group->addButton(ui->m_header_align_center_rb, Qt::AlignHCenter);
|
||||
@ -59,7 +61,8 @@ GraphicsTablePropertiesEditor::GraphicsTablePropertiesEditor(QetGraphicsTableIte
|
||||
/**
|
||||
@brief GraphicsTablePropertiesEditor::~GraphicsTablePropertiesEditor
|
||||
*/
|
||||
GraphicsTablePropertiesEditor::~GraphicsTablePropertiesEditor() {
|
||||
GraphicsTablePropertiesEditor::~GraphicsTablePropertiesEditor()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@ -84,8 +87,14 @@ void GraphicsTablePropertiesEditor::setTable(QetGraphicsTableItem *table)
|
||||
|
||||
m_table_item = table;
|
||||
m_connect_list.clear();
|
||||
m_connect_list << connect(m_table_item.data(), &QetGraphicsTableItem::xChanged, this, &GraphicsTablePropertiesEditor::updateUi);
|
||||
m_connect_list << connect(m_table_item.data(), &QetGraphicsTableItem::yChanged, this, &GraphicsTablePropertiesEditor::updateUi);
|
||||
m_connect_list << connect(m_table_item.data(),
|
||||
&QetGraphicsTableItem::xChanged,
|
||||
this,
|
||||
&GraphicsTablePropertiesEditor::updateUi);
|
||||
m_connect_list << connect(m_table_item.data(),
|
||||
&QetGraphicsTableItem::yChanged,
|
||||
this,
|
||||
&GraphicsTablePropertiesEditor::updateUi);
|
||||
|
||||
|
||||
if (auto editor = PropertiesEditorFactory::propertiesEditor(table->model(), this))
|
||||
@ -121,63 +130,103 @@ QUndoCommand *GraphicsTablePropertiesEditor::associatedUndo() const
|
||||
if (m_live_edit)
|
||||
{
|
||||
if (!qFuzzyCompare(ui->m_x_pos->value(), m_table_item->pos().x())) {
|
||||
auto undo = new QPropertyUndoCommand(m_table_item.data(), "x", m_table_item->pos().x(), ui->m_x_pos->value());
|
||||
auto undo = new QPropertyUndoCommand(
|
||||
m_table_item.data(),
|
||||
"x",
|
||||
m_table_item->pos().x(),
|
||||
ui->m_x_pos->value());
|
||||
undo->setAnimated(true, false);
|
||||
undo->setText(tr("Déplacer un tableau"));
|
||||
return undo;
|
||||
}
|
||||
|
||||
if (!qFuzzyCompare(ui->m_y_pos->value(), m_table_item->pos().y())) {
|
||||
auto undo = new QPropertyUndoCommand(m_table_item.data(), "y", m_table_item->pos().y(), ui->m_y_pos->value());
|
||||
auto undo = new QPropertyUndoCommand(
|
||||
m_table_item.data(),
|
||||
"y",
|
||||
m_table_item->pos().y(),
|
||||
ui->m_y_pos->value());
|
||||
undo->setAnimated(true, false);
|
||||
undo->setText(tr("Déplacer un tableau"));
|
||||
return undo;
|
||||
}
|
||||
|
||||
if (ui->m_display_n_row_sb->value() != m_table_item->displayNRow()) {
|
||||
auto undo = new QPropertyUndoCommand(m_table_item.data(), "displayNRow", m_table_item->displayNRow(), ui->m_display_n_row_sb->value());
|
||||
auto undo = new QPropertyUndoCommand(
|
||||
m_table_item.data(),
|
||||
"displayNRow",
|
||||
m_table_item->displayNRow(),
|
||||
ui->m_display_n_row_sb->value());
|
||||
undo->setText(tr("Modifier le nombre de ligne affiché par un tableau"));
|
||||
return undo;
|
||||
}
|
||||
|
||||
QMargins edited_header_margins(ui->m_header_left_margin->value(),
|
||||
ui->m_header_top_margin->value(),
|
||||
ui->m_header_right_margin->value(),
|
||||
ui->m_header_bottom_margin->value());
|
||||
auto model_header_margins = QETUtils::marginsFromString(m_table_item->model()->headerData(0, Qt::Horizontal, Qt::UserRole+1).toString());
|
||||
QMargins edited_header_margins(
|
||||
ui->m_header_left_margin->value(),
|
||||
ui->m_header_top_margin->value(),
|
||||
ui->m_header_right_margin->value(),
|
||||
ui->m_header_bottom_margin->value());
|
||||
auto model_header_margins = QETUtils::marginsFromString(
|
||||
m_table_item->model()->headerData(
|
||||
0,
|
||||
Qt::Horizontal,
|
||||
Qt::UserRole+1).toString());
|
||||
if (edited_header_margins != model_header_margins)
|
||||
{
|
||||
auto undo = new ModelHeaderDataCommand(m_table_item->model());
|
||||
undo->setData(0, Qt::Horizontal, QETUtils::marginsToString(edited_header_margins), Qt::UserRole+1);
|
||||
undo->setData(
|
||||
0,
|
||||
Qt::Horizontal,
|
||||
QETUtils::marginsToString(edited_header_margins),
|
||||
Qt::UserRole+1);
|
||||
undo->setText(tr("Modifier les marges d'une en tête de tableau"));
|
||||
return undo;
|
||||
}
|
||||
|
||||
QMargins edited_table_margins(ui->m_table_left_margin->value(),
|
||||
ui->m_table_top_margin->value(),
|
||||
ui->m_table_right_margin->value(),
|
||||
ui->m_table_bottom_margin->value());
|
||||
auto model_margins = QETUtils::marginsFromString(m_table_item->model()->index(0,0).data(Qt::UserRole+1).toString());
|
||||
QMargins edited_table_margins(
|
||||
ui->m_table_left_margin->value(),
|
||||
ui->m_table_top_margin->value(),
|
||||
ui->m_table_right_margin->value(),
|
||||
ui->m_table_bottom_margin->value());
|
||||
auto model_margins = QETUtils::marginsFromString(
|
||||
m_table_item->model()->index(0,0).data(Qt::UserRole+1).toString());
|
||||
if (edited_table_margins != model_margins)
|
||||
{
|
||||
auto undo = new ModelIndexCommand(m_table_item->model(), m_table_item->model()->index(0,0));
|
||||
undo->setData(QETUtils::marginsToString(edited_table_margins), Qt::UserRole+1);
|
||||
auto undo = new ModelIndexCommand(
|
||||
m_table_item->model(),
|
||||
m_table_item->model()->index(0,0));
|
||||
undo->setData(
|
||||
QETUtils::marginsToString(edited_table_margins),
|
||||
Qt::UserRole+1);
|
||||
undo->setText(tr("Modifier les marges d'un tableau"));
|
||||
return undo;
|
||||
}
|
||||
|
||||
if (m_header_button_group->checkedId() != m_table_item->model()->headerData(0, Qt::Horizontal, Qt::TextAlignmentRole).toInt())
|
||||
if (m_header_button_group->checkedId()
|
||||
!= m_table_item->model()->headerData(
|
||||
0,
|
||||
Qt::Horizontal,
|
||||
Qt::TextAlignmentRole).toInt())
|
||||
{
|
||||
auto undo = new ModelHeaderDataCommand(m_table_item->model());
|
||||
undo->setData(0, Qt::Horizontal, m_header_button_group->checkedId(), Qt::TextAlignmentRole);
|
||||
undo->setData(
|
||||
0,
|
||||
Qt::Horizontal,
|
||||
m_header_button_group->checkedId(),
|
||||
Qt::TextAlignmentRole);
|
||||
undo->setText(tr("Modifier l'alignement d'une en tête de tableau"));
|
||||
return undo;
|
||||
}
|
||||
|
||||
if (m_table_button_group->checkedId() != m_table_item->model()->index(0,0).data(Qt::TextAlignmentRole).toInt())
|
||||
if (m_table_button_group->checkedId()
|
||||
!= m_table_item->model()->index(0,0).data(Qt::TextAlignmentRole).toInt())
|
||||
{
|
||||
auto undo = new ModelIndexCommand(m_table_item->model(), m_table_item->model()->index(0,0));
|
||||
undo->setData(m_table_button_group->checkedId(), Qt::TextAlignmentRole);
|
||||
auto undo = new ModelIndexCommand(
|
||||
m_table_item->model(),
|
||||
m_table_item->model()->index(0,0));
|
||||
undo->setData(
|
||||
m_table_button_group->checkedId(),
|
||||
Qt::TextAlignmentRole);
|
||||
undo->setText(tr("Modifier l'alignement des textes d'un tableau"));
|
||||
return undo;
|
||||
}
|
||||
@ -205,13 +254,21 @@ void GraphicsTablePropertiesEditor::on_m_header_font_pb_clicked()
|
||||
if (m_table_item && m_table_item->model())
|
||||
{
|
||||
bool ok;
|
||||
auto font = QFontDialog::getFont(&ok,
|
||||
m_table_item->model()->headerData(0, Qt::Horizontal, Qt::FontRole).value<QFont>(),
|
||||
this);
|
||||
auto font = QFontDialog::getFont(
|
||||
&ok,
|
||||
m_table_item->model()->headerData(
|
||||
0,
|
||||
Qt::Horizontal,
|
||||
Qt::FontRole).value<QFont>(),
|
||||
this);
|
||||
if (ok && m_table_item->model())
|
||||
{
|
||||
auto undo = new ModelHeaderDataCommand(m_table_item->model());
|
||||
undo->setData(0, Qt::Horizontal, QVariant::fromValue(font), Qt::FontRole);
|
||||
undo->setData(
|
||||
0,
|
||||
Qt::Horizontal,
|
||||
QVariant::fromValue(font),
|
||||
Qt::FontRole);
|
||||
undo->setText(tr("Modifier la police d'une en tête de tableau"));
|
||||
m_table_item->diagram()->undoStack().push(undo);
|
||||
}
|
||||
@ -227,12 +284,15 @@ void GraphicsTablePropertiesEditor::on_m_table_font_pb_clicked()
|
||||
{
|
||||
bool ok;
|
||||
auto index = m_table_item->model()->index(0,0);
|
||||
auto old_font = m_table_item->model()->data(index, Qt::FontRole).value<QFont>();
|
||||
auto old_font = m_table_item->model()->data(
|
||||
index,
|
||||
Qt::FontRole).value<QFont>();
|
||||
auto new_font = QFontDialog::getFont(&ok, old_font, this);
|
||||
|
||||
if (ok && m_table_item->diagram())
|
||||
{
|
||||
auto undo = new ModelIndexCommand(m_table_item->model(), index);
|
||||
auto undo = new ModelIndexCommand(
|
||||
m_table_item->model(), index);
|
||||
undo->setData(QVariant::fromValue(new_font), Qt::FontRole);
|
||||
undo->setText(tr("Changer la police d'un tableau"));
|
||||
m_table_item->diagram()->undoStack().push(undo);
|
||||
@ -268,8 +328,12 @@ void GraphicsTablePropertiesEditor::updateUi()
|
||||
if (auto item_ = m_table_item->previousTable()) //Add the current previous table
|
||||
{
|
||||
m_other_table_vector.append(item_);
|
||||
ui->m_previous_table_cb->addItem(item_->tableName(), m_other_table_vector.indexOf(item_));
|
||||
ui->m_previous_table_cb->setCurrentIndex(ui->m_previous_table_cb->findData(m_other_table_vector.indexOf(item_)));
|
||||
ui->m_previous_table_cb->addItem(
|
||||
item_->tableName(),
|
||||
m_other_table_vector.indexOf(item_));
|
||||
ui->m_previous_table_cb->setCurrentIndex(
|
||||
ui->m_previous_table_cb->findData(
|
||||
m_other_table_vector.indexOf(item_)));
|
||||
}
|
||||
|
||||
ElementProvider ep(m_table_item->diagram()->project());
|
||||
@ -279,19 +343,27 @@ void GraphicsTablePropertiesEditor::updateUi()
|
||||
item_->nextTable() == nullptr)
|
||||
{
|
||||
m_other_table_vector.append(item_);
|
||||
ui->m_previous_table_cb->addItem(item_->tableName(), m_other_table_vector.indexOf(item_));
|
||||
ui->m_previous_table_cb->addItem(
|
||||
item_->tableName(),
|
||||
m_other_table_vector.indexOf(item_));
|
||||
}
|
||||
}
|
||||
|
||||
updateInfoLabel();
|
||||
|
||||
auto margin = QETUtils::marginsFromString(m_table_item->model()->headerData(0, Qt::Horizontal, Qt::UserRole+1).toString());
|
||||
auto margin = QETUtils::marginsFromString(
|
||||
m_table_item->model()->headerData(
|
||||
0,
|
||||
Qt::Horizontal,
|
||||
Qt::UserRole+1).toString());
|
||||
ui->m_header_top_margin ->setValue(margin.top());
|
||||
ui->m_header_left_margin ->setValue(margin.left());
|
||||
ui->m_header_right_margin ->setValue(margin.right());
|
||||
ui->m_header_bottom_margin->setValue(margin.bottom());
|
||||
|
||||
margin = QETUtils::marginsFromString(m_table_item->model()->index(0,0).data(Qt::UserRole+1).toString());
|
||||
margin = QETUtils::marginsFromString(
|
||||
m_table_item->model()->index(0,0).data(
|
||||
Qt::UserRole+1).toString());
|
||||
ui->m_table_top_margin ->setValue(margin.top());
|
||||
ui->m_table_left_margin ->setValue(margin.left());
|
||||
ui->m_table_right_margin ->setValue(margin.right());
|
||||
@ -302,9 +374,16 @@ void GraphicsTablePropertiesEditor::updateUi()
|
||||
return;
|
||||
}
|
||||
|
||||
if (auto button = m_header_button_group->button(m_table_item->model()->headerData(0, Qt::Horizontal, Qt::TextAlignmentRole).toInt()))
|
||||
if (auto button = m_header_button_group->button(
|
||||
m_table_item->model()->headerData(
|
||||
0,
|
||||
Qt::Horizontal,
|
||||
Qt::TextAlignmentRole).toInt()))
|
||||
button->setChecked(true);
|
||||
if (auto button = m_table_button_group->button(m_table_item->model()->data(m_table_item->model()->index(0,0), Qt::TextAlignmentRole).toInt()))
|
||||
if (auto button = m_table_button_group->button(
|
||||
m_table_item->model()->data(
|
||||
m_table_item->model()->index(0,0),
|
||||
Qt::TextAlignmentRole).toInt()))
|
||||
button->setChecked(true);
|
||||
|
||||
setUpEditConnection();
|
||||
@ -378,7 +457,8 @@ void GraphicsTablePropertiesEditor::setUpEditConnection()
|
||||
}
|
||||
}
|
||||
|
||||
void GraphicsTablePropertiesEditor::on_m_table_name_le_textEdited(const QString &arg1) {
|
||||
void GraphicsTablePropertiesEditor::on_m_table_name_le_textEdited(const QString &arg1)
|
||||
{
|
||||
m_table_item->setTableName(arg1);
|
||||
}
|
||||
|
||||
@ -387,7 +467,9 @@ void GraphicsTablePropertiesEditor::on_m_previous_table_cb_activated(int index)
|
||||
if (index == 0) {
|
||||
m_table_item->setPreviousTable();
|
||||
} else {
|
||||
m_table_item->setPreviousTable(m_other_table_vector.at(ui->m_previous_table_cb->currentData().toInt()));
|
||||
m_table_item->setPreviousTable(
|
||||
m_other_table_vector.at(
|
||||
ui->m_previous_table_cb->currentData().toInt()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -424,7 +506,10 @@ void GraphicsTablePropertiesEditor::on_m_auto_geometry_pb_clicked()
|
||||
*/
|
||||
void GraphicsTablePropertiesEditor::on_m_apply_geometry_to_linked_table_pb_clicked()
|
||||
{
|
||||
if (m_table_item.isNull() || !m_table_item->diagram() || (!m_table_item->nextTable() && !m_table_item->previousTable())) {
|
||||
if (m_table_item.isNull()
|
||||
|| !m_table_item->diagram()
|
||||
|| (!m_table_item->nextTable()
|
||||
&& !m_table_item->previousTable())) {
|
||||
return;
|
||||
}
|
||||
auto first_table = m_table_item;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user