mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Fix compilation warning (clang and gcc)
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5301 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -290,7 +290,7 @@ void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) {
|
||||
* @param t, type used
|
||||
*/
|
||||
void NumPartEditorW::setCurrentIndex(NumPartEditorW::type t) {
|
||||
int i;
|
||||
int i=-1;
|
||||
if (t == unit)
|
||||
i = ui->type_cb->findText(tr("Chiffre 1"));
|
||||
else if (t == unitfolio)
|
||||
|
||||
@@ -123,7 +123,11 @@ void ElementsPanel::panelContentChange() {
|
||||
@param project Projet a inserer dans le panel d'elements
|
||||
@return Le QTreeWidgetItem insere le plus haut
|
||||
*/
|
||||
QTreeWidgetItem *ElementsPanel::addProject(QETProject *project) {
|
||||
QTreeWidgetItem *ElementsPanel::addProject(QETProject *project, QTreeWidgetItem *parent_item, PanelOptions options)
|
||||
{
|
||||
Q_UNUSED(parent_item)
|
||||
Q_UNUSED(options)
|
||||
|
||||
bool first_add = (first_reload_ || !projects_to_display_.contains(project));
|
||||
|
||||
// create the QTreeWidgetItem representing the project
|
||||
|
||||
@@ -74,7 +74,7 @@ class ElementsPanel : public GenericPanel {
|
||||
void panelContentChange();
|
||||
|
||||
private:
|
||||
virtual QTreeWidgetItem *addProject (QETProject *);
|
||||
QTreeWidgetItem *addProject (QETProject *, QTreeWidgetItem * = nullptr, PanelOptions = AddAllChild) override;
|
||||
QTreeWidgetItem *updateTemplatesCollectionItem(QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions = AddAllChild, bool = false) override;
|
||||
QTreeWidgetItem *updateTemplateItem (QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions, bool = false) override;
|
||||
|
||||
|
||||
@@ -1020,7 +1020,13 @@ QDomElement Conductor::toXml(QDomDocument &dom_document, QHash<Terminal *, int>
|
||||
|
||||
// Export the properties and text
|
||||
m_properties. toXml(dom_element);
|
||||
m_text_item -> toXml(dom_element);
|
||||
if(m_text_item->wasMovedByUser())
|
||||
{
|
||||
dom_element.setAttribute("userx", QString::number(m_text_item->pos().x()));
|
||||
dom_element.setAttribute("usery", QString::number(m_text_item->pos().y()));
|
||||
}
|
||||
if(m_text_item->wasRotateByUser())
|
||||
dom_element.setAttribute("rotation", QString::number(m_text_item->rotation()));
|
||||
|
||||
return(dom_element);
|
||||
}
|
||||
|
||||
@@ -78,22 +78,6 @@ void ConductorTextItem::fromXml(const QDomElement &e) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ConductorTextItem::toXml
|
||||
* Export the properties of this text in the attribute of the xml element given in parameter
|
||||
* The properties exported are position and rotation (only if moved or rotate by user)
|
||||
* @param xml
|
||||
*/
|
||||
void ConductorTextItem::toXml(QDomElement &xml) const {
|
||||
if (moved_by_user_) {
|
||||
xml.setAttribute("userx", QString("%1").arg(pos().x()));
|
||||
xml.setAttribute("usery", QString("%1").arg(pos().y()));
|
||||
}
|
||||
if (rotate_by_user_) {
|
||||
xml.setAttribute("rotation", QString("%1").arg(rotation()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@return true si ce champ de texte a ete explictement deplace par
|
||||
l'utilisateur, false sinon
|
||||
|
||||
@@ -42,7 +42,6 @@ class ConductorTextItem : public DiagramTextItem
|
||||
enum { Type = UserType + 1006 };
|
||||
Conductor *parentConductor() const;
|
||||
void fromXml(const QDomElement &) override;
|
||||
virtual void toXml (QDomElement &xml) const;
|
||||
int type() const override { return Type; }
|
||||
virtual bool wasMovedByUser() const;
|
||||
virtual bool wasRotateByUser() const;
|
||||
|
||||
@@ -75,7 +75,7 @@ void CrossRefItem::init()
|
||||
{
|
||||
if(!m_element->diagram())
|
||||
{
|
||||
qDebug() << "CrossRefItem constructor", "element is not in a diagram";
|
||||
qDebug() << "CrossRefItem constructor" << "element is not in a diagram";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -253,6 +253,7 @@ bool CrossRefItem::sceneEvent(QEvent *event)
|
||||
case QEvent::GraphicsSceneMouseDoubleClick:
|
||||
mouseDoubleClickEvent(static_cast<QGraphicsSceneMouseEvent *>(event));
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -648,6 +648,7 @@ bool CustomElement::parsePolygon(QDomElement &e, QPainter &qp, bool addtolist) {
|
||||
@return true si l'analyse reussit, false sinon
|
||||
*/
|
||||
bool CustomElement::parseText(QDomElement &e, QPainter &qp, bool addtolist) {
|
||||
Q_UNUSED(addtolist);
|
||||
qreal pos_x, pos_y;
|
||||
int size;
|
||||
if (
|
||||
|
||||
@@ -963,7 +963,7 @@ void DynamicElementTextItem::clearFormulaConnection()
|
||||
|
||||
void DynamicElementTextItem::updateReportFormulaConnection()
|
||||
{
|
||||
if(!m_parent_element.data()->linkType() & Element::AllReport)
|
||||
if(!(m_parent_element.data()->linkType() & Element::AllReport))
|
||||
return;
|
||||
|
||||
removeConnectionForReportFormula(m_report_formula);
|
||||
@@ -977,7 +977,7 @@ void DynamicElementTextItem::updateReportFormulaConnection()
|
||||
*/
|
||||
void DynamicElementTextItem::updateReportText()
|
||||
{
|
||||
if(!m_parent_element.data()->linkType() & Element::AllReport)
|
||||
if(!(m_parent_element.data()->linkType() & Element::AllReport))
|
||||
return;
|
||||
|
||||
if (m_text_from == ElementInfo && m_info_name == "label" && m_other_report)
|
||||
|
||||
@@ -356,12 +356,6 @@ bool Element::valideXml(QDomElement &e) {
|
||||
*/
|
||||
bool Element::fromXml(QDomElement &e, QHash<int, Terminal *> &table_id_adr, bool handle_inputs_rotation)
|
||||
{
|
||||
QDomDocument doc = e.ownerDocument();
|
||||
QDomElement root = doc.documentElement();
|
||||
double saved_version = -1;
|
||||
if(root.tagName() == "project")
|
||||
saved_version = root.attribute("version", "-1").toDouble();
|
||||
|
||||
/*
|
||||
les bornes vont maintenant etre recensees pour associer leurs id a leur adresse reelle
|
||||
ce recensement servira lors de la mise en place des fils
|
||||
|
||||
@@ -78,11 +78,11 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
static const char RichTextDialogGroupC[] = "RichTextDialog";
|
||||
static const char GeometryKeyC[] = "Geometry";
|
||||
static const char TabKeyC[] = "Tab";
|
||||
//static const char RichTextDialogGroupC[] = "RichTextDialog";
|
||||
//static const char GeometryKeyC[] = "Geometry";
|
||||
//static const char TabKeyC[] = "Tab";
|
||||
|
||||
const bool simplifyRichTextDefault = true;
|
||||
//const bool simplifyRichTextDefault = true;
|
||||
|
||||
namespace qdesigner_internal {
|
||||
// Richtext simplification filter helpers: Elements to be discarded
|
||||
|
||||
@@ -687,9 +687,9 @@ void QETTitleBlockTemplateEditor::updateEditorTitle() {
|
||||
void QETTitleBlockTemplateEditor::updateActions() {
|
||||
save_ -> setEnabled(!read_only_);
|
||||
|
||||
bool can_merge;
|
||||
bool can_split;
|
||||
int count;
|
||||
bool can_merge = true;
|
||||
bool can_split = true;
|
||||
int count = 0;
|
||||
if (!read_only_) {
|
||||
template_edition_area_view_ -> analyzeSelectedCells(&can_merge, &can_split, &count);
|
||||
}
|
||||
|
||||
@@ -1255,6 +1255,7 @@ void DynamicElementTextModel::updateDataFromText(DynamicElementTextItem *deti, V
|
||||
qsi->child(width_txt_row,1)->setData(deti->textWidth(), Qt::EditRole);
|
||||
break;
|
||||
}
|
||||
default:break;
|
||||
}
|
||||
|
||||
m_block_dataChanged = false;
|
||||
@@ -1296,6 +1297,7 @@ void DynamicElementTextModel::updateDataFromGroup(ElementTextItemGroup *group, D
|
||||
enableGroupRotation(group);
|
||||
break;
|
||||
}
|
||||
default:break;
|
||||
}
|
||||
|
||||
m_block_dataChanged = false;
|
||||
@@ -1540,6 +1542,7 @@ bool DynamicTextItemDelegate::eventFilter(QObject *object, QEvent *event)
|
||||
emit commitData(sb); break;
|
||||
case QEvent::Wheel:
|
||||
emit commitData(sb); break;
|
||||
default:break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ bool ImagePropertiesWidget::setLiveEdit(bool live_edit)
|
||||
* @return the change in an undo command (ItemResizerCommand).
|
||||
* If there is no change return nullptr
|
||||
*/
|
||||
QUndoCommand* ImagePropertiesWidget::associatedUndo()
|
||||
QUndoCommand* ImagePropertiesWidget::associatedUndo() const
|
||||
{
|
||||
|
||||
qreal value = ui->m_scale_slider->value();
|
||||
|
||||
@@ -42,7 +42,7 @@ class ImagePropertiesWidget : public PropertiesEditorWidget
|
||||
void apply() override;
|
||||
void reset() override;
|
||||
bool setLiveEdit(bool live_edit) override;
|
||||
QUndoCommand* associatedUndo();
|
||||
QUndoCommand* associatedUndo() const override;
|
||||
|
||||
private:
|
||||
void updateUi() override;
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
|
||||
RotateSelectionCommand::RotateSelectionCommand(Diagram *diagram, qreal angle, QUndoCommand *parent) :
|
||||
QUndoCommand(parent),
|
||||
m_diagram(diagram),
|
||||
m_angle(angle)
|
||||
m_diagram(diagram)
|
||||
{
|
||||
setText(QObject::tr("Pivoter la selection"));
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ class RotateSelectionCommand : public QUndoCommand
|
||||
|
||||
private:
|
||||
Diagram *m_diagram =nullptr;
|
||||
qreal m_angle;
|
||||
|
||||
QList<QPointer<ConductorTextItem>> m_cond_text;
|
||||
QHash<ConductorTextItem *, bool> m_rotate_by_user;
|
||||
|
||||
Reference in New Issue
Block a user