summaryrefslogtreecommitdiffstats
path: root/examples/widgets/itemviews/stardelegate
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-10-14 17:46:16 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-10-14 17:46:34 +0200
commit440286655e0ca271506cf7cc02ad0dbf4baef9ca (patch)
tree896fa81adb8b14a69355a3a6cf64d06ec8173c9a /examples/widgets/itemviews/stardelegate
parent1e27ad1697187549151657ba187928e439300db7 (diff)
parente164d61ca8263fc4b46fdd916e1ea77c7dd2b735 (diff)
Merge remote-tracking branch 'origin/dev' into wip/cmake
Diffstat (limited to 'examples/widgets/itemviews/stardelegate')
-rw-r--r--examples/widgets/itemviews/stardelegate/main.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/widgets/itemviews/stardelegate/main.cpp b/examples/widgets/itemviews/stardelegate/main.cpp
index 452976bba0..5ca85a6151 100644
--- a/examples/widgets/itemviews/stardelegate/main.cpp
+++ b/examples/widgets/itemviews/stardelegate/main.cpp
@@ -48,7 +48,8 @@
**
****************************************************************************/
-#include <QtWidgets>
+#include <QApplication>
+#include <QTableWidget>
#include "stardelegate.h"
#include "stareditor.h"
@@ -57,7 +58,7 @@
//! [0]
void populateTableWidget(QTableWidget *tableWidget)
{
- static const struct {
+ static constexpr struct {
const char *title;
const char *genre;
const char *artist;
@@ -70,12 +71,12 @@ void populateTableWidget(QTableWidget *tableWidget)
{ "Sex Bomb", "Pop", "Tom Jones", 3 },
{ "Barbie Girl", "Pop", "Aqua", 5 },
//! [2]
- { 0, 0, 0, 0 }
+ { nullptr, nullptr, nullptr, 0 }
//! [2] //! [3]
};
//! [3] //! [4]
- for (int row = 0; staticData[row].title != 0; ++row) {
+ for (int row = 0; staticData[row].title != nullptr; ++row) {
QTableWidgetItem *item0 = new QTableWidgetItem(staticData[row].title);
QTableWidgetItem *item1 = new QTableWidgetItem(staticData[row].genre);
QTableWidgetItem *item2 = new QTableWidgetItem(staticData[row].artist);