Bläddra i källkod

Paramètres en réf constantes

François Drouhard 3 år sedan
förälder
incheckning
6421bd315b
2 ändrade filer med 22 tillägg och 22 borttagningar
  1. 15 15
      options.cpp
  2. 7 7
      options.h

+ 15 - 15
options.cpp

@@ -4,12 +4,12 @@
 #include <QString>
 #include <QObject>
 
-Options::Options(QString joueur1, QString joueur2, QTime const& temps, bool son, QObject *parent) :
+Options::Options(QString const& joueur1, QString const& joueur2, QTime const& temps, bool son, QObject *parent) :
     QObject(parent),
-    _tempsDepart(temps),
-    _nomJoueur1 (joueur1),
-    _nomJoueur2 (joueur2),
-    _son (son)
+    m_tempsDepart(temps),
+    m_nomJoueur1 (joueur1),
+    m_nomJoueur2 (joueur2),
+    m_son (son)
 {
 }
 
@@ -18,34 +18,34 @@ Options::~Options ()
 
 }
 
-void Options::setNomJoueur1(QString joueur) {
-    _nomJoueur1 = joueur;
+void Options::setNomJoueur1(QString const& joueur) {
+    m_nomJoueur1 = joueur;
 }
 
-void Options::setNomJoueur2(QString joueur) {
-    _nomJoueur2 = joueur;
+void Options::setNomJoueur2(QString const& joueur) {
+    m_nomJoueur2 = joueur;
 }
 
 void Options::setTempsDepart(QTime const& temps) {
-    _tempsDepart = temps;
+    m_tempsDepart = temps;
 }
 
 void Options::setSon (bool son) {
-    _son = son;
+    m_son = son;
 }
 
 QString Options::nomJoueur1() const {
-    return _nomJoueur1;
+    return m_nomJoueur1;
 }
 
 QString Options::nomJoueur2() const {
-    return _nomJoueur2;
+    return m_nomJoueur2;
 }
 
 QTime Options::tempsDepart() const {
-    return _tempsDepart;
+    return m_tempsDepart;
 }
 
 bool Options::son() const {
-    return _son;
+    return m_son;
 }

+ 7 - 7
options.h

@@ -10,11 +10,11 @@ class Options : public QObject
 {
 
 public:
-    explicit Options (QString joueur1, QString joueur2, QTime const& time, bool son = true, QObject *parent = nullptr);
+    explicit Options (QString const& joueur1, QString const& joueur2, QTime const& time, bool son = true, QObject *parent = nullptr);
     virtual ~Options();
     void setTempsDepart (QTime const& temps);
-    void setNomJoueur1 (QString joueur);
-    void setNomJoueur2 (QString joueur);
+    void setNomJoueur1 (QString const& joueur);
+    void setNomJoueur2 (QString const& joueur);
     void setSon (bool son);
     QString nomJoueur1 () const;
     QString nomJoueur2 () const;
@@ -26,10 +26,10 @@ public slots:
 signals:
 
 private:
-    QTime   _tempsDepart;
-    QString _nomJoueur1;
-    QString _nomJoueur2;
-    bool    _son;
+    QTime   m_tempsDepart;
+    QString m_nomJoueur1;
+    QString m_nomJoueur2;
+    bool    m_son;
 
 };