Gui: modernize C++11

* remove redundant void-arg
* use nullptr
This commit is contained in:
wmayer
2022-02-03 11:15:46 +01:00
parent d9016c490a
commit dd57f124fe
25 changed files with 50 additions and 50 deletions

View File

@@ -79,7 +79,7 @@
// doc in super
void
SmSwitchboard::initClass(void)
SmSwitchboard::initClass()
{
SO_NODE_INIT_CLASS(SmSwitchboard, SoGroup, SoGroup);
}
@@ -89,7 +89,7 @@ SO_NODE_SOURCE(SmSwitchboard)
/*!
Default constructor.
*/
SmSwitchboard::SmSwitchboard(void)
SmSwitchboard::SmSwitchboard()
{
SO_NODE_CONSTRUCTOR(SmSwitchboard);
@@ -115,7 +115,7 @@ SmSwitchboard::SmSwitchboard(int numchildren)
/*!
Destructor.
*/
SmSwitchboard::~SmSwitchboard(void) // virtual, protected
SmSwitchboard::~SmSwitchboard() // virtual, protected
{
}
@@ -204,7 +204,7 @@ SmSwitchboard::handleEvent(SoHandleEventAction *action)
void
SmSwitchboard::search(SoSearchAction * action)
{
SoNode::search(action);
SoNode::search(action); // clazy:exclude=skipped-base-method
if (action->isFound()) return;
SmSwitchboard::doAction(action);
}

View File

@@ -45,8 +45,8 @@ class GuiExport SmSwitchboard : public SoGroup {
SO_NODE_HEADER(SmSwitchboard);
public:
static void initClass(void);
SmSwitchboard(void);
static void initClass();
SmSwitchboard();
SmSwitchboard(int numchildren);
SoMFBool enable;
@@ -61,7 +61,7 @@ public:
virtual void search(SoSearchAction * action);
protected:
virtual ~SmSwitchboard(void);
virtual ~SmSwitchboard();
};

View File

@@ -42,7 +42,7 @@ public:
SoSFFloat scaleFactor;
protected:
virtual ~SoAutoZoomTranslation() {};
virtual ~SoAutoZoomTranslation() {}
virtual void doAction(SoAction * action);
virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
virtual void getMatrix(SoGetMatrixAction * action);

View File

@@ -132,7 +132,7 @@ QPixmap ActionBox::icon() const
ActionLabel* ActionBox::createItem(QAction * action, QLayout * l)
{
if (!action)
return 0;
return nullptr;
ActionLabel *act = createItem("", l);
act->setDefaultAction(action);

View File

@@ -169,13 +169,13 @@ class QSINT_EXPORT ActionBox : public QFrame
public:
/** Constructor.
*/
explicit ActionBox(QWidget *parent = 0);
explicit ActionBox(QWidget *parent = nullptr);
/** Constructor.
*/
explicit ActionBox(const QString & headerText, QWidget *parent = 0);
explicit ActionBox(const QString & headerText, QWidget *parent = nullptr);
/** Constructor.
*/
explicit ActionBox(const QPixmap & icon, const QString & headerText, QWidget *parent = 0);
explicit ActionBox(const QPixmap & icon, const QString & headerText, QWidget *parent = nullptr);
/** Sets icon of the ActionBox to \a icon.
*/
@@ -199,7 +199,7 @@ public:
\since 0.2
*/
ActionLabel* createItem(QAction * action, QLayout * l = 0);
ActionLabel* createItem(QAction * action, QLayout * l = nullptr);
/** Creates action items from the \a actions list and returns the list of action items.
\since 0.2
@@ -208,19 +208,19 @@ public:
/** Adds an action with \a text to the ActionBox and returns action item.
*/
ActionLabel* createItem(const QString & text = QString(), QLayout * l = 0);
ActionLabel* createItem(const QString & text = QString(), QLayout * l = nullptr);
/** Adds an action with \a icon and \a text to the ActionBox and returns action item.
This function acts just like previous one. See the description above.
*/
ActionLabel* createItem(const QPixmap & icon, const QString & text, QLayout * l = 0);
ActionLabel* createItem(const QPixmap & icon, const QString & text, QLayout * l = nullptr);
/** Adds a spacer and returns spacer item.
By default, a spacer is added to the default vertical layout.
You can add a spacer to the specified layout passing it as \a l parameter.
*/
QSpacerItem* createSpacer(QLayout * l = 0);
QSpacerItem* createSpacer(QLayout * l = nullptr);
/** Creates empty horizontal layout.
@@ -240,7 +240,7 @@ public:
By default, widget is added to the default vertical layout.
You can add widget to the specified layout passing it as \a l parameter.
*/
void addWidget(QWidget * w, QLayout * l = 0);
void addWidget(QWidget * w, QLayout * l = nullptr);
virtual QSize minimumSizeHint() const;

View File

@@ -79,7 +79,7 @@ QBoxLayout* ActionGroup::groupLayout()
ActionLabel* ActionGroup::addAction(QAction *action, bool addToLayout, bool addStretch)
{
if (!action)
return 0;
return nullptr;
ActionLabel* label = new ActionLabel(action, this);
myGroup->addActionLabel(label, addToLayout, addStretch);
@@ -90,7 +90,7 @@ ActionLabel* ActionGroup::addAction(QAction *action, bool addToLayout, bool addS
ActionLabel* ActionGroup::addActionLabel(ActionLabel *label, bool addToLayout, bool addStretch)
{
if (!label)
return 0;
return nullptr;
myGroup->addActionLabel(label, addToLayout, addStretch);

View File

@@ -43,7 +43,7 @@ class QSINT_EXPORT ActionGroup : public QWidget
public:
/** Constructor. Creates ActionGroup without header.
*/
explicit ActionGroup(QWidget *parent = 0);
explicit ActionGroup(QWidget *parent = nullptr);
/** Constructor. Creates ActionGroup with header's
text set to \a title, but with no icon.
@@ -52,7 +52,7 @@ public:
*/
explicit ActionGroup(const QString& title,
bool expandable = true,
QWidget *parent = 0);
QWidget *parent = nullptr);
/** Constructor. Creates ActionGroup with header's
text set to \a title and icon set to \a icon.
@@ -62,7 +62,7 @@ public:
explicit ActionGroup(const QPixmap& icon,
const QString& title,
bool expandable = true,
QWidget *parent = 0);
QWidget *parent = nullptr);
/** Creates action item from the \a action and returns it.

View File

@@ -72,12 +72,12 @@ class QSINT_EXPORT ActionLabel : public QToolButton
public:
/** Constructor.
*/
explicit ActionLabel(QWidget *parent = 0);
explicit ActionLabel(QWidget *parent = nullptr);
/** Constructor. Creates ActionLabel from the \a action.
\since 0.2
*/
explicit ActionLabel(QAction *action, QWidget *parent = 0);
explicit ActionLabel(QAction *action, QWidget *parent = nullptr);
virtual ~ActionLabel() {}

View File

@@ -17,7 +17,7 @@ namespace QSint
ActionPanel::ActionPanel(QWidget *parent) :
BaseClass(parent), mySpacer(0)
BaseClass(parent), mySpacer(nullptr)
{
setProperty("class", "panel");
@@ -85,7 +85,7 @@ void ActionPanel::removeStretch()
if (mySpacer) {
layout()->removeItem(mySpacer);
delete mySpacer;
mySpacer = 0;
mySpacer = nullptr;
}
}

View File

@@ -45,7 +45,7 @@ class QSINT_EXPORT ActionPanel : public QFrame
public:
/** Constructor.
*/
explicit ActionPanel(QWidget *parent = 0);
explicit ActionPanel(QWidget *parent = nullptr);
/** Adds a widget \a w to the ActionPanel's vertical layout.
*/

View File

@@ -31,7 +31,7 @@ TaskHeader::TaskHeader(const QIcon &icon, const QString &title, bool expandable,
m_buttonOver(false),
m_fold(true),
m_opacity(0.1),
myButton(0)
myButton(nullptr)
{
setProperty("class", "header");
@@ -79,9 +79,9 @@ void TaskHeader::setExpandable(bool expandable)
return;
myButton->removeEventFilter(this);
myButton->setParent(0);
myButton->setParent(nullptr);
delete myButton;
myButton = 0;
myButton = nullptr;
changeIcons();
}
}

View File

@@ -27,7 +27,7 @@ class TaskHeader : public QFrame
friend class ActionGroup;
public:
TaskHeader(const QIcon &icon, const QString &title, bool expandable, QWidget *parent = 0);
TaskHeader(const QIcon &icon, const QString &title, bool expandable, QWidget *parent = nullptr);
inline bool expandable() const { return myExpandable; }
void setExpandable(bool expandable);

View File

@@ -26,7 +26,7 @@
#include <QStyle>
iisFreeCADTaskPanelScheme* iisFreeCADTaskPanelScheme::myDefaultXPScheme = 0;
iisFreeCADTaskPanelScheme* iisFreeCADTaskPanelScheme::myDefaultXPScheme = nullptr;
iisFreeCADTaskPanelScheme::iisFreeCADTaskPanelScheme(QObject *parent)
: iisTaskPanelScheme(parent)

View File

@@ -32,7 +32,7 @@
class IISTASKPANEL_EXPORT iisFreeCADTaskPanelScheme : public iisTaskPanelScheme
{
public:
iisFreeCADTaskPanelScheme(QObject *parent=0);
iisFreeCADTaskPanelScheme(QObject *parent=nullptr);
~iisFreeCADTaskPanelScheme();
static iisTaskPanelScheme* defaultScheme();

View File

@@ -12,7 +12,7 @@ iisIconLabel::iisIconLabel(const QIcon &icon, const QString &title, QWidget *par
: QWidget(parent),
myPixmap(icon),
myText(title),
mySchemePointer(0),
mySchemePointer(nullptr),
m_over(false),
m_pressed(false),
m_changeCursorOver(true),

View File

@@ -20,7 +20,7 @@ class IISTASKPANEL_EXPORT iisIconLabel : public QWidget
Q_OBJECT
public:
iisIconLabel(const QIcon &icon, const QString &title, QWidget *parent = 0);
iisIconLabel(const QIcon &icon, const QString &title, QWidget *parent = nullptr);
virtual ~iisIconLabel();
void setColors(const QColor &color, const QColor &colorOver, const QColor &colorOff);

View File

@@ -27,8 +27,8 @@ class IISTASKPANEL_EXPORT iisTaskBox : public QFrame
Q_OBJECT
public:
iisTaskBox(const QString &title, bool expandable = true, QWidget *parent = 0);
iisTaskBox(const QPixmap &icon, const QString &title, bool expandable = true, QWidget *parent = 0);
iisTaskBox(const QString &title, bool expandable = true, QWidget *parent = nullptr);
iisTaskBox(const QPixmap &icon, const QString &title, bool expandable = true, QWidget *parent = nullptr);
virtual ~iisTaskBox();
void setScheme(iisTaskPanelScheme *pointer);

View File

@@ -22,7 +22,7 @@ iisTaskHeader::iisTaskHeader(const QIcon &icon, const QString &title, bool expan
m_buttonOver(false),
m_fold(true),
m_opacity(0.1),
myButton(0)
myButton(nullptr)
{
myTitle = new iisIconLabel(icon, title, this);
myTitle->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);

View File

@@ -25,7 +25,7 @@ class IISTASKPANEL_EXPORT iisTaskHeader : public QFrame
Q_OBJECT
public:
iisTaskHeader(const QIcon &icon, const QString &title, bool expandable, QWidget *parent = 0);
iisTaskHeader(const QIcon &icon, const QString &title, bool expandable, QWidget *parent = nullptr);
void setScheme(iisTaskPanelScheme *scheme);
virtual ~iisTaskHeader();

View File

@@ -12,7 +12,7 @@
iisTaskPanel::iisTaskPanel(QWidget *parent) :
QWidget(parent), mySpacer(0)
QWidget(parent), mySpacer(nullptr)
{
myScheme = iisTaskPanelScheme::defaultScheme();
@@ -85,7 +85,7 @@ void iisTaskPanel::removeStretch()
{
if (mySpacer) {
layout()->removeItem(mySpacer);
delete mySpacer; mySpacer = 0;
delete mySpacer; mySpacer = nullptr;
}
}

View File

@@ -30,7 +30,7 @@ class iisTaskPanelScheme;
class IISTASKPANEL_EXPORT iisTaskPanel : public QWidget
{
public:
iisTaskPanel(QWidget *parent = 0);
iisTaskPanel(QWidget *parent = nullptr);
~iisTaskPanel();
void addWidget(QWidget *w);

View File

@@ -7,7 +7,7 @@
#include "iistaskpanelscheme.h"
iisTaskPanelScheme* iisTaskPanelScheme::myDefaultScheme = 0;
iisTaskPanelScheme* iisTaskPanelScheme::myDefaultScheme = nullptr;
iisTaskPanelScheme::iisTaskPanelScheme(QObject *parent)
: QObject(parent)
@@ -79,5 +79,5 @@ iisTaskPanelScheme* iisTaskPanelScheme::defaultScheme()
myDefaultScheme = new iisTaskPanelScheme();
return myDefaultScheme;
}
}

View File

@@ -28,7 +28,7 @@ struct IISTASKPANEL_EXPORT iisIconLabelScheme
class IISTASKPANEL_EXPORT iisTaskPanelScheme : public QObject
{
public:
iisTaskPanelScheme(QObject *parent = 0);
iisTaskPanelScheme(QObject *parent = nullptr);
~iisTaskPanelScheme();
static iisTaskPanelScheme* defaultScheme();

View File

@@ -7,7 +7,7 @@
#include "iiswinxptaskpanelscheme.h"
iisWinXPTaskPanelScheme* iisWinXPTaskPanelScheme::myDefaultXPScheme = 0;
iisWinXPTaskPanelScheme* iisWinXPTaskPanelScheme::myDefaultXPScheme = nullptr;
iisWinXPTaskPanelScheme::iisWinXPTaskPanelScheme(QObject *parent)
: iisTaskPanelScheme(parent)
@@ -55,7 +55,7 @@ iisTaskPanelScheme* iisWinXPTaskPanelScheme::defaultScheme()
iisWinXPTaskPanelScheme2* iisWinXPTaskPanelScheme2::myDefaultXPScheme = 0;
iisWinXPTaskPanelScheme2* iisWinXPTaskPanelScheme2::myDefaultXPScheme = nullptr;
iisWinXPTaskPanelScheme2::iisWinXPTaskPanelScheme2(QObject *parent)
: iisTaskPanelScheme(parent)

View File

@@ -15,7 +15,7 @@
class IISTASKPANEL_EXPORT iisWinXPTaskPanelScheme : public iisTaskPanelScheme
{
public:
iisWinXPTaskPanelScheme(QObject *parent=0);
iisWinXPTaskPanelScheme(QObject *parent=nullptr);
~iisWinXPTaskPanelScheme();
static iisTaskPanelScheme* defaultScheme();
@@ -28,7 +28,7 @@ protected:
class IISTASKPANEL_EXPORT iisWinXPTaskPanelScheme2 : public iisTaskPanelScheme
{
public:
iisWinXPTaskPanelScheme2(QObject *parent=0);
iisWinXPTaskPanelScheme2(QObject *parent=nullptr);
~iisWinXPTaskPanelScheme2();
static iisTaskPanelScheme* defaultScheme();