Commit 7362ef02 authored by Emmanuel Promayon's avatar Emmanuel Promayon

UPDATED modernize to C++11 using default member initialization

parent b4c81777
......@@ -40,7 +40,7 @@ class Direction {
public:
/// default constructor: nothing is specified
Direction() : x(0.0), y(0.0), z(0.0), xState(NOT_SPECIFIED), yState(NOT_SPECIFIED), zState(NOT_SPECIFIED), towardIndex(-1) {};
Direction() {};
/// constructor with initialization of the toward
Direction(const unsigned int toward) {
setToward(toward);
......@@ -235,19 +235,19 @@ private:
};
/// x coordinates
double x;
double x{0.0};
/// y coordinates
double y;
double y{0.0};
/// z coordinates
double z;
double z{0.0};
/// state for the x coordinates
DirState xState;
DirState xState{NOT_SPECIFIED};
/// state for the y coordinates
DirState yState;
DirState yState{NOT_SPECIFIED};
/// state for the z coordinates
DirState zState;
DirState zState{NOT_SPECIFIED};
/// toward atom index
int towardIndex;
int towardIndex{-1};
};
#endif //DIRECTION_H
......@@ -45,7 +45,7 @@ public:
ValueEvent(const double v, const double d): value(v), date(d) {};
/// default constructor
ValueEvent(): value(0.0), date(0.0) {};
ValueEvent() {};
/// destructor
~ValueEvent() = default;
......@@ -78,9 +78,9 @@ public:
private:
/// actual value
double value;
double value{0.0};
/// actual date
double date;
double date{0.0};
};
......
......@@ -43,7 +43,7 @@ class StructuralComponent;
class Structure {
public:
/** Base constructor */
Structure() : properties(nullptr) {
Structure() {
hasIndex = false;
}
/** Virtual destructor needed here as this is an abstract class (pure virtual) */
......@@ -101,7 +101,7 @@ public:
protected:
/** Property of the current structure */
StructureProperties* properties;
StructureProperties* properties{nullptr};
private:
......
......@@ -60,7 +60,7 @@ class CAMITK_API ActionExtension : public QObject {
protected :
/// constructor
ActionExtension():translator(nullptr) {};
ActionExtension() {};
public :
/// destructor
......@@ -103,7 +103,7 @@ private:
QString dynamicLibraryFileName;
/// Provide internationalization support for text output.
QTranslator* translator;
QTranslator* translator{nullptr};
};
}
......
......@@ -155,13 +155,6 @@ public :
NONE
};
/// \enum InteractionMode list of possible user interaction mode
// enum InteractionMode {
// CONTROL, ///< mouse interaction mode (\see ControlMode)
// PICKING, ///< picking mode
// AREA_PICKING ///< area picking mode
// };
/// \enum MouseButtonState state of the pressed button (for 3 buttons mouse)
enum MouseButtonState {
NO_BUTTON, ///< no buttons are currently pressed
......@@ -190,7 +183,7 @@ public :
class ScreenshotFormatInfo {
public:
/// the corresponding type (key)
ScreenshotFormat type;
ScreenshotFormat type{NOT_SUPPORTED};
/// file extension (suffix)
QString extension;
/// file format description
......@@ -198,7 +191,7 @@ public :
/// Constructor
ScreenshotFormatInfo(ScreenshotFormat t, QString e, QString d) : type(t), extension(e), description(d) {}
/// default constructor
ScreenshotFormatInfo() : type(NOT_SUPPORTED), extension(""), description("Not supported") {}
ScreenshotFormatInfo() : extension(""), description("Not supported") {}
};
/** constructors.
......
......@@ -70,17 +70,16 @@ public:
void slotToggled(bool checked);
struct WidgetItem {
WidgetItem() : widget(nullptr), label(nullptr), widgetLabel(nullptr),
button(nullptr), container(nullptr), layout(nullptr), /*line(0), */parent(nullptr), expanded(false) { }
QWidget* widget; // can be null
QLabel* label; // main label with property name
QLabel* widgetLabel; // label substitute showing the current value if there is no widget
QToolButton* button; // expandable button for items with children
QWidget* container; // container which is expanded when the button is clicked
QGridLayout* layout; // layout in container
WidgetItem* parent;
WidgetItem() { }
QWidget* widget{nullptr}; // can be null
QLabel* label{nullptr}; // main label with property name
QLabel* widgetLabel{nullptr}; // label substitute showing the current value if there is no widget
QToolButton* button{nullptr}; // expandable button for items with children
QWidget* container{nullptr}; // container which is expanded when the button is clicked
QGridLayout* layout{nullptr}; // layout in container
WidgetItem* parent{nullptr};
QList<WidgetItem*> children;
bool expanded;
bool expanded{false};
};
private:
void updateLater();
......
......@@ -1958,11 +1958,11 @@ public:
QMap<QtProperty*, QtProperty*> m_enumToProperty;
QMap<QtProperty*, QList<QWidget*> > m_enumToEditors;
QMap<QWidget*, QtProperty*> m_editorToEnum;
bool m_updatingEnum;
bool m_updatingEnum{false};
};
QtCursorEditorFactoryPrivate::QtCursorEditorFactoryPrivate()
: m_updatingEnum(false) {
{
}
......
......@@ -68,15 +68,14 @@ public:
void slotUpdate();
struct WidgetItem {
WidgetItem() : widget(nullptr), label(nullptr), widgetLabel(nullptr),
groupBox(nullptr), layout(nullptr), line(nullptr), parent(nullptr) { }
QWidget* widget; // can be null
QLabel* label;
QLabel* widgetLabel;
QGroupBox* groupBox;
QGridLayout* layout;
QFrame* line;
WidgetItem* parent;
WidgetItem() { }
QWidget* widget{nullptr}; // can be null
QLabel* label{nullptr};
QLabel* widgetLabel{nullptr};
QGroupBox* groupBox{nullptr};
QGridLayout* layout{nullptr};
QFrame* line{nullptr};
WidgetItem* parent{nullptr};
QList<WidgetItem*> children;
};
private:
......
......@@ -1220,11 +1220,11 @@ public:
QList<QtBrowserItem*> m_topLevelIndexes;
QMap<QtProperty*, QList<QtBrowserItem*> > m_propertyToIndexes;
QtBrowserItem* m_currentItem;
QtBrowserItem* m_currentItem{nullptr};
};
QtAbstractPropertyBrowserPrivate::QtAbstractPropertyBrowserPrivate() :
m_currentItem(nullptr) {
QtAbstractPropertyBrowserPrivate::QtAbstractPropertyBrowserPrivate()
{
}
void QtAbstractPropertyBrowserPrivate::insertSubTree(QtProperty* property,
......
......@@ -184,8 +184,8 @@ QString QtPropertyBrowserUtils::fontValueText(const QFont& f) {
QtBoolEdit::QtBoolEdit(QWidget* parent) :
QWidget(parent),
m_checkBox(new QCheckBox(this)),
m_textVisible(true) {
m_checkBox(new QCheckBox(this))
{
QHBoxLayout* lt = new QHBoxLayout;
if (QApplication::layoutDirection() == Qt::LeftToRight) {
lt->setContentsMargins(4, 0, 0, 0);
......@@ -258,7 +258,7 @@ void QtBoolEdit::paintEvent(QPaintEvent*) {
QtKeySequenceEdit::QtKeySequenceEdit(QWidget* parent)
: QWidget(parent), m_num(0), m_lineEdit(new QLineEdit(this)) {
: QWidget(parent), m_lineEdit(new QLineEdit(this)) {
QHBoxLayout* layout = new QHBoxLayout(this);
layout->addWidget(m_lineEdit);
layout->setMargin(0);
......
......@@ -129,7 +129,7 @@ protected:
private:
QCheckBox* m_checkBox;
bool m_textVisible;
bool m_textVisible{true};
};
class QtKeySequenceEdit : public QWidget {
......@@ -156,7 +156,7 @@ private:
void handleKeyEvent(QKeyEvent* e);
int translateModifiers(Qt::KeyboardModifiers state, const QString& text) const;
int m_num;
int m_num{0};
QKeySequence m_keySequence;
QLineEdit* m_lineEdit;
};
......
......@@ -642,11 +642,11 @@ class QtIntPropertyManagerPrivate {
public:
struct Data {
Data() : val(0), minVal(-INT_MAX), maxVal(INT_MAX), singleStep(1) {}
int val;
int minVal;
int maxVal;
int singleStep;
Data() {}
int val{0};
int minVal{-INT_MAX};
int maxVal{INT_MAX};
int singleStep{1};
bool readOnly;
int minimumValue() const {
return minVal;
......@@ -938,12 +938,12 @@ class QtDoublePropertyManagerPrivate {
public:
struct Data {
Data() : val(0), minVal(-INT_MAX), maxVal(INT_MAX), singleStep(1), decimals(2) {}
double val;
double minVal;
double maxVal;
double singleStep;
int decimals;
Data() {}
double val{0};
double minVal{-INT_MAX};
double maxVal{INT_MAX};
double singleStep{1};
int decimals{2};
bool readOnly;
double minimumValue() const {
......@@ -1303,12 +1303,12 @@ class QtStringPropertyManagerPrivate {
public:
struct Data {
Data() : regExp(QString(QLatin1Char('*')), Qt::CaseSensitive, QRegExp::Wildcard), echoMode(QLineEdit::Normal), readOnly(false) {
Data() : regExp(QString(QLatin1Char('*')), Qt::CaseSensitive, QRegExp::Wildcard) {
}
QString val;
QRegExp regExp;
int echoMode;
bool readOnly;
int echoMode{QLineEdit::Normal};
bool readOnly{false};
};
typedef QMap<const QtProperty*, Data> PropertyValueMap;
......@@ -1628,9 +1628,9 @@ public:
struct Data
{
Data() : val(false), textVisible(true) {}
bool val;
bool textVisible;
Data() {}
bool val{false};
bool textVisible{true};
};
typedef QMap<const QtProperty *, Data> PropertyValueMap;
......@@ -2893,9 +2893,9 @@ class QtPointFPropertyManagerPrivate {
public:
struct Data {
Data() : decimals(2) {}
Data() {}
QPointF val;
int decimals;
int decimals{2};
};
void slotDoubleChanged(QtProperty* property, double value);
......@@ -3506,11 +3506,11 @@ public:
const QSizeF& minVal, const QSizeF& maxVal, const QSizeF& val);
struct Data {
Data() : val(QSizeF(0, 0)), minVal(QSizeF(0, 0)), maxVal(QSizeF(INT_MAX, INT_MAX)), decimals(2) {}
Data() : val(QSizeF(0, 0)), minVal(QSizeF(0, 0)), maxVal(QSizeF(INT_MAX, INT_MAX)) {}
QSizeF val;
QSizeF minVal;
QSizeF maxVal;
int decimals;
int decimals{2};
QSizeF minimumValue() const {
return minVal;
}
......@@ -4310,10 +4310,10 @@ public:
void setConstraint(QtProperty* property, const QRectF& constraint, const QRectF& val);
struct Data {
Data() : val(0, 0, 0, 0), decimals(2) {}
Data() : val(0, 0, 0, 0) {}
QRectF val;
QRectF constraint;
int decimals;
int decimals{2};
};
typedef QMap<const QtProperty*, Data> PropertyValueMap;
......@@ -4782,9 +4782,9 @@ class QtVector3DPropertyManagerPrivate {
public:
struct Data {
Data() : decimals(3) {}
Data() {}
QVector3D val;
int decimals;
int decimals{3};
};
void slotDoubleChanged(QtProperty* property, double value);
......@@ -5071,8 +5071,8 @@ class QtEnumPropertyManagerPrivate {
public:
struct Data {
Data() : val(-1) {}
int val;
Data() {}
int val{-1};
QStringList enumNames;
QMap<int, QIcon> enumIcons;
};
......@@ -5342,8 +5342,8 @@ public:
void slotPropertyDestroyed(QtProperty* property);
struct Data {
Data() : val(-1) {}
int val;
Data() {}
int val{-1};
QStringList flagNames;
};
......@@ -6013,13 +6013,12 @@ public:
QMap<const QtProperty*, QtProperty*> m_strikeOutToProperty;
QMap<const QtProperty*, QtProperty*> m_kerningToProperty;
bool m_settingValue;
QTimer* m_fontDatabaseChangeTimer;
bool m_settingValue{false};
QTimer* m_fontDatabaseChangeTimer{nullptr};
};
QtFontPropertyManagerPrivate::QtFontPropertyManagerPrivate() :
m_settingValue(false),
m_fontDatabaseChangeTimer(nullptr) {
QtFontPropertyManagerPrivate::QtFontPropertyManagerPrivate()
{
}
void QtFontPropertyManagerPrivate::slotIntChanged(QtProperty* property, int value) {
......
......@@ -108,13 +108,13 @@ private:
QMap<QtBrowserItem*, QColor> m_indexToBackgroundColor;
QtPropertyEditorView* m_treeWidget;
QtPropertyEditorView* m_treeWidget{nullptr};
bool m_headerVisible;
QtTreePropertyBrowser::ResizeMode m_resizeMode;
class QtPropertyEditorDelegate* m_delegate;
bool m_markPropertiesWithoutValue;
bool m_browserChangedBlocked;
bool m_headerVisible{true};
QtTreePropertyBrowser::ResizeMode m_resizeMode{QtTreePropertyBrowser::Stretch};
class QtPropertyEditorDelegate* m_delegate{nullptr};
bool m_markPropertiesWithoutValue{false};
bool m_browserChangedBlocked{false};
QIcon m_expandIcon;
};
......@@ -138,12 +138,12 @@ protected:
void drawRow(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
private:
QtTreePropertyBrowserPrivate* m_editorPrivate;
QtTreePropertyBrowserPrivate* m_editorPrivate{nullptr};
};
QtPropertyEditorView::QtPropertyEditorView(QWidget* parent) :
QTreeWidget(parent),
m_editorPrivate(nullptr) {
QTreeWidget(parent)
{
connect(header(), SIGNAL(sectionDoubleClicked(int)), this, SLOT(resizeColumnToContents(int)));
}
......@@ -224,7 +224,7 @@ class QtPropertyEditorDelegate : public QItemDelegate {
Q_OBJECT
public:
QtPropertyEditorDelegate(QObject* parent = nullptr)
: QItemDelegate(parent), m_editorPrivate(nullptr), m_editedItem(nullptr), m_editedWidget(nullptr), m_disablePainting(false) {
: QItemDelegate(parent) {
}
void setEditorPrivate(QtTreePropertyBrowserPrivate* editorPrivate) {
......@@ -272,10 +272,10 @@ private:
typedef QMap<QtProperty*, QWidget*> PropertyToEditorMap;
mutable PropertyToEditorMap m_propertyToEditor;
QtTreePropertyBrowserPrivate* m_editorPrivate;
mutable QTreeWidgetItem* m_editedItem;
mutable QWidget* m_editedWidget;
mutable bool m_disablePainting;
QtTreePropertyBrowserPrivate* m_editorPrivate{nullptr};
mutable QTreeWidgetItem* m_editedItem{nullptr};
mutable QWidget* m_editedWidget{nullptr};
mutable bool m_disablePainting{false};
};
int QtPropertyEditorDelegate::indentation(const QModelIndex& index) const {
......@@ -422,13 +422,8 @@ bool QtPropertyEditorDelegate::eventFilter(QObject* object, QEvent* event) {
}
// -------- QtTreePropertyBrowserPrivate implementation
QtTreePropertyBrowserPrivate::QtTreePropertyBrowserPrivate() :
m_treeWidget(nullptr),
m_headerVisible(true),
m_resizeMode(QtTreePropertyBrowser::Stretch),
m_delegate(nullptr),
m_markPropertiesWithoutValue(false),
m_browserChangedBlocked(false) {
QtTreePropertyBrowserPrivate::QtTreePropertyBrowserPrivate()
{
}
// Draw an icon indicating opened/closing branches
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment