diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-10-31 11:09:00 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-02-17 05:55:19 +0000 |
commit | 8d71fae08078afbf4aa2de7429302f46d46fb43f (patch) | |
tree | dd67e91f7dc00c38582930a774981865c6d8d850 /examples/xml/streambookmarks/xbelwriter.h | |
parent | 146f6d261ba743b643825d62cdb2deb1e701d3d2 (diff) |
Polish the XML bookmarks examples
- Use Qt 5 connect syntax.
- Streamline code, remove unused members.
- Add a context menu for copying and opening the URLs.
- Add const to XML code.
- In the XML code, show the use of QStringLiteral in static inline
functions to create strings versus QLatin1String in comparison
overloads to avoid allocating strings from const char * literals.
Change-Id: Ib5e62ca188e271ffe01996dff3c9ea8e0b60739a
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'examples/xml/streambookmarks/xbelwriter.h')
-rw-r--r-- | examples/xml/streambookmarks/xbelwriter.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/xml/streambookmarks/xbelwriter.h b/examples/xml/streambookmarks/xbelwriter.h index b15bf60e31..465d8f0dc4 100644 --- a/examples/xml/streambookmarks/xbelwriter.h +++ b/examples/xml/streambookmarks/xbelwriter.h @@ -62,13 +62,13 @@ QT_END_NAMESPACE class XbelWriter { public: - XbelWriter(QTreeWidget *treeWidget); + explicit XbelWriter(const QTreeWidget *treeWidget); bool writeFile(QIODevice *device); private: - void writeItem(QTreeWidgetItem *item); + void writeItem(const QTreeWidgetItem *item); QXmlStreamWriter xml; - QTreeWidget *treeWidget; + const QTreeWidget *treeWidget; }; //! [0] |