diff --git a/sources/ElementsCollection/elementslocation.cpp b/sources/ElementsCollection/elementslocation.cpp index 2048b2535..0772e5045 100644 --- a/sources/ElementsCollection/elementslocation.cpp +++ b/sources/ElementsCollection/elementslocation.cpp @@ -649,7 +649,7 @@ QIcon ElementsLocation::icon() const { ElementFactory *factory = ElementFactory::Instance(); int state; - Element *elmt = factory->createElement(*this, 0, &state); + Element *elmt = factory->createElement(*this, nullptr, &state); if (state == 0) return QIcon(elmt->pixmap()); diff --git a/sources/ElementsCollection/elementstreeview.cpp b/sources/ElementsCollection/elementstreeview.cpp index 657157033..ecf4f1807 100644 --- a/sources/ElementsCollection/elementstreeview.cpp +++ b/sources/ElementsCollection/elementstreeview.cpp @@ -89,7 +89,7 @@ void ElementsTreeView::startElementDrag(const ElementsLocation &location) //Build the element for set the pixmap of the QDrag int elmt_creation_state; - Element *temp_elmt = ElementFactory::Instance()->createElement(location, 0, &elmt_creation_state); + Element *temp_elmt = ElementFactory::Instance()->createElement(location, nullptr, &elmt_creation_state); if (elmt_creation_state) { delete temp_elmt; diff --git a/sources/ElementsCollection/ui/renamedialog.h b/sources/ElementsCollection/ui/renamedialog.h index 33f6b857d..409c776d4 100644 --- a/sources/ElementsCollection/ui/renamedialog.h +++ b/sources/ElementsCollection/ui/renamedialog.h @@ -30,7 +30,7 @@ class RenameDialog : public QDialog Q_OBJECT public: - explicit RenameDialog(QString path, QWidget *parent = 0); + explicit RenameDialog(QString path, QWidget *parent = nullptr); ~RenameDialog(); QString newName() const {return m_new_name;} diff --git a/sources/PropertiesEditor/propertieseditordialog.h b/sources/PropertiesEditor/propertieseditordialog.h index 78f75fc2e..bdf615099 100644 --- a/sources/PropertiesEditor/propertieseditordialog.h +++ b/sources/PropertiesEditor/propertieseditordialog.h @@ -39,7 +39,7 @@ class PropertiesEditorDialog : public QDialog Q_OBJECT public: template - PropertiesEditorDialog(T editor, QWidget *parent = 0) : + PropertiesEditorDialog(T editor, QWidget *parent = nullptr) : QDialog (parent) { //Set dialog title diff --git a/sources/PropertiesEditor/propertieseditordockwidget.h b/sources/PropertiesEditor/propertieseditordockwidget.h index 935334070..b673fdea9 100644 --- a/sources/PropertiesEditor/propertieseditordockwidget.h +++ b/sources/PropertiesEditor/propertieseditordockwidget.h @@ -31,7 +31,7 @@ class PropertiesEditorDockWidget : public QDockWidget Q_OBJECT public: - explicit PropertiesEditorDockWidget(QWidget *parent = 0); + explicit PropertiesEditorDockWidget(QWidget *parent = nullptr); ~PropertiesEditorDockWidget(); virtual void clear(); diff --git a/sources/PropertiesEditor/propertieseditorwidget.h b/sources/PropertiesEditor/propertieseditorwidget.h index 445ac5456..bbdb1da35 100644 --- a/sources/PropertiesEditor/propertieseditorwidget.h +++ b/sources/PropertiesEditor/propertieseditorwidget.h @@ -31,7 +31,7 @@ class PropertiesEditorWidget : public QWidget { Q_OBJECT public: - explicit PropertiesEditorWidget(QWidget *parent = 0); + explicit PropertiesEditorWidget(QWidget *parent = nullptr); virtual void apply() {} virtual void reset() {} diff --git a/sources/QPropertyUndoCommand/qpropertyundocommand.h b/sources/QPropertyUndoCommand/qpropertyundocommand.h index 3e8fe5982..b8db96239 100644 --- a/sources/QPropertyUndoCommand/qpropertyundocommand.h +++ b/sources/QPropertyUndoCommand/qpropertyundocommand.h @@ -33,8 +33,8 @@ class QObject; class QPropertyUndoCommand : public QUndoCommand { public: - QPropertyUndoCommand(QObject *object, const char *property_name, const QVariant &old_value, const QVariant &new_value, QUndoCommand *parent = 0); - QPropertyUndoCommand(QObject *object, const char *property_name, const QVariant &old_value, QUndoCommand *parent = 0); + QPropertyUndoCommand(QObject *object, const char *property_name, const QVariant &old_value, const QVariant &new_value, QUndoCommand *parent = nullptr); + QPropertyUndoCommand(QObject *object, const char *property_name, const QVariant &old_value, QUndoCommand *parent = nullptr); void setNewValue(const QVariant &new_value); void enableAnimation (bool animate = true); diff --git a/sources/aboutqet.h b/sources/aboutqet.h index df896ba92..f5ffb674f 100644 --- a/sources/aboutqet.h +++ b/sources/aboutqet.h @@ -27,7 +27,7 @@ class AboutQET : public QDialog { // constructors, destructor public: - AboutQET(QWidget * = 0); + AboutQET(QWidget * = nullptr); virtual ~AboutQET(); private: diff --git a/sources/autoNum/numerotationcontextcommands.cpp b/sources/autoNum/numerotationcontextcommands.cpp index 8be96f851..6c16a6bcf 100644 --- a/sources/autoNum/numerotationcontextcommands.cpp +++ b/sources/autoNum/numerotationcontextcommands.cpp @@ -24,7 +24,7 @@ NumerotationContextCommands::NumerotationContextCommands(const NumerotationContext &nc, Diagram *d): diagram_ (d), context_ (nc), - strategy_ (NULL) + strategy_ (nullptr) {} /** diff --git a/sources/autoNum/ui/autonumberingdockwidget.cpp b/sources/autoNum/ui/autonumberingdockwidget.cpp index 574687a59..18427bb6b 100644 --- a/sources/autoNum/ui/autonumberingdockwidget.cpp +++ b/sources/autoNum/ui/autonumberingdockwidget.cpp @@ -167,7 +167,7 @@ void AutoNumberingDockWidget::setContext() { * @param dv: activated diagramview */ void AutoNumberingDockWidget::setConductorActive(DiagramView* dv) { - if (dv!=NULL) { + if (dv!=nullptr) { QString conductor_autonum = dv->diagram()->conductorsAutonumName(); int conductor_index = ui->m_conductor_cb->findText(conductor_autonum); ui->m_conductor_cb->setCurrentIndex(conductor_index); @@ -180,7 +180,7 @@ void AutoNumberingDockWidget::setConductorActive(DiagramView* dv) { */ void AutoNumberingDockWidget::setActive() { - if (m_project_view!=NULL) { + if (m_project_view!=nullptr) { //Conductor if (m_project_view->currentDiagram()) { QString conductor_autonum = m_project_view->currentDiagram()->diagram()->conductorsAutonumName(); diff --git a/sources/autoNum/ui/autonumberingdockwidget.h b/sources/autoNum/ui/autonumberingdockwidget.h index 76dae7b6f..9f7e5aa79 100644 --- a/sources/autoNum/ui/autonumberingdockwidget.h +++ b/sources/autoNum/ui/autonumberingdockwidget.h @@ -31,7 +31,7 @@ class AutoNumberingDockWidget : public QDockWidget Q_OBJECT public: - explicit AutoNumberingDockWidget(QWidget *parent = 0); + explicit AutoNumberingDockWidget(QWidget *parent = nullptr); ~AutoNumberingDockWidget(); void setContext(); diff --git a/sources/autoNum/ui/autonumberingmanagementw.h b/sources/autoNum/ui/autonumberingmanagementw.h index 504d1b35d..b0dcb0743 100644 --- a/sources/autoNum/ui/autonumberingmanagementw.h +++ b/sources/autoNum/ui/autonumberingmanagementw.h @@ -34,7 +34,7 @@ class AutoNumberingManagementW : public QWidget //METHODS public: - explicit AutoNumberingManagementW(QETProject *project, QWidget *parent = 0); + explicit AutoNumberingManagementW(QETProject *project, QWidget *parent = nullptr); ~AutoNumberingManagementW(); Ui::AutoNumberingManagementW *ui; void setProjectContext (); diff --git a/sources/autoNum/ui/folioautonumbering.h b/sources/autoNum/ui/folioautonumbering.h index b3ee3c867..25327c8e7 100644 --- a/sources/autoNum/ui/folioautonumbering.h +++ b/sources/autoNum/ui/folioautonumbering.h @@ -35,7 +35,7 @@ class FolioAutonumberingW : public QWidget //METHODS public: - explicit FolioAutonumberingW(QETProject *project, QWidget *parent = 0); + explicit FolioAutonumberingW(QETProject *project, QWidget *parent = nullptr); ~FolioAutonumberingW(); void setContext (QList autonums); diff --git a/sources/autoNum/ui/formulaautonumberingw.h b/sources/autoNum/ui/formulaautonumberingw.h index 7e77a0ace..c74199073 100644 --- a/sources/autoNum/ui/formulaautonumberingw.h +++ b/sources/autoNum/ui/formulaautonumberingw.h @@ -38,7 +38,7 @@ class FormulaAutonumberingW : public QWidget //METHODS public: - explicit FormulaAutonumberingW(QWidget *parent = 0); + explicit FormulaAutonumberingW(QWidget *parent = nullptr); ~FormulaAutonumberingW(); QString formula(); void setContext(QString); diff --git a/sources/autoNum/ui/numparteditorw.cpp b/sources/autoNum/ui/numparteditorw.cpp index beade696d..8ab2fe52e 100644 --- a/sources/autoNum/ui/numparteditorw.cpp +++ b/sources/autoNum/ui/numparteditorw.cpp @@ -249,7 +249,7 @@ void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) { ui -> value_field -> clear(); ui -> increase_spinBox -> setDisabled(true); if (t==string) { - ui -> value_field -> setValidator(0); + ui -> value_field -> setValidator(nullptr); ui -> value_field -> setEnabled(true); } else if (t==folio) { diff --git a/sources/autoNum/ui/numparteditorw.h b/sources/autoNum/ui/numparteditorw.h index 65b26a950..f05ee837d 100644 --- a/sources/autoNum/ui/numparteditorw.h +++ b/sources/autoNum/ui/numparteditorw.h @@ -37,8 +37,8 @@ class NumPartEditorW : public QWidget //METHODS public: - explicit NumPartEditorW(int type, QWidget *parent = 0); - NumPartEditorW (NumerotationContext &, int, int type, QWidget *parent=0); + explicit NumPartEditorW(int type, QWidget *parent = nullptr); + NumPartEditorW (NumerotationContext &, int, int type, QWidget *parent=nullptr); ~NumPartEditorW(); enum type {unit,unitfolio,ten,tenfolio, hundred, hundredfolio, diff --git a/sources/autoNum/ui/selectautonumw.h b/sources/autoNum/ui/selectautonumw.h index af7ca2d25..c5890f9cb 100644 --- a/sources/autoNum/ui/selectautonumw.h +++ b/sources/autoNum/ui/selectautonumw.h @@ -37,8 +37,8 @@ class SelectAutonumW : public QWidget //METHODS public: - explicit SelectAutonumW(int type, QWidget *parent = 0); - explicit SelectAutonumW(const NumerotationContext &context, int type, QWidget *parent = 0); + explicit SelectAutonumW(int type, QWidget *parent = nullptr); + explicit SelectAutonumW(const NumerotationContext &context, int type, QWidget *parent = nullptr); ~SelectAutonumW(); void setContext (const NumerotationContext &context); diff --git a/sources/bordertitleblock.h b/sources/bordertitleblock.h index c0e9ba6b4..812fb1f3f 100644 --- a/sources/bordertitleblock.h +++ b/sources/bordertitleblock.h @@ -37,7 +37,7 @@ class BorderTitleBlock : public QObject Q_OBJECT public: - BorderTitleBlock(QObject * = 0); + BorderTitleBlock(QObject * = nullptr); virtual ~BorderTitleBlock(); private: @@ -153,7 +153,7 @@ class BorderTitleBlock : public QObject btb_folio_ = folio; emit (titleBlockFolioChanged(folio)); } - void setFolioData(int, int, QString = NULL, const DiagramContext & = DiagramContext()); + void setFolioData(int, int, QString = nullptr, const DiagramContext & = DiagramContext()); /// @param author the new value of the "File" field void setMachine(const QString &machine) { btb_machine_ = machine; } void setLocMach(const QString &locmach) { btb_locmach_ = locmach; } @@ -180,7 +180,7 @@ class BorderTitleBlock : public QObject public slots: void titleBlockTemplateChanged(const QString &); - void titleBlockTemplateRemoved(const QString &, const TitleBlockTemplate * = 0); + void titleBlockTemplateRemoved(const QString &, const TitleBlockTemplate * = nullptr); // methods to set display options void displayTitleBlock(bool); diff --git a/sources/conductorsegment.cpp b/sources/conductorsegment.cpp index a6a01ca43..cd42fcdeb 100644 --- a/sources/conductorsegment.cpp +++ b/sources/conductorsegment.cpp @@ -477,14 +477,14 @@ void ConductorSegment::setSecondPoint(const QPointF &p) { @return true si le segment a un segment precedent, false sinon */ bool ConductorSegment::hasPreviousSegment() const { - return(previous_segment != NULL); + return(previous_segment != nullptr); } /** @return true si le segment a un segment suivant, false sinon */ bool ConductorSegment::hasNextSegment() const { - return(next_segment != NULL); + return(next_segment != nullptr); } /** diff --git a/sources/conductorsegment.h b/sources/conductorsegment.h index 5f132af6f..555fe1f36 100644 --- a/sources/conductorsegment.h +++ b/sources/conductorsegment.h @@ -26,7 +26,7 @@ class ConductorSegment { // constructors, destructor public: - ConductorSegment(const QPointF &, const QPointF &, ConductorSegment * = NULL, ConductorSegment * = NULL); + ConductorSegment(const QPointF &, const QPointF &, ConductorSegment * = nullptr, ConductorSegment * = nullptr); virtual ~ConductorSegment(); private: diff --git a/sources/configdialog.h b/sources/configdialog.h index 4598d04b5..2409dbffa 100644 --- a/sources/configdialog.h +++ b/sources/configdialog.h @@ -32,7 +32,7 @@ class ConfigDialog : public QDialog { Q_OBJECT // constructors, destructor public: - ConfigDialog(QWidget * = 0); + ConfigDialog(QWidget * = nullptr); virtual ~ConfigDialog(); private: ConfigDialog(const ConfigDialog &); diff --git a/sources/configpages.h b/sources/configpages.h index 7019c3a9b..fbc7e7eaa 100644 --- a/sources/configpages.h +++ b/sources/configpages.h @@ -38,7 +38,7 @@ class NewDiagramPage : public ConfigPage { Q_OBJECT // constructors, destructor public: - NewDiagramPage(QETProject *project = 0, QWidget * = 0, ProjectPropertiesDialog *teste = NULL); + NewDiagramPage(QETProject *project = nullptr, QWidget * = nullptr, ProjectPropertiesDialog *teste = nullptr); virtual ~NewDiagramPage(); private: NewDiagramPage(const NewDiagramPage &); @@ -76,7 +76,7 @@ class GeneralConfigurationPage : public ConfigPage { Q_OBJECT // constructors, destructor public: - GeneralConfigurationPage(QWidget * = 0); + GeneralConfigurationPage(QWidget * = nullptr); virtual ~GeneralConfigurationPage(); private: GeneralConfigurationPage(const GeneralConfigurationPage &); @@ -121,7 +121,7 @@ class ExportConfigPage : public ConfigPage { Q_OBJECT // constructors, destructor public: - ExportConfigPage(QWidget * = 0); + ExportConfigPage(QWidget * = nullptr); virtual ~ExportConfigPage(); private: ExportConfigPage(const ExportConfigPage &); @@ -144,7 +144,7 @@ class PrintConfigPage : public ConfigPage { Q_OBJECT // constructors, destructor public: - PrintConfigPage(QWidget * = 0); + PrintConfigPage(QWidget * = nullptr); virtual ~PrintConfigPage(); private: PrintConfigPage(const PrintConfigPage &); diff --git a/sources/diagram.cpp b/sources/diagram.cpp index 7b0beea11..12fd37a92 100644 --- a/sources/diagram.cpp +++ b/sources/diagram.cpp @@ -67,7 +67,7 @@ Diagram::Diagram(QETProject *project) : setProject(project); qgi_manager_ = new QGIManager(this); setBackgroundBrush(Qt::white); - conductor_setter_ = new QGraphicsLineItem(0); + conductor_setter_ = new QGraphicsLineItem(nullptr); conductor_setter_ -> setZValue(1000000); QPen pen(Qt::NoBrush, 1.5, Qt::DashLine); @@ -863,7 +863,7 @@ bool Diagram::fromXml(QDomElement &document, QPointF position, bool consider_inf } int state = 0; - Element *nvel_elmt = ElementFactory::Instance() -> createElement(element_location, 0, &state); + Element *nvel_elmt = ElementFactory::Instance() -> createElement(element_location, nullptr, &state); if (state) { QString debug_message = QString("Diagram::fromXml() : Le chargement de la description de l'element %1 a echoue avec le code d'erreur %2").arg(element_location.path()).arg(state); diff --git a/sources/diagram.h b/sources/diagram.h index c71c91e5c..93d487033 100644 --- a/sources/diagram.h +++ b/sources/diagram.h @@ -150,9 +150,9 @@ class Diagram : public QGraphicsScene // methods related to XML import/export QDomDocument toXml(bool = true); - bool initFromXml(QDomElement &, QPointF = QPointF(), bool = true, DiagramContent * = 0); - bool fromXml(QDomDocument &, QPointF = QPointF(), bool = true, DiagramContent * = 0); - bool fromXml(QDomElement &, QPointF = QPointF(), bool = true, DiagramContent * = 0); + bool initFromXml(QDomElement &, QPointF = QPointF(), bool = true, DiagramContent * = nullptr); + bool fromXml(QDomDocument &, QPointF = QPointF(), bool = true, DiagramContent * = nullptr); + bool fromXml(QDomElement &, QPointF = QPointF(), bool = true, DiagramContent * = nullptr); void folioSequentialsToXml(QHash*, QDomElement *, QString, QString, QDomDocument *); void folioSequentialsFromXml(const QDomElement&, QHash*, QString, QString, QString, QString); @@ -192,10 +192,10 @@ class Diagram : public QGraphicsScene DiagramContent content() const; DiagramContent selectedContent(); bool canRotateSelection() const; - int beginMoveElements(QGraphicsItem * = 0); + int beginMoveElements(QGraphicsItem * = nullptr); void continueMoveElements(const QPointF &); void endMoveElements(); - int beginMoveElementTexts(QGraphicsItem * = 0); + int beginMoveElementTexts(QGraphicsItem * = nullptr); void continueMoveElementTexts(const QPointF &); void endMoveElementTexts(); bool usesElement(const ElementsLocation &); diff --git a/sources/diagramcommands.h b/sources/diagramcommands.h index 4ca8d84be..5ac5274c4 100644 --- a/sources/diagramcommands.h +++ b/sources/diagramcommands.h @@ -87,7 +87,7 @@ QString itemText(const Conductor *item); class PasteDiagramCommand : public QUndoCommand { // constructors, destructor public: - PasteDiagramCommand(Diagram *, const DiagramContent &, QUndoCommand * = 0); + PasteDiagramCommand(Diagram *, const DiagramContent &, QUndoCommand * = nullptr); virtual ~PasteDiagramCommand(); private: PasteDiagramCommand(const PasteDiagramCommand &); @@ -115,7 +115,7 @@ class PasteDiagramCommand : public QUndoCommand { class CutDiagramCommand : public DeleteQGraphicsItemCommand { // constructors, destructor public: - CutDiagramCommand(Diagram *, const DiagramContent &, QUndoCommand * = 0); + CutDiagramCommand(Diagram *, const DiagramContent &, QUndoCommand * = nullptr); virtual ~CutDiagramCommand(); private: CutDiagramCommand(const CutDiagramCommand &); @@ -127,7 +127,7 @@ class CutDiagramCommand : public DeleteQGraphicsItemCommand { class MoveElementsCommand : public QUndoCommand { // constructors, destructor public: - MoveElementsCommand(Diagram *, const DiagramContent &, const QPointF &m, QUndoCommand * = 0); + MoveElementsCommand(Diagram *, const DiagramContent &, const QPointF &m, QUndoCommand * = nullptr); virtual ~MoveElementsCommand(); private: MoveElementsCommand(const MoveElementsCommand &); @@ -162,7 +162,7 @@ class MoveElementsCommand : public QUndoCommand { class MoveConductorsTextsCommand : public QUndoCommand { // constructors, destructor public: - MoveConductorsTextsCommand(Diagram *, QUndoCommand * = 0); + MoveConductorsTextsCommand(Diagram *, QUndoCommand * = nullptr); virtual ~MoveConductorsTextsCommand(); private: MoveConductorsTextsCommand(const MoveConductorsTextsCommand &); @@ -192,7 +192,7 @@ class MoveConductorsTextsCommand : public QUndoCommand { class ChangeDiagramTextCommand : public QUndoCommand { // constructors, destructor public: - ChangeDiagramTextCommand(DiagramTextItem *, const QString &before, const QString &after, QUndoCommand * = 0); + ChangeDiagramTextCommand(DiagramTextItem *, const QString &before, const QString &after, QUndoCommand * = nullptr); virtual ~ChangeDiagramTextCommand(); private: ChangeDiagramTextCommand(const ChangeDiagramTextCommand &); @@ -221,7 +221,7 @@ class ChangeDiagramTextCommand : public QUndoCommand { class RotateElementsCommand : public QUndoCommand { // constructors, destructor public: - RotateElementsCommand(const QList &elements, const QList &, const QList &, QUndoCommand * = 0); + RotateElementsCommand(const QList &elements, const QList &, const QList &, QUndoCommand * = nullptr); virtual ~RotateElementsCommand(); private: RotateElementsCommand(const RotateElementsCommand &); @@ -284,7 +284,7 @@ class RotateTextsCommand : public QUndoCommand class ChangeConductorCommand : public QUndoCommand { // constructors, destructor public: - ChangeConductorCommand(Conductor *, const ConductorProfile &, const ConductorProfile &, Qt::Corner, QUndoCommand * = 0); + ChangeConductorCommand(Conductor *, const ConductorProfile &, const ConductorProfile &, Qt::Corner, QUndoCommand * = nullptr); virtual ~ChangeConductorCommand(); private: ChangeConductorCommand(const ChangeConductorCommand &); @@ -320,7 +320,7 @@ class ChangeConductorCommand : public QUndoCommand { class ResetConductorCommand : public QUndoCommand { // constructors, destructor public: - ResetConductorCommand(const QHash &, QUndoCommand * = 0); + ResetConductorCommand(const QHash &, QUndoCommand * = nullptr); virtual ~ResetConductorCommand(); private: ResetConductorCommand(const ResetConductorCommand &); @@ -343,7 +343,7 @@ class ResetConductorCommand : public QUndoCommand { class ChangeTitleBlockCommand : public QUndoCommand { // constructors, destructor public: - ChangeTitleBlockCommand(Diagram *, const TitleBlockProperties &, const TitleBlockProperties &, QUndoCommand * = 0); + ChangeTitleBlockCommand(Diagram *, const TitleBlockProperties &, const TitleBlockProperties &, QUndoCommand * = nullptr); virtual ~ChangeTitleBlockCommand(); private: ChangeTitleBlockCommand(const ChangeTitleBlockCommand &); @@ -369,7 +369,7 @@ class ChangeTitleBlockCommand : public QUndoCommand { class ChangeBorderCommand : public QUndoCommand { // constructors, destructor public: - ChangeBorderCommand(Diagram *, const BorderProperties &, const BorderProperties &, QUndoCommand * = 0); + ChangeBorderCommand(Diagram *, const BorderProperties &, const BorderProperties &, QUndoCommand * = nullptr); virtual ~ChangeBorderCommand(); private: ChangeBorderCommand(const ChangeBorderCommand &); diff --git a/sources/diagramcontextwidget.h b/sources/diagramcontextwidget.h index f9b22be97..11f536c33 100644 --- a/sources/diagramcontextwidget.h +++ b/sources/diagramcontextwidget.h @@ -29,7 +29,7 @@ class DiagramContextWidget : public QWidget { Q_OBJECT // Constructor, destructor public: - DiagramContextWidget(QWidget *parent = 0); + DiagramContextWidget(QWidget *parent = nullptr); virtual ~DiagramContextWidget(); private: DiagramContextWidget(const DiagramContextWidget &); diff --git a/sources/diagramevent/diagrameventaddelement.cpp b/sources/diagramevent/diagrameventaddelement.cpp index 84caefb39..c6ff54a1d 100644 --- a/sources/diagramevent/diagrameventaddelement.cpp +++ b/sources/diagramevent/diagrameventaddelement.cpp @@ -180,7 +180,7 @@ bool DiagramEventAddElement::buildElement() int state; ElementsLocation loc(m_integrate_path); - m_element = ElementFactory::Instance() -> createElement(loc, 0, &state); + m_element = ElementFactory::Instance() -> createElement(loc, nullptr, &state); //The creation of element failed, we delete it if (state) { delete m_element; @@ -200,9 +200,9 @@ void DiagramEventAddElement::addElement() int state; Element *element; if (m_integrate_path.isEmpty()) - element = ElementFactory::Instance() -> createElement(m_location, 0, &state); + element = ElementFactory::Instance() -> createElement(m_location, nullptr, &state); else - element = ElementFactory::Instance() -> createElement(ElementsLocation(m_integrate_path), 0, &state); + element = ElementFactory::Instance() -> createElement(ElementsLocation(m_integrate_path), nullptr, &state); //Build failed if (state) diff --git a/sources/diagramprintdialog.cpp b/sources/diagramprintdialog.cpp index 965c6cbb6..fa74a4b94 100644 --- a/sources/diagramprintdialog.cpp +++ b/sources/diagramprintdialog.cpp @@ -34,7 +34,7 @@ DiagramPrintDialog::DiagramPrintDialog(QETProject *project, QWidget *parent) : QWidget(parent), project_(project), - dialog_(0) + dialog_(nullptr) { // initialise l'imprimante printer_ = new QPrinter(); diff --git a/sources/diagramprintdialog.h b/sources/diagramprintdialog.h index 605af70b5..42ee80c2c 100644 --- a/sources/diagramprintdialog.h +++ b/sources/diagramprintdialog.h @@ -36,7 +36,7 @@ class DiagramPrintDialog : public QWidget Q_OBJECT // Constructors, destructor public: - DiagramPrintDialog(QETProject *, QWidget * = 0); + DiagramPrintDialog(QETProject *, QWidget * = nullptr); virtual ~DiagramPrintDialog(); private: DiagramPrintDialog(const DiagramPrintDialog &); @@ -63,7 +63,7 @@ class DiagramPrintDialog : public QWidget private slots: void print(const QList &, bool, const ExportProperties); - void printDiagram(Diagram *, bool, const ExportProperties &, QPainter *, QPrinter * = 0); + void printDiagram(Diagram *, bool, const ExportProperties &, QPainter *, QPrinter * = nullptr); void updatePrintTypeDialog(); void acceptPrintTypeDialog(); void browseFilePrintTypeDialog(); diff --git a/sources/diagramschooser.cpp b/sources/diagramschooser.cpp index 6852f82d5..eec88de96 100644 --- a/sources/diagramschooser.cpp +++ b/sources/diagramschooser.cpp @@ -27,8 +27,8 @@ DiagramsChooser::DiagramsChooser(QETProject *project, QWidget *parent) : QScrollArea(parent), project_(project), - widget0_(0), - vlayout0_(0) + widget0_(nullptr), + vlayout0_(nullptr) { setFrameShadow(QFrame::Sunken); setFrameShape(QFrame::StyledPanel); diff --git a/sources/diagramschooser.h b/sources/diagramschooser.h index 492937447..0db6965bc 100644 --- a/sources/diagramschooser.h +++ b/sources/diagramschooser.h @@ -29,7 +29,7 @@ class DiagramsChooser : public QScrollArea { // constructors, destructor public: - DiagramsChooser(QETProject *, QWidget * = 0); + DiagramsChooser(QETProject *, QWidget * = nullptr); virtual ~DiagramsChooser(); private: DiagramsChooser(const DiagramsChooser &); diff --git a/sources/diagramview.h b/sources/diagramview.h index eadcb7cb9..be4dded15 100644 --- a/sources/diagramview.h +++ b/sources/diagramview.h @@ -41,7 +41,7 @@ class DiagramView : public QGraphicsView // constructors, destructor public: - DiagramView(Diagram *diagram, QWidget * = 0); + DiagramView(Diagram *diagram, QWidget * = nullptr); virtual ~DiagramView(); private: diff --git a/sources/editor/arceditor.cpp b/sources/editor/arceditor.cpp index c5cbc1ce2..940f0a883 100644 --- a/sources/editor/arceditor.cpp +++ b/sources/editor/arceditor.cpp @@ -93,8 +93,8 @@ bool ArcEditor::setPart(CustomElementPart *new_part) disconnect(part, &PartArc::spanAngleChanged, this, &ArcEditor::updateForm); disconnect(part, &PartArc::startAngleChanged, this, &ArcEditor::updateForm); } - part = 0; - style_ -> setPart(0); + part = nullptr; + style_ -> setPart(nullptr); return(true); } diff --git a/sources/editor/arceditor.h b/sources/editor/arceditor.h index 3d2a3a33c..bf01b664b 100644 --- a/sources/editor/arceditor.h +++ b/sources/editor/arceditor.h @@ -34,7 +34,7 @@ class ArcEditor : public ElementItemEditor // constructors, destructor public: - ArcEditor(QETElementEditor *, PartArc * = 0, QWidget * = 0); + ArcEditor(QETElementEditor *, PartArc * = nullptr, QWidget * = nullptr); virtual ~ArcEditor(); private: ArcEditor(const ArcEditor &); diff --git a/sources/editor/editorcommands.cpp b/sources/editor/editorcommands.cpp index a23d322be..21415c290 100644 --- a/sources/editor/editorcommands.cpp +++ b/sources/editor/editorcommands.cpp @@ -86,7 +86,7 @@ DeletePartsCommand::DeletePartsCommand( const QList parts, QUndoCommand *parent ) : - ElementEditionCommand(QObject::tr("suppression", "undo caption"), scene, 0, parent), + ElementEditionCommand(QObject::tr("suppression", "undo caption"), scene, nullptr, parent), deleted_parts(parts) { foreach(QGraphicsItem *qgi, deleted_parts) { @@ -131,7 +131,7 @@ PastePartsCommand::PastePartsCommand( const ElementContent &c, QUndoCommand *parent ) : - ElementEditionCommand(view ? view -> scene() : 0, view, parent), + ElementEditionCommand(view ? view -> scene() : nullptr, view, parent), content_(c), uses_offset(false), first_redo(true) @@ -227,7 +227,7 @@ MovePartsCommand::MovePartsCommand( const QList parts, QUndoCommand *parent ) : - ElementEditionCommand(QObject::tr("déplacement", "undo caption"), scene, 0, parent), + ElementEditionCommand(QObject::tr("déplacement", "undo caption"), scene, nullptr, parent), movement(m), first_redo(true) { @@ -267,7 +267,7 @@ AddPartCommand::AddPartCommand( QGraphicsItem *p, QUndoCommand *parent ) : - ElementEditionCommand(QString(QObject::tr("ajout %1", "undo caption")).arg(name), scene, 0, parent), + ElementEditionCommand(QString(QObject::tr("ajout %1", "undo caption")).arg(name), scene, nullptr, parent), part(p), first_redo(true) { @@ -315,7 +315,7 @@ ChangeNamesCommand::ChangeNamesCommand( const NamesList &after, QUndoCommand *parent ) : - ElementEditionCommand(QObject::tr("modification noms", "undo caption"), element_scene, 0, parent), + ElementEditionCommand(QObject::tr("modification noms", "undo caption"), element_scene, nullptr, parent), names_before(before), names_after(after) { @@ -346,7 +346,7 @@ ChangeZValueCommand::ChangeZValueCommand( ChangeZValueCommand::Option o, QUndoCommand *parent ) : - ElementEditionCommand(elmt, 0, parent), + ElementEditionCommand(elmt, nullptr, parent), option(o) { // retrieve all primitives but terminals @@ -466,7 +466,7 @@ void ChangeZValueCommand::applySendBackward(const QList &items_ @param parent QUndoCommand parent */ ChangeInformationsCommand::ChangeInformationsCommand(ElementScene *elmt, const QString &old_infos, const QString &new_infos, QUndoCommand *parent) : - ElementEditionCommand(QObject::tr("modification informations complementaires", "undo caption"), elmt, 0, parent), + ElementEditionCommand(QObject::tr("modification informations complementaires", "undo caption"), elmt, nullptr, parent), old_informations_(old_infos), new_informations_(new_infos) { @@ -492,7 +492,7 @@ void ChangeInformationsCommand::redo() { @param parent Parent QUndoCommand */ ScalePartsCommand::ScalePartsCommand(ElementScene *scene, QUndoCommand * parent) : - ElementEditionCommand(scene, 0, parent), + ElementEditionCommand(scene, nullptr, parent), first_redo(true) {} @@ -594,7 +594,7 @@ void ScalePartsCommand::adjustText() { * @param parent: parent undo */ ChangePropertiesCommand::ChangePropertiesCommand(ElementScene *scene, QString type, DiagramContext info, QUndoCommand *parent) : - ElementEditionCommand(scene, 0, parent) + ElementEditionCommand(scene, nullptr, parent) { m_type << scene->m_elmt_type << type; m_info << scene->m_elmt_kindInfo << info; diff --git a/sources/editor/editorcommands.h b/sources/editor/editorcommands.h index d979d5901..2e60d287e 100644 --- a/sources/editor/editorcommands.h +++ b/sources/editor/editorcommands.h @@ -33,8 +33,8 @@ class ElementEditionCommand : public QUndoCommand { // constructors, destructor public: - ElementEditionCommand(ElementScene * = 0, ElementView * = 0, QUndoCommand * = 0); - ElementEditionCommand(const QString &, ElementScene * = 0, ElementView * = 0, QUndoCommand * = 0); + ElementEditionCommand(ElementScene * = nullptr, ElementView * = nullptr, QUndoCommand * = nullptr); + ElementEditionCommand(const QString &, ElementScene * = nullptr, ElementView * = nullptr, QUndoCommand * = nullptr); virtual ~ElementEditionCommand(); private: ElementEditionCommand(const ElementEditionCommand &); @@ -60,7 +60,7 @@ class ElementEditionCommand : public QUndoCommand class DeletePartsCommand : public ElementEditionCommand { // constructors, destructor public: - DeletePartsCommand(ElementScene *, const QList, QUndoCommand * = 0); + DeletePartsCommand(ElementScene *, const QList, QUndoCommand * = nullptr); virtual ~DeletePartsCommand(); private: DeletePartsCommand(const DeletePartsCommand &); @@ -82,7 +82,7 @@ class DeletePartsCommand : public ElementEditionCommand { class PastePartsCommand : public ElementEditionCommand { // constructors, destructor public: - PastePartsCommand(ElementView *, const ElementContent &, QUndoCommand * = 0); + PastePartsCommand(ElementView *, const ElementContent &, QUndoCommand * = nullptr); virtual ~PastePartsCommand(); private: PastePartsCommand(const PastePartsCommand &); @@ -113,7 +113,7 @@ class PastePartsCommand : public ElementEditionCommand { class CutPartsCommand : public DeletePartsCommand { // constructors, destructor public: - CutPartsCommand(ElementScene *, const QList, QUndoCommand * = 0); + CutPartsCommand(ElementScene *, const QList, QUndoCommand * = nullptr); virtual ~CutPartsCommand(); private: CutPartsCommand(const CutPartsCommand &); @@ -125,7 +125,7 @@ class CutPartsCommand : public DeletePartsCommand { class MovePartsCommand : public ElementEditionCommand { // constructors, destructor public: - MovePartsCommand(const QPointF &, ElementScene *, const QList, QUndoCommand * = 0); + MovePartsCommand(const QPointF &, ElementScene *, const QList, QUndoCommand * = nullptr); virtual ~MovePartsCommand(); private: MovePartsCommand(const MovePartsCommand &); @@ -151,7 +151,7 @@ class MovePartsCommand : public ElementEditionCommand { class AddPartCommand : public ElementEditionCommand { // constructors, destructor public: - AddPartCommand(const QString &, ElementScene *, QGraphicsItem *, QUndoCommand * = 0); + AddPartCommand(const QString &, ElementScene *, QGraphicsItem *, QUndoCommand * = nullptr); virtual ~AddPartCommand(); private: AddPartCommand(const AddPartCommand &); @@ -175,7 +175,7 @@ class AddPartCommand : public ElementEditionCommand { class ChangeNamesCommand : public ElementEditionCommand { // constructors, destructor public: - ChangeNamesCommand(ElementScene *, const NamesList &, const NamesList &, QUndoCommand * = 0); + ChangeNamesCommand(ElementScene *, const NamesList &, const NamesList &, QUndoCommand * = nullptr); virtual ~ChangeNamesCommand(); private: ChangeNamesCommand(const ChangeNamesCommand &); @@ -207,7 +207,7 @@ class ChangeZValueCommand : public ElementEditionCommand { Lower, ///< Send primitives one layer below their current one; zValues are decremented SendBackward ///< Send primitives to the background so they have the lowest zValue }; - ChangeZValueCommand(ElementScene *, Option, QUndoCommand * = 0); + ChangeZValueCommand(ElementScene *, Option, QUndoCommand * = nullptr); virtual ~ChangeZValueCommand(); private: ChangeZValueCommand(const ChangeZValueCommand &); @@ -239,7 +239,7 @@ class ChangeZValueCommand : public ElementEditionCommand { class ChangeInformationsCommand : public ElementEditionCommand { // constructors, destructor public: - ChangeInformationsCommand(ElementScene *, const QString &, const QString &, QUndoCommand * = 0); + ChangeInformationsCommand(ElementScene *, const QString &, const QString &, QUndoCommand * = nullptr); virtual ~ChangeInformationsCommand(); private: ChangeInformationsCommand(const ChangeInformationsCommand &); @@ -263,7 +263,7 @@ class ChangeInformationsCommand : public ElementEditionCommand { class ScalePartsCommand : public ElementEditionCommand { // constructors, destructor public: - ScalePartsCommand(ElementScene * = 0, QUndoCommand * = 0); + ScalePartsCommand(ElementScene * = nullptr, QUndoCommand * = nullptr); virtual ~ScalePartsCommand(); private: ScalePartsCommand(const ScalePartsCommand &); @@ -296,7 +296,7 @@ class ScalePartsCommand : public ElementEditionCommand { class ChangePropertiesCommand : public ElementEditionCommand { public: - ChangePropertiesCommand (ElementScene *scene, QString type, DiagramContext info, QUndoCommand *parent=0); + ChangePropertiesCommand (ElementScene *scene, QString type, DiagramContext info, QUndoCommand *parent=nullptr); virtual ~ChangePropertiesCommand (); virtual void undo(); diff --git a/sources/editor/elementitemeditor.cpp b/sources/editor/elementitemeditor.cpp index 0999db882..1c2ebd5ef 100644 --- a/sources/editor/elementitemeditor.cpp +++ b/sources/editor/elementitemeditor.cpp @@ -61,5 +61,5 @@ void ElementItemEditor::setElementTypeName(const QString &name) { @see setPart */ void ElementItemEditor::detach() { - setPart(0); + setPart(nullptr); } diff --git a/sources/editor/elementitemeditor.h b/sources/editor/elementitemeditor.h index 88be988b2..fbbd01b38 100644 --- a/sources/editor/elementitemeditor.h +++ b/sources/editor/elementitemeditor.h @@ -35,7 +35,7 @@ class ElementItemEditor : public QWidget Q_OBJECT // constructors, destructor public: - ElementItemEditor(QETElementEditor *, QWidget * = 0); + ElementItemEditor(QETElementEditor *, QWidget * = nullptr); virtual ~ElementItemEditor() {}; private: ElementItemEditor(const ElementItemEditor &); diff --git a/sources/editor/elementprimitivedecorator.cpp b/sources/editor/elementprimitivedecorator.cpp index 80a2bbace..47b6fc577 100644 --- a/sources/editor/elementprimitivedecorator.cpp +++ b/sources/editor/elementprimitivedecorator.cpp @@ -222,14 +222,14 @@ void ElementPrimitiveDecorator::mouseReleaseEvent(QGraphicsSceneMouseEvent *even { Q_UNUSED(event) - ElementEditionCommand *command = 0; + ElementEditionCommand *command = nullptr; if (current_operation_square_ == QET::MoveArea) { QPointF movement = mapToScene(modified_bounding_rect_.topLeft()) - mapToScene(original_bounding_rect_.topLeft()); if (!movement.isNull()) { - MovePartsCommand *move_command = new MovePartsCommand(movement, 0, graphicsItems()); + MovePartsCommand *move_command = new MovePartsCommand(movement, nullptr, graphicsItems()); command = move_command; } @@ -282,7 +282,7 @@ void ElementPrimitiveDecorator::keyReleaseEvent(QKeyEvent *e) { moving_by_keys_ && !e -> isAutoRepeat() ) { // cree un objet d'annulation pour le mouvement qui vient de se finir - emit(actionFinished(new MovePartsCommand(keys_movement_, 0, graphicsItems()))); + emit(actionFinished(new MovePartsCommand(keys_movement_, nullptr, graphicsItems()))); keys_movement_ = QPointF(); moving_by_keys_ = false; } @@ -378,7 +378,7 @@ CustomElementPart *ElementPrimitiveDecorator::singleItem() const { if (decorated_items_.count() == 1) { return(decorated_items_.first()); } - return(0); + return(nullptr); } /** @@ -538,7 +538,7 @@ void ElementPrimitiveDecorator::handlerMouseReleaseEvent(QetGraphicsHandlerItem Q_UNUSED(qghi); Q_UNUSED(event); - ElementEditionCommand *command = 0; + ElementEditionCommand *command = nullptr; if (current_operation_square_ > QET::NoOperation) { ScalePartsCommand *scale_command = new ScalePartsCommand(); diff --git a/sources/editor/elementprimitivedecorator.h b/sources/editor/elementprimitivedecorator.h index 67b5864d7..297f303eb 100644 --- a/sources/editor/elementprimitivedecorator.h +++ b/sources/editor/elementprimitivedecorator.h @@ -42,7 +42,7 @@ class ElementPrimitiveDecorator : public QGraphicsObject Q_OBJECT public: - ElementPrimitiveDecorator(QGraphicsItem * = 0); + ElementPrimitiveDecorator(QGraphicsItem * = nullptr); virtual ~ElementPrimitiveDecorator(); enum { Type = UserType + 2200 }; @@ -50,7 +50,7 @@ class ElementPrimitiveDecorator : public QGraphicsObject // methods QRectF internalBoundingRect() const; virtual QRectF boundingRect () const; - virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = 0); + virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = nullptr); virtual int type() const { return Type; } void setItems(const QList &); void setItems(const QList &); diff --git a/sources/editor/elementscene.h b/sources/editor/elementscene.h index 39cb19473..113f50b75 100644 --- a/sources/editor/elementscene.h +++ b/sources/editor/elementscene.h @@ -55,7 +55,7 @@ class ElementScene : public QGraphicsScene // constructors, destructor public: - ElementScene(QETElementEditor *, QObject * = 0); + ElementScene(QETElementEditor *, QObject * = nullptr); virtual ~ElementScene(); private: @@ -113,7 +113,7 @@ class ElementScene : public QGraphicsScene virtual void setGrid(int, int); virtual const QDomDocument toXml(bool = true); virtual QRectF boundingRectFromXml(const QDomDocument &); - virtual void fromXml(const QDomDocument &, const QPointF & = QPointF(), bool = true, ElementContent * = 0); + virtual void fromXml(const QDomDocument &, const QPointF & = QPointF(), bool = true, ElementContent * = nullptr); virtual void reset(); virtual QList primitives() const; virtual QList zItems(ItemOptions options = ItemOptions(SortByZValue | IncludeTerminals | SelectedOrNot)) const; @@ -141,10 +141,10 @@ class ElementScene : public QGraphicsScene private: QRectF elementContentBoundingRect(const ElementContent &) const; - bool applyInformations(const QDomDocument &, QString * = 0); - ElementContent loadContent(const QDomDocument &, QString * = 0); - ElementContent addContent(const ElementContent &, QString * = 0); - ElementContent addContentAtPos(const ElementContent &, const QPointF &, QString * = 0); + bool applyInformations(const QDomDocument &, QString * = nullptr); + ElementContent loadContent(const QDomDocument &, QString * = nullptr); + ElementContent addContent(const ElementContent &, QString * = nullptr); + ElementContent addContentAtPos(const ElementContent &, const QPointF &, QString * = nullptr); void addPrimitive(QGraphicsItem *); void initPasteArea(); static bool zValueLessThan(QGraphicsItem *, QGraphicsItem *); diff --git a/sources/editor/elementview.h b/sources/editor/elementview.h index 4a3b0b006..69e3a0a13 100644 --- a/sources/editor/elementview.h +++ b/sources/editor/elementview.h @@ -30,7 +30,7 @@ class ElementView : public QGraphicsView { // constructors, destructor public: - ElementView(ElementScene *, QWidget * = 0); + ElementView(ElementScene *, QWidget * = nullptr); virtual ~ElementView(); private: diff --git a/sources/editor/ellipseeditor.cpp b/sources/editor/ellipseeditor.cpp index 9831fb224..9c52bc4d8 100644 --- a/sources/editor/ellipseeditor.cpp +++ b/sources/editor/ellipseeditor.cpp @@ -83,8 +83,8 @@ bool EllipseEditor::setPart(CustomElementPart *new_part) { if (part) disconnect(part, &PartEllipse::rectChanged, this, &EllipseEditor::updateForm); - part = 0; - style_ -> setPart(0); + part = nullptr; + style_ -> setPart(nullptr); return(true); } if (PartEllipse *part_ellipse = dynamic_cast(new_part)) diff --git a/sources/editor/ellipseeditor.h b/sources/editor/ellipseeditor.h index b4f8b4c54..0fadad9b8 100644 --- a/sources/editor/ellipseeditor.h +++ b/sources/editor/ellipseeditor.h @@ -33,7 +33,7 @@ class EllipseEditor : public ElementItemEditor // constructors, destructor public: - EllipseEditor(QETElementEditor *, PartEllipse * = 0, QWidget * = 0); + EllipseEditor(QETElementEditor *, PartEllipse * = nullptr, QWidget * = nullptr); virtual ~EllipseEditor(); private: EllipseEditor(const EllipseEditor &); diff --git a/sources/editor/graphicspart/abstractpartellipse.h b/sources/editor/graphicspart/abstractpartellipse.h index e196da118..36bf15c4f 100644 --- a/sources/editor/graphicspart/abstractpartellipse.h +++ b/sources/editor/graphicspart/abstractpartellipse.h @@ -41,7 +41,7 @@ class AbstractPartEllipse : public CustomElementGraphicPart // constructors, destructor public: - AbstractPartEllipse(QETElementEditor *editor, QGraphicsItem * parent = 0); + AbstractPartEllipse(QETElementEditor *editor, QGraphicsItem * parent = nullptr); virtual ~AbstractPartEllipse(); private: diff --git a/sources/editor/graphicspart/customelementgraphicpart.h b/sources/editor/graphicspart/customelementgraphicpart.h index 7a5ee0cc5..279ef5cbc 100644 --- a/sources/editor/graphicspart/customelementgraphicpart.h +++ b/sources/editor/graphicspart/customelementgraphicpart.h @@ -64,7 +64,7 @@ class CustomElementGraphicPart : public QGraphicsObject, public CustomElementPar // constructors, destructor public: - CustomElementGraphicPart(QETElementEditor *editor, QGraphicsItem *parent = 0); + CustomElementGraphicPart(QETElementEditor *editor, QGraphicsItem *parent = nullptr); virtual ~CustomElementGraphicPart(); static void drawCross (const QPointF ¢er, QPainter *painter); diff --git a/sources/editor/graphicspart/partarc.h b/sources/editor/graphicspart/partarc.h index 348e96506..e99e283ea 100644 --- a/sources/editor/graphicspart/partarc.h +++ b/sources/editor/graphicspart/partarc.h @@ -33,7 +33,7 @@ class PartArc : public AbstractPartEllipse Q_OBJECT public: - PartArc(QETElementEditor *editor, QGraphicsItem *parent = 0); + PartArc(QETElementEditor *editor, QGraphicsItem *parent = nullptr); virtual ~PartArc(); private: @@ -46,7 +46,7 @@ class PartArc : public AbstractPartEllipse * @return the QGraphicsItem type */ virtual int type() const { return Type; } - virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = 0); + virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = nullptr); //Name and XML virtual QString name() const { return(QObject::tr("arc", "element part name")); } diff --git a/sources/editor/graphicspart/partellipse.h b/sources/editor/graphicspart/partellipse.h index 8369c8aec..72225e70d 100644 --- a/sources/editor/graphicspart/partellipse.h +++ b/sources/editor/graphicspart/partellipse.h @@ -33,7 +33,7 @@ class PartEllipse : public AbstractPartEllipse // constructors, destructor public: - PartEllipse(QETElementEditor *editor, QGraphicsItem * parent = 0); + PartEllipse(QETElementEditor *editor, QGraphicsItem * parent = nullptr); virtual ~PartEllipse(); private: @@ -47,7 +47,7 @@ class PartEllipse : public AbstractPartEllipse * @return the QGraphicsItem type */ virtual int type() const { return Type; } - virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = 0); + virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = nullptr); //Name and XML virtual QString name() const { return(QObject::tr("ellipse", "element part name")); } diff --git a/sources/editor/graphicspart/partline.h b/sources/editor/graphicspart/partline.h index 3a0cc1bf7..d1b1acacf 100644 --- a/sources/editor/graphicspart/partline.h +++ b/sources/editor/graphicspart/partline.h @@ -45,7 +45,7 @@ class PartLine : public CustomElementGraphicPart // constructors, destructor public: - PartLine(QETElementEditor *, QGraphicsItem * = 0); + PartLine(QETElementEditor *, QGraphicsItem * = nullptr); virtual ~PartLine(); private: PartLine(const PartLine &); @@ -67,7 +67,7 @@ class PartLine : public CustomElementGraphicPart * @return the QGraphicsItem type */ virtual int type() const { return Type; } - virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = 0); + virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = nullptr); virtual QString name() const { return(QObject::tr("ligne", "element part name")); } virtual QString xmlName() const { return(QString("line")); } virtual const QDomElement toXml(QDomDocument &) const; diff --git a/sources/editor/graphicspart/partpolygon.h b/sources/editor/graphicspart/partpolygon.h index 371c46f14..696d82411 100644 --- a/sources/editor/graphicspart/partpolygon.h +++ b/sources/editor/graphicspart/partpolygon.h @@ -38,7 +38,7 @@ class PartPolygon : public CustomElementGraphicPart // constructors, destructor public: - PartPolygon(QETElementEditor *editor, QGraphicsItem *parent = 0); + PartPolygon(QETElementEditor *editor, QGraphicsItem *parent = nullptr); virtual ~PartPolygon(); private: diff --git a/sources/editor/graphicspart/partrectangle.h b/sources/editor/graphicspart/partrectangle.h index 014941b85..ad17fc899 100644 --- a/sources/editor/graphicspart/partrectangle.h +++ b/sources/editor/graphicspart/partrectangle.h @@ -36,7 +36,7 @@ class PartRectangle : public CustomElementGraphicPart // constructors, destructor public: - PartRectangle(QETElementEditor *, QGraphicsItem *parent = 0); + PartRectangle(QETElementEditor *, QGraphicsItem *parent = nullptr); virtual ~PartRectangle(); private: @@ -53,7 +53,7 @@ class PartRectangle : public CustomElementGraphicPart * @return the QGraphicsItem type */ virtual int type () const { return Type; } - virtual void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget * = 0); + virtual void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget * = nullptr); virtual QString name () const { return(QObject::tr("rectangle", "element part name")); } virtual QString xmlName () const { return(QString("rect")); } diff --git a/sources/editor/graphicspart/partterminal.h b/sources/editor/graphicspart/partterminal.h index 21c00319b..6653f39bb 100644 --- a/sources/editor/graphicspart/partterminal.h +++ b/sources/editor/graphicspart/partterminal.h @@ -35,7 +35,7 @@ class PartTerminal : public CustomElementGraphicPart public: // constructors, destructor - PartTerminal(QETElementEditor *editor, QGraphicsItem *parent = 0); + PartTerminal(QETElementEditor *editor, QGraphicsItem *parent = nullptr); virtual ~PartTerminal(); private: PartTerminal(const PartTerminal &); diff --git a/sources/editor/graphicspart/parttext.h b/sources/editor/graphicspart/parttext.h index 1fa9bef47..ace8db0dc 100644 --- a/sources/editor/graphicspart/parttext.h +++ b/sources/editor/graphicspart/parttext.h @@ -31,7 +31,7 @@ class PartText : public QGraphicsTextItem, public CustomElementPart { // constructors, destructor public: - PartText(QETElementEditor *, QGraphicsItem * = 0); + PartText(QETElementEditor *, QGraphicsItem * = nullptr); virtual ~PartText(); private: diff --git a/sources/editor/graphicspart/parttextfield.h b/sources/editor/graphicspart/parttextfield.h index 32ed24641..c6ad0fd8c 100644 --- a/sources/editor/graphicspart/parttextfield.h +++ b/sources/editor/graphicspart/parttextfield.h @@ -35,7 +35,7 @@ class PartTextField : public QGraphicsTextItem, public CustomElementPart // constructors, destructor public: - PartTextField(QETElementEditor *, QGraphicsItem * = 0); + PartTextField(QETElementEditor *, QGraphicsItem * = nullptr); virtual ~PartTextField(); private: diff --git a/sources/editor/lineeditor.cpp b/sources/editor/lineeditor.cpp index 75ffc1d7b..6c4b02725 100644 --- a/sources/editor/lineeditor.cpp +++ b/sources/editor/lineeditor.cpp @@ -110,8 +110,8 @@ bool LineEditor::setPart(CustomElementPart *new_part) disconnect(part, &PartLine::firstEndLengthChanged, this, &LineEditor::updateForm); disconnect(part, &PartLine::secondEndLengthChanged, this, &LineEditor::updateForm); } - part = 0; - style_ -> setPart(0); + part = nullptr; + style_ -> setPart(nullptr); return(true); } if (PartLine *part_line = dynamic_cast(new_part)) diff --git a/sources/editor/lineeditor.h b/sources/editor/lineeditor.h index 84eb11656..cc4bcc506 100644 --- a/sources/editor/lineeditor.h +++ b/sources/editor/lineeditor.h @@ -33,7 +33,7 @@ class LineEditor : public ElementItemEditor Q_OBJECT // constructors, destructor public: - LineEditor(QETElementEditor *, PartLine * = 0, QWidget * = 0); + LineEditor(QETElementEditor *, PartLine * = nullptr, QWidget * = nullptr); virtual ~LineEditor(); private: LineEditor(const LineEditor &); diff --git a/sources/editor/polygoneditor.cpp b/sources/editor/polygoneditor.cpp index 827799d65..d6a490491 100644 --- a/sources/editor/polygoneditor.cpp +++ b/sources/editor/polygoneditor.cpp @@ -130,8 +130,8 @@ bool PolygonEditor::setPart(CustomElementPart *new_part) disconnect(part, &PartPolygon::polygonChanged, this, &PolygonEditor::updateForm); disconnect(part, &PartPolygon::closedChange, this, &PolygonEditor::updateForm); } - part = 0; - style_ -> setPart(0); + part = nullptr; + style_ -> setPart(nullptr); return(true); } if (PartPolygon *part_polygon = dynamic_cast(new_part)) diff --git a/sources/editor/polygoneditor.h b/sources/editor/polygoneditor.h index b60ffced4..1922118fa 100644 --- a/sources/editor/polygoneditor.h +++ b/sources/editor/polygoneditor.h @@ -35,7 +35,7 @@ class PolygonEditor : public ElementItemEditor { // constructors, destructor public: - PolygonEditor(QETElementEditor *, PartPolygon * = 0, QWidget * = 0); + PolygonEditor(QETElementEditor *, PartPolygon * = nullptr, QWidget * = nullptr); virtual ~PolygonEditor(); private: diff --git a/sources/editor/qetelementeditor.cpp b/sources/editor/qetelementeditor.cpp index b38219995..39372d728 100644 --- a/sources/editor/qetelementeditor.cpp +++ b/sources/editor/qetelementeditor.cpp @@ -1267,11 +1267,11 @@ bool QETElementEditor::canClose() { */ QWidget *QETElementEditor::clearToolsDock() { if (QWidget *previous_widget = tools_dock_scroll_area_ -> takeWidget()) { - previous_widget -> setParent(0); + previous_widget -> setParent(nullptr); previous_widget -> hide(); return(previous_widget); } - return(0); + return(nullptr); } /** diff --git a/sources/editor/qetelementeditor.h b/sources/editor/qetelementeditor.h index 0c356955a..10f46de47 100644 --- a/sources/editor/qetelementeditor.h +++ b/sources/editor/qetelementeditor.h @@ -36,7 +36,7 @@ class QETElementEditor : public QETMainWindow { // constructor, destructor public: - QETElementEditor(QWidget * = 0); + QETElementEditor(QWidget * = nullptr); virtual ~QETElementEditor(); private: QETElementEditor(const QETElementEditor &); @@ -109,7 +109,7 @@ class QETElementEditor : public QETMainWindow { void readSettings(); void writeSettings(); static QPointF pasteOffset(); - static QString getOpenElementFileName(QWidget * = 0, const QString & = QString()); + static QString getOpenElementFileName(QWidget * = nullptr, const QString & = QString()); void contextMenu(QPoint p); signals: diff --git a/sources/editor/rectangleeditor.cpp b/sources/editor/rectangleeditor.cpp index 86862dd91..9ff190a83 100644 --- a/sources/editor/rectangleeditor.cpp +++ b/sources/editor/rectangleeditor.cpp @@ -82,8 +82,8 @@ bool RectangleEditor::setPart(CustomElementPart *new_part) { if (part) disconnect(part, &PartRectangle::rectChanged, this, &RectangleEditor::updateForm); - part = 0; - style_ -> setPart(0); + part = nullptr; + style_ -> setPart(nullptr); return(true); } diff --git a/sources/editor/rectangleeditor.h b/sources/editor/rectangleeditor.h index 8ebe1dbe6..4d0b016a6 100644 --- a/sources/editor/rectangleeditor.h +++ b/sources/editor/rectangleeditor.h @@ -33,7 +33,7 @@ class RectangleEditor : public ElementItemEditor // constructors, destructor public: - RectangleEditor(QETElementEditor *, PartRectangle * = 0, QWidget * = 0); + RectangleEditor(QETElementEditor *, PartRectangle * = nullptr, QWidget * = nullptr); virtual ~RectangleEditor(); private: RectangleEditor(const RectangleEditor &); diff --git a/sources/editor/styleeditor.h b/sources/editor/styleeditor.h index 04e3a0442..d8ae27a87 100644 --- a/sources/editor/styleeditor.h +++ b/sources/editor/styleeditor.h @@ -36,7 +36,7 @@ class StyleEditor : public ElementItemEditor Q_OBJECT // constructors, destructor public: - StyleEditor(QETElementEditor *, CustomElementGraphicPart * = 0, QWidget * = 0); + StyleEditor(QETElementEditor *, CustomElementGraphicPart * = nullptr, QWidget * = nullptr); virtual ~StyleEditor(); private: diff --git a/sources/editor/terminaleditor.cpp b/sources/editor/terminaleditor.cpp index 92b277a4f..29e9fc2a4 100644 --- a/sources/editor/terminaleditor.cpp +++ b/sources/editor/terminaleditor.cpp @@ -88,7 +88,7 @@ bool TerminalEditor::setPart(CustomElementPart *new_part) { if (part) disconnect(part, &PartTerminal::orientationChanged, this, &TerminalEditor::updateForm); - part = 0; + part = nullptr; return(true); } if (PartTerminal *part_terminal = dynamic_cast(new_part)) diff --git a/sources/editor/terminaleditor.h b/sources/editor/terminaleditor.h index 5cff083df..0f0a00f34 100644 --- a/sources/editor/terminaleditor.h +++ b/sources/editor/terminaleditor.h @@ -31,7 +31,7 @@ class TerminalEditor : public ElementItemEditor { Q_OBJECT // Constructors, destructor public: - TerminalEditor(QETElementEditor *, PartTerminal * = 0, QWidget * = 0); + TerminalEditor(QETElementEditor *, PartTerminal * = nullptr, QWidget * = nullptr); virtual ~TerminalEditor(); private: TerminalEditor(const TerminalEditor &); diff --git a/sources/editor/texteditor.cpp b/sources/editor/texteditor.cpp index 65999d742..c2e3e45eb 100644 --- a/sources/editor/texteditor.cpp +++ b/sources/editor/texteditor.cpp @@ -107,7 +107,7 @@ bool TextEditor::setPart(CustomElementPart *new_part) { if (!new_part) { - part = 0; + part = nullptr; return(true); } if (PartText *part_text = dynamic_cast(new_part)) diff --git a/sources/editor/texteditor.h b/sources/editor/texteditor.h index 7cbb5ea85..dcbd64680 100644 --- a/sources/editor/texteditor.h +++ b/sources/editor/texteditor.h @@ -38,7 +38,7 @@ class TextEditor : public ElementItemEditor // Constructors, destructor public: - TextEditor(QETElementEditor *, PartText * = 0, QWidget * = 0); + TextEditor(QETElementEditor *, PartText * = nullptr, QWidget * = nullptr); virtual ~TextEditor(); private: TextEditor(const TextEditor &); diff --git a/sources/editor/textfieldeditor.cpp b/sources/editor/textfieldeditor.cpp index 6f280e526..e240192ff 100644 --- a/sources/editor/textfieldeditor.cpp +++ b/sources/editor/textfieldeditor.cpp @@ -106,7 +106,7 @@ bool TextFieldEditor::setPart(CustomElementPart *new_part) { if (!new_part) { - part = 0; + part = nullptr; return(true); } if (PartTextField *part_textfield = dynamic_cast(new_part)) diff --git a/sources/editor/textfieldeditor.h b/sources/editor/textfieldeditor.h index c4d861e40..4169cf5c7 100644 --- a/sources/editor/textfieldeditor.h +++ b/sources/editor/textfieldeditor.h @@ -37,7 +37,7 @@ class TextFieldEditor : public ElementItemEditor // Constructors, destructor public: - TextFieldEditor(QETElementEditor *, PartTextField * = 0, QWidget * = 0); + TextFieldEditor(QETElementEditor *, PartTextField * = nullptr, QWidget * = nullptr); virtual ~TextFieldEditor(); private: TextFieldEditor(const TextFieldEditor &); diff --git a/sources/editor/ui/elementpropertieseditorwidget.h b/sources/editor/ui/elementpropertieseditorwidget.h index 44b49a95c..47fdda135 100644 --- a/sources/editor/ui/elementpropertieseditorwidget.h +++ b/sources/editor/ui/elementpropertieseditorwidget.h @@ -37,7 +37,7 @@ class ElementPropertiesEditorWidget : public QDialog //METHODS public: - explicit ElementPropertiesEditorWidget(QString &basic_type, DiagramContext &dc, QWidget *parent = 0); + explicit ElementPropertiesEditorWidget(QString &basic_type, DiagramContext &dc, QWidget *parent = nullptr); ~ElementPropertiesEditorWidget(); void upDateInterface(); diff --git a/sources/elementprovider.h b/sources/elementprovider.h index c4675ba6d..f745d5fe8 100644 --- a/sources/elementprovider.h +++ b/sources/elementprovider.h @@ -34,7 +34,7 @@ class Element; class ElementProvider { public: - ElementProvider(QETProject *prj, Diagram *diagram=0); + ElementProvider(QETProject *prj, Diagram *diagram=nullptr); ElementProvider(Diagram *diag); QList freeElement(const int filter) const; QList fromUuids(QList ) const; diff --git a/sources/elementscollectioncache.cpp b/sources/elementscollectioncache.cpp index c8e69ca56..72838c080 100644 --- a/sources/elementscollectioncache.cpp +++ b/sources/elementscollectioncache.cpp @@ -208,7 +208,7 @@ QPixmap ElementsCollectionCache::pixmap() const { */ bool ElementsCollectionCache::fetchData(const ElementsLocation &location) { int state; - Element *custom_elmt = ElementFactory::Instance() -> createElement(location, 0, &state); + Element *custom_elmt = ElementFactory::Instance() -> createElement(location, nullptr, &state); if (state) { qDebug() << "ElementsCollectionCache::fetchData() : Le chargement du composant" << qPrintable(location.toString()) << "a echoue avec le code d'erreur" << state; } else { diff --git a/sources/elementscollectioncache.h b/sources/elementscollectioncache.h index 59eb7e97f..9e18a21c2 100644 --- a/sources/elementscollectioncache.h +++ b/sources/elementscollectioncache.h @@ -31,7 +31,7 @@ class ElementsCollectionCache : public QObject { public: // constructor, destructor - ElementsCollectionCache(const QString &database_path, QObject * = 0); + ElementsCollectionCache(const QString &database_path, QObject * = nullptr); virtual ~ElementsCollectionCache(); // methods diff --git a/sources/elementsmover.cpp b/sources/elementsmover.cpp index a7ab60da8..9fbb85229 100644 --- a/sources/elementsmover.cpp +++ b/sources/elementsmover.cpp @@ -32,8 +32,8 @@ ElementsMover::ElementsMover() : movement_running_(false), current_movement_(), - diagram_(0), - movement_driver_(0), + diagram_(nullptr), + movement_driver_(nullptr), moved_content_() { diff --git a/sources/elementsmover.h b/sources/elementsmover.h index 423b55707..091aa3b45 100644 --- a/sources/elementsmover.h +++ b/sources/elementsmover.h @@ -46,7 +46,7 @@ class ElementsMover { // methods public: bool isReady() const; - int beginMovement(Diagram *, QGraphicsItem * = 0); + int beginMovement(Diagram *, QGraphicsItem * = nullptr); void continueMovement(const QPointF &); void endMovement(); diff --git a/sources/elementspanel.cpp b/sources/elementspanel.cpp index 05dbc47d3..278c25c04 100644 --- a/sources/elementspanel.cpp +++ b/sources/elementspanel.cpp @@ -127,7 +127,7 @@ QTreeWidgetItem *ElementsPanel::addProject(QETProject *project) { bool first_add = (first_reload_ || !projects_to_display_.contains(project)); // create the QTreeWidgetItem representing the project - QTreeWidgetItem *qtwi_project = GenericPanel::addProject(project, 0, GenericPanel::All); + QTreeWidgetItem *qtwi_project = GenericPanel::addProject(project, nullptr, GenericPanel::All); // the project will be inserted right before the common tb templates collection invisibleRootItem() -> insertChild( indexOfTopLevelItem(common_tbt_collection_item_), diff --git a/sources/elementspanel.h b/sources/elementspanel.h index 81080c9af..3fea19506 100644 --- a/sources/elementspanel.h +++ b/sources/elementspanel.h @@ -36,7 +36,7 @@ class ElementsPanel : public GenericPanel { // constructors, destructor public: - ElementsPanel(QWidget * = 0); + ElementsPanel(QWidget * = nullptr); virtual ~ElementsPanel(); private: diff --git a/sources/elementspanelwidget.h b/sources/elementspanelwidget.h index 0c9fd43ed..9de6166c9 100644 --- a/sources/elementspanelwidget.h +++ b/sources/elementspanelwidget.h @@ -30,7 +30,7 @@ class ElementsPanelWidget : public QWidget { // constructors, destructor public: - ElementsPanelWidget(QWidget * = 0); + ElementsPanelWidget(QWidget * = nullptr); virtual ~ElementsPanelWidget(); private: diff --git a/sources/exportdialog.h b/sources/exportdialog.h index a4e554d2e..1ae7a3a8d 100644 --- a/sources/exportdialog.h +++ b/sources/exportdialog.h @@ -32,7 +32,7 @@ class ExportDialog : public QDialog { // constructors, destructor public: - ExportDialog(QETProject *, QWidget * = 0); + ExportDialog(QETProject *, QWidget * = nullptr); virtual ~ExportDialog(); private: diff --git a/sources/exportpropertieswidget.h b/sources/exportpropertieswidget.h index c9760c4a3..8662db934 100644 --- a/sources/exportpropertieswidget.h +++ b/sources/exportpropertieswidget.h @@ -28,8 +28,8 @@ class ExportPropertiesWidget : public QWidget { Q_OBJECT // constructors, destructor public: - ExportPropertiesWidget(QWidget * = 0); - ExportPropertiesWidget(const ExportProperties &, QWidget * = 0); + ExportPropertiesWidget(QWidget * = nullptr); + ExportPropertiesWidget(const ExportProperties &, QWidget * = nullptr); virtual ~ExportPropertiesWidget(); private: ExportPropertiesWidget(const ExportPropertiesWidget &); diff --git a/sources/factory/elementfactory.h b/sources/factory/elementfactory.h index 221199fa4..524c106c5 100644 --- a/sources/factory/elementfactory.h +++ b/sources/factory/elementfactory.h @@ -52,7 +52,7 @@ class ElementFactory if (factory_) { mutex.lock(); delete factory_; - factory_ = 0; + factory_ = nullptr; mutex.unlock(); } } @@ -69,7 +69,7 @@ class ElementFactory ~ElementFactory() {} public: - Element *createElement (const ElementsLocation &, QGraphicsItem * = 0, int * = 0); + Element *createElement (const ElementsLocation &, QGraphicsItem * = nullptr, int * = nullptr); }; //ElementFactory ElementFactory::factory_ = 0; #endif // ELEMENTFACTORY_H diff --git a/sources/genericpanel.cpp b/sources/genericpanel.cpp index aa25d943f..28d7f5d5c 100644 --- a/sources/genericpanel.cpp +++ b/sources/genericpanel.cpp @@ -55,7 +55,7 @@ QETProject *GenericPanel::projectForItem(QTreeWidgetItem *item) const { if (item && item -> type() == QET::Project) { return(valueForItem(item)); } - return(0); + return(nullptr); } @@ -66,7 +66,7 @@ Diagram *GenericPanel::diagramForItem(QTreeWidgetItem *item) const { if (item && item -> type() == QET::Diagram) { return(valueForItem(item)); } - return(0); + return(nullptr); } /** @@ -104,7 +104,7 @@ TitleBlockTemplateLocation GenericPanel::selectedTemplateLocation() const { */ QTreeWidgetItem *GenericPanel::addProject(QETProject *project, QTreeWidgetItem *parent_item, PanelOptions options) { - if (!project) return(0); + if (!project) return(nullptr); bool creation_required; QTreeWidgetItem *project_qtwi = getItemForProject(project, &creation_required); @@ -121,8 +121,8 @@ QTreeWidgetItem *GenericPanel::addProject(QETProject *project, QTreeWidgetItem * project does not appear within this panel. */ QTreeWidgetItem *GenericPanel::itemForProject(QETProject *project) { - if (!project) return(0); - return(projects_.value(project, 0)); + if (!project) return(nullptr); + return(projects_.value(project, nullptr)); } /** @@ -134,9 +134,9 @@ QTreeWidgetItem *GenericPanel::itemForProject(QETProject *project) { appear within this panel, it is created. */ QTreeWidgetItem *GenericPanel::getItemForProject(QETProject *project, bool *created) { - if (!project) return(0); + if (!project) return(nullptr); - QTreeWidgetItem *project_qtwi = projects_.value(project, 0); + QTreeWidgetItem *project_qtwi = projects_.value(project, nullptr); if (project_qtwi) { if (created) *created = false; return(project_qtwi); @@ -152,7 +152,7 @@ QTreeWidgetItem *GenericPanel::getItemForProject(QETProject *project, bool *crea */ QTreeWidgetItem *GenericPanel::updateProjectItem(QTreeWidgetItem *project_qtwi, QETProject *project, PanelOptions options, bool freshly_created) { Q_UNUSED(options) - if (!project_qtwi || !project) return(0); + if (!project_qtwi || !project) return(nullptr); if (freshly_created) { project_qtwi -> setData(0, GenericPanel::Item, qVariantFromValue(project)); @@ -188,7 +188,7 @@ QTreeWidgetItem *GenericPanel::updateProjectItem(QTreeWidgetItem *project_qtwi, */ QTreeWidgetItem *GenericPanel::fillProjectItem(QTreeWidgetItem *project_qtwi, QETProject *project, PanelOptions options, bool freshly_created) { - if (!project_qtwi || !project) return(0); + if (!project_qtwi || !project) return(nullptr); if (options & AddChildDiagrams) { @@ -211,7 +211,7 @@ QTreeWidgetItem *GenericPanel::fillProjectItem(QTreeWidgetItem *project_qtwi, QE } int index = 0; foreach (Diagram *diagram, project -> diagrams()) { - QTreeWidgetItem *diagram_qtwi = addDiagram(diagram, 0, options); + QTreeWidgetItem *diagram_qtwi = addDiagram(diagram, nullptr, options); project_qtwi -> insertChild(index, diagram_qtwi); ++ index; } @@ -239,7 +239,7 @@ QTreeWidgetItem *GenericPanel::fillProjectItem(QTreeWidgetItem *project_qtwi, QE */ QTreeWidgetItem *GenericPanel::addDiagram(Diagram *diagram, QTreeWidgetItem *parent_item, PanelOptions options) { Q_UNUSED(options) - if (!diagram) return(0); + if (!diagram) return(nullptr); bool creation_required; @@ -255,9 +255,9 @@ QTreeWidgetItem *GenericPanel::addDiagram(Diagram *diagram, QTreeWidgetItem *par */ QTreeWidgetItem *GenericPanel::getItemForDiagram(Diagram *diagram, bool *created) { - if (!diagram) return(0); + if (!diagram) return(nullptr); - QTreeWidgetItem *diagram_qtwi = diagrams_.value(diagram, 0); + QTreeWidgetItem *diagram_qtwi = diagrams_.value(diagram, nullptr); if (diagram_qtwi) { if (created) *created = false; return(diagram_qtwi); @@ -273,7 +273,7 @@ QTreeWidgetItem *GenericPanel::getItemForDiagram(Diagram *diagram, bool *created */ QTreeWidgetItem *GenericPanel::updateDiagramItem(QTreeWidgetItem *diagram_qtwi, Diagram *diagram, PanelOptions options, bool freshly_created) { Q_UNUSED(options) - if (!diagram || !diagram_qtwi) return(0); + if (!diagram || !diagram_qtwi) return(nullptr); QSettings settings; QString displayed_title = diagram -> title(); @@ -342,7 +342,7 @@ QTreeWidgetItem *GenericPanel::fillDiagramItem(QTreeWidgetItem *diagram_qtwi, Di */ QTreeWidgetItem *GenericPanel::addTemplatesCollection(TitleBlockTemplatesCollection *tbt_collection, QTreeWidgetItem *parent_item, PanelOptions options) { - if (!tbt_collection) return(0); + if (!tbt_collection) return(nullptr); bool creation_required; QTreeWidgetItem *tbt_collection_qtwi = getItemForTemplatesCollection(tbt_collection, &creation_required); @@ -357,16 +357,16 @@ QTreeWidgetItem *GenericPanel::addTemplatesCollection(TitleBlockTemplatesCollect */ QTreeWidgetItem *GenericPanel::itemForTemplatesCollection(TitleBlockTemplatesCollection *tbt_collection) { - if (!tbt_collection) return(0); - return(tb_templates_.value(tbt_collection -> location(), 0)); + if (!tbt_collection) return(nullptr); + return(tb_templates_.value(tbt_collection -> location(), nullptr)); } /** */ QTreeWidgetItem *GenericPanel::getItemForTemplatesCollection(TitleBlockTemplatesCollection *tbt_collection, bool *created) { - if (!tbt_collection) return(0); - QTreeWidgetItem *tbt_collection_item = tb_templates_.value(tbt_collection -> location(), 0); + if (!tbt_collection) return(nullptr); + QTreeWidgetItem *tbt_collection_item = tb_templates_.value(tbt_collection -> location(), nullptr); if (tbt_collection_item) { if (created) *created = false; return(tbt_collection_item); @@ -421,7 +421,7 @@ QTreeWidgetItem *GenericPanel::fillTemplatesCollectionItem(QTreeWidgetItem *tbt_ int index = 0; foreach (QString template_name, tbt_collection -> templates()) { - QTreeWidgetItem *template_item = addTemplate(tbt_collection -> location(template_name), 0, options); + QTreeWidgetItem *template_item = addTemplate(tbt_collection -> location(template_name), nullptr, options); tbt_collection_qtwi -> insertChild(index ++, template_item); } } @@ -433,7 +433,7 @@ QTreeWidgetItem *GenericPanel::fillTemplatesCollectionItem(QTreeWidgetItem *tbt_ */ QTreeWidgetItem *GenericPanel::addTemplate(const TitleBlockTemplateLocation &tb_template, QTreeWidgetItem *parent_item, PanelOptions options) { - if (!tb_template.isValid()) return(0); + if (!tb_template.isValid()) return(nullptr); bool creation_required; QTreeWidgetItem *tb_template_qtwi = getItemForTemplate(tb_template, &creation_required); @@ -448,9 +448,9 @@ QTreeWidgetItem *GenericPanel::addTemplate(const TitleBlockTemplateLocation &tb_ */ QTreeWidgetItem *GenericPanel::getItemForTemplate(const TitleBlockTemplateLocation &tb_template, bool *created) { - if (!tb_template.isValid()) return(0); + if (!tb_template.isValid()) return(nullptr); - QTreeWidgetItem *tb_template_qtwi = tb_templates_.value(tb_template, 0); + QTreeWidgetItem *tb_template_qtwi = tb_templates_.value(tb_template, nullptr); if (tb_template_qtwi) { if (created) *created = false; return(tb_template_qtwi); @@ -530,7 +530,7 @@ QTreeWidgetItem *GenericPanel::fillItem(QTreeWidgetItem *qtwi, PanelOptions opti */ void GenericPanel::projectInformationsChanged(QETProject *project) { - addProject(project, 0, 0); + addProject(project, nullptr, nullptr); emit(panelContentChanged()); } @@ -539,7 +539,7 @@ void GenericPanel::projectInformationsChanged(QETProject *project) { */ void GenericPanel::diagramAdded(QETProject *project, Diagram *diagram) { Q_UNUSED(diagram) - addProject(project, 0, GenericPanel::AddChildDiagrams); + addProject(project, nullptr, GenericPanel::AddChildDiagrams); emit(panelContentChanged()); } @@ -548,7 +548,7 @@ void GenericPanel::diagramAdded(QETProject *project, Diagram *diagram) { */ void GenericPanel::diagramRemoved(QETProject *project, Diagram *diagram) { Q_UNUSED(diagram) - addProject(project, 0, GenericPanel::AddChildDiagrams); + addProject(project, nullptr, GenericPanel::AddChildDiagrams); emit(panelContentChanged()); } diff --git a/sources/genericpanel.h b/sources/genericpanel.h index d3a6dcb6c..d0b27701d 100644 --- a/sources/genericpanel.h +++ b/sources/genericpanel.h @@ -55,7 +55,7 @@ class GenericPanel : public QTreeWidget { // Constructors, destructor public: - GenericPanel(QWidget * = 0); + GenericPanel(QWidget * = nullptr); virtual ~GenericPanel(); public: @@ -72,35 +72,35 @@ class GenericPanel : public QTreeWidget { // project-related methods public: - virtual QTreeWidgetItem *addProject(QETProject *, QTreeWidgetItem * = 0, PanelOptions = AddAllChild); + virtual QTreeWidgetItem *addProject(QETProject *, QTreeWidgetItem * = nullptr, PanelOptions = AddAllChild); virtual QTreeWidgetItem *itemForProject(QETProject *); protected: - virtual QTreeWidgetItem *getItemForProject(QETProject *, bool * = 0); + virtual QTreeWidgetItem *getItemForProject(QETProject *, bool * = nullptr); virtual QTreeWidgetItem *updateProjectItem(QTreeWidgetItem *, QETProject *, PanelOptions = AddAllChild, bool = false); virtual QTreeWidgetItem *fillProjectItem (QTreeWidgetItem *, QETProject *, PanelOptions = AddAllChild, bool = false); // diagram-related methods public: - virtual QTreeWidgetItem *addDiagram(Diagram *, QTreeWidgetItem * = 0, PanelOptions = AddAllChild); + virtual QTreeWidgetItem *addDiagram(Diagram *, QTreeWidgetItem * = nullptr, PanelOptions = AddAllChild); protected: - virtual QTreeWidgetItem *getItemForDiagram(Diagram *, bool * = 0); + virtual QTreeWidgetItem *getItemForDiagram(Diagram *, bool * = nullptr); virtual QTreeWidgetItem *updateDiagramItem(QTreeWidgetItem *, Diagram *, PanelOptions = AddAllChild, bool = false); virtual QTreeWidgetItem *fillDiagramItem (QTreeWidgetItem *, Diagram *, PanelOptions = AddAllChild, bool = false); // title block templates collections methods public: - virtual QTreeWidgetItem *addTemplatesCollection(TitleBlockTemplatesCollection *, QTreeWidgetItem * = 0, PanelOptions = AddAllChild); + virtual QTreeWidgetItem *addTemplatesCollection(TitleBlockTemplatesCollection *, QTreeWidgetItem * = nullptr, PanelOptions = AddAllChild); virtual QTreeWidgetItem *itemForTemplatesCollection(TitleBlockTemplatesCollection *); protected: - virtual QTreeWidgetItem *getItemForTemplatesCollection(TitleBlockTemplatesCollection *, bool * = 0); + virtual QTreeWidgetItem *getItemForTemplatesCollection(TitleBlockTemplatesCollection *, bool * = nullptr); virtual QTreeWidgetItem *updateTemplatesCollectionItem(QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions = AddAllChild, bool = false); virtual QTreeWidgetItem *fillTemplatesCollectionItem (QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions = AddAllChild, bool = false); // title block templates methods public: - virtual QTreeWidgetItem *addTemplate(const TitleBlockTemplateLocation &, QTreeWidgetItem * = 0, PanelOptions = AddAllChild); + virtual QTreeWidgetItem *addTemplate(const TitleBlockTemplateLocation &, QTreeWidgetItem * = nullptr, PanelOptions = AddAllChild); protected: - virtual QTreeWidgetItem *getItemForTemplate(const TitleBlockTemplateLocation &, bool * = 0); + virtual QTreeWidgetItem *getItemForTemplate(const TitleBlockTemplateLocation &, bool * = nullptr); virtual QTreeWidgetItem *updateTemplateItem(QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions = AddAllChild, bool = false); virtual QTreeWidgetItem *fillTemplateItem (QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions = AddAllChild, bool = false); @@ -123,7 +123,7 @@ class GenericPanel : public QTreeWidget { protected: virtual QString defaultText(QET::ItemType); virtual QIcon defaultIcon(QET::ItemType); - virtual QTreeWidgetItem *makeItem(QET::ItemType, QTreeWidgetItem * = 0, const QString & = QString(), const QIcon & = QIcon()); + virtual QTreeWidgetItem *makeItem(QET::ItemType, QTreeWidgetItem * = nullptr, const QString & = QString(), const QIcon & = QIcon()); virtual void deleteItem(QTreeWidgetItem *, bool = false); virtual void markItemAsUnused(QTreeWidgetItem *); virtual void reparent(QTreeWidgetItem *, QTreeWidgetItem *); diff --git a/sources/nameslistwidget.h b/sources/nameslistwidget.h index 84b1899f0..cbe4d5e0c 100644 --- a/sources/nameslistwidget.h +++ b/sources/nameslistwidget.h @@ -28,7 +28,7 @@ class NamesListWidget : public QWidget { // constructors, destructor public: - NamesListWidget(QWidget * = 0); + NamesListWidget(QWidget * = nullptr); virtual ~NamesListWidget(); private: diff --git a/sources/newelementwizard.h b/sources/newelementwizard.h index 4e6c5dde0..04205f30b 100644 --- a/sources/newelementwizard.h +++ b/sources/newelementwizard.h @@ -41,7 +41,7 @@ class NewElementWizard : public QWizard // constructors, destructor public: - NewElementWizard(QWidget * = 0, Qt::WindowFlags = 0); + NewElementWizard(QWidget * = nullptr, Qt::WindowFlags = nullptr); virtual ~NewElementWizard(); void preselectedLocation(const ElementsLocation &location); diff --git a/sources/nomenclature.h b/sources/nomenclature.h index 2f869f3ec..4b0877dac 100644 --- a/sources/nomenclature.h +++ b/sources/nomenclature.h @@ -43,7 +43,7 @@ class nomenclature // constructors, destructor public: - nomenclature(QETProject *project, QWidget *parent =0); + nomenclature(QETProject *project, QWidget *parent =nullptr); virtual ~nomenclature(); // attributes diff --git a/sources/projectconfigpages.h b/sources/projectconfigpages.h index e2464aeeb..23f07c720 100644 --- a/sources/projectconfigpages.h +++ b/sources/projectconfigpages.h @@ -40,7 +40,7 @@ class ProjectConfigPage : public ConfigPage { Q_OBJECT // Constructor, destructor public: - ProjectConfigPage(QETProject *, QWidget * = 0); + ProjectConfigPage(QETProject *, QWidget * = nullptr); virtual ~ProjectConfigPage(); private: ProjectConfigPage(const ProjectConfigPage &); @@ -90,7 +90,7 @@ class ProjectMainConfigPage : public ProjectConfigPage { Q_OBJECT // Constructor, destructor public: - ProjectMainConfigPage(QETProject *, QWidget * = 0); + ProjectMainConfigPage(QETProject *, QWidget * = nullptr); virtual ~ProjectMainConfigPage(); private: ProjectMainConfigPage(const ProjectMainConfigPage &); @@ -122,7 +122,7 @@ class ProjectAutoNumConfigPage : public ProjectConfigPage { //Methods public: - ProjectAutoNumConfigPage (QETProject *project, QWidget *parent = 0); + ProjectAutoNumConfigPage (QETProject *project, QWidget *parent = nullptr); virtual QString title() const; virtual QIcon icon() const; diff --git a/sources/projectview.cpp b/sources/projectview.cpp index ba9924d89..13840d636 100644 --- a/sources/projectview.cpp +++ b/sources/projectview.cpp @@ -41,7 +41,7 @@ */ ProjectView::ProjectView(QETProject *project, QWidget *parent) : QWidget(parent), - m_project(0) + m_project(nullptr) { initActions(); initWidgets(); @@ -123,7 +123,7 @@ void ProjectView::closeEvent(QCloseEvent *qce) { */ void ProjectView::changeTabDown(){ DiagramView *nextDiagramView = this->nextDiagram(); - if (nextDiagramView!=NULL){ + if (nextDiagramView!=nullptr){ rebuildDiagramsMap(); m_tab -> setCurrentWidget(nextDiagramView); } @@ -138,7 +138,7 @@ DiagramView *ProjectView::nextDiagram() { if (next_tab_index= greatest tab the last tab is activated so no need to change tab. return(m_diagram_ids[next_tab_index]); else - return NULL; + return nullptr; } /** @@ -146,7 +146,7 @@ DiagramView *ProjectView::nextDiagram() { */ void ProjectView::changeTabUp(){ DiagramView *previousDiagramView = this->previousDiagram(); - if (previousDiagramView!=NULL){ + if (previousDiagramView!=nullptr){ rebuildDiagramsMap(); m_tab -> setCurrentWidget(previousDiagramView); } @@ -161,7 +161,7 @@ DiagramView *ProjectView::previousDiagram() { if (previous_tab_index>=0) //if previous tab index = 0 then the first tab is activated so no need to change tab. return(m_diagram_ids[previous_tab_index]); else - return NULL; + return nullptr; } /** @@ -965,7 +965,7 @@ DiagramView *ProjectView::findDiagram(Diagram *diagram) { return(diagram_view); } } - return(0); + return(nullptr); } /** diff --git a/sources/projectview.h b/sources/projectview.h index e8ccdefc6..190eddac3 100644 --- a/sources/projectview.h +++ b/sources/projectview.h @@ -41,7 +41,7 @@ class ProjectView : public QWidget // constructors, destructor public: - ProjectView(QETProject *, QWidget * = 0); + ProjectView(QETProject *, QWidget * = nullptr); virtual ~ProjectView(); private: ProjectView(const ProjectView &); diff --git a/sources/qet.cpp b/sources/qet.cpp index cb4f6e86a..5498827d3 100644 --- a/sources/qet.cpp +++ b/sources/qet.cpp @@ -199,7 +199,7 @@ bool QET::attributeIsAnInteger(const QDomElement &e, QString nom_attribut, int * bool ok; int tmp = e.attribute(nom_attribut).toInt(&ok); if (!ok) return(false); - if (entier != NULL) *entier = tmp; + if (entier != nullptr) *entier = tmp; return(true); } @@ -218,7 +218,7 @@ bool QET::attributeIsAReal(const QDomElement &e, QString nom_attribut, qreal *re bool ok; qreal tmp = e.attribute(nom_attribut).toDouble(&ok); if (!ok) return(false); - if (reel != NULL) *reel = tmp; + if (reel != nullptr) *reel = tmp; return(true); } diff --git a/sources/qet.h b/sources/qet.h index 5494559b0..5352e9844 100644 --- a/sources/qet.h +++ b/sources/qet.h @@ -140,9 +140,9 @@ namespace QET { QetCollection qetCollectionFromString (const QString &str); bool lineContainsPoint(const QLineF &, const QPointF &); - bool orthogonalProjection(const QPointF &, const QLineF &, QPointF * = 0); - bool attributeIsAnInteger(const QDomElement &, QString , int * = NULL); - bool attributeIsAReal(const QDomElement &, QString , qreal * = NULL); + bool orthogonalProjection(const QPointF &, const QLineF &, QPointF * = nullptr); + bool attributeIsAnInteger(const QDomElement &, QString , int * = nullptr); + bool attributeIsAReal(const QDomElement &, QString , qreal * = nullptr); QString ElementsAndConductorsSentence(int, int, int = 0, int = 0, int = 0, int = 0); QList findInDomElement(const QDomElement &, const QString &); QList findInDomElement(const QDomElement &, const QString &, const QString &); @@ -160,7 +160,7 @@ namespace QET { qreal correctAngle(const qreal &); bool compareCanonicalFilePaths(const QString &, const QString &); QString titleBlockColumnLengthToString(const TitleBlockColumnLength &); - bool writeXmlFile(QDomDocument &, const QString &, QString * = 0); + bool writeXmlFile(QDomDocument &, const QString &, QString * = nullptr); QPointF graphicsSceneEventPos(QEvent *); bool eachStrIsEqual (const QStringList &qsl); } diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp index baed73ae4..5cec76f78 100644 --- a/sources/qetapp.cpp +++ b/sources/qetapp.cpp @@ -62,7 +62,7 @@ TitleBlockTemplate *QETApp::default_titleblock_template_ = nullptr; */ QETApp::QETApp(int &argc, char **argv) : QETSingleApplication(argc, argv, QString("qelectrotech-" + QETApp::userName())), - splash_screen_(0), + splash_screen_(nullptr), non_interactive_execution_(false) { parseArguments(); @@ -378,7 +378,7 @@ TitleBlockTemplatesCollection *QETApp::titleBlockTemplatesCollection(const QStri return(project -> embeddedTitleBlockTemplatesCollection()); } } - return(0); + return(nullptr); } /** @@ -597,7 +597,7 @@ QStringList QETApp::handledFiles(const QList &urls) { n'est pas edite par l'application. */ QETDiagramEditor *QETApp::diagramEditorForFile(const QString &filepath) { - if (filepath.isEmpty()) return(0); + if (filepath.isEmpty()) return(nullptr); QETApp *qet_app(QETApp::instance()); foreach (QETDiagramEditor *diagram_editor, qet_app -> diagramEditors()) { @@ -606,7 +606,7 @@ QETDiagramEditor *QETApp::diagramEditorForFile(const QString &filepath) { } } - return(0); + return(nullptr); } /** @@ -1225,7 +1225,7 @@ void QETApp::configureQET() { // affiche le dialogue puis evite de le lier a un quelconque widget parent cd.exec(); - cd.setParent(0, cd.windowFlags()); + cd.setParent(nullptr, cd.windowFlags()); } /** @@ -1471,7 +1471,7 @@ int QETApp::projectIdFromString(const QString &url) { */ QETProject *QETApp::projectFromString(const QString &url) { int project_id = projectIdFromString(url); - if (project_id == -1) return(0); + if (project_id == -1) return(nullptr); return(project(project_id)); } @@ -1655,7 +1655,7 @@ QETProject *QETApp::project(const uint &id) { if (registered_projects_.contains(id)) { return(registered_projects_[id]); } else { - return(0); + return(nullptr); } } diff --git a/sources/qetarguments.h b/sources/qetarguments.h index 3a6719580..e57b200c2 100644 --- a/sources/qetarguments.h +++ b/sources/qetarguments.h @@ -28,8 +28,8 @@ class QETArguments : public QObject { // constructors, destructor public: - QETArguments(QObject * = 0); - QETArguments(const QList &, QObject * = 0); + QETArguments(QObject * = nullptr); + QETArguments(const QList &, QObject * = nullptr); QETArguments(const QETArguments &); QETArguments &operator=(const QETArguments &); virtual ~QETArguments(); diff --git a/sources/qetdiagrameditor.cpp b/sources/qetdiagrameditor.cpp index 8b5a7202b..b8b12f997 100644 --- a/sources/qetdiagrameditor.cpp +++ b/sources/qetdiagrameditor.cpp @@ -983,7 +983,7 @@ bool QETDiagramEditor::addProject(QETProject *project, bool update_panel) { // met a jour le panel d'elements if (update_panel) { pa -> elementsPanel().projectWasOpened(project); - if (currentDiagram() != NULL) + if (currentDiagram() != nullptr) m_autonumbering_dock->setProject(project, project_view); } @@ -1010,15 +1010,15 @@ QList QETDiagramEditor::openedProjects() const { */ ProjectView *QETDiagramEditor::currentProject() const { QMdiSubWindow *current_window = workspace.activeSubWindow(); - if (!current_window) return(0); + if (!current_window) return(nullptr); QWidget *current_widget = current_window -> widget(); - if (!current_widget) return(0); + if (!current_widget) return(nullptr); if (ProjectView *project_view = qobject_cast(current_widget)) { return(project_view); } - return(0); + return(nullptr); } /** @@ -1029,7 +1029,7 @@ DiagramView *QETDiagramEditor::currentDiagram() const { if (ProjectView *project_view = currentProject()) { return(project_view -> currentDiagram()); } - return(0); + return(nullptr); } /** @@ -1040,10 +1040,10 @@ DiagramView *QETDiagramEditor::currentDiagram() const { */ Element *QETDiagramEditor::currentElement() const { DiagramView *dv = currentDiagram(); - if (!dv) return(0); + if (!dv) return(nullptr); QList selected_elements = dv -> diagram() -> selectedContent().m_elements.toList(); - if (selected_elements.count() != 1) return(0); + if (selected_elements.count() != 1) return(nullptr); return(selected_elements.first()); } @@ -1070,7 +1070,7 @@ ProjectView *QETDiagramEditor::findProject(DiagramView *diagram_view) const { return(project_view); } } - return(0); + return(nullptr); } /** @@ -1086,7 +1086,7 @@ ProjectView *QETDiagramEditor::findProject(Diagram *diagram) const { } } } - return(0); + return(nullptr); } /** @@ -1099,7 +1099,7 @@ ProjectView *QETDiagramEditor::findProject(QETProject *project) const { return(opened_project); } } - return(0); + return(nullptr); } /** @@ -1115,7 +1115,7 @@ ProjectView *QETDiagramEditor::findProject(const QString &filepath) const { } } } - return(0); + return(nullptr); } /** @@ -1129,7 +1129,7 @@ QMdiSubWindow *QETDiagramEditor::subWindowForWidget(QWidget *widget) const { return(sub_window); } } - return(0); + return(nullptr); } /** @@ -1357,7 +1357,7 @@ void QETDiagramEditor::slot_updateActions() void QETDiagramEditor::slot_updateAutoNumDock() { if ( workspace.subWindowList().indexOf(workspace.activeSubWindow()) != activeSubWindowIndex) { activeSubWindowIndex = workspace.subWindowList().indexOf(workspace.activeSubWindow()); - if (currentProject() != NULL && currentDiagram() != NULL) { + if (currentProject() != nullptr && currentDiagram() != nullptr) { m_autonumbering_dock->setProject(currentProject()->project(),currentProject()); } } @@ -1584,12 +1584,12 @@ QList QETDiagramEditor::editedFiles() const { pas edite par cet editeur de schemas. */ ProjectView *QETDiagramEditor::viewForFile(const QString &filepath) const { - if (filepath.isEmpty()) return(0); + if (filepath.isEmpty()) return(nullptr); QString searched_can_file_path = QFileInfo(filepath).canonicalFilePath(); if (searched_can_file_path.isEmpty()) { // QFileInfo returns an empty path for non-existent files - return(0); + return(nullptr); } foreach (ProjectView *project_view, openedProjects()) { QString project_can_file_path = QFileInfo(project_view -> project() -> filePath()).canonicalFilePath(); @@ -1597,7 +1597,7 @@ ProjectView *QETDiagramEditor::viewForFile(const QString &filepath) const { return(project_view); } } - return(0); + return(nullptr); } /** @@ -1606,15 +1606,15 @@ ProjectView *QETDiagramEditor::viewForFile(const QString &filepath) const { */ ProjectView *QETDiagramEditor::acessCurrentProject (){ QMdiSubWindow *current_window = workspace.activeSubWindow(); - if (!current_window) return(0); + if (!current_window) return(nullptr); QWidget *current_widget = current_window -> widget(); - if (!current_widget) return(0); + if (!current_widget) return(nullptr); if (ProjectView *project_view = qobject_cast(current_widget)) { return(project_view); } - return(0); + return(nullptr); } /** @@ -1633,7 +1633,7 @@ DiagramView *QETDiagramEditor::acessCurrentDiagramView () { if (ProjectView *project_view = currentProject()) { return(project_view -> currentDiagram()); } - return(0); + return(nullptr); } /** @@ -2191,7 +2191,7 @@ success = process->startDetached("/Library/Frameworks/Python.framework/Versions/ success = process->startDetached("qet_tb_generator"); #endif if ( !success ) { -QMessageBox::warning(0, +QMessageBox::warning(nullptr, "Error launching plugin", "To install the plugin qet_tb_generator\nVisit https://pypi.python.org/pypi/qet-tb-generator/\n" "\n" diff --git a/sources/qetdiagrameditor.h b/sources/qetdiagrameditor.h index 82dab46f7..f0c6503d5 100644 --- a/sources/qetdiagrameditor.h +++ b/sources/qetdiagrameditor.h @@ -43,7 +43,7 @@ class QETDiagramEditor : public QETMainWindow { // constructors, destructor public: - QETDiagramEditor(const QStringList & = QStringList(), QWidget * = 0); + QETDiagramEditor(const QStringList & = QStringList(), QWidget * = nullptr); virtual ~QETDiagramEditor(); private: diff --git a/sources/qetgraphicsitem/conductor.cpp b/sources/qetgraphicsitem/conductor.cpp index 4c5a98f54..a139bf1fb 100644 --- a/sources/qetgraphicsitem/conductor.cpp +++ b/sources/qetgraphicsitem/conductor.cpp @@ -74,12 +74,12 @@ class ConductorXmlRetroCompatibility */ Conductor::Conductor(Terminal *p1, Terminal* p2) : QObject(), - QGraphicsPathItem(0), + QGraphicsPathItem(nullptr), terminal1(p1), terminal2(p2), m_mouse_over(false), - m_text_item(0), - segments(NULL), + m_text_item(nullptr), + segments(nullptr), m_moving_segment(false), modified_path(false), has_to_save_profile(false), @@ -178,7 +178,7 @@ void Conductor::segmentsToPath() { QPainterPath path; - if (segments == NULL) + if (segments == nullptr) setPath(path); //Start the path @@ -913,7 +913,7 @@ QList Conductor::segmentsToPoints() const { QList points_list; // on retourne la liste tout de suite s'il n'y a pas de segments - if (segments == NULL) return(points_list); + if (segments == nullptr) return(points_list); // recupere le premier point points_list << segments -> firstPoint(); @@ -941,7 +941,7 @@ void Conductor::pointsToSegments(QList points_list) { deleteSegments(); // cree les segments a partir de la liste de points - ConductorSegment *last_segment = NULL; + ConductorSegment *last_segment = nullptr; for (int i = 0 ; i < points_list.size() - 1 ; ++ i) { last_segment = new ConductorSegment(points_list.at(i), points_list.at(i + 1), last_segment); if (!i) segments = last_segment; @@ -956,8 +956,8 @@ void Conductor::pointsToSegments(QList points_list) { */ bool Conductor::fromXml(QDomElement &dom_element) { - setPos(dom_element.attribute("x", 0).toDouble(), - dom_element.attribute("y", 0).toDouble()); + setPos(dom_element.attribute("x", nullptr).toDouble(), + dom_element.attribute("y", nullptr).toDouble()); bool return_ = pathFromXml(dom_element); @@ -1123,7 +1123,7 @@ QVector Conductor::handlerPoints() const /// @return les segments de ce conducteur const QList Conductor::segmentsList() const { - if (segments == NULL) return(QList()); + if (segments == nullptr) return(QList()); QList segments_vector; ConductorSegment *segment = segments; @@ -1148,7 +1148,7 @@ qreal Conductor::length() const{ @return Le segment qui contient le point au milieu du conducteur */ ConductorSegment *Conductor::middleSegment() { - if (segments == NULL) return(NULL); + if (segments == nullptr) return(nullptr); qreal half_length = length() / 2.0; @@ -1532,7 +1532,7 @@ void Conductor::displayedTextChanged() */ QSet Conductor::relatedPotentialConductors(const bool all_diagram, QList *t_list) { bool declar_t_list = false; - if (t_list == 0) { + if (t_list == nullptr) { declar_t_list = true; t_list = new QList ; } @@ -1802,10 +1802,10 @@ void Conductor::setProfiles(const ConductorProfilesGroup &cpg) { /// Supprime les segments void Conductor::deleteSegments() { - if (segments != NULL) { + if (segments != nullptr) { while (segments -> hasNextSegment()) delete segments -> nextSegment(); delete segments; - segments = NULL; + segments = nullptr; } } diff --git a/sources/qetgraphicsitem/conductor.h b/sources/qetgraphicsitem/conductor.h index e8630441d..f2e2c84af 100644 --- a/sources/qetgraphicsitem/conductor.h +++ b/sources/qetgraphicsitem/conductor.h @@ -113,7 +113,7 @@ class Conductor : public QObject, public QGraphicsPathItem void calculateTextItemPosition(); virtual Highlight highlight() const; virtual void setHighlighted(Highlight); - QSet relatedPotentialConductors(const bool all_diagram = true, QList *t_list=0); + QSet relatedPotentialConductors(const bool all_diagram = true, QList *t_list=nullptr); QETDiagramEditor* diagramEditor() const; void editProperty (); diff --git a/sources/qetgraphicsitem/conductortextitem.h b/sources/qetgraphicsitem/conductortextitem.h index 57b58d287..442ebf8a8 100644 --- a/sources/qetgraphicsitem/conductortextitem.h +++ b/sources/qetgraphicsitem/conductortextitem.h @@ -32,8 +32,8 @@ class ConductorTextItem : public DiagramTextItem // constructors, destructor public: - ConductorTextItem(Conductor * = 0); - ConductorTextItem(const QString &, Conductor * = 0); + ConductorTextItem(Conductor * = nullptr); + ConductorTextItem(const QString &, Conductor * = nullptr); virtual ~ConductorTextItem(); private: ConductorTextItem(const ConductorTextItem &); diff --git a/sources/qetgraphicsitem/customelement.cpp b/sources/qetgraphicsitem/customelement.cpp index 1c1bc15ce..fb6b62070 100644 --- a/sources/qetgraphicsitem/customelement.cpp +++ b/sources/qetgraphicsitem/customelement.cpp @@ -692,7 +692,7 @@ ElementTextItem *CustomElement::parseInput(QDomElement &e) { !QET::attributeIsAReal(e, "x", &pos_x) ||\ !QET::attributeIsAReal(e, "y", &pos_y) ||\ !QET::attributeIsAnInteger(e, "size", &size) - ) return(0); + ) return(nullptr); ElementTextItem *eti = new ElementTextItem(e.attribute("text"), this); eti -> setFont(QETApp::diagramTextsFont(size)); @@ -733,14 +733,14 @@ Terminal *CustomElement::parseTerminal(QDomElement &e) { // verifie la presence et la validite des attributs obligatoires qreal terminalx, terminaly; Qet::Orientation terminalo; - if (!QET::attributeIsAReal(e, QString("x"), &terminalx)) return(0); - if (!QET::attributeIsAReal(e, QString("y"), &terminaly)) return(0); - if (!e.hasAttribute("orientation")) return(0); + if (!QET::attributeIsAReal(e, QString("x"), &terminalx)) return(nullptr); + if (!QET::attributeIsAReal(e, QString("y"), &terminaly)) return(nullptr); + if (!e.hasAttribute("orientation")) return(nullptr); if (e.attribute("orientation") == "n") terminalo = Qet::North; else if (e.attribute("orientation") == "s") terminalo = Qet::South; else if (e.attribute("orientation") == "e") terminalo = Qet::East; else if (e.attribute("orientation") == "w") terminalo = Qet::West; - else return(0); + else return(nullptr); Terminal *new_terminal = new Terminal(terminalx, terminaly, terminalo, this); new_terminal -> setZValue(420); // valeur arbitraire pour maintenir les bornes au-dessus des champs de texte list_terminals << new_terminal; @@ -991,5 +991,5 @@ ElementTextItem* CustomElement::taggedText(const QString &tagg) const { foreach (ElementTextItem *eti, list_texts_) { if (eti -> tagg() == tagg) return eti; } - return NULL; + return nullptr; } diff --git a/sources/qetgraphicsitem/customelement.h b/sources/qetgraphicsitem/customelement.h index 961fee1ab..79e07f3c1 100644 --- a/sources/qetgraphicsitem/customelement.h +++ b/sources/qetgraphicsitem/customelement.h @@ -36,7 +36,7 @@ class CustomElement : public FixedElement // constructors, destructor public: - CustomElement (const ElementsLocation &, QGraphicsItem * = 0, int * = 0); + CustomElement (const ElementsLocation &, QGraphicsItem * = nullptr, int * = nullptr); virtual ~CustomElement(); @@ -78,7 +78,7 @@ class CustomElement : public FixedElement ElementTextItem* taggedText(const QString &tagg) const; protected: - virtual bool buildFromXml(const QDomElement &, int * = 0); + virtual bool buildFromXml(const QDomElement &, int * = nullptr); virtual bool parseElement(QDomElement &, QPainter &); virtual bool parseLine(QDomElement &, QPainter &); virtual bool parseRect(QDomElement &, QPainter &); diff --git a/sources/qetgraphicsitem/diagramimageitem.h b/sources/qetgraphicsitem/diagramimageitem.h index 26e60b25d..69ddb3887 100644 --- a/sources/qetgraphicsitem/diagramimageitem.h +++ b/sources/qetgraphicsitem/diagramimageitem.h @@ -33,8 +33,8 @@ class DiagramImageItem : public QetGraphicsItem { // constructors, destructor public: - DiagramImageItem(QetGraphicsItem * = 0); - DiagramImageItem(const QPixmap &pixmap, QetGraphicsItem * = 0); + DiagramImageItem(QetGraphicsItem * = nullptr); + DiagramImageItem(const QPixmap &pixmap, QetGraphicsItem * = nullptr); virtual ~DiagramImageItem(); // attributes diff --git a/sources/qetgraphicsitem/diagramtextitem.h b/sources/qetgraphicsitem/diagramtextitem.h index 83ff3983b..46efc780b 100644 --- a/sources/qetgraphicsitem/diagramtextitem.h +++ b/sources/qetgraphicsitem/diagramtextitem.h @@ -41,8 +41,8 @@ class DiagramTextItem : public QGraphicsTextItem void colorChanged(QColor color); public: - DiagramTextItem(QGraphicsItem * = 0); - DiagramTextItem(const QString &, QGraphicsItem * = 0); + DiagramTextItem(QGraphicsItem * = nullptr); + DiagramTextItem(const QString &, QGraphicsItem * = nullptr); private: void build(); diff --git a/sources/qetgraphicsitem/element.cpp b/sources/qetgraphicsitem/element.cpp index 743709d59..9c2784dad 100644 --- a/sources/qetgraphicsitem/element.cpp +++ b/sources/qetgraphicsitem/element.cpp @@ -337,7 +337,7 @@ void Element::updatePixmap() { // Translation de l'origine du repere de la pixmap p.translate(hotspot_coord); // L'element se dessine sur la pixmap - paint(&p, 0); + paint(&p, nullptr); } /** diff --git a/sources/qetgraphicsitem/element.h b/sources/qetgraphicsitem/element.h index 81d501ad1..85f868bb6 100644 --- a/sources/qetgraphicsitem/element.h +++ b/sources/qetgraphicsitem/element.h @@ -41,7 +41,7 @@ class Element : public QetGraphicsItem // constructors, destructor public: - Element(QGraphicsItem * = 0); + Element(QGraphicsItem * = nullptr); virtual ~Element(); private: Element(const Element &); diff --git a/sources/qetgraphicsitem/elementtextitem.h b/sources/qetgraphicsitem/elementtextitem.h index aaafb4278..64a46c79a 100644 --- a/sources/qetgraphicsitem/elementtextitem.h +++ b/sources/qetgraphicsitem/elementtextitem.h @@ -31,8 +31,8 @@ class ElementTextItem : public DiagramTextItem { Q_OBJECT // constructors, destructor public: - ElementTextItem(Element * = 0); - ElementTextItem(const QString &, Element * = 0); + ElementTextItem(Element * = nullptr); + ElementTextItem(const QString &, Element * = nullptr); virtual ~ElementTextItem(); // attributes diff --git a/sources/qetgraphicsitem/fixedelement.h b/sources/qetgraphicsitem/fixedelement.h index b445fd7a8..ffea506ee 100644 --- a/sources/qetgraphicsitem/fixedelement.h +++ b/sources/qetgraphicsitem/fixedelement.h @@ -29,7 +29,7 @@ class FixedElement : public Element { // constructors, destructor public: - FixedElement(QGraphicsItem * = 0); + FixedElement(QGraphicsItem * = nullptr); virtual ~FixedElement(); // methods diff --git a/sources/qetgraphicsitem/ghostelement.h b/sources/qetgraphicsitem/ghostelement.h index 4d0629e49..d0100dd39 100644 --- a/sources/qetgraphicsitem/ghostelement.h +++ b/sources/qetgraphicsitem/ghostelement.h @@ -36,7 +36,7 @@ class GhostElement : public CustomElement { // constructor, destructor public: - GhostElement(const ElementsLocation &, QGraphicsItem * = 0); + GhostElement(const ElementsLocation &, QGraphicsItem * = nullptr); virtual ~GhostElement(); // methods diff --git a/sources/qetgraphicsitem/independenttextitem.cpp b/sources/qetgraphicsitem/independenttextitem.cpp index e59cb61d9..8be47a35e 100644 --- a/sources/qetgraphicsitem/independenttextitem.cpp +++ b/sources/qetgraphicsitem/independenttextitem.cpp @@ -23,7 +23,7 @@ @param parent_diagram Le schema auquel est rattache le champ de texte */ IndependentTextItem::IndependentTextItem() : - DiagramTextItem(0) + DiagramTextItem(nullptr) {} /** @@ -32,7 +32,7 @@ IndependentTextItem::IndependentTextItem() : @param parent_diagram Le schema auquel est rattache le champ de texte */ IndependentTextItem::IndependentTextItem(const QString &text) : - DiagramTextItem(text, 0) + DiagramTextItem(text, nullptr) {} /// Destructeur diff --git a/sources/qetgraphicsitem/masterelement.h b/sources/qetgraphicsitem/masterelement.h index 26216518c..942a7a73d 100644 --- a/sources/qetgraphicsitem/masterelement.h +++ b/sources/qetgraphicsitem/masterelement.h @@ -33,7 +33,7 @@ class MasterElement : public CustomElement Q_OBJECT public: - explicit MasterElement(const ElementsLocation &, QGraphicsItem * = 0, int * = 0); + explicit MasterElement(const ElementsLocation &, QGraphicsItem * = nullptr, int * = nullptr); ~MasterElement(); virtual void linkToElement (Element *elmt); diff --git a/sources/qetgraphicsitem/qetgraphicsitem.h b/sources/qetgraphicsitem/qetgraphicsitem.h index bc84a1d18..eb733b14e 100644 --- a/sources/qetgraphicsitem/qetgraphicsitem.h +++ b/sources/qetgraphicsitem/qetgraphicsitem.h @@ -28,7 +28,7 @@ class QetGraphicsItem : public QGraphicsObject public: //constructor destructor - QetGraphicsItem(QGraphicsItem *parent = 0); + QetGraphicsItem(QGraphicsItem *parent = nullptr); virtual ~QetGraphicsItem() = 0; //public methode diff --git a/sources/qetgraphicsitem/qetshapeitem.cpp b/sources/qetgraphicsitem/qetshapeitem.cpp index 01665c790..f3a72c3ea 100644 --- a/sources/qetgraphicsitem/qetshapeitem.cpp +++ b/sources/qetgraphicsitem/qetshapeitem.cpp @@ -606,14 +606,14 @@ bool QetShapeItem::fromXml(const QDomElement &e) if (m_shapeType != Polygon) { - m_P1.setX(e.attribute("x1", 0).toDouble()); - m_P1.setY(e.attribute("y1", 0).toDouble()); - m_P2.setX(e.attribute("x2", 0).toDouble()); - m_P2.setY(e.attribute("y2", 0).toDouble()); + m_P1.setX(e.attribute("x1", nullptr).toDouble()); + m_P1.setY(e.attribute("y1", nullptr).toDouble()); + m_P2.setX(e.attribute("x2", nullptr).toDouble()); + m_P2.setY(e.attribute("y2", nullptr).toDouble()); } else foreach(QDomElement de, QET::findInDomElement(e, "points", "point")) - m_polygon << QPointF(de.attribute("x", 0).toDouble(), de.attribute("y", 0).toDouble()); + m_polygon << QPointF(de.attribute("x", nullptr).toDouble(), de.attribute("y", nullptr).toDouble()); return (true); } diff --git a/sources/qetgraphicsitem/qetshapeitem.h b/sources/qetgraphicsitem/qetshapeitem.h index fdbf94efd..13f023486 100644 --- a/sources/qetgraphicsitem/qetshapeitem.h +++ b/sources/qetgraphicsitem/qetshapeitem.h @@ -56,7 +56,7 @@ class QetShapeItem : public QetGraphicsItem enum { Type = UserType + 1008 }; - QetShapeItem(QPointF, QPointF = QPointF(0,0), ShapeType = Line, QGraphicsItem *parent = 0); + QetShapeItem(QPointF, QPointF = QPointF(0,0), ShapeType = Line, QGraphicsItem *parent = nullptr); virtual ~QetShapeItem(); //Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a QetShapeItem @return the QGraphicsItem type diff --git a/sources/qetgraphicsitem/reportelement.cpp b/sources/qetgraphicsitem/reportelement.cpp index 72c32da88..d172bf8cc 100644 --- a/sources/qetgraphicsitem/reportelement.cpp +++ b/sources/qetgraphicsitem/reportelement.cpp @@ -59,7 +59,7 @@ ReportElement::~ReportElement() { unlinkAllElements(); if (terminals().size()) - disconnect(terminals().first(), 0, 0, 0); + disconnect(terminals().first(), nullptr, nullptr, nullptr); if (m_watched_conductor) disconnect(m_watched_conductor, &Conductor::propertiesChange, this, &ReportElement::updateLabel); } diff --git a/sources/qetgraphicsitem/reportelement.h b/sources/qetgraphicsitem/reportelement.h index a5fc943e2..12f93fc03 100644 --- a/sources/qetgraphicsitem/reportelement.h +++ b/sources/qetgraphicsitem/reportelement.h @@ -32,7 +32,7 @@ class ReportElement : public CustomElement Q_OBJECT public : - explicit ReportElement(const ElementsLocation &,QString link_type, QGraphicsItem * = 0, int * = 0); + explicit ReportElement(const ElementsLocation &,QString link_type, QGraphicsItem * = nullptr, int * = nullptr); ~ReportElement(); virtual void linkToElement(Element *); virtual void unlinkAllElements(); diff --git a/sources/qetgraphicsitem/simpleelement.h b/sources/qetgraphicsitem/simpleelement.h index f2b3109dc..89277539d 100644 --- a/sources/qetgraphicsitem/simpleelement.h +++ b/sources/qetgraphicsitem/simpleelement.h @@ -32,7 +32,7 @@ class SimpleElement : public CustomElement { Q_OBJECT public : - explicit SimpleElement(const ElementsLocation &, QGraphicsItem * = 0, int * = 0); + explicit SimpleElement(const ElementsLocation &, QGraphicsItem * = nullptr, int * = nullptr); ~SimpleElement(); virtual void initLink(QETProject *project); diff --git a/sources/qetgraphicsitem/slaveelement.cpp b/sources/qetgraphicsitem/slaveelement.cpp index 40e939e50..60904c741 100644 --- a/sources/qetgraphicsitem/slaveelement.cpp +++ b/sources/qetgraphicsitem/slaveelement.cpp @@ -110,7 +110,7 @@ void SlaveElement::unlinkElement(Element *elmt) disconnect(elmt -> diagram(), SIGNAL(XRefPropertiesChanged()), this, SLOT(updateLabel())); disconnect(elmt, SIGNAL(updateLabel()), this, SLOT(updateLabel())); - delete m_xref_item; m_xref_item = NULL; + delete m_xref_item; m_xref_item = nullptr; if (ElementTextItem *eti = this->taggedText("label")) eti->setPlainText("_"); diff --git a/sources/qetgraphicsitem/slaveelement.h b/sources/qetgraphicsitem/slaveelement.h index bcdd008bc..51d171da8 100644 --- a/sources/qetgraphicsitem/slaveelement.h +++ b/sources/qetgraphicsitem/slaveelement.h @@ -25,7 +25,7 @@ class SlaveElement : public CustomElement { Q_OBJECT public: - explicit SlaveElement (const ElementsLocation &, QGraphicsItem * = 0, int * = 0); + explicit SlaveElement (const ElementsLocation &, QGraphicsItem * = nullptr, int * = nullptr); ~SlaveElement(); virtual void linkToElement(Element *elmt); virtual void unlinkAllElements(); diff --git a/sources/qetgraphicsitem/terminal.cpp b/sources/qetgraphicsitem/terminal.cpp index 28535ed43..25c3a7b22 100644 --- a/sources/qetgraphicsitem/terminal.cpp +++ b/sources/qetgraphicsitem/terminal.cpp @@ -62,7 +62,7 @@ void Terminal::init(QPointF pf, Qet::Orientation o, QString number, QString name // QRectF null br_ = new QRectF(); - previous_terminal_ = 0; + previous_terminal_ = nullptr; // divers setAcceptHoverEvents(true); setAcceptedMouseButtons(Qt::LeftButton); @@ -559,7 +559,7 @@ void Terminal::mouseMoveEvent(QGraphicsSceneMouseEvent *e) { */ void Terminal::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) { - previous_terminal_ = 0; + previous_terminal_ = nullptr; hovered_color_ = neutralColor; if (!diagram()) return; diff --git a/sources/qetgraphicsitem/terminal.h b/sources/qetgraphicsitem/terminal.h index f3e94a548..38a1a53cd 100644 --- a/sources/qetgraphicsitem/terminal.h +++ b/sources/qetgraphicsitem/terminal.h @@ -37,9 +37,9 @@ class Terminal : public QGraphicsObject // constructors, destructor public: - Terminal(QPointF, Qet::Orientation, Element * = 0); - Terminal(qreal, qreal, Qet::Orientation, Element * = 0); - Terminal(QPointF, Qet::Orientation, QString number, QString name, bool hiddenName, Element * = 0); + Terminal(QPointF, Qet::Orientation, Element * = nullptr); + Terminal(qreal, qreal, Qet::Orientation, Element * = nullptr); + Terminal(QPointF, Qet::Orientation, QString number, QString name, bool hiddenName, Element * = nullptr); virtual ~Terminal(); private: diff --git a/sources/qetgraphicsitem/terminalelement.h b/sources/qetgraphicsitem/terminalelement.h index 6687f7e2f..d0f615e4e 100644 --- a/sources/qetgraphicsitem/terminalelement.h +++ b/sources/qetgraphicsitem/terminalelement.h @@ -27,7 +27,7 @@ class TerminalElement : public CustomElement { Q_OBJECT public: - TerminalElement(const ElementsLocation &, QGraphicsItem * = 0, int * = 0); + TerminalElement(const ElementsLocation &, QGraphicsItem * = nullptr, int * = nullptr); ~TerminalElement(); virtual void initLink(QETProject *project); diff --git a/sources/qetmainwindow.cpp b/sources/qetmainwindow.cpp index 8be55ec7c..9f868c04c 100644 --- a/sources/qetmainwindow.cpp +++ b/sources/qetmainwindow.cpp @@ -33,7 +33,7 @@ */ QETMainWindow::QETMainWindow(QWidget *widget, Qt::WindowFlags flags) : QMainWindow(widget, flags), - display_toolbars_(0), + display_toolbars_(nullptr), first_activation_(true) { initCommonActions(); @@ -161,8 +161,8 @@ upgrade_M -> setVisible(true); upgrade_M -> setVisible(false); #endif - insertMenu(0, settings_menu_); - insertMenu(0, help_menu_); + insertMenu(nullptr, settings_menu_); + insertMenu(nullptr, help_menu_); } /** @@ -185,7 +185,7 @@ void QETMainWindow::insertMenu(QMenu *before, QMenu *menu, bool customize) { @return the action returned when inserting \a menu */ QAction *QETMainWindow::actionForMenu(QMenu *menu) { - return(menu_actions_.value(menu, 0)); + return(menu_actions_.value(menu, nullptr)); } /** diff --git a/sources/qetmainwindow.h b/sources/qetmainwindow.h index 6593cf5b4..737f4b355 100644 --- a/sources/qetmainwindow.h +++ b/sources/qetmainwindow.h @@ -28,7 +28,7 @@ class QETMainWindow : public QMainWindow { // constructor, destructor public: - QETMainWindow(QWidget * = 0, Qt::WindowFlags = 0); + QETMainWindow(QWidget * = nullptr, Qt::WindowFlags = nullptr); virtual ~QETMainWindow(); // methods diff --git a/sources/qetprintpreviewdialog.h b/sources/qetprintpreviewdialog.h index 0c41c80ad..39843fbf3 100644 --- a/sources/qetprintpreviewdialog.h +++ b/sources/qetprintpreviewdialog.h @@ -36,7 +36,7 @@ class QETPrintPreviewDialog : public QDialog { // constructors, destructor public: - QETPrintPreviewDialog(QETProject *, QPrinter *, QWidget * = 0, Qt::WindowFlags = 0); + QETPrintPreviewDialog(QETProject *, QPrinter *, QWidget * = nullptr, Qt::WindowFlags = nullptr); virtual ~QETPrintPreviewDialog(); private: QETPrintPreviewDialog(const QETPrintPreviewDialog &); diff --git a/sources/qetproject.cpp b/sources/qetproject.cpp index ce33e4a0d..e5e08d2d5 100644 --- a/sources/qetproject.cpp +++ b/sources/qetproject.cpp @@ -1044,7 +1044,7 @@ bool QETProject::usesTitleBlockTemplate(const TitleBlockTemplateLocation &locati */ Diagram *QETProject::addNewDiagram() { // ne fait rien si le projet est en lecture seule - if (isReadOnly()) return(0); + if (isReadOnly()) return(nullptr); // cree un nouveau schema Diagram *diagram = new Diagram(this); @@ -1189,7 +1189,7 @@ void QETProject::readProjectXml(QDomDocument &xml_project) if (conv_ok && QET::version.toDouble() < project_qet_version_) { int ret = QET::QetMessageBox::warning( - 0, + nullptr, tr("Avertissement", "message box title"), tr( "Ce document semble avoir été enregistré avec " @@ -1636,7 +1636,7 @@ void QETProject::updateDiagramsFolioData() { m_diagrams_list[i]->project()->addFolioAutoNum(autopagenum,nCC.next()); } else{ - m_diagrams_list[i] -> border_and_titleblock.setFolioData(i + 1, total_folio, NULL, project_wide_properties); + m_diagrams_list[i] -> border_and_titleblock.setFolioData(i + 1, total_folio, nullptr, project_wide_properties); } m_diagrams_list[i] -> update(); } diff --git a/sources/qetproject.h b/sources/qetproject.h index b7204e195..dfd27e656 100644 --- a/sources/qetproject.h +++ b/sources/qetproject.h @@ -49,8 +49,8 @@ class QETProject : public QObject // constructors, destructor public: - QETProject (int = 1, QObject * = 0); - QETProject (const QString &, QObject * = 0); + QETProject (int = 1, QObject * = nullptr); + QETProject (const QString &, QObject * = nullptr); virtual ~QETProject(); private: diff --git a/sources/qfilenameedit.h b/sources/qfilenameedit.h index d16ff95a2..7ab01cc81 100644 --- a/sources/qfilenameedit.h +++ b/sources/qfilenameedit.h @@ -34,8 +34,8 @@ class QFileNameEdit : public QLineEdit { // constructors, destructor public: - QFileNameEdit(QWidget * = 0); - QFileNameEdit(const QString &, QWidget * = 0); + QFileNameEdit(QWidget * = nullptr); + QFileNameEdit(const QString &, QWidget * = nullptr); virtual ~QFileNameEdit(); private: QFileNameEdit(const QFileNameEdit &); diff --git a/sources/qtextorientationspinboxwidget.h b/sources/qtextorientationspinboxwidget.h index da4d8f8e6..2c07177c3 100644 --- a/sources/qtextorientationspinboxwidget.h +++ b/sources/qtextorientationspinboxwidget.h @@ -29,7 +29,7 @@ class QTextOrientationSpinBoxWidget : public QWidget { // constructors, destructor public: - QTextOrientationSpinBoxWidget(QWidget * = 0); + QTextOrientationSpinBoxWidget(QWidget * = nullptr); virtual ~QTextOrientationSpinBoxWidget(); private: QTextOrientationSpinBoxWidget(const QTextOrientationSpinBoxWidget &); diff --git a/sources/qtextorientationwidget.h b/sources/qtextorientationwidget.h index 2e4e7b1a7..e6bf270bf 100644 --- a/sources/qtextorientationwidget.h +++ b/sources/qtextorientationwidget.h @@ -26,7 +26,7 @@ class QTextOrientationWidget : public QWidget { // constructors, destructor public: - QTextOrientationWidget(QWidget * = 0); + QTextOrientationWidget(QWidget * = nullptr); virtual ~QTextOrientationWidget(); private: QTextOrientationWidget(const QTextOrientationWidget &); @@ -82,6 +82,6 @@ class QTextOrientationWidget : public QWidget { private: QString getMostUsableStringForRadius(const qreal &); void generateTextSizeHash(); - bool positionIsASquare(const QPointF &, double * = 0); + bool positionIsASquare(const QPointF &, double * = nullptr); }; #endif diff --git a/sources/recentfiles.cpp b/sources/recentfiles.cpp index b52ca2b09..63374aff2 100644 --- a/sources/recentfiles.cpp +++ b/sources/recentfiles.cpp @@ -30,7 +30,7 @@ RecentFiles::RecentFiles(const QString &identifier, int size, QObject *parent) : QObject(parent), identifier_(identifier.isEmpty() ? "unnamed" : identifier), size_(size > 0 ? size : 10), - menu_(0) + menu_(nullptr) { mapper_ = new QSignalMapper(this); connect(mapper_, SIGNAL(mapped(const QString &)), this, SLOT(handleMenuRequest(const QString &))); diff --git a/sources/recentfiles.h b/sources/recentfiles.h index c1cf1eaf7..3d2bd2845 100644 --- a/sources/recentfiles.h +++ b/sources/recentfiles.h @@ -28,7 +28,7 @@ class RecentFiles : public QObject { // constructors, destructor public: - RecentFiles(const QString &, int = 10, QObject * = 0); + RecentFiles(const QString &, int = 10, QObject * = nullptr); virtual ~RecentFiles(); private: RecentFiles(const RecentFiles &); diff --git a/sources/richtext/richtexteditor.cpp b/sources/richtext/richtexteditor.cpp index ba779a400..e54ab96c7 100644 --- a/sources/richtext/richtexteditor.cpp +++ b/sources/richtext/richtexteditor.cpp @@ -134,7 +134,7 @@ namespace qdesigner_internal { // Richtext simplification filter: Remove hard-coded font settings, //