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();
int state;
Element *elmt = factory->createElement(*this, 0, &state);
Element *elmt = factory->createElement(*this, nullptr, &state);
if (state == 0)
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
int elmt_creation_state;
Element *temp_elmt = ElementFactory::Instance()->createElement(location, 0, &elmt_creation_state);
Element *temp_elmt = ElementFactory::Instance()->createElement(location, nullptr, &elmt_creation_state);
if (elmt_creation_state)
{
delete temp_elmt;

View File

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

View File

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

View File

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

View File

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

View File

@ -33,8 +33,8 @@ class QObject;
class QPropertyUndoCommand : public QUndoCommand
{
public:
QPropertyUndoCommand(QObject *object, const char *property_name, const QVariant &old_value, const QVariant &new_value, QUndoCommand *parent = 0);
QPropertyUndoCommand(QObject *object, const char *property_name, const QVariant &old_value, QUndoCommand *parent = 0);
QPropertyUndoCommand(QObject *object, const char *property_name, const QVariant &old_value, const QVariant &new_value, QUndoCommand *parent = nullptr);
QPropertyUndoCommand(QObject *object, const char *property_name, const QVariant &old_value, QUndoCommand *parent = nullptr);
void setNewValue(const QVariant &new_value);
void enableAnimation (bool animate = true);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -67,7 +67,7 @@ Diagram::Diagram(QETProject *project) :
setProject(project);
qgi_manager_ = new QGIManager(this);
setBackgroundBrush(Qt::white);
conductor_setter_ = new QGraphicsLineItem(0);
conductor_setter_ = new QGraphicsLineItem(nullptr);
conductor_setter_ -> setZValue(1000000);
QPen pen(Qt::NoBrush, 1.5, Qt::DashLine);
@ -863,7 +863,7 @@ bool Diagram::fromXml(QDomElement &document, QPointF position, bool consider_inf
}
int state = 0;
Element *nvel_elmt = ElementFactory::Instance() -> createElement(element_location, 0, &state);
Element *nvel_elmt = ElementFactory::Instance() -> createElement(element_location, nullptr, &state);
if (state)
{
QString debug_message = QString("Diagram::fromXml() : Le chargement de la description de l'element %1 a echoue avec le code d'erreur %2").arg(element_location.path()).arg(state);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,7 +36,7 @@ class DiagramPrintDialog : public QWidget
Q_OBJECT
// Constructors, destructor
public:
DiagramPrintDialog(QETProject *, QWidget * = 0);
DiagramPrintDialog(QETProject *, QWidget * = nullptr);
virtual ~DiagramPrintDialog();
private:
DiagramPrintDialog(const DiagramPrintDialog &);
@ -63,7 +63,7 @@ class DiagramPrintDialog : public QWidget
private slots:
void print(const QList<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 acceptPrintTypeDialog();
void browseFilePrintTypeDialog();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -33,7 +33,7 @@ class PartArc : public AbstractPartEllipse
Q_OBJECT
public:
PartArc(QETElementEditor *editor, QGraphicsItem *parent = 0);
PartArc(QETElementEditor *editor, QGraphicsItem *parent = nullptr);
virtual ~PartArc();
private:
@ -46,7 +46,7 @@ class PartArc : public AbstractPartEllipse
* @return the QGraphicsItem type
*/
virtual int type() const { return Type; }
virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = 0);
virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = nullptr);
//Name and XML
virtual QString name() const { return(QObject::tr("arc", "element part name")); }

View File

@ -33,7 +33,7 @@ class PartEllipse : public AbstractPartEllipse
// constructors, destructor
public:
PartEllipse(QETElementEditor *editor, QGraphicsItem * parent = 0);
PartEllipse(QETElementEditor *editor, QGraphicsItem * parent = nullptr);
virtual ~PartEllipse();
private:
@ -47,7 +47,7 @@ class PartEllipse : public AbstractPartEllipse
* @return the QGraphicsItem type
*/
virtual int type() const { return Type; }
virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = 0);
virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = nullptr);
//Name and XML
virtual QString name() const { return(QObject::tr("ellipse", "element part name")); }

View File

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

View File

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

View File

@ -36,7 +36,7 @@ class PartRectangle : public CustomElementGraphicPart
// constructors, destructor
public:
PartRectangle(QETElementEditor *, QGraphicsItem *parent = 0);
PartRectangle(QETElementEditor *, QGraphicsItem *parent = nullptr);
virtual ~PartRectangle();
private:
@ -53,7 +53,7 @@ class PartRectangle : public CustomElementGraphicPart
* @return the QGraphicsItem type
*/
virtual int type () const { return Type; }
virtual void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget * = 0);
virtual void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget * = nullptr);
virtual QString name () const { return(QObject::tr("rectangle", "element part name")); }
virtual QString xmlName () const { return(QString("rect")); }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -113,7 +113,7 @@ class Conductor : public QObject, public QGraphicsPathItem
void calculateTextItemPosition();
virtual Highlight highlight() const;
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;
void editProperty ();

View File

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

View File

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

View File

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

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