path: root/examples/sql/masterdetail/dialog.h
diff options
authorMichael Winkelmann <>2017-07-20 16:39:01 +0200
committerTopi Reiniö <>2017-09-14 10:48:48 +0000
commit3d67793a9ec01f15e3dcf6b59e6e0df5f59bdfad (patch)
treee8bd72349e2580e2dfb4908a96653f3fa3644922 /examples/sql/masterdetail/dialog.h
parent590e71a69cc74b4e7da1ccb19a1304047dbaecb8 (diff)
Revamp SQL examples to C++11
Changed signals and slots to new syntax, used nullptr and replaced foreach with new C++11 range based for loops. Also fixed a few minor flaws. Task-number: QTBUG-60633 Change-Id: Ice4030133971912f96752d9d84c638c70fd73e35 Reviewed-by: Jesus Fernandez <> Reviewed-by: André Hartmann <> Reviewed-by: Friedemann Kleint <>
Diffstat (limited to 'examples/sql/masterdetail/dialog.h')
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/sql/masterdetail/dialog.h b/examples/sql/masterdetail/dialog.h
index 1789207d8d..31c4d8552c 100644
--- a/examples/sql/masterdetail/dialog.h
+++ b/examples/sql/masterdetail/dialog.h
@@ -61,7 +61,7 @@ class Dialog : public QDialog
Dialog(QSqlRelationalTableModel *albums, QDomDocument details,
- QFile *output, QWidget *parent = 0);
+ QFile *output, QWidget *parent = nullptr);
private slots:
void revert();
@@ -70,12 +70,12 @@ private slots:
int addNewAlbum(const QString &title, int artistId);
int addNewArtist(const QString &name);
- void addTracks(int albumId, QStringList tracks);
+ void addTracks(int albumId, const QStringList &tracks);
QDialogButtonBox *createButtons();
QGroupBox *createInputWidgets();
int findArtistId(const QString &artist);
- int generateAlbumId();
- int generateArtistId();
+ static int generateAlbumId();
+ static int generateArtistId();
void increaseAlbumCount(QModelIndex artistIndex);
QModelIndex indexOfArtist(const QString &artist);