Skip to content
Snippets Groups Projects
Commit eef66cea authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

google-explicit-constructor

initializer-list constructor should not be declared explicit.
Constructors that take a single std::initializer_list
parameter should also omit explicit, in order to support
copy-initialization.
parent 220e3ea7
No related branches found
No related tags found
No related merge requests found
Showing
with 39 additions and 34 deletions
......@@ -31,7 +31,7 @@ class CheckboxDelegate : public QItemDelegate
public:
/// \brief Constructor
CheckboxDelegate(QObject* parent = nullptr);
explicit CheckboxDelegate(QObject* parent = nullptr);
/// \brief Paints a checkbox. This overrides the default painting of a combo box.
void paint(QPainter* painter, const QStyleOptionViewItem& option,
......
......@@ -30,7 +30,7 @@ class ColorPickerPushButton : public QPushButton
Q_OBJECT
public:
ColorPickerPushButton(QWidget* parent = nullptr);
explicit ColorPickerPushButton(QWidget* parent = nullptr);
public slots:
/// Calls the QColorDialog
......
......@@ -24,9 +24,9 @@
class QNonScalableGraphicsTextItem : public QGraphicsTextItem
{
public:
QNonScalableGraphicsTextItem(QGraphicsItem* parent = nullptr);
QNonScalableGraphicsTextItem(const QString& text,
QGraphicsItem* parent = nullptr);
explicit QNonScalableGraphicsTextItem(QGraphicsItem* parent = nullptr);
explicit QNonScalableGraphicsTextItem(const QString& text,
QGraphicsItem* parent = nullptr);
~QNonScalableGraphicsTextItem() override;
void paint(QPainter* painter,
......
......@@ -23,7 +23,7 @@ class QValueTooltipSlider : public QSlider
Q_OBJECT
public:
QValueTooltipSlider(QWidget* parent = nullptr);
explicit QValueTooltipSlider(QWidget* parent = nullptr);
public slots:
void setTooltipValue(int value);
......
......@@ -26,8 +26,8 @@ public:
QDoubleValidator( min, max, decimals, parent)
{}
StrictDoubleValidator ( QObject* parent = nullptr) :
QDoubleValidator( parent)
explicit StrictDoubleValidator(QObject* parent = nullptr)
: QDoubleValidator(parent)
{}
QValidator::State validate(QString& input, int& pos) const override
......
......@@ -31,7 +31,7 @@ class TreeModel : public QAbstractItemModel
Q_OBJECT
public:
TreeModel(QObject* parent = nullptr);
explicit TreeModel(QObject* parent = nullptr);
~TreeModel() override;
QVariant data(const QModelIndex& index, int role) const override;
......
......@@ -35,7 +35,7 @@ class TreeModelIterator
{
public:
/// \brief Constructor. Provide a tree model to iterate over.
TreeModelIterator(TreeModel* model);
explicit TreeModelIterator(TreeModel* model);
/// \brief Dereferencing the iterator to retrieve the current TreeItem.
/// Returns nullptr if the iterator is at the end.
......
......@@ -27,7 +27,7 @@ class AddLayerToMeshDialog : public QDialog, private Ui_AddLayerToMesh
Q_OBJECT
public:
AddLayerToMeshDialog(QDialog* parent = nullptr);
explicit AddLayerToMeshDialog(QDialog* parent = nullptr);
/// Returns if the top layer button is selected (if false, bottom is selected).
bool isTopLayer() const { return this->topButton->isChecked(); };
......
......@@ -31,8 +31,8 @@ class Point;
class BaseItem
{
public:
BaseItem(const QString& listName,
const std::vector<GeoLib::Point*>* stations = nullptr)
explicit BaseItem(const QString& listName,
const std::vector<GeoLib::Point*>* stations = nullptr)
: _stations(stations), _vtkSource(VtkStationSource::New())
{
// create the vtk-object for 3d-visualisation of this list
......
......@@ -27,7 +27,7 @@ class ColorTableModel : public QAbstractTableModel
Q_OBJECT
public:
ColorTableModel(
explicit ColorTableModel(
const std::map<std::string, DataHolderLib::Color*>& colorLookupTable,
QObject* parent = nullptr);
~ColorTableModel() override;
......
......@@ -25,7 +25,7 @@ class ColorTableView : public QTableView
public:
/// Constructor
ColorTableView(QWidget* parent = nullptr);
explicit ColorTableView(QWidget* parent = nullptr);
};
/**
......@@ -37,7 +37,10 @@ class ColorTableViewDelegate : public QItemDelegate
public:
/// Constructor
ColorTableViewDelegate(QWidget* parent = nullptr) : QItemDelegate(parent) {}
explicit ColorTableViewDelegate(QWidget* parent = nullptr)
: QItemDelegate(parent)
{
}
/// Overwrites the paint-method to set user-defined properties instead of the default properties.
void paint(QPainter* painter, const QStyleOptionViewItem& option,
const QModelIndex& index) const override;
......
......@@ -31,8 +31,8 @@ class CondFromRasterDialog : public QDialog, private Ui_CondFromRaster
Q_OBJECT
public:
CondFromRasterDialog(std::vector<MeshLib::Mesh*> msh_vec,
QDialog* parent = nullptr);
explicit CondFromRasterDialog(std::vector<MeshLib::Mesh*> msh_vec,
QDialog* parent = nullptr);
~CondFromRasterDialog() override;
private:
......
......@@ -27,7 +27,7 @@ class CreateStructuredGridDialog : public QDialog, private Ui_CreateStructuredGr
Q_OBJECT
public:
CreateStructuredGridDialog(QDialog* parent = nullptr);
explicit CreateStructuredGridDialog(QDialog* parent = nullptr);
private slots:
void on_lineButton_toggled() const;
......
......@@ -25,7 +25,7 @@ class DataExplorerSettingsDialog : public QDialog, private Ui_DataExplorerSettin
Q_OBJECT
public:
DataExplorerSettingsDialog(QDialog* parent = nullptr);
explicit DataExplorerSettingsDialog(QDialog* parent = nullptr);
~DataExplorerSettingsDialog() override;
private slots:
......
......@@ -27,22 +27,23 @@ class DetailWindow : public QWidget, private Ui_DetailWindow
public:
/// Creates an empty diagram window.
DetailWindow(QWidget* parent = nullptr);
explicit DetailWindow(QWidget* parent = nullptr);
/**
* Creates a window containing a diagram.
* \param filename ASCII file containing x and y values for the graph to be displayed.
* \param parent The parent QWidget.
*/
DetailWindow(QString filename, QWidget* parent = nullptr);
explicit DetailWindow(QString filename, QWidget* parent = nullptr);
/**
* Creates a window containing a diagram
* \param list A QDiagramList containing all the data points and necessary metainformation for a graph to be displayed
* \param parent The parent QWidget.
*/
DetailWindow(DiagramList* list, QWidget* parent = nullptr);
explicit DetailWindow(DiagramList* list, QWidget* parent = nullptr);
DetailWindow(std::vector<std::size_t> data, QWidget* parent = nullptr);
explicit DetailWindow(std::vector<std::size_t> data,
QWidget* parent = nullptr);
~DetailWindow() override;
......
......@@ -58,7 +58,8 @@ public:
* \param stn The station object associated the diagram.
* \param parent The parent QDialog.
*/
DiagramPrefsDialog(GeoLib::Station* stn, QDialog* parent = nullptr);
explicit DiagramPrefsDialog(GeoLib::Station* stn,
QDialog* parent = nullptr);
/**
* Opens a new dialog and automatically reads data from the specified file. The diagram is not associated
......@@ -67,9 +68,9 @@ public:
* \param[out] window Returns the created DetailWindow.
* \param parent The parent QDialog.
*/
DiagramPrefsDialog(const QString& filename,
DetailWindow* window = nullptr,
QDialog* parent = nullptr);
explicit DiagramPrefsDialog(const QString& filename,
DetailWindow* window = nullptr,
QDialog* parent = nullptr);
~DiagramPrefsDialog() override;
......
......@@ -28,8 +28,8 @@ class QDateTime;
class DiagramScene : public QGraphicsScene
{
public:
DiagramScene(QObject* parent = nullptr);
DiagramScene(DiagramList* list, QObject* parent = nullptr);
explicit DiagramScene(QObject* parent = nullptr);
explicit DiagramScene(DiagramList* list, QObject* parent = nullptr);
~DiagramScene() override;
QArrow* addArrow(qreal length, qreal angle, QPen& pen);
......
......@@ -31,13 +31,13 @@ public:
/**
* Creates an empty view.
*/
DiagramView(QWidget* parent = nullptr);
explicit DiagramView(QWidget* parent = nullptr);
/**
* Creates a view already containing a graph
* \param list Contains a list of data points and metainformation to be displayed by the scene.
* \param parent The parent QWidget.
*/
DiagramView(DiagramList* list, QWidget* parent = nullptr);
explicit DiagramView(DiagramList* list, QWidget* parent = nullptr);
~DiagramView() override;
/// Adds a new graph to the scene.
......
......@@ -32,7 +32,7 @@ class ElementTreeModel : public TreeModel
Q_OBJECT
public:
ElementTreeModel(QObject* parent = nullptr);
explicit ElementTreeModel(QObject* parent = nullptr);
~ElementTreeModel() override;
vtkUnstructuredGridAlgorithm const* getSource() const { return _mesh_source; };
......
......@@ -26,7 +26,7 @@ class ElementTreeView : public QTreeView
public:
/// Constructor
ElementTreeView(QWidget* parent = nullptr);
explicit ElementTreeView(QWidget* parent = nullptr);
public slots:
void updateView();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment