Modernize-use-nullptr refactors code

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5008 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
scorpio810 2017-08-05 02:06:59 +00:00
parent 876d05a338
commit 9f9b127c04
187 changed files with 438 additions and 438 deletions

View File

@ -649,7 +649,7 @@ QIcon ElementsLocation::icon() const
{ {
ElementFactory *factory = ElementFactory::Instance(); ElementFactory *factory = ElementFactory::Instance();
int state; int state;
Element *elmt = factory->createElement(*this, 0, &state); Element *elmt = factory->createElement(*this, nullptr, &state);
if (state == 0) if (state == 0)
return QIcon(elmt->pixmap()); return QIcon(elmt->pixmap());

View File

@ -89,7 +89,7 @@ void ElementsTreeView::startElementDrag(const ElementsLocation &location)
//Build the element for set the pixmap of the QDrag //Build the element for set the pixmap of the QDrag
int elmt_creation_state; 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) if (elmt_creation_state)
{ {
delete temp_elmt; delete temp_elmt;

View File

@ -30,7 +30,7 @@ class RenameDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit RenameDialog(QString path, QWidget *parent = 0); explicit RenameDialog(QString path, QWidget *parent = nullptr);
~RenameDialog(); ~RenameDialog();
QString newName() const {return m_new_name;} QString newName() const {return m_new_name;}

View File

@ -39,7 +39,7 @@ class PropertiesEditorDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
template<typename T> template<typename T>
PropertiesEditorDialog(T editor, QWidget *parent = 0) : PropertiesEditorDialog(T editor, QWidget *parent = nullptr) :
QDialog (parent) QDialog (parent)
{ {
//Set dialog title //Set dialog title

View File

@ -31,7 +31,7 @@ class PropertiesEditorDockWidget : public QDockWidget
Q_OBJECT Q_OBJECT
public: public:
explicit PropertiesEditorDockWidget(QWidget *parent = 0); explicit PropertiesEditorDockWidget(QWidget *parent = nullptr);
~PropertiesEditorDockWidget(); ~PropertiesEditorDockWidget();
virtual void clear(); virtual void clear();

View File

@ -31,7 +31,7 @@ class PropertiesEditorWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit PropertiesEditorWidget(QWidget *parent = 0); explicit PropertiesEditorWidget(QWidget *parent = nullptr);
virtual void apply() {} virtual void apply() {}
virtual void reset() {} virtual void reset() {}

View File

@ -33,8 +33,8 @@ class QObject;
class QPropertyUndoCommand : public QUndoCommand class QPropertyUndoCommand : public QUndoCommand
{ {
public: 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, const QVariant &new_value, QUndoCommand *parent = nullptr);
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, QUndoCommand *parent = nullptr);
void setNewValue(const QVariant &new_value); void setNewValue(const QVariant &new_value);
void enableAnimation (bool animate = true); void enableAnimation (bool animate = true);

View File

@ -27,7 +27,7 @@ class AboutQET : public QDialog {
// constructors, destructor // constructors, destructor
public: public:
AboutQET(QWidget * = 0); AboutQET(QWidget * = nullptr);
virtual ~AboutQET(); virtual ~AboutQET();
private: private:

View File

@ -24,7 +24,7 @@
NumerotationContextCommands::NumerotationContextCommands(const NumerotationContext &nc, Diagram *d): NumerotationContextCommands::NumerotationContextCommands(const NumerotationContext &nc, Diagram *d):
diagram_ (d), diagram_ (d),
context_ (nc), context_ (nc),
strategy_ (NULL) strategy_ (nullptr)
{} {}
/** /**

View File

@ -167,7 +167,7 @@ void AutoNumberingDockWidget::setContext() {
* @param dv: activated diagramview * @param dv: activated diagramview
*/ */
void AutoNumberingDockWidget::setConductorActive(DiagramView* dv) { void AutoNumberingDockWidget::setConductorActive(DiagramView* dv) {
if (dv!=NULL) { if (dv!=nullptr) {
QString conductor_autonum = dv->diagram()->conductorsAutonumName(); QString conductor_autonum = dv->diagram()->conductorsAutonumName();
int conductor_index = ui->m_conductor_cb->findText(conductor_autonum); int conductor_index = ui->m_conductor_cb->findText(conductor_autonum);
ui->m_conductor_cb->setCurrentIndex(conductor_index); ui->m_conductor_cb->setCurrentIndex(conductor_index);
@ -180,7 +180,7 @@ void AutoNumberingDockWidget::setConductorActive(DiagramView* dv) {
*/ */
void AutoNumberingDockWidget::setActive() { void AutoNumberingDockWidget::setActive() {
if (m_project_view!=NULL) { if (m_project_view!=nullptr) {
//Conductor //Conductor
if (m_project_view->currentDiagram()) { if (m_project_view->currentDiagram()) {
QString conductor_autonum = m_project_view->currentDiagram()->diagram()->conductorsAutonumName(); QString conductor_autonum = m_project_view->currentDiagram()->diagram()->conductorsAutonumName();

View File

@ -31,7 +31,7 @@ class AutoNumberingDockWidget : public QDockWidget
Q_OBJECT Q_OBJECT
public: public:
explicit AutoNumberingDockWidget(QWidget *parent = 0); explicit AutoNumberingDockWidget(QWidget *parent = nullptr);
~AutoNumberingDockWidget(); ~AutoNumberingDockWidget();
void setContext(); void setContext();

View File

@ -34,7 +34,7 @@ class AutoNumberingManagementW : public QWidget
//METHODS //METHODS
public: public:
explicit AutoNumberingManagementW(QETProject *project, QWidget *parent = 0); explicit AutoNumberingManagementW(QETProject *project, QWidget *parent = nullptr);
~AutoNumberingManagementW(); ~AutoNumberingManagementW();
Ui::AutoNumberingManagementW *ui; Ui::AutoNumberingManagementW *ui;
void setProjectContext (); void setProjectContext ();

View File

@ -35,7 +35,7 @@ class FolioAutonumberingW : public QWidget
//METHODS //METHODS
public: public:
explicit FolioAutonumberingW(QETProject *project, QWidget *parent = 0); explicit FolioAutonumberingW(QETProject *project, QWidget *parent = nullptr);
~FolioAutonumberingW(); ~FolioAutonumberingW();
void setContext (QList <QString> autonums); void setContext (QList <QString> autonums);

View File

@ -38,7 +38,7 @@ class FormulaAutonumberingW : public QWidget
//METHODS //METHODS
public: public:
explicit FormulaAutonumberingW(QWidget *parent = 0); explicit FormulaAutonumberingW(QWidget *parent = nullptr);
~FormulaAutonumberingW(); ~FormulaAutonumberingW();
QString formula(); QString formula();
void setContext(QString); void setContext(QString);

View File

@ -249,7 +249,7 @@ void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) {
ui -> value_field -> clear(); ui -> value_field -> clear();
ui -> increase_spinBox -> setDisabled(true); ui -> increase_spinBox -> setDisabled(true);
if (t==string) { if (t==string) {
ui -> value_field -> setValidator(0); ui -> value_field -> setValidator(nullptr);
ui -> value_field -> setEnabled(true); ui -> value_field -> setEnabled(true);
} }
else if (t==folio) { else if (t==folio) {

View File

@ -37,8 +37,8 @@ class NumPartEditorW : public QWidget
//METHODS //METHODS
public: public:
explicit NumPartEditorW(int type, QWidget *parent = 0); explicit NumPartEditorW(int type, QWidget *parent = nullptr);
NumPartEditorW (NumerotationContext &, int, int type, QWidget *parent=0); NumPartEditorW (NumerotationContext &, int, int type, QWidget *parent=nullptr);
~NumPartEditorW(); ~NumPartEditorW();
enum type {unit,unitfolio,ten,tenfolio, hundred, hundredfolio, enum type {unit,unitfolio,ten,tenfolio, hundred, hundredfolio,

View File

@ -37,8 +37,8 @@ class SelectAutonumW : public QWidget
//METHODS //METHODS
public: public:
explicit SelectAutonumW(int type, QWidget *parent = 0); explicit SelectAutonumW(int type, QWidget *parent = nullptr);
explicit SelectAutonumW(const NumerotationContext &context, int type, QWidget *parent = 0); explicit SelectAutonumW(const NumerotationContext &context, int type, QWidget *parent = nullptr);
~SelectAutonumW(); ~SelectAutonumW();
void setContext (const NumerotationContext &context); void setContext (const NumerotationContext &context);

View File

@ -37,7 +37,7 @@ class BorderTitleBlock : public QObject
Q_OBJECT Q_OBJECT
public: public:
BorderTitleBlock(QObject * = 0); BorderTitleBlock(QObject * = nullptr);
virtual ~BorderTitleBlock(); virtual ~BorderTitleBlock();
private: private:
@ -153,7 +153,7 @@ class BorderTitleBlock : public QObject
btb_folio_ = folio; btb_folio_ = folio;
emit (titleBlockFolioChanged(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 /// @param author the new value of the "File" field
void setMachine(const QString &machine) { btb_machine_ = machine; } void setMachine(const QString &machine) { btb_machine_ = machine; }
void setLocMach(const QString &locmach) { btb_locmach_ = locmach; } void setLocMach(const QString &locmach) { btb_locmach_ = locmach; }
@ -180,7 +180,7 @@ class BorderTitleBlock : public QObject
public slots: public slots:
void titleBlockTemplateChanged(const QString &); void titleBlockTemplateChanged(const QString &);
void titleBlockTemplateRemoved(const QString &, const TitleBlockTemplate * = 0); void titleBlockTemplateRemoved(const QString &, const TitleBlockTemplate * = nullptr);
// methods to set display options // methods to set display options
void displayTitleBlock(bool); void displayTitleBlock(bool);

View File

@ -477,14 +477,14 @@ void ConductorSegment::setSecondPoint(const QPointF &p) {
@return true si le segment a un segment precedent, false sinon @return true si le segment a un segment precedent, false sinon
*/ */
bool ConductorSegment::hasPreviousSegment() const { bool ConductorSegment::hasPreviousSegment() const {
return(previous_segment != NULL); return(previous_segment != nullptr);
} }
/** /**
@return true si le segment a un segment suivant, false sinon @return true si le segment a un segment suivant, false sinon
*/ */
bool ConductorSegment::hasNextSegment() const { bool ConductorSegment::hasNextSegment() const {
return(next_segment != NULL); return(next_segment != nullptr);
} }
/** /**

View File

@ -26,7 +26,7 @@ class ConductorSegment {
// constructors, destructor // constructors, destructor
public: public:
ConductorSegment(const QPointF &, const QPointF &, ConductorSegment * = NULL, ConductorSegment * = NULL); ConductorSegment(const QPointF &, const QPointF &, ConductorSegment * = nullptr, ConductorSegment * = nullptr);
virtual ~ConductorSegment(); virtual ~ConductorSegment();
private: private:

View File

@ -32,7 +32,7 @@ class ConfigDialog : public QDialog {
Q_OBJECT Q_OBJECT
// constructors, destructor // constructors, destructor
public: public:
ConfigDialog(QWidget * = 0); ConfigDialog(QWidget * = nullptr);
virtual ~ConfigDialog(); virtual ~ConfigDialog();
private: private:
ConfigDialog(const ConfigDialog &); ConfigDialog(const ConfigDialog &);

View File

@ -38,7 +38,7 @@ class NewDiagramPage : public ConfigPage {
Q_OBJECT Q_OBJECT
// constructors, destructor // constructors, destructor
public: public:
NewDiagramPage(QETProject *project = 0, QWidget * = 0, ProjectPropertiesDialog *teste = NULL); NewDiagramPage(QETProject *project = nullptr, QWidget * = nullptr, ProjectPropertiesDialog *teste = nullptr);
virtual ~NewDiagramPage(); virtual ~NewDiagramPage();
private: private:
NewDiagramPage(const NewDiagramPage &); NewDiagramPage(const NewDiagramPage &);
@ -76,7 +76,7 @@ class GeneralConfigurationPage : public ConfigPage {
Q_OBJECT Q_OBJECT
// constructors, destructor // constructors, destructor
public: public:
GeneralConfigurationPage(QWidget * = 0); GeneralConfigurationPage(QWidget * = nullptr);
virtual ~GeneralConfigurationPage(); virtual ~GeneralConfigurationPage();
private: private:
GeneralConfigurationPage(const GeneralConfigurationPage &); GeneralConfigurationPage(const GeneralConfigurationPage &);
@ -121,7 +121,7 @@ class ExportConfigPage : public ConfigPage {
Q_OBJECT Q_OBJECT
// constructors, destructor // constructors, destructor
public: public:
ExportConfigPage(QWidget * = 0); ExportConfigPage(QWidget * = nullptr);
virtual ~ExportConfigPage(); virtual ~ExportConfigPage();
private: private:
ExportConfigPage(const ExportConfigPage &); ExportConfigPage(const ExportConfigPage &);
@ -144,7 +144,7 @@ class PrintConfigPage : public ConfigPage {
Q_OBJECT Q_OBJECT
// constructors, destructor // constructors, destructor
public: public:
PrintConfigPage(QWidget * = 0); PrintConfigPage(QWidget * = nullptr);
virtual ~PrintConfigPage(); virtual ~PrintConfigPage();
private: private:
PrintConfigPage(const PrintConfigPage &); PrintConfigPage(const PrintConfigPage &);

View File

@ -67,7 +67,7 @@ Diagram::Diagram(QETProject *project) :
setProject(project); setProject(project);
qgi_manager_ = new QGIManager(this); qgi_manager_ = new QGIManager(this);
setBackgroundBrush(Qt::white); setBackgroundBrush(Qt::white);
conductor_setter_ = new QGraphicsLineItem(0); conductor_setter_ = new QGraphicsLineItem(nullptr);
conductor_setter_ -> setZValue(1000000); conductor_setter_ -> setZValue(1000000);
QPen pen(Qt::NoBrush, 1.5, Qt::DashLine); 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; 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) 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); 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);

View File

@ -150,9 +150,9 @@ class Diagram : public QGraphicsScene
// methods related to XML import/export // methods related to XML import/export
QDomDocument toXml(bool = true); QDomDocument toXml(bool = true);
bool initFromXml(QDomElement &, QPointF = QPointF(), bool = true, DiagramContent * = 0); bool initFromXml(QDomElement &, QPointF = QPointF(), bool = true, DiagramContent * = nullptr);
bool fromXml(QDomDocument &, QPointF = QPointF(), bool = true, DiagramContent * = 0); bool fromXml(QDomDocument &, QPointF = QPointF(), bool = true, DiagramContent * = nullptr);
bool fromXml(QDomElement &, QPointF = QPointF(), bool = true, DiagramContent * = 0); bool fromXml(QDomElement &, QPointF = QPointF(), bool = true, DiagramContent * = nullptr);
void folioSequentialsToXml(QHash<QString, QStringList>*, QDomElement *, QString, QString, QDomDocument *); void folioSequentialsToXml(QHash<QString, QStringList>*, QDomElement *, QString, QString, QDomDocument *);
void folioSequentialsFromXml(const QDomElement&, QHash<QString, QStringList>*, QString, QString, QString, QString); void folioSequentialsFromXml(const QDomElement&, QHash<QString, QStringList>*, QString, QString, QString, QString);
@ -192,10 +192,10 @@ class Diagram : public QGraphicsScene
DiagramContent content() const; DiagramContent content() const;
DiagramContent selectedContent(); DiagramContent selectedContent();
bool canRotateSelection() const; bool canRotateSelection() const;
int beginMoveElements(QGraphicsItem * = 0); int beginMoveElements(QGraphicsItem * = nullptr);
void continueMoveElements(const QPointF &); void continueMoveElements(const QPointF &);
void endMoveElements(); void endMoveElements();
int beginMoveElementTexts(QGraphicsItem * = 0); int beginMoveElementTexts(QGraphicsItem * = nullptr);
void continueMoveElementTexts(const QPointF &); void continueMoveElementTexts(const QPointF &);
void endMoveElementTexts(); void endMoveElementTexts();
bool usesElement(const ElementsLocation &); bool usesElement(const ElementsLocation &);

View File

@ -87,7 +87,7 @@ QString itemText(const Conductor *item);
class PasteDiagramCommand : public QUndoCommand { class PasteDiagramCommand : public QUndoCommand {
// constructors, destructor // constructors, destructor
public: public:
PasteDiagramCommand(Diagram *, const DiagramContent &, QUndoCommand * = 0); PasteDiagramCommand(Diagram *, const DiagramContent &, QUndoCommand * = nullptr);
virtual ~PasteDiagramCommand(); virtual ~PasteDiagramCommand();
private: private:
PasteDiagramCommand(const PasteDiagramCommand &); PasteDiagramCommand(const PasteDiagramCommand &);
@ -115,7 +115,7 @@ class PasteDiagramCommand : public QUndoCommand {
class CutDiagramCommand : public DeleteQGraphicsItemCommand { class CutDiagramCommand : public DeleteQGraphicsItemCommand {
// constructors, destructor // constructors, destructor
public: public:
CutDiagramCommand(Diagram *, const DiagramContent &, QUndoCommand * = 0); CutDiagramCommand(Diagram *, const DiagramContent &, QUndoCommand * = nullptr);
virtual ~CutDiagramCommand(); virtual ~CutDiagramCommand();
private: private:
CutDiagramCommand(const CutDiagramCommand &); CutDiagramCommand(const CutDiagramCommand &);
@ -127,7 +127,7 @@ class CutDiagramCommand : public DeleteQGraphicsItemCommand {
class MoveElementsCommand : public QUndoCommand { class MoveElementsCommand : public QUndoCommand {
// constructors, destructor // constructors, destructor
public: public:
MoveElementsCommand(Diagram *, const DiagramContent &, const QPointF &m, QUndoCommand * = 0); MoveElementsCommand(Diagram *, const DiagramContent &, const QPointF &m, QUndoCommand * = nullptr);
virtual ~MoveElementsCommand(); virtual ~MoveElementsCommand();
private: private:
MoveElementsCommand(const MoveElementsCommand &); MoveElementsCommand(const MoveElementsCommand &);
@ -162,7 +162,7 @@ class MoveElementsCommand : public QUndoCommand {
class MoveConductorsTextsCommand : public QUndoCommand { class MoveConductorsTextsCommand : public QUndoCommand {
// constructors, destructor // constructors, destructor
public: public:
MoveConductorsTextsCommand(Diagram *, QUndoCommand * = 0); MoveConductorsTextsCommand(Diagram *, QUndoCommand * = nullptr);
virtual ~MoveConductorsTextsCommand(); virtual ~MoveConductorsTextsCommand();
private: private:
MoveConductorsTextsCommand(const MoveConductorsTextsCommand &); MoveConductorsTextsCommand(const MoveConductorsTextsCommand &);
@ -192,7 +192,7 @@ class MoveConductorsTextsCommand : public QUndoCommand {
class ChangeDiagramTextCommand : public QUndoCommand { class ChangeDiagramTextCommand : public QUndoCommand {
// constructors, destructor // constructors, destructor
public: public:
ChangeDiagramTextCommand(DiagramTextItem *, const QString &before, const QString &after, QUndoCommand * = 0); ChangeDiagramTextCommand(DiagramTextItem *, const QString &before, const QString &after, QUndoCommand * = nullptr);
virtual ~ChangeDiagramTextCommand(); virtual ~ChangeDiagramTextCommand();
private: private:
ChangeDiagramTextCommand(const ChangeDiagramTextCommand &); ChangeDiagramTextCommand(const ChangeDiagramTextCommand &);
@ -221,7 +221,7 @@ class ChangeDiagramTextCommand : public QUndoCommand {
class RotateElementsCommand : public QUndoCommand { class RotateElementsCommand : public QUndoCommand {
// constructors, destructor // constructors, destructor
public: public:
RotateElementsCommand(const QList<Element *> &elements, const QList<DiagramTextItem *> &, const QList<DiagramImageItem *> &, QUndoCommand * = 0); RotateElementsCommand(const QList<Element *> &elements, const QList<DiagramTextItem *> &, const QList<DiagramImageItem *> &, QUndoCommand * = nullptr);
virtual ~RotateElementsCommand(); virtual ~RotateElementsCommand();
private: private:
RotateElementsCommand(const RotateElementsCommand &); RotateElementsCommand(const RotateElementsCommand &);
@ -284,7 +284,7 @@ class RotateTextsCommand : public QUndoCommand
class ChangeConductorCommand : public QUndoCommand { class ChangeConductorCommand : public QUndoCommand {
// constructors, destructor // constructors, destructor
public: public:
ChangeConductorCommand(Conductor *, const ConductorProfile &, const ConductorProfile &, Qt::Corner, QUndoCommand * = 0); ChangeConductorCommand(Conductor *, const ConductorProfile &, const ConductorProfile &, Qt::Corner, QUndoCommand * = nullptr);
virtual ~ChangeConductorCommand(); virtual ~ChangeConductorCommand();
private: private:
ChangeConductorCommand(const ChangeConductorCommand &); ChangeConductorCommand(const ChangeConductorCommand &);
@ -320,7 +320,7 @@ class ChangeConductorCommand : public QUndoCommand {
class ResetConductorCommand : public QUndoCommand { class ResetConductorCommand : public QUndoCommand {
// constructors, destructor // constructors, destructor
public: public:
ResetConductorCommand(const QHash<Conductor *, ConductorProfilesGroup> &, QUndoCommand * = 0); ResetConductorCommand(const QHash<Conductor *, ConductorProfilesGroup> &, QUndoCommand * = nullptr);
virtual ~ResetConductorCommand(); virtual ~ResetConductorCommand();
private: private:
ResetConductorCommand(const ResetConductorCommand &); ResetConductorCommand(const ResetConductorCommand &);
@ -343,7 +343,7 @@ class ResetConductorCommand : public QUndoCommand {
class ChangeTitleBlockCommand : public QUndoCommand { class ChangeTitleBlockCommand : public QUndoCommand {
// constructors, destructor // constructors, destructor
public: public:
ChangeTitleBlockCommand(Diagram *, const TitleBlockProperties &, const TitleBlockProperties &, QUndoCommand * = 0); ChangeTitleBlockCommand(Diagram *, const TitleBlockProperties &, const TitleBlockProperties &, QUndoCommand * = nullptr);
virtual ~ChangeTitleBlockCommand(); virtual ~ChangeTitleBlockCommand();
private: private:
ChangeTitleBlockCommand(const ChangeTitleBlockCommand &); ChangeTitleBlockCommand(const ChangeTitleBlockCommand &);
@ -369,7 +369,7 @@ class ChangeTitleBlockCommand : public QUndoCommand {
class ChangeBorderCommand : public QUndoCommand { class ChangeBorderCommand : public QUndoCommand {
// constructors, destructor // constructors, destructor
public: public:
ChangeBorderCommand(Diagram *, const BorderProperties &, const BorderProperties &, QUndoCommand * = 0); ChangeBorderCommand(Diagram *, const BorderProperties &, const BorderProperties &, QUndoCommand * = nullptr);
virtual ~ChangeBorderCommand(); virtual ~ChangeBorderCommand();
private: private:
ChangeBorderCommand(const ChangeBorderCommand &); ChangeBorderCommand(const ChangeBorderCommand &);

View File

@ -29,7 +29,7 @@ class DiagramContextWidget : public QWidget {
Q_OBJECT Q_OBJECT
// Constructor, destructor // Constructor, destructor
public: public:
DiagramContextWidget(QWidget *parent = 0); DiagramContextWidget(QWidget *parent = nullptr);
virtual ~DiagramContextWidget(); virtual ~DiagramContextWidget();
private: private:
DiagramContextWidget(const DiagramContextWidget &); DiagramContextWidget(const DiagramContextWidget &);

View File

@ -180,7 +180,7 @@ bool DiagramEventAddElement::buildElement()
int state; int state;
ElementsLocation loc(m_integrate_path); 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 //The creation of element failed, we delete it
if (state) { if (state) {
delete m_element; delete m_element;
@ -200,9 +200,9 @@ void DiagramEventAddElement::addElement()
int state; int state;
Element *element; Element *element;
if (m_integrate_path.isEmpty()) if (m_integrate_path.isEmpty())
element = ElementFactory::Instance() -> createElement(m_location, 0, &state); element = ElementFactory::Instance() -> createElement(m_location, nullptr, &state);
else else
element = ElementFactory::Instance() -> createElement(ElementsLocation(m_integrate_path), 0, &state); element = ElementFactory::Instance() -> createElement(ElementsLocation(m_integrate_path), nullptr, &state);
//Build failed //Build failed
if (state) if (state)

View File

@ -34,7 +34,7 @@
DiagramPrintDialog::DiagramPrintDialog(QETProject *project, QWidget *parent) : DiagramPrintDialog::DiagramPrintDialog(QETProject *project, QWidget *parent) :
QWidget(parent), QWidget(parent),
project_(project), project_(project),
dialog_(0) dialog_(nullptr)
{ {
// initialise l'imprimante // initialise l'imprimante
printer_ = new QPrinter(); printer_ = new QPrinter();

View File

@ -36,7 +36,7 @@ class DiagramPrintDialog : public QWidget
Q_OBJECT Q_OBJECT
// Constructors, destructor // Constructors, destructor
public: public:
DiagramPrintDialog(QETProject *, QWidget * = 0); DiagramPrintDialog(QETProject *, QWidget * = nullptr);
virtual ~DiagramPrintDialog(); virtual ~DiagramPrintDialog();
private: private:
DiagramPrintDialog(const DiagramPrintDialog &); DiagramPrintDialog(const DiagramPrintDialog &);
@ -63,7 +63,7 @@ class DiagramPrintDialog : public QWidget
private slots: private slots:
void print(const QList<Diagram *> &, bool, const ExportProperties); void print(const QList<Diagram *> &, bool, const ExportProperties);
void printDiagram(Diagram *, bool, const ExportProperties &, QPainter *, QPrinter * = 0); void printDiagram(Diagram *, bool, const ExportProperties &, QPainter *, QPrinter * = nullptr);
void updatePrintTypeDialog(); void updatePrintTypeDialog();
void acceptPrintTypeDialog(); void acceptPrintTypeDialog();
void browseFilePrintTypeDialog(); void browseFilePrintTypeDialog();

View File

@ -27,8 +27,8 @@
DiagramsChooser::DiagramsChooser(QETProject *project, QWidget *parent) : DiagramsChooser::DiagramsChooser(QETProject *project, QWidget *parent) :
QScrollArea(parent), QScrollArea(parent),
project_(project), project_(project),
widget0_(0), widget0_(nullptr),
vlayout0_(0) vlayout0_(nullptr)
{ {
setFrameShadow(QFrame::Sunken); setFrameShadow(QFrame::Sunken);
setFrameShape(QFrame::StyledPanel); setFrameShape(QFrame::StyledPanel);

View File

@ -29,7 +29,7 @@ class DiagramsChooser : public QScrollArea {
// constructors, destructor // constructors, destructor
public: public:
DiagramsChooser(QETProject *, QWidget * = 0); DiagramsChooser(QETProject *, QWidget * = nullptr);
virtual ~DiagramsChooser(); virtual ~DiagramsChooser();
private: private:
DiagramsChooser(const DiagramsChooser &); DiagramsChooser(const DiagramsChooser &);

View File

@ -41,7 +41,7 @@ class DiagramView : public QGraphicsView
// constructors, destructor // constructors, destructor
public: public:
DiagramView(Diagram *diagram, QWidget * = 0); DiagramView(Diagram *diagram, QWidget * = nullptr);
virtual ~DiagramView(); virtual ~DiagramView();
private: private:

View File

@ -93,8 +93,8 @@ bool ArcEditor::setPart(CustomElementPart *new_part)
disconnect(part, &PartArc::spanAngleChanged, this, &ArcEditor::updateForm); disconnect(part, &PartArc::spanAngleChanged, this, &ArcEditor::updateForm);
disconnect(part, &PartArc::startAngleChanged, this, &ArcEditor::updateForm); disconnect(part, &PartArc::startAngleChanged, this, &ArcEditor::updateForm);
} }
part = 0; part = nullptr;
style_ -> setPart(0); style_ -> setPart(nullptr);
return(true); return(true);
} }

View File

@ -34,7 +34,7 @@ class ArcEditor : public ElementItemEditor
// constructors, destructor // constructors, destructor
public: public:
ArcEditor(QETElementEditor *, PartArc * = 0, QWidget * = 0); ArcEditor(QETElementEditor *, PartArc * = nullptr, QWidget * = nullptr);
virtual ~ArcEditor(); virtual ~ArcEditor();
private: private:
ArcEditor(const ArcEditor &); ArcEditor(const ArcEditor &);

View File

@ -86,7 +86,7 @@ DeletePartsCommand::DeletePartsCommand(
const QList<QGraphicsItem *> parts, const QList<QGraphicsItem *> parts,
QUndoCommand *parent QUndoCommand *parent
) : ) :
ElementEditionCommand(QObject::tr("suppression", "undo caption"), scene, 0, parent), ElementEditionCommand(QObject::tr("suppression", "undo caption"), scene, nullptr, parent),
deleted_parts(parts) deleted_parts(parts)
{ {
foreach(QGraphicsItem *qgi, deleted_parts) { foreach(QGraphicsItem *qgi, deleted_parts) {
@ -131,7 +131,7 @@ PastePartsCommand::PastePartsCommand(
const ElementContent &c, const ElementContent &c,
QUndoCommand *parent QUndoCommand *parent
) : ) :
ElementEditionCommand(view ? view -> scene() : 0, view, parent), ElementEditionCommand(view ? view -> scene() : nullptr, view, parent),
content_(c), content_(c),
uses_offset(false), uses_offset(false),
first_redo(true) first_redo(true)
@ -227,7 +227,7 @@ MovePartsCommand::MovePartsCommand(
const QList<QGraphicsItem *> parts, const QList<QGraphicsItem *> parts,
QUndoCommand *parent QUndoCommand *parent
) : ) :
ElementEditionCommand(QObject::tr("déplacement", "undo caption"), scene, 0, parent), ElementEditionCommand(QObject::tr("déplacement", "undo caption"), scene, nullptr, parent),
movement(m), movement(m),
first_redo(true) first_redo(true)
{ {
@ -267,7 +267,7 @@ AddPartCommand::AddPartCommand(
QGraphicsItem *p, QGraphicsItem *p,
QUndoCommand *parent 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), part(p),
first_redo(true) first_redo(true)
{ {
@ -315,7 +315,7 @@ ChangeNamesCommand::ChangeNamesCommand(
const NamesList &after, const NamesList &after,
QUndoCommand *parent 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_before(before),
names_after(after) names_after(after)
{ {
@ -346,7 +346,7 @@ ChangeZValueCommand::ChangeZValueCommand(
ChangeZValueCommand::Option o, ChangeZValueCommand::Option o,
QUndoCommand *parent QUndoCommand *parent
) : ) :
ElementEditionCommand(elmt, 0, parent), ElementEditionCommand(elmt, nullptr, parent),
option(o) option(o)
{ {
// retrieve all primitives but terminals // retrieve all primitives but terminals
@ -466,7 +466,7 @@ void ChangeZValueCommand::applySendBackward(const QList<QGraphicsItem *> &items_
@param parent QUndoCommand parent @param parent QUndoCommand parent
*/ */
ChangeInformationsCommand::ChangeInformationsCommand(ElementScene *elmt, const QString &old_infos, const QString &new_infos, 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), old_informations_(old_infos),
new_informations_(new_infos) new_informations_(new_infos)
{ {
@ -492,7 +492,7 @@ void ChangeInformationsCommand::redo() {
@param parent Parent QUndoCommand @param parent Parent QUndoCommand
*/ */
ScalePartsCommand::ScalePartsCommand(ElementScene *scene, QUndoCommand * parent) : ScalePartsCommand::ScalePartsCommand(ElementScene *scene, QUndoCommand * parent) :
ElementEditionCommand(scene, 0, parent), ElementEditionCommand(scene, nullptr, parent),
first_redo(true) first_redo(true)
{} {}
@ -594,7 +594,7 @@ void ScalePartsCommand::adjustText() {
* @param parent: parent undo * @param parent: parent undo
*/ */
ChangePropertiesCommand::ChangePropertiesCommand(ElementScene *scene, QString type, DiagramContext info, QUndoCommand *parent) : 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_type << scene->m_elmt_type << type;
m_info << scene->m_elmt_kindInfo << info; m_info << scene->m_elmt_kindInfo << info;

View File

@ -33,8 +33,8 @@ class ElementEditionCommand : public QUndoCommand
{ {
// constructors, destructor // constructors, destructor
public: public:
ElementEditionCommand(ElementScene * = 0, ElementView * = 0, QUndoCommand * = 0); ElementEditionCommand(ElementScene * = nullptr, ElementView * = nullptr, QUndoCommand * = nullptr);
ElementEditionCommand(const QString &, ElementScene * = 0, ElementView * = 0, QUndoCommand * = 0); ElementEditionCommand(const QString &, ElementScene * = nullptr, ElementView * = nullptr, QUndoCommand * = nullptr);
virtual ~ElementEditionCommand(); virtual ~ElementEditionCommand();
private: private:
ElementEditionCommand(const ElementEditionCommand &); ElementEditionCommand(const ElementEditionCommand &);
@ -60,7 +60,7 @@ class ElementEditionCommand : public QUndoCommand
class DeletePartsCommand : public ElementEditionCommand { class DeletePartsCommand : public ElementEditionCommand {
// constructors, destructor // constructors, destructor
public: public:
DeletePartsCommand(ElementScene *, const QList<QGraphicsItem *>, QUndoCommand * = 0); DeletePartsCommand(ElementScene *, const QList<QGraphicsItem *>, QUndoCommand * = nullptr);
virtual ~DeletePartsCommand(); virtual ~DeletePartsCommand();
private: private:
DeletePartsCommand(const DeletePartsCommand &); DeletePartsCommand(const DeletePartsCommand &);
@ -82,7 +82,7 @@ class DeletePartsCommand : public ElementEditionCommand {
class PastePartsCommand : public ElementEditionCommand { class PastePartsCommand : public ElementEditionCommand {
// constructors, destructor // constructors, destructor
public: public:
PastePartsCommand(ElementView *, const ElementContent &, QUndoCommand * = 0); PastePartsCommand(ElementView *, const ElementContent &, QUndoCommand * = nullptr);
virtual ~PastePartsCommand(); virtual ~PastePartsCommand();
private: private:
PastePartsCommand(const PastePartsCommand &); PastePartsCommand(const PastePartsCommand &);
@ -113,7 +113,7 @@ class PastePartsCommand : public ElementEditionCommand {
class CutPartsCommand : public DeletePartsCommand { class CutPartsCommand : public DeletePartsCommand {
// constructors, destructor // constructors, destructor
public: public:
CutPartsCommand(ElementScene *, const QList<QGraphicsItem *>, QUndoCommand * = 0); CutPartsCommand(ElementScene *, const QList<QGraphicsItem *>, QUndoCommand * = nullptr);
virtual ~CutPartsCommand(); virtual ~CutPartsCommand();
private: private:
CutPartsCommand(const CutPartsCommand &); CutPartsCommand(const CutPartsCommand &);
@ -125,7 +125,7 @@ class CutPartsCommand : public DeletePartsCommand {
class MovePartsCommand : public ElementEditionCommand { class MovePartsCommand : public ElementEditionCommand {
// constructors, destructor // constructors, destructor
public: public:
MovePartsCommand(const QPointF &, ElementScene *, const QList<QGraphicsItem *>, QUndoCommand * = 0); MovePartsCommand(const QPointF &, ElementScene *, const QList<QGraphicsItem *>, QUndoCommand * = nullptr);
virtual ~MovePartsCommand(); virtual ~MovePartsCommand();
private: private:
MovePartsCommand(const MovePartsCommand &); MovePartsCommand(const MovePartsCommand &);
@ -151,7 +151,7 @@ class MovePartsCommand : public ElementEditionCommand {
class AddPartCommand : public ElementEditionCommand { class AddPartCommand : public ElementEditionCommand {
// constructors, destructor // constructors, destructor
public: public:
AddPartCommand(const QString &, ElementScene *, QGraphicsItem *, QUndoCommand * = 0); AddPartCommand(const QString &, ElementScene *, QGraphicsItem *, QUndoCommand * = nullptr);
virtual ~AddPartCommand(); virtual ~AddPartCommand();
private: private:
AddPartCommand(const AddPartCommand &); AddPartCommand(const AddPartCommand &);
@ -175,7 +175,7 @@ class AddPartCommand : public ElementEditionCommand {
class ChangeNamesCommand : public ElementEditionCommand { class ChangeNamesCommand : public ElementEditionCommand {
// constructors, destructor // constructors, destructor
public: public:
ChangeNamesCommand(ElementScene *, const NamesList &, const NamesList &, QUndoCommand * = 0); ChangeNamesCommand(ElementScene *, const NamesList &, const NamesList &, QUndoCommand * = nullptr);
virtual ~ChangeNamesCommand(); virtual ~ChangeNamesCommand();
private: private:
ChangeNamesCommand(const ChangeNamesCommand &); ChangeNamesCommand(const ChangeNamesCommand &);
@ -207,7 +207,7 @@ class ChangeZValueCommand : public ElementEditionCommand {
Lower, ///< Send primitives one layer below their current one; zValues are decremented Lower, ///< Send primitives one layer below their current one; zValues are decremented
SendBackward ///< Send primitives to the background so they have the lowest zValue SendBackward ///< Send primitives to the background so they have the lowest zValue
}; };
ChangeZValueCommand(ElementScene *, Option, QUndoCommand * = 0); ChangeZValueCommand(ElementScene *, Option, QUndoCommand * = nullptr);
virtual ~ChangeZValueCommand(); virtual ~ChangeZValueCommand();
private: private:
ChangeZValueCommand(const ChangeZValueCommand &); ChangeZValueCommand(const ChangeZValueCommand &);
@ -239,7 +239,7 @@ class ChangeZValueCommand : public ElementEditionCommand {
class ChangeInformationsCommand : public ElementEditionCommand { class ChangeInformationsCommand : public ElementEditionCommand {
// constructors, destructor // constructors, destructor
public: public:
ChangeInformationsCommand(ElementScene *, const QString &, const QString &, QUndoCommand * = 0); ChangeInformationsCommand(ElementScene *, const QString &, const QString &, QUndoCommand * = nullptr);
virtual ~ChangeInformationsCommand(); virtual ~ChangeInformationsCommand();
private: private:
ChangeInformationsCommand(const ChangeInformationsCommand &); ChangeInformationsCommand(const ChangeInformationsCommand &);
@ -263,7 +263,7 @@ class ChangeInformationsCommand : public ElementEditionCommand {
class ScalePartsCommand : public ElementEditionCommand { class ScalePartsCommand : public ElementEditionCommand {
// constructors, destructor // constructors, destructor
public: public:
ScalePartsCommand(ElementScene * = 0, QUndoCommand * = 0); ScalePartsCommand(ElementScene * = nullptr, QUndoCommand * = nullptr);
virtual ~ScalePartsCommand(); virtual ~ScalePartsCommand();
private: private:
ScalePartsCommand(const ScalePartsCommand &); ScalePartsCommand(const ScalePartsCommand &);
@ -296,7 +296,7 @@ class ScalePartsCommand : public ElementEditionCommand {
class ChangePropertiesCommand : public ElementEditionCommand { class ChangePropertiesCommand : public ElementEditionCommand {
public: public:
ChangePropertiesCommand (ElementScene *scene, QString type, DiagramContext info, QUndoCommand *parent=0); ChangePropertiesCommand (ElementScene *scene, QString type, DiagramContext info, QUndoCommand *parent=nullptr);
virtual ~ChangePropertiesCommand (); virtual ~ChangePropertiesCommand ();
virtual void undo(); virtual void undo();

View File

@ -61,5 +61,5 @@ void ElementItemEditor::setElementTypeName(const QString &name) {
@see setPart @see setPart
*/ */
void ElementItemEditor::detach() { void ElementItemEditor::detach() {
setPart(0); setPart(nullptr);
} }

View File

@ -35,7 +35,7 @@ class ElementItemEditor : public QWidget
Q_OBJECT Q_OBJECT
// constructors, destructor // constructors, destructor
public: public:
ElementItemEditor(QETElementEditor *, QWidget * = 0); ElementItemEditor(QETElementEditor *, QWidget * = nullptr);
virtual ~ElementItemEditor() {}; virtual ~ElementItemEditor() {};
private: private:
ElementItemEditor(const ElementItemEditor &); ElementItemEditor(const ElementItemEditor &);

View File

@ -222,14 +222,14 @@ void ElementPrimitiveDecorator::mouseReleaseEvent(QGraphicsSceneMouseEvent *even
{ {
Q_UNUSED(event) Q_UNUSED(event)
ElementEditionCommand *command = 0; ElementEditionCommand *command = nullptr;
if (current_operation_square_ == QET::MoveArea) if (current_operation_square_ == QET::MoveArea)
{ {
QPointF movement = mapToScene(modified_bounding_rect_.topLeft()) - mapToScene(original_bounding_rect_.topLeft()); QPointF movement = mapToScene(modified_bounding_rect_.topLeft()) - mapToScene(original_bounding_rect_.topLeft());
if (!movement.isNull()) if (!movement.isNull())
{ {
MovePartsCommand *move_command = new MovePartsCommand(movement, 0, graphicsItems()); MovePartsCommand *move_command = new MovePartsCommand(movement, nullptr, graphicsItems());
command = move_command; command = move_command;
} }
@ -282,7 +282,7 @@ void ElementPrimitiveDecorator::keyReleaseEvent(QKeyEvent *e) {
moving_by_keys_ && !e -> isAutoRepeat() moving_by_keys_ && !e -> isAutoRepeat()
) { ) {
// cree un objet d'annulation pour le mouvement qui vient de se finir // 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(); keys_movement_ = QPointF();
moving_by_keys_ = false; moving_by_keys_ = false;
} }
@ -378,7 +378,7 @@ CustomElementPart *ElementPrimitiveDecorator::singleItem() const {
if (decorated_items_.count() == 1) { if (decorated_items_.count() == 1) {
return(decorated_items_.first()); return(decorated_items_.first());
} }
return(0); return(nullptr);
} }
/** /**
@ -538,7 +538,7 @@ void ElementPrimitiveDecorator::handlerMouseReleaseEvent(QetGraphicsHandlerItem
Q_UNUSED(qghi); Q_UNUSED(qghi);
Q_UNUSED(event); Q_UNUSED(event);
ElementEditionCommand *command = 0; ElementEditionCommand *command = nullptr;
if (current_operation_square_ > QET::NoOperation) if (current_operation_square_ > QET::NoOperation)
{ {
ScalePartsCommand *scale_command = new ScalePartsCommand(); ScalePartsCommand *scale_command = new ScalePartsCommand();

View File

@ -42,7 +42,7 @@ class ElementPrimitiveDecorator : public QGraphicsObject
Q_OBJECT Q_OBJECT
public: public:
ElementPrimitiveDecorator(QGraphicsItem * = 0); ElementPrimitiveDecorator(QGraphicsItem * = nullptr);
virtual ~ElementPrimitiveDecorator(); virtual ~ElementPrimitiveDecorator();
enum { Type = UserType + 2200 }; enum { Type = UserType + 2200 };
@ -50,7 +50,7 @@ class ElementPrimitiveDecorator : public QGraphicsObject
// methods // methods
QRectF internalBoundingRect() const; QRectF internalBoundingRect() const;
virtual QRectF boundingRect () 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; } virtual int type() const { return Type; }
void setItems(const QList<QGraphicsItem *> &); void setItems(const QList<QGraphicsItem *> &);
void setItems(const QList<CustomElementPart *> &); void setItems(const QList<CustomElementPart *> &);

View File

@ -55,7 +55,7 @@ class ElementScene : public QGraphicsScene
// constructors, destructor // constructors, destructor
public: public:
ElementScene(QETElementEditor *, QObject * = 0); ElementScene(QETElementEditor *, QObject * = nullptr);
virtual ~ElementScene(); virtual ~ElementScene();
private: private:
@ -113,7 +113,7 @@ class ElementScene : public QGraphicsScene
virtual void setGrid(int, int); virtual void setGrid(int, int);
virtual const QDomDocument toXml(bool = true); virtual const QDomDocument toXml(bool = true);
virtual QRectF boundingRectFromXml(const QDomDocument &); 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 void reset();
virtual QList<CustomElementPart *> primitives() const; virtual QList<CustomElementPart *> primitives() const;
virtual QList<QGraphicsItem *> zItems(ItemOptions options = ItemOptions(SortByZValue | IncludeTerminals | SelectedOrNot)) const; virtual QList<QGraphicsItem *> zItems(ItemOptions options = ItemOptions(SortByZValue | IncludeTerminals | SelectedOrNot)) const;
@ -141,10 +141,10 @@ class ElementScene : public QGraphicsScene
private: private:
QRectF elementContentBoundingRect(const ElementContent &) const; QRectF elementContentBoundingRect(const ElementContent &) const;
bool applyInformations(const QDomDocument &, QString * = 0); bool applyInformations(const QDomDocument &, QString * = nullptr);
ElementContent loadContent(const QDomDocument &, QString * = 0); ElementContent loadContent(const QDomDocument &, QString * = nullptr);
ElementContent addContent(const ElementContent &, QString * = 0); ElementContent addContent(const ElementContent &, QString * = nullptr);
ElementContent addContentAtPos(const ElementContent &, const QPointF &, QString * = 0); ElementContent addContentAtPos(const ElementContent &, const QPointF &, QString * = nullptr);
void addPrimitive(QGraphicsItem *); void addPrimitive(QGraphicsItem *);
void initPasteArea(); void initPasteArea();
static bool zValueLessThan(QGraphicsItem *, QGraphicsItem *); static bool zValueLessThan(QGraphicsItem *, QGraphicsItem *);

View File

@ -30,7 +30,7 @@ class ElementView : public QGraphicsView {
// constructors, destructor // constructors, destructor
public: public:
ElementView(ElementScene *, QWidget * = 0); ElementView(ElementScene *, QWidget * = nullptr);
virtual ~ElementView(); virtual ~ElementView();
private: private:

View File

@ -83,8 +83,8 @@ bool EllipseEditor::setPart(CustomElementPart *new_part)
{ {
if (part) if (part)
disconnect(part, &PartEllipse::rectChanged, this, &EllipseEditor::updateForm); disconnect(part, &PartEllipse::rectChanged, this, &EllipseEditor::updateForm);
part = 0; part = nullptr;
style_ -> setPart(0); style_ -> setPart(nullptr);
return(true); return(true);
} }
if (PartEllipse *part_ellipse = dynamic_cast<PartEllipse *>(new_part)) if (PartEllipse *part_ellipse = dynamic_cast<PartEllipse *>(new_part))

View File

@ -33,7 +33,7 @@ class EllipseEditor : public ElementItemEditor
// constructors, destructor // constructors, destructor
public: public:
EllipseEditor(QETElementEditor *, PartEllipse * = 0, QWidget * = 0); EllipseEditor(QETElementEditor *, PartEllipse * = nullptr, QWidget * = nullptr);
virtual ~EllipseEditor(); virtual ~EllipseEditor();
private: private:
EllipseEditor(const EllipseEditor &); EllipseEditor(const EllipseEditor &);

View File

@ -41,7 +41,7 @@ class AbstractPartEllipse : public CustomElementGraphicPart
// constructors, destructor // constructors, destructor
public: public:
AbstractPartEllipse(QETElementEditor *editor, QGraphicsItem * parent = 0); AbstractPartEllipse(QETElementEditor *editor, QGraphicsItem * parent = nullptr);
virtual ~AbstractPartEllipse(); virtual ~AbstractPartEllipse();
private: private:

View File

@ -64,7 +64,7 @@ class CustomElementGraphicPart : public QGraphicsObject, public CustomElementPar
// constructors, destructor // constructors, destructor
public: public:
CustomElementGraphicPart(QETElementEditor *editor, QGraphicsItem *parent = 0); CustomElementGraphicPart(QETElementEditor *editor, QGraphicsItem *parent = nullptr);
virtual ~CustomElementGraphicPart(); virtual ~CustomElementGraphicPart();
static void drawCross (const QPointF &center, QPainter *painter); static void drawCross (const QPointF &center, QPainter *painter);

View File

@ -33,7 +33,7 @@ class PartArc : public AbstractPartEllipse
Q_OBJECT Q_OBJECT
public: public:
PartArc(QETElementEditor *editor, QGraphicsItem *parent = 0); PartArc(QETElementEditor *editor, QGraphicsItem *parent = nullptr);
virtual ~PartArc(); virtual ~PartArc();
private: private:
@ -46,7 +46,7 @@ class PartArc : public AbstractPartEllipse
* @return the QGraphicsItem type * @return the QGraphicsItem type
*/ */
virtual int type() const { return 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 //Name and XML
virtual QString name() const { return(QObject::tr("arc", "element part name")); } virtual QString name() const { return(QObject::tr("arc", "element part name")); }

View File

@ -33,7 +33,7 @@ class PartEllipse : public AbstractPartEllipse
// constructors, destructor // constructors, destructor
public: public:
PartEllipse(QETElementEditor *editor, QGraphicsItem * parent = 0); PartEllipse(QETElementEditor *editor, QGraphicsItem * parent = nullptr);
virtual ~PartEllipse(); virtual ~PartEllipse();
private: private:
@ -47,7 +47,7 @@ class PartEllipse : public AbstractPartEllipse
* @return the QGraphicsItem type * @return the QGraphicsItem type
*/ */
virtual int type() const { return 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 //Name and XML
virtual QString name() const { return(QObject::tr("ellipse", "element part name")); } virtual QString name() const { return(QObject::tr("ellipse", "element part name")); }

View File

@ -45,7 +45,7 @@ class PartLine : public CustomElementGraphicPart
// constructors, destructor // constructors, destructor
public: public:
PartLine(QETElementEditor *, QGraphicsItem * = 0); PartLine(QETElementEditor *, QGraphicsItem * = nullptr);
virtual ~PartLine(); virtual ~PartLine();
private: private:
PartLine(const PartLine &); PartLine(const PartLine &);
@ -67,7 +67,7 @@ class PartLine : public CustomElementGraphicPart
* @return the QGraphicsItem type * @return the QGraphicsItem type
*/ */
virtual int type() const { return 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 name() const { return(QObject::tr("ligne", "element part name")); }
virtual QString xmlName() const { return(QString("line")); } virtual QString xmlName() const { return(QString("line")); }
virtual const QDomElement toXml(QDomDocument &) const; virtual const QDomElement toXml(QDomDocument &) const;

View File

@ -38,7 +38,7 @@ class PartPolygon : public CustomElementGraphicPart
// constructors, destructor // constructors, destructor
public: public:
PartPolygon(QETElementEditor *editor, QGraphicsItem *parent = 0); PartPolygon(QETElementEditor *editor, QGraphicsItem *parent = nullptr);
virtual ~PartPolygon(); virtual ~PartPolygon();
private: private:

View File

@ -36,7 +36,7 @@ class PartRectangle : public CustomElementGraphicPart
// constructors, destructor // constructors, destructor
public: public:
PartRectangle(QETElementEditor *, QGraphicsItem *parent = 0); PartRectangle(QETElementEditor *, QGraphicsItem *parent = nullptr);
virtual ~PartRectangle(); virtual ~PartRectangle();
private: private:
@ -53,7 +53,7 @@ class PartRectangle : public CustomElementGraphicPart
* @return the QGraphicsItem type * @return the QGraphicsItem type
*/ */
virtual int type () const { return 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 name () const { return(QObject::tr("rectangle", "element part name")); }
virtual QString xmlName () const { return(QString("rect")); } virtual QString xmlName () const { return(QString("rect")); }

View File

@ -35,7 +35,7 @@ class PartTerminal : public CustomElementGraphicPart
public: public:
// constructors, destructor // constructors, destructor
PartTerminal(QETElementEditor *editor, QGraphicsItem *parent = 0); PartTerminal(QETElementEditor *editor, QGraphicsItem *parent = nullptr);
virtual ~PartTerminal(); virtual ~PartTerminal();
private: private:
PartTerminal(const PartTerminal &); PartTerminal(const PartTerminal &);

View File

@ -31,7 +31,7 @@ class PartText : public QGraphicsTextItem, public CustomElementPart {
// constructors, destructor // constructors, destructor
public: public:
PartText(QETElementEditor *, QGraphicsItem * = 0); PartText(QETElementEditor *, QGraphicsItem * = nullptr);
virtual ~PartText(); virtual ~PartText();
private: private:

View File

@ -35,7 +35,7 @@ class PartTextField : public QGraphicsTextItem, public CustomElementPart
// constructors, destructor // constructors, destructor
public: public:
PartTextField(QETElementEditor *, QGraphicsItem * = 0); PartTextField(QETElementEditor *, QGraphicsItem * = nullptr);
virtual ~PartTextField(); virtual ~PartTextField();
private: private:

View File

@ -110,8 +110,8 @@ bool LineEditor::setPart(CustomElementPart *new_part)
disconnect(part, &PartLine::firstEndLengthChanged, this, &LineEditor::updateForm); disconnect(part, &PartLine::firstEndLengthChanged, this, &LineEditor::updateForm);
disconnect(part, &PartLine::secondEndLengthChanged, this, &LineEditor::updateForm); disconnect(part, &PartLine::secondEndLengthChanged, this, &LineEditor::updateForm);
} }
part = 0; part = nullptr;
style_ -> setPart(0); style_ -> setPart(nullptr);
return(true); return(true);
} }
if (PartLine *part_line = dynamic_cast<PartLine *>(new_part)) if (PartLine *part_line = dynamic_cast<PartLine *>(new_part))

View File

@ -33,7 +33,7 @@ class LineEditor : public ElementItemEditor
Q_OBJECT Q_OBJECT
// constructors, destructor // constructors, destructor
public: public:
LineEditor(QETElementEditor *, PartLine * = 0, QWidget * = 0); LineEditor(QETElementEditor *, PartLine * = nullptr, QWidget * = nullptr);
virtual ~LineEditor(); virtual ~LineEditor();
private: private:
LineEditor(const LineEditor &); LineEditor(const LineEditor &);

View File

@ -130,8 +130,8 @@ bool PolygonEditor::setPart(CustomElementPart *new_part)
disconnect(part, &PartPolygon::polygonChanged, this, &PolygonEditor::updateForm); disconnect(part, &PartPolygon::polygonChanged, this, &PolygonEditor::updateForm);
disconnect(part, &PartPolygon::closedChange, this, &PolygonEditor::updateForm); disconnect(part, &PartPolygon::closedChange, this, &PolygonEditor::updateForm);
} }
part = 0; part = nullptr;
style_ -> setPart(0); style_ -> setPart(nullptr);
return(true); return(true);
} }
if (PartPolygon *part_polygon = dynamic_cast<PartPolygon *>(new_part)) if (PartPolygon *part_polygon = dynamic_cast<PartPolygon *>(new_part))

View File

@ -35,7 +35,7 @@ class PolygonEditor : public ElementItemEditor {
// constructors, destructor // constructors, destructor
public: public:
PolygonEditor(QETElementEditor *, PartPolygon * = 0, QWidget * = 0); PolygonEditor(QETElementEditor *, PartPolygon * = nullptr, QWidget * = nullptr);
virtual ~PolygonEditor(); virtual ~PolygonEditor();
private: private:

View File

@ -1267,11 +1267,11 @@ bool QETElementEditor::canClose() {
*/ */
QWidget *QETElementEditor::clearToolsDock() { QWidget *QETElementEditor::clearToolsDock() {
if (QWidget *previous_widget = tools_dock_scroll_area_ -> takeWidget()) { if (QWidget *previous_widget = tools_dock_scroll_area_ -> takeWidget()) {
previous_widget -> setParent(0); previous_widget -> setParent(nullptr);
previous_widget -> hide(); previous_widget -> hide();
return(previous_widget); return(previous_widget);
} }
return(0); return(nullptr);
} }
/** /**

View File

@ -36,7 +36,7 @@ class QETElementEditor : public QETMainWindow {
// constructor, destructor // constructor, destructor
public: public:
QETElementEditor(QWidget * = 0); QETElementEditor(QWidget * = nullptr);
virtual ~QETElementEditor(); virtual ~QETElementEditor();
private: private:
QETElementEditor(const QETElementEditor &); QETElementEditor(const QETElementEditor &);
@ -109,7 +109,7 @@ class QETElementEditor : public QETMainWindow {
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
static QPointF pasteOffset(); static QPointF pasteOffset();
static QString getOpenElementFileName(QWidget * = 0, const QString & = QString()); static QString getOpenElementFileName(QWidget * = nullptr, const QString & = QString());
void contextMenu(QPoint p); void contextMenu(QPoint p);
signals: signals:

View File

@ -82,8 +82,8 @@ bool RectangleEditor::setPart(CustomElementPart *new_part)
{ {
if (part) if (part)
disconnect(part, &PartRectangle::rectChanged, this, &RectangleEditor::updateForm); disconnect(part, &PartRectangle::rectChanged, this, &RectangleEditor::updateForm);
part = 0; part = nullptr;
style_ -> setPart(0); style_ -> setPart(nullptr);
return(true); return(true);
} }

View File

@ -33,7 +33,7 @@ class RectangleEditor : public ElementItemEditor
// constructors, destructor // constructors, destructor
public: public:
RectangleEditor(QETElementEditor *, PartRectangle * = 0, QWidget * = 0); RectangleEditor(QETElementEditor *, PartRectangle * = nullptr, QWidget * = nullptr);
virtual ~RectangleEditor(); virtual ~RectangleEditor();
private: private:
RectangleEditor(const RectangleEditor &); RectangleEditor(const RectangleEditor &);

View File

@ -36,7 +36,7 @@ class StyleEditor : public ElementItemEditor
Q_OBJECT Q_OBJECT
// constructors, destructor // constructors, destructor
public: public:
StyleEditor(QETElementEditor *, CustomElementGraphicPart * = 0, QWidget * = 0); StyleEditor(QETElementEditor *, CustomElementGraphicPart * = nullptr, QWidget * = nullptr);
virtual ~StyleEditor(); virtual ~StyleEditor();
private: private:

View File

@ -88,7 +88,7 @@ bool TerminalEditor::setPart(CustomElementPart *new_part)
{ {
if (part) if (part)
disconnect(part, &PartTerminal::orientationChanged, this, &TerminalEditor::updateForm); disconnect(part, &PartTerminal::orientationChanged, this, &TerminalEditor::updateForm);
part = 0; part = nullptr;
return(true); return(true);
} }
if (PartTerminal *part_terminal = dynamic_cast<PartTerminal *>(new_part)) if (PartTerminal *part_terminal = dynamic_cast<PartTerminal *>(new_part))

View File

@ -31,7 +31,7 @@ class TerminalEditor : public ElementItemEditor {
Q_OBJECT Q_OBJECT
// Constructors, destructor // Constructors, destructor
public: public:
TerminalEditor(QETElementEditor *, PartTerminal * = 0, QWidget * = 0); TerminalEditor(QETElementEditor *, PartTerminal * = nullptr, QWidget * = nullptr);
virtual ~TerminalEditor(); virtual ~TerminalEditor();
private: private:
TerminalEditor(const TerminalEditor &); TerminalEditor(const TerminalEditor &);

View File

@ -107,7 +107,7 @@ bool TextEditor::setPart(CustomElementPart *new_part)
{ {
if (!new_part) if (!new_part)
{ {
part = 0; part = nullptr;
return(true); return(true);
} }
if (PartText *part_text = dynamic_cast<PartText *>(new_part)) if (PartText *part_text = dynamic_cast<PartText *>(new_part))

View File

@ -38,7 +38,7 @@ class TextEditor : public ElementItemEditor
// Constructors, destructor // Constructors, destructor
public: public:
TextEditor(QETElementEditor *, PartText * = 0, QWidget * = 0); TextEditor(QETElementEditor *, PartText * = nullptr, QWidget * = nullptr);
virtual ~TextEditor(); virtual ~TextEditor();
private: private:
TextEditor(const TextEditor &); TextEditor(const TextEditor &);

View File

@ -106,7 +106,7 @@ bool TextFieldEditor::setPart(CustomElementPart *new_part)
{ {
if (!new_part) if (!new_part)
{ {
part = 0; part = nullptr;
return(true); return(true);
} }
if (PartTextField *part_textfield = dynamic_cast<PartTextField *>(new_part)) if (PartTextField *part_textfield = dynamic_cast<PartTextField *>(new_part))

View File

@ -37,7 +37,7 @@ class TextFieldEditor : public ElementItemEditor
// Constructors, destructor // Constructors, destructor
public: public:
TextFieldEditor(QETElementEditor *, PartTextField * = 0, QWidget * = 0); TextFieldEditor(QETElementEditor *, PartTextField * = nullptr, QWidget * = nullptr);
virtual ~TextFieldEditor(); virtual ~TextFieldEditor();
private: private:
TextFieldEditor(const TextFieldEditor &); TextFieldEditor(const TextFieldEditor &);

View File

@ -37,7 +37,7 @@ class ElementPropertiesEditorWidget : public QDialog
//METHODS //METHODS
public: public:
explicit ElementPropertiesEditorWidget(QString &basic_type, DiagramContext &dc, QWidget *parent = 0); explicit ElementPropertiesEditorWidget(QString &basic_type, DiagramContext &dc, QWidget *parent = nullptr);
~ElementPropertiesEditorWidget(); ~ElementPropertiesEditorWidget();
void upDateInterface(); void upDateInterface();

View File

@ -34,7 +34,7 @@ class Element;
class ElementProvider class ElementProvider
{ {
public: public:
ElementProvider(QETProject *prj, Diagram *diagram=0); ElementProvider(QETProject *prj, Diagram *diagram=nullptr);
ElementProvider(Diagram *diag); ElementProvider(Diagram *diag);
QList <Element *> freeElement(const int filter) const; QList <Element *> freeElement(const int filter) const;
QList <Element *> fromUuids(QList <QUuid>) const; QList <Element *> fromUuids(QList <QUuid>) const;

View File

@ -208,7 +208,7 @@ QPixmap ElementsCollectionCache::pixmap() const {
*/ */
bool ElementsCollectionCache::fetchData(const ElementsLocation &location) { bool ElementsCollectionCache::fetchData(const ElementsLocation &location) {
int state; int state;
Element *custom_elmt = ElementFactory::Instance() -> createElement(location, 0, &state); Element *custom_elmt = ElementFactory::Instance() -> createElement(location, nullptr, &state);
if (state) { if (state) {
qDebug() << "ElementsCollectionCache::fetchData() : Le chargement du composant" << qPrintable(location.toString()) << "a echoue avec le code d'erreur" << state; qDebug() << "ElementsCollectionCache::fetchData() : Le chargement du composant" << qPrintable(location.toString()) << "a echoue avec le code d'erreur" << state;
} else { } else {

View File

@ -31,7 +31,7 @@ class ElementsCollectionCache : public QObject
{ {
public: public:
// constructor, destructor // constructor, destructor
ElementsCollectionCache(const QString &database_path, QObject * = 0); ElementsCollectionCache(const QString &database_path, QObject * = nullptr);
virtual ~ElementsCollectionCache(); virtual ~ElementsCollectionCache();
// methods // methods

View File

@ -32,8 +32,8 @@
ElementsMover::ElementsMover() : ElementsMover::ElementsMover() :
movement_running_(false), movement_running_(false),
current_movement_(), current_movement_(),
diagram_(0), diagram_(nullptr),
movement_driver_(0), movement_driver_(nullptr),
moved_content_() moved_content_()
{ {

View File

@ -46,7 +46,7 @@ class ElementsMover {
// methods // methods
public: public:
bool isReady() const; bool isReady() const;
int beginMovement(Diagram *, QGraphicsItem * = 0); int beginMovement(Diagram *, QGraphicsItem * = nullptr);
void continueMovement(const QPointF &); void continueMovement(const QPointF &);
void endMovement(); void endMovement();

View File

@ -127,7 +127,7 @@ QTreeWidgetItem *ElementsPanel::addProject(QETProject *project) {
bool first_add = (first_reload_ || !projects_to_display_.contains(project)); bool first_add = (first_reload_ || !projects_to_display_.contains(project));
// create the QTreeWidgetItem representing the 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 // the project will be inserted right before the common tb templates collection
invisibleRootItem() -> insertChild( invisibleRootItem() -> insertChild(
indexOfTopLevelItem(common_tbt_collection_item_), indexOfTopLevelItem(common_tbt_collection_item_),

View File

@ -36,7 +36,7 @@ class ElementsPanel : public GenericPanel {
// constructors, destructor // constructors, destructor
public: public:
ElementsPanel(QWidget * = 0); ElementsPanel(QWidget * = nullptr);
virtual ~ElementsPanel(); virtual ~ElementsPanel();
private: private:

View File

@ -30,7 +30,7 @@ class ElementsPanelWidget : public QWidget {
// constructors, destructor // constructors, destructor
public: public:
ElementsPanelWidget(QWidget * = 0); ElementsPanelWidget(QWidget * = nullptr);
virtual ~ElementsPanelWidget(); virtual ~ElementsPanelWidget();
private: private:

View File

@ -32,7 +32,7 @@ class ExportDialog : public QDialog {
// constructors, destructor // constructors, destructor
public: public:
ExportDialog(QETProject *, QWidget * = 0); ExportDialog(QETProject *, QWidget * = nullptr);
virtual ~ExportDialog(); virtual ~ExportDialog();
private: private:

View File

@ -28,8 +28,8 @@ class ExportPropertiesWidget : public QWidget {
Q_OBJECT Q_OBJECT
// constructors, destructor // constructors, destructor
public: public:
ExportPropertiesWidget(QWidget * = 0); ExportPropertiesWidget(QWidget * = nullptr);
ExportPropertiesWidget(const ExportProperties &, QWidget * = 0); ExportPropertiesWidget(const ExportProperties &, QWidget * = nullptr);
virtual ~ExportPropertiesWidget(); virtual ~ExportPropertiesWidget();
private: private:
ExportPropertiesWidget(const ExportPropertiesWidget &); ExportPropertiesWidget(const ExportPropertiesWidget &);

View File

@ -52,7 +52,7 @@ class ElementFactory
if (factory_) { if (factory_) {
mutex.lock(); mutex.lock();
delete factory_; delete factory_;
factory_ = 0; factory_ = nullptr;
mutex.unlock(); mutex.unlock();
} }
} }
@ -69,7 +69,7 @@ class ElementFactory
~ElementFactory() {} ~ElementFactory() {}
public: public:
Element *createElement (const ElementsLocation &, QGraphicsItem * = 0, int * = 0); Element *createElement (const ElementsLocation &, QGraphicsItem * = nullptr, int * = nullptr);
}; };
//ElementFactory ElementFactory::factory_ = 0; //ElementFactory ElementFactory::factory_ = 0;
#endif // ELEMENTFACTORY_H #endif // ELEMENTFACTORY_H

View File

@ -55,7 +55,7 @@ QETProject *GenericPanel::projectForItem(QTreeWidgetItem *item) const {
if (item && item -> type() == QET::Project) { if (item && item -> type() == QET::Project) {
return(valueForItem<QETProject *>(item)); return(valueForItem<QETProject *>(item));
} }
return(0); return(nullptr);
} }
@ -66,7 +66,7 @@ Diagram *GenericPanel::diagramForItem(QTreeWidgetItem *item) const {
if (item && item -> type() == QET::Diagram) { if (item && item -> type() == QET::Diagram) {
return(valueForItem<Diagram *>(item)); return(valueForItem<Diagram *>(item));
} }
return(0); return(nullptr);
} }
/** /**
@ -104,7 +104,7 @@ TitleBlockTemplateLocation GenericPanel::selectedTemplateLocation() const {
*/ */
QTreeWidgetItem *GenericPanel::addProject(QETProject *project, QTreeWidgetItem *parent_item, PanelOptions options) { QTreeWidgetItem *GenericPanel::addProject(QETProject *project, QTreeWidgetItem *parent_item, PanelOptions options) {
if (!project) return(0); if (!project) return(nullptr);
bool creation_required; bool creation_required;
QTreeWidgetItem *project_qtwi = getItemForProject(project, &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. project does not appear within this panel.
*/ */
QTreeWidgetItem *GenericPanel::itemForProject(QETProject *project) { QTreeWidgetItem *GenericPanel::itemForProject(QETProject *project) {
if (!project) return(0); if (!project) return(nullptr);
return(projects_.value(project, 0)); return(projects_.value(project, nullptr));
} }
/** /**
@ -134,9 +134,9 @@ QTreeWidgetItem *GenericPanel::itemForProject(QETProject *project) {
appear within this panel, it is created. appear within this panel, it is created.
*/ */
QTreeWidgetItem *GenericPanel::getItemForProject(QETProject *project, bool *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 (project_qtwi) {
if (created) *created = false; if (created) *created = false;
return(project_qtwi); 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) { QTreeWidgetItem *GenericPanel::updateProjectItem(QTreeWidgetItem *project_qtwi, QETProject *project, PanelOptions options, bool freshly_created) {
Q_UNUSED(options) Q_UNUSED(options)
if (!project_qtwi || !project) return(0); if (!project_qtwi || !project) return(nullptr);
if (freshly_created) { if (freshly_created) {
project_qtwi -> setData(0, GenericPanel::Item, qVariantFromValue(project)); 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) { 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) { if (options & AddChildDiagrams) {
@ -211,7 +211,7 @@ QTreeWidgetItem *GenericPanel::fillProjectItem(QTreeWidgetItem *project_qtwi, QE
} }
int index = 0; int index = 0;
foreach (Diagram *diagram, project -> diagrams()) { 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); project_qtwi -> insertChild(index, diagram_qtwi);
++ index; ++ index;
} }
@ -239,7 +239,7 @@ QTreeWidgetItem *GenericPanel::fillProjectItem(QTreeWidgetItem *project_qtwi, QE
*/ */
QTreeWidgetItem *GenericPanel::addDiagram(Diagram *diagram, QTreeWidgetItem *parent_item, PanelOptions options) { QTreeWidgetItem *GenericPanel::addDiagram(Diagram *diagram, QTreeWidgetItem *parent_item, PanelOptions options) {
Q_UNUSED(options) Q_UNUSED(options)
if (!diagram) return(0); if (!diagram) return(nullptr);
bool creation_required; bool creation_required;
@ -255,9 +255,9 @@ QTreeWidgetItem *GenericPanel::addDiagram(Diagram *diagram, QTreeWidgetItem *par
*/ */
QTreeWidgetItem *GenericPanel::getItemForDiagram(Diagram *diagram, bool *created) { 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 (diagram_qtwi) {
if (created) *created = false; if (created) *created = false;
return(diagram_qtwi); 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) { QTreeWidgetItem *GenericPanel::updateDiagramItem(QTreeWidgetItem *diagram_qtwi, Diagram *diagram, PanelOptions options, bool freshly_created) {
Q_UNUSED(options) Q_UNUSED(options)
if (!diagram || !diagram_qtwi) return(0); if (!diagram || !diagram_qtwi) return(nullptr);
QSettings settings; QSettings settings;
QString displayed_title = diagram -> title(); 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) { QTreeWidgetItem *GenericPanel::addTemplatesCollection(TitleBlockTemplatesCollection *tbt_collection, QTreeWidgetItem *parent_item, PanelOptions options) {
if (!tbt_collection) return(0); if (!tbt_collection) return(nullptr);
bool creation_required; bool creation_required;
QTreeWidgetItem *tbt_collection_qtwi = getItemForTemplatesCollection(tbt_collection, &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) { QTreeWidgetItem *GenericPanel::itemForTemplatesCollection(TitleBlockTemplatesCollection *tbt_collection) {
if (!tbt_collection) return(0); if (!tbt_collection) return(nullptr);
return(tb_templates_.value(tbt_collection -> location(), 0)); return(tb_templates_.value(tbt_collection -> location(), nullptr));
} }
/** /**
*/ */
QTreeWidgetItem *GenericPanel::getItemForTemplatesCollection(TitleBlockTemplatesCollection *tbt_collection, bool *created) { QTreeWidgetItem *GenericPanel::getItemForTemplatesCollection(TitleBlockTemplatesCollection *tbt_collection, bool *created) {
if (!tbt_collection) return(0); if (!tbt_collection) return(nullptr);
QTreeWidgetItem *tbt_collection_item = tb_templates_.value(tbt_collection -> location(), 0); QTreeWidgetItem *tbt_collection_item = tb_templates_.value(tbt_collection -> location(), nullptr);
if (tbt_collection_item) { if (tbt_collection_item) {
if (created) *created = false; if (created) *created = false;
return(tbt_collection_item); return(tbt_collection_item);
@ -421,7 +421,7 @@ QTreeWidgetItem *GenericPanel::fillTemplatesCollectionItem(QTreeWidgetItem *tbt_
int index = 0; int index = 0;
foreach (QString template_name, tbt_collection -> templates()) { 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); 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) { 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; bool creation_required;
QTreeWidgetItem *tb_template_qtwi = getItemForTemplate(tb_template, &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) { 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 (tb_template_qtwi) {
if (created) *created = false; if (created) *created = false;
return(tb_template_qtwi); return(tb_template_qtwi);
@ -530,7 +530,7 @@ QTreeWidgetItem *GenericPanel::fillItem(QTreeWidgetItem *qtwi, PanelOptions opti
*/ */
void GenericPanel::projectInformationsChanged(QETProject *project) { void GenericPanel::projectInformationsChanged(QETProject *project) {
addProject(project, 0, 0); addProject(project, nullptr, nullptr);
emit(panelContentChanged()); emit(panelContentChanged());
} }
@ -539,7 +539,7 @@ void GenericPanel::projectInformationsChanged(QETProject *project) {
*/ */
void GenericPanel::diagramAdded(QETProject *project, Diagram *diagram) { void GenericPanel::diagramAdded(QETProject *project, Diagram *diagram) {
Q_UNUSED(diagram) Q_UNUSED(diagram)
addProject(project, 0, GenericPanel::AddChildDiagrams); addProject(project, nullptr, GenericPanel::AddChildDiagrams);
emit(panelContentChanged()); emit(panelContentChanged());
} }
@ -548,7 +548,7 @@ void GenericPanel::diagramAdded(QETProject *project, Diagram *diagram) {
*/ */
void GenericPanel::diagramRemoved(QETProject *project, Diagram *diagram) { void GenericPanel::diagramRemoved(QETProject *project, Diagram *diagram) {
Q_UNUSED(diagram) Q_UNUSED(diagram)
addProject(project, 0, GenericPanel::AddChildDiagrams); addProject(project, nullptr, GenericPanel::AddChildDiagrams);
emit(panelContentChanged()); emit(panelContentChanged());
} }

View File

@ -55,7 +55,7 @@ class GenericPanel : public QTreeWidget {
// Constructors, destructor // Constructors, destructor
public: public:
GenericPanel(QWidget * = 0); GenericPanel(QWidget * = nullptr);
virtual ~GenericPanel(); virtual ~GenericPanel();
public: public:
@ -72,35 +72,35 @@ class GenericPanel : public QTreeWidget {
// project-related methods // project-related methods
public: public:
virtual QTreeWidgetItem *addProject(QETProject *, QTreeWidgetItem * = 0, PanelOptions = AddAllChild); virtual QTreeWidgetItem *addProject(QETProject *, QTreeWidgetItem * = nullptr, PanelOptions = AddAllChild);
virtual QTreeWidgetItem *itemForProject(QETProject *); virtual QTreeWidgetItem *itemForProject(QETProject *);
protected: protected:
virtual QTreeWidgetItem *getItemForProject(QETProject *, bool * = 0); virtual QTreeWidgetItem *getItemForProject(QETProject *, bool * = nullptr);
virtual QTreeWidgetItem *updateProjectItem(QTreeWidgetItem *, QETProject *, PanelOptions = AddAllChild, bool = false); virtual QTreeWidgetItem *updateProjectItem(QTreeWidgetItem *, QETProject *, PanelOptions = AddAllChild, bool = false);
virtual QTreeWidgetItem *fillProjectItem (QTreeWidgetItem *, QETProject *, PanelOptions = AddAllChild, bool = false); virtual QTreeWidgetItem *fillProjectItem (QTreeWidgetItem *, QETProject *, PanelOptions = AddAllChild, bool = false);
// diagram-related methods // diagram-related methods
public: public:
virtual QTreeWidgetItem *addDiagram(Diagram *, QTreeWidgetItem * = 0, PanelOptions = AddAllChild); virtual QTreeWidgetItem *addDiagram(Diagram *, QTreeWidgetItem * = nullptr, PanelOptions = AddAllChild);
protected: protected:
virtual QTreeWidgetItem *getItemForDiagram(Diagram *, bool * = 0); virtual QTreeWidgetItem *getItemForDiagram(Diagram *, bool * = nullptr);
virtual QTreeWidgetItem *updateDiagramItem(QTreeWidgetItem *, Diagram *, PanelOptions = AddAllChild, bool = false); virtual QTreeWidgetItem *updateDiagramItem(QTreeWidgetItem *, Diagram *, PanelOptions = AddAllChild, bool = false);
virtual QTreeWidgetItem *fillDiagramItem (QTreeWidgetItem *, Diagram *, PanelOptions = AddAllChild, bool = false); virtual QTreeWidgetItem *fillDiagramItem (QTreeWidgetItem *, Diagram *, PanelOptions = AddAllChild, bool = false);
// title block templates collections methods // title block templates collections methods
public: public:
virtual QTreeWidgetItem *addTemplatesCollection(TitleBlockTemplatesCollection *, QTreeWidgetItem * = 0, PanelOptions = AddAllChild); virtual QTreeWidgetItem *addTemplatesCollection(TitleBlockTemplatesCollection *, QTreeWidgetItem * = nullptr, PanelOptions = AddAllChild);
virtual QTreeWidgetItem *itemForTemplatesCollection(TitleBlockTemplatesCollection *); virtual QTreeWidgetItem *itemForTemplatesCollection(TitleBlockTemplatesCollection *);
protected: protected:
virtual QTreeWidgetItem *getItemForTemplatesCollection(TitleBlockTemplatesCollection *, bool * = 0); virtual QTreeWidgetItem *getItemForTemplatesCollection(TitleBlockTemplatesCollection *, bool * = nullptr);
virtual QTreeWidgetItem *updateTemplatesCollectionItem(QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions = AddAllChild, bool = false); virtual QTreeWidgetItem *updateTemplatesCollectionItem(QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions = AddAllChild, bool = false);
virtual QTreeWidgetItem *fillTemplatesCollectionItem (QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions = AddAllChild, bool = false); virtual QTreeWidgetItem *fillTemplatesCollectionItem (QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions = AddAllChild, bool = false);
// title block templates methods // title block templates methods
public: public:
virtual QTreeWidgetItem *addTemplate(const TitleBlockTemplateLocation &, QTreeWidgetItem * = 0, PanelOptions = AddAllChild); virtual QTreeWidgetItem *addTemplate(const TitleBlockTemplateLocation &, QTreeWidgetItem * = nullptr, PanelOptions = AddAllChild);
protected: 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 *updateTemplateItem(QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions = AddAllChild, bool = false);
virtual QTreeWidgetItem *fillTemplateItem (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: protected:
virtual QString defaultText(QET::ItemType); virtual QString defaultText(QET::ItemType);
virtual QIcon defaultIcon(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 deleteItem(QTreeWidgetItem *, bool = false);
virtual void markItemAsUnused(QTreeWidgetItem *); virtual void markItemAsUnused(QTreeWidgetItem *);
virtual void reparent(QTreeWidgetItem *, QTreeWidgetItem *); virtual void reparent(QTreeWidgetItem *, QTreeWidgetItem *);

View File

@ -28,7 +28,7 @@ class NamesListWidget : public QWidget {
// constructors, destructor // constructors, destructor
public: public:
NamesListWidget(QWidget * = 0); NamesListWidget(QWidget * = nullptr);
virtual ~NamesListWidget(); virtual ~NamesListWidget();
private: private:

View File

@ -41,7 +41,7 @@ class NewElementWizard : public QWizard
// constructors, destructor // constructors, destructor
public: public:
NewElementWizard(QWidget * = 0, Qt::WindowFlags = 0); NewElementWizard(QWidget * = nullptr, Qt::WindowFlags = nullptr);
virtual ~NewElementWizard(); virtual ~NewElementWizard();
void preselectedLocation(const ElementsLocation &location); void preselectedLocation(const ElementsLocation &location);

View File

@ -43,7 +43,7 @@ class nomenclature
// constructors, destructor // constructors, destructor
public: public:
nomenclature(QETProject *project, QWidget *parent =0); nomenclature(QETProject *project, QWidget *parent =nullptr);
virtual ~nomenclature(); virtual ~nomenclature();
// attributes // attributes

View File

@ -40,7 +40,7 @@ class ProjectConfigPage : public ConfigPage {
Q_OBJECT Q_OBJECT
// Constructor, destructor // Constructor, destructor
public: public:
ProjectConfigPage(QETProject *, QWidget * = 0); ProjectConfigPage(QETProject *, QWidget * = nullptr);
virtual ~ProjectConfigPage(); virtual ~ProjectConfigPage();
private: private:
ProjectConfigPage(const ProjectConfigPage &); ProjectConfigPage(const ProjectConfigPage &);
@ -90,7 +90,7 @@ class ProjectMainConfigPage : public ProjectConfigPage {
Q_OBJECT Q_OBJECT
// Constructor, destructor // Constructor, destructor
public: public:
ProjectMainConfigPage(QETProject *, QWidget * = 0); ProjectMainConfigPage(QETProject *, QWidget * = nullptr);
virtual ~ProjectMainConfigPage(); virtual ~ProjectMainConfigPage();
private: private:
ProjectMainConfigPage(const ProjectMainConfigPage &); ProjectMainConfigPage(const ProjectMainConfigPage &);
@ -122,7 +122,7 @@ class ProjectAutoNumConfigPage : public ProjectConfigPage {
//Methods //Methods
public: public:
ProjectAutoNumConfigPage (QETProject *project, QWidget *parent = 0); ProjectAutoNumConfigPage (QETProject *project, QWidget *parent = nullptr);
virtual QString title() const; virtual QString title() const;
virtual QIcon icon() const; virtual QIcon icon() const;

View File

@ -41,7 +41,7 @@
*/ */
ProjectView::ProjectView(QETProject *project, QWidget *parent) : ProjectView::ProjectView(QETProject *project, QWidget *parent) :
QWidget(parent), QWidget(parent),
m_project(0) m_project(nullptr)
{ {
initActions(); initActions();
initWidgets(); initWidgets();
@ -123,7 +123,7 @@ void ProjectView::closeEvent(QCloseEvent *qce) {
*/ */
void ProjectView::changeTabDown(){ void ProjectView::changeTabDown(){
DiagramView *nextDiagramView = this->nextDiagram(); DiagramView *nextDiagramView = this->nextDiagram();
if (nextDiagramView!=NULL){ if (nextDiagramView!=nullptr){
rebuildDiagramsMap(); rebuildDiagramsMap();
m_tab -> setCurrentWidget(nextDiagramView); m_tab -> setCurrentWidget(nextDiagramView);
} }
@ -138,7 +138,7 @@ DiagramView *ProjectView::nextDiagram() {
if (next_tab_index<m_diagram_ids.count()) //if next tab index >= greatest tab the last tab is activated so no need to change tab. if (next_tab_index<m_diagram_ids.count()) //if next tab index >= greatest tab the last tab is activated so no need to change tab.
return(m_diagram_ids[next_tab_index]); return(m_diagram_ids[next_tab_index]);
else else
return NULL; return nullptr;
} }
/** /**
@ -146,7 +146,7 @@ DiagramView *ProjectView::nextDiagram() {
*/ */
void ProjectView::changeTabUp(){ void ProjectView::changeTabUp(){
DiagramView *previousDiagramView = this->previousDiagram(); DiagramView *previousDiagramView = this->previousDiagram();
if (previousDiagramView!=NULL){ if (previousDiagramView!=nullptr){
rebuildDiagramsMap(); rebuildDiagramsMap();
m_tab -> setCurrentWidget(previousDiagramView); 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. 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]); return(m_diagram_ids[previous_tab_index]);
else else
return NULL; return nullptr;
} }
/** /**
@ -965,7 +965,7 @@ DiagramView *ProjectView::findDiagram(Diagram *diagram) {
return(diagram_view); return(diagram_view);
} }
} }
return(0); return(nullptr);
} }
/** /**

View File

@ -41,7 +41,7 @@ class ProjectView : public QWidget
// constructors, destructor // constructors, destructor
public: public:
ProjectView(QETProject *, QWidget * = 0); ProjectView(QETProject *, QWidget * = nullptr);
virtual ~ProjectView(); virtual ~ProjectView();
private: private:
ProjectView(const ProjectView &); ProjectView(const ProjectView &);

View File

@ -199,7 +199,7 @@ bool QET::attributeIsAnInteger(const QDomElement &e, QString nom_attribut, int *
bool ok; bool ok;
int tmp = e.attribute(nom_attribut).toInt(&ok); int tmp = e.attribute(nom_attribut).toInt(&ok);
if (!ok) return(false); if (!ok) return(false);
if (entier != NULL) *entier = tmp; if (entier != nullptr) *entier = tmp;
return(true); return(true);
} }
@ -218,7 +218,7 @@ bool QET::attributeIsAReal(const QDomElement &e, QString nom_attribut, qreal *re
bool ok; bool ok;
qreal tmp = e.attribute(nom_attribut).toDouble(&ok); qreal tmp = e.attribute(nom_attribut).toDouble(&ok);
if (!ok) return(false); if (!ok) return(false);
if (reel != NULL) *reel = tmp; if (reel != nullptr) *reel = tmp;
return(true); return(true);
} }

View File

@ -140,9 +140,9 @@ namespace QET {
QetCollection qetCollectionFromString (const QString &str); QetCollection qetCollectionFromString (const QString &str);
bool lineContainsPoint(const QLineF &, const QPointF &); bool lineContainsPoint(const QLineF &, const QPointF &);
bool orthogonalProjection(const QPointF &, const QLineF &, QPointF * = 0); bool orthogonalProjection(const QPointF &, const QLineF &, QPointF * = nullptr);
bool attributeIsAnInteger(const QDomElement &, QString , int * = NULL); bool attributeIsAnInteger(const QDomElement &, QString , int * = nullptr);
bool attributeIsAReal(const QDomElement &, QString , qreal * = NULL); bool attributeIsAReal(const QDomElement &, QString , qreal * = nullptr);
QString ElementsAndConductorsSentence(int, int, int = 0, int = 0, int = 0, int = 0); QString ElementsAndConductorsSentence(int, int, int = 0, int = 0, int = 0, int = 0);
QList<QDomElement> findInDomElement(const QDomElement &, const QString &); QList<QDomElement> findInDomElement(const QDomElement &, const QString &);
QList<QDomElement> findInDomElement(const QDomElement &, const QString &, const QString &); QList<QDomElement> findInDomElement(const QDomElement &, const QString &, const QString &);
@ -160,7 +160,7 @@ namespace QET {
qreal correctAngle(const qreal &); qreal correctAngle(const qreal &);
bool compareCanonicalFilePaths(const QString &, const QString &); bool compareCanonicalFilePaths(const QString &, const QString &);
QString titleBlockColumnLengthToString(const TitleBlockColumnLength &); QString titleBlockColumnLengthToString(const TitleBlockColumnLength &);
bool writeXmlFile(QDomDocument &, const QString &, QString * = 0); bool writeXmlFile(QDomDocument &, const QString &, QString * = nullptr);
QPointF graphicsSceneEventPos(QEvent *); QPointF graphicsSceneEventPos(QEvent *);
bool eachStrIsEqual (const QStringList &qsl); bool eachStrIsEqual (const QStringList &qsl);
} }

View File

@ -62,7 +62,7 @@ TitleBlockTemplate *QETApp::default_titleblock_template_ = nullptr;
*/ */
QETApp::QETApp(int &argc, char **argv) : QETApp::QETApp(int &argc, char **argv) :
QETSingleApplication(argc, argv, QString("qelectrotech-" + QETApp::userName())), QETSingleApplication(argc, argv, QString("qelectrotech-" + QETApp::userName())),
splash_screen_(0), splash_screen_(nullptr),
non_interactive_execution_(false) non_interactive_execution_(false)
{ {
parseArguments(); parseArguments();
@ -378,7 +378,7 @@ TitleBlockTemplatesCollection *QETApp::titleBlockTemplatesCollection(const QStri
return(project -> embeddedTitleBlockTemplatesCollection()); return(project -> embeddedTitleBlockTemplatesCollection());
} }
} }
return(0); return(nullptr);
} }
/** /**
@ -597,7 +597,7 @@ QStringList QETApp::handledFiles(const QList<QUrl> &urls) {
n'est pas edite par l'application. n'est pas edite par l'application.
*/ */
QETDiagramEditor *QETApp::diagramEditorForFile(const QString &filepath) { QETDiagramEditor *QETApp::diagramEditorForFile(const QString &filepath) {
if (filepath.isEmpty()) return(0); if (filepath.isEmpty()) return(nullptr);
QETApp *qet_app(QETApp::instance()); QETApp *qet_app(QETApp::instance());
foreach (QETDiagramEditor *diagram_editor, qet_app -> diagramEditors()) { 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 // affiche le dialogue puis evite de le lier a un quelconque widget parent
cd.exec(); 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) { QETProject *QETApp::projectFromString(const QString &url) {
int project_id = projectIdFromString(url); int project_id = projectIdFromString(url);
if (project_id == -1) return(0); if (project_id == -1) return(nullptr);
return(project(project_id)); return(project(project_id));
} }
@ -1655,7 +1655,7 @@ QETProject *QETApp::project(const uint &id) {
if (registered_projects_.contains(id)) { if (registered_projects_.contains(id)) {
return(registered_projects_[id]); return(registered_projects_[id]);
} else { } else {
return(0); return(nullptr);
} }
} }

View File

@ -28,8 +28,8 @@ class QETArguments : public QObject {
// constructors, destructor // constructors, destructor
public: public:
QETArguments(QObject * = 0); QETArguments(QObject * = nullptr);
QETArguments(const QList<QString> &, QObject * = 0); QETArguments(const QList<QString> &, QObject * = nullptr);
QETArguments(const QETArguments &); QETArguments(const QETArguments &);
QETArguments &operator=(const QETArguments &); QETArguments &operator=(const QETArguments &);
virtual ~QETArguments(); virtual ~QETArguments();

View File

@ -983,7 +983,7 @@ bool QETDiagramEditor::addProject(QETProject *project, bool update_panel) {
// met a jour le panel d'elements // met a jour le panel d'elements
if (update_panel) { if (update_panel) {
pa -> elementsPanel().projectWasOpened(project); pa -> elementsPanel().projectWasOpened(project);
if (currentDiagram() != NULL) if (currentDiagram() != nullptr)
m_autonumbering_dock->setProject(project, project_view); m_autonumbering_dock->setProject(project, project_view);
} }
@ -1010,15 +1010,15 @@ QList<ProjectView *> QETDiagramEditor::openedProjects() const {
*/ */
ProjectView *QETDiagramEditor::currentProject() const { ProjectView *QETDiagramEditor::currentProject() const {
QMdiSubWindow *current_window = workspace.activeSubWindow(); QMdiSubWindow *current_window = workspace.activeSubWindow();
if (!current_window) return(0); if (!current_window) return(nullptr);
QWidget *current_widget = current_window -> widget(); QWidget *current_widget = current_window -> widget();
if (!current_widget) return(0); if (!current_widget) return(nullptr);
if (ProjectView *project_view = qobject_cast<ProjectView *>(current_widget)) { if (ProjectView *project_view = qobject_cast<ProjectView *>(current_widget)) {
return(project_view); return(project_view);
} }
return(0); return(nullptr);
} }
/** /**
@ -1029,7 +1029,7 @@ DiagramView *QETDiagramEditor::currentDiagram() const {
if (ProjectView *project_view = currentProject()) { if (ProjectView *project_view = currentProject()) {
return(project_view -> currentDiagram()); return(project_view -> currentDiagram());
} }
return(0); return(nullptr);
} }
/** /**
@ -1040,10 +1040,10 @@ DiagramView *QETDiagramEditor::currentDiagram() const {
*/ */
Element *QETDiagramEditor::currentElement() const { Element *QETDiagramEditor::currentElement() const {
DiagramView *dv = currentDiagram(); DiagramView *dv = currentDiagram();
if (!dv) return(0); if (!dv) return(nullptr);
QList<Element *> selected_elements = dv -> diagram() -> selectedContent().m_elements.toList(); QList<Element *> 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()); return(selected_elements.first());
} }
@ -1070,7 +1070,7 @@ ProjectView *QETDiagramEditor::findProject(DiagramView *diagram_view) const {
return(project_view); 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(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(sub_window);
} }
} }
return(0); return(nullptr);
} }
/** /**
@ -1357,7 +1357,7 @@ void QETDiagramEditor::slot_updateActions()
void QETDiagramEditor::slot_updateAutoNumDock() { void QETDiagramEditor::slot_updateAutoNumDock() {
if ( workspace.subWindowList().indexOf(workspace.activeSubWindow()) != activeSubWindowIndex) { if ( workspace.subWindowList().indexOf(workspace.activeSubWindow()) != activeSubWindowIndex) {
activeSubWindowIndex = workspace.subWindowList().indexOf(workspace.activeSubWindow()); activeSubWindowIndex = workspace.subWindowList().indexOf(workspace.activeSubWindow());
if (currentProject() != NULL && currentDiagram() != NULL) { if (currentProject() != nullptr && currentDiagram() != nullptr) {
m_autonumbering_dock->setProject(currentProject()->project(),currentProject()); m_autonumbering_dock->setProject(currentProject()->project(),currentProject());
} }
} }
@ -1584,12 +1584,12 @@ QList<QString> QETDiagramEditor::editedFiles() const {
pas edite par cet editeur de schemas. pas edite par cet editeur de schemas.
*/ */
ProjectView *QETDiagramEditor::viewForFile(const QString &filepath) const { ProjectView *QETDiagramEditor::viewForFile(const QString &filepath) const {
if (filepath.isEmpty()) return(0); if (filepath.isEmpty()) return(nullptr);
QString searched_can_file_path = QFileInfo(filepath).canonicalFilePath(); QString searched_can_file_path = QFileInfo(filepath).canonicalFilePath();
if (searched_can_file_path.isEmpty()) { if (searched_can_file_path.isEmpty()) {
// QFileInfo returns an empty path for non-existent files // QFileInfo returns an empty path for non-existent files
return(0); return(nullptr);
} }
foreach (ProjectView *project_view, openedProjects()) { foreach (ProjectView *project_view, openedProjects()) {
QString project_can_file_path = QFileInfo(project_view -> project() -> filePath()).canonicalFilePath(); 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(project_view);
} }
} }
return(0); return(nullptr);
} }
/** /**
@ -1606,15 +1606,15 @@ ProjectView *QETDiagramEditor::viewForFile(const QString &filepath) const {
*/ */
ProjectView *QETDiagramEditor::acessCurrentProject (){ ProjectView *QETDiagramEditor::acessCurrentProject (){
QMdiSubWindow *current_window = workspace.activeSubWindow(); QMdiSubWindow *current_window = workspace.activeSubWindow();
if (!current_window) return(0); if (!current_window) return(nullptr);
QWidget *current_widget = current_window -> widget(); QWidget *current_widget = current_window -> widget();
if (!current_widget) return(0); if (!current_widget) return(nullptr);
if (ProjectView *project_view = qobject_cast<ProjectView *>(current_widget)) { if (ProjectView *project_view = qobject_cast<ProjectView *>(current_widget)) {
return(project_view); return(project_view);
} }
return(0); return(nullptr);
} }
/** /**
@ -1633,7 +1633,7 @@ DiagramView *QETDiagramEditor::acessCurrentDiagramView () {
if (ProjectView *project_view = currentProject()) { if (ProjectView *project_view = currentProject()) {
return(project_view -> currentDiagram()); 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"); success = process->startDetached("qet_tb_generator");
#endif #endif
if ( !success ) { if ( !success ) {
QMessageBox::warning(0, QMessageBox::warning(nullptr,
"Error launching plugin", "Error launching plugin",
"To install the plugin qet_tb_generator\nVisit https://pypi.python.org/pypi/qet-tb-generator/\n" "To install the plugin qet_tb_generator\nVisit https://pypi.python.org/pypi/qet-tb-generator/\n"
"\n" "\n"

View File

@ -43,7 +43,7 @@ class QETDiagramEditor : public QETMainWindow {
// constructors, destructor // constructors, destructor
public: public:
QETDiagramEditor(const QStringList & = QStringList(), QWidget * = 0); QETDiagramEditor(const QStringList & = QStringList(), QWidget * = nullptr);
virtual ~QETDiagramEditor(); virtual ~QETDiagramEditor();
private: private:

View File

@ -74,12 +74,12 @@ class ConductorXmlRetroCompatibility
*/ */
Conductor::Conductor(Terminal *p1, Terminal* p2) : Conductor::Conductor(Terminal *p1, Terminal* p2) :
QObject(), QObject(),
QGraphicsPathItem(0), QGraphicsPathItem(nullptr),
terminal1(p1), terminal1(p1),
terminal2(p2), terminal2(p2),
m_mouse_over(false), m_mouse_over(false),
m_text_item(0), m_text_item(nullptr),
segments(NULL), segments(nullptr),
m_moving_segment(false), m_moving_segment(false),
modified_path(false), modified_path(false),
has_to_save_profile(false), has_to_save_profile(false),
@ -178,7 +178,7 @@ void Conductor::segmentsToPath()
{ {
QPainterPath path; QPainterPath path;
if (segments == NULL) if (segments == nullptr)
setPath(path); setPath(path);
//Start the path //Start the path
@ -913,7 +913,7 @@ QList<QPointF> Conductor::segmentsToPoints() const {
QList<QPointF> points_list; QList<QPointF> points_list;
// on retourne la liste tout de suite s'il n'y a pas de segments // 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 // recupere le premier point
points_list << segments -> firstPoint(); points_list << segments -> firstPoint();
@ -941,7 +941,7 @@ void Conductor::pointsToSegments(QList<QPointF> points_list) {
deleteSegments(); deleteSegments();
// cree les segments a partir de la liste de points // 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) { 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); last_segment = new ConductorSegment(points_list.at(i), points_list.at(i + 1), last_segment);
if (!i) segments = last_segment; if (!i) segments = last_segment;
@ -956,8 +956,8 @@ void Conductor::pointsToSegments(QList<QPointF> points_list) {
*/ */
bool Conductor::fromXml(QDomElement &dom_element) bool Conductor::fromXml(QDomElement &dom_element)
{ {
setPos(dom_element.attribute("x", 0).toDouble(), setPos(dom_element.attribute("x", nullptr).toDouble(),
dom_element.attribute("y", 0).toDouble()); dom_element.attribute("y", nullptr).toDouble());
bool return_ = pathFromXml(dom_element); bool return_ = pathFromXml(dom_element);
@ -1123,7 +1123,7 @@ QVector<QPointF> Conductor::handlerPoints() const
/// @return les segments de ce conducteur /// @return les segments de ce conducteur
const QList<ConductorSegment *> Conductor::segmentsList() const { const QList<ConductorSegment *> Conductor::segmentsList() const {
if (segments == NULL) return(QList<ConductorSegment *>()); if (segments == nullptr) return(QList<ConductorSegment *>());
QList<ConductorSegment *> segments_vector; QList<ConductorSegment *> segments_vector;
ConductorSegment *segment = segments; ConductorSegment *segment = segments;
@ -1148,7 +1148,7 @@ qreal Conductor::length() const{
@return Le segment qui contient le point au milieu du conducteur @return Le segment qui contient le point au milieu du conducteur
*/ */
ConductorSegment *Conductor::middleSegment() { ConductorSegment *Conductor::middleSegment() {
if (segments == NULL) return(NULL); if (segments == nullptr) return(nullptr);
qreal half_length = length() / 2.0; qreal half_length = length() / 2.0;
@ -1532,7 +1532,7 @@ void Conductor::displayedTextChanged()
*/ */
QSet<Conductor *> Conductor::relatedPotentialConductors(const bool all_diagram, QList <Terminal *> *t_list) { QSet<Conductor *> Conductor::relatedPotentialConductors(const bool all_diagram, QList <Terminal *> *t_list) {
bool declar_t_list = false; bool declar_t_list = false;
if (t_list == 0) { if (t_list == nullptr) {
declar_t_list = true; declar_t_list = true;
t_list = new QList <Terminal *>; t_list = new QList <Terminal *>;
} }
@ -1802,10 +1802,10 @@ void Conductor::setProfiles(const ConductorProfilesGroup &cpg) {
/// Supprime les segments /// Supprime les segments
void Conductor::deleteSegments() { void Conductor::deleteSegments() {
if (segments != NULL) { if (segments != nullptr) {
while (segments -> hasNextSegment()) delete segments -> nextSegment(); while (segments -> hasNextSegment()) delete segments -> nextSegment();
delete segments; delete segments;
segments = NULL; segments = nullptr;
} }
} }

View File

@ -113,7 +113,7 @@ class Conductor : public QObject, public QGraphicsPathItem
void calculateTextItemPosition(); void calculateTextItemPosition();
virtual Highlight highlight() const; virtual Highlight highlight() const;
virtual void setHighlighted(Highlight); virtual void setHighlighted(Highlight);
QSet<Conductor *> relatedPotentialConductors(const bool all_diagram = true, QList <Terminal *> *t_list=0); QSet<Conductor *> relatedPotentialConductors(const bool all_diagram = true, QList <Terminal *> *t_list=nullptr);
QETDiagramEditor* diagramEditor() const; QETDiagramEditor* diagramEditor() const;
void editProperty (); void editProperty ();

View File

@ -32,8 +32,8 @@ class ConductorTextItem : public DiagramTextItem
// constructors, destructor // constructors, destructor
public: public:
ConductorTextItem(Conductor * = 0); ConductorTextItem(Conductor * = nullptr);
ConductorTextItem(const QString &, Conductor * = 0); ConductorTextItem(const QString &, Conductor * = nullptr);
virtual ~ConductorTextItem(); virtual ~ConductorTextItem();
private: private:
ConductorTextItem(const ConductorTextItem &); ConductorTextItem(const ConductorTextItem &);

View File

@ -692,7 +692,7 @@ ElementTextItem *CustomElement::parseInput(QDomElement &e) {
!QET::attributeIsAReal(e, "x", &pos_x) ||\ !QET::attributeIsAReal(e, "x", &pos_x) ||\
!QET::attributeIsAReal(e, "y", &pos_y) ||\ !QET::attributeIsAReal(e, "y", &pos_y) ||\
!QET::attributeIsAnInteger(e, "size", &size) !QET::attributeIsAnInteger(e, "size", &size)
) return(0); ) return(nullptr);
ElementTextItem *eti = new ElementTextItem(e.attribute("text"), this); ElementTextItem *eti = new ElementTextItem(e.attribute("text"), this);
eti -> setFont(QETApp::diagramTextsFont(size)); eti -> setFont(QETApp::diagramTextsFont(size));
@ -733,14 +733,14 @@ Terminal *CustomElement::parseTerminal(QDomElement &e) {
// verifie la presence et la validite des attributs obligatoires // verifie la presence et la validite des attributs obligatoires
qreal terminalx, terminaly; qreal terminalx, terminaly;
Qet::Orientation terminalo; Qet::Orientation terminalo;
if (!QET::attributeIsAReal(e, QString("x"), &terminalx)) return(0); if (!QET::attributeIsAReal(e, QString("x"), &terminalx)) return(nullptr);
if (!QET::attributeIsAReal(e, QString("y"), &terminaly)) return(0); if (!QET::attributeIsAReal(e, QString("y"), &terminaly)) return(nullptr);
if (!e.hasAttribute("orientation")) return(0); if (!e.hasAttribute("orientation")) return(nullptr);
if (e.attribute("orientation") == "n") terminalo = Qet::North; if (e.attribute("orientation") == "n") terminalo = Qet::North;
else if (e.attribute("orientation") == "s") terminalo = Qet::South; else if (e.attribute("orientation") == "s") terminalo = Qet::South;
else if (e.attribute("orientation") == "e") terminalo = Qet::East; else if (e.attribute("orientation") == "e") terminalo = Qet::East;
else if (e.attribute("orientation") == "w") terminalo = Qet::West; else if (e.attribute("orientation") == "w") terminalo = Qet::West;
else return(0); else return(nullptr);
Terminal *new_terminal = new Terminal(terminalx, terminaly, terminalo, this); 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 new_terminal -> setZValue(420); // valeur arbitraire pour maintenir les bornes au-dessus des champs de texte
list_terminals << new_terminal; list_terminals << new_terminal;
@ -991,5 +991,5 @@ ElementTextItem* CustomElement::taggedText(const QString &tagg) const {
foreach (ElementTextItem *eti, list_texts_) { foreach (ElementTextItem *eti, list_texts_) {
if (eti -> tagg() == tagg) return eti; if (eti -> tagg() == tagg) return eti;
} }
return NULL; return nullptr;
} }

View File

@ -36,7 +36,7 @@ class CustomElement : public FixedElement
// constructors, destructor // constructors, destructor
public: public:
CustomElement (const ElementsLocation &, QGraphicsItem * = 0, int * = 0); CustomElement (const ElementsLocation &, QGraphicsItem * = nullptr, int * = nullptr);
virtual ~CustomElement(); virtual ~CustomElement();
@ -78,7 +78,7 @@ class CustomElement : public FixedElement
ElementTextItem* taggedText(const QString &tagg) const; ElementTextItem* taggedText(const QString &tagg) const;
protected: protected:
virtual bool buildFromXml(const QDomElement &, int * = 0); virtual bool buildFromXml(const QDomElement &, int * = nullptr);
virtual bool parseElement(QDomElement &, QPainter &); virtual bool parseElement(QDomElement &, QPainter &);
virtual bool parseLine(QDomElement &, QPainter &); virtual bool parseLine(QDomElement &, QPainter &);
virtual bool parseRect(QDomElement &, QPainter &); virtual bool parseRect(QDomElement &, QPainter &);

Some files were not shown because too many files have changed in this diff Show More