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/xbelreader.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/xbelreader.h')
-rw-r--r-- | examples/xml/streambookmarks/xbelreader.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/xml/streambookmarks/xbelreader.h b/examples/xml/streambookmarks/xbelreader.h index 3175441ddd..fd486a430f 100644 --- a/examples/xml/streambookmarks/xbelreader.h +++ b/examples/xml/streambookmarks/xbelreader.h @@ -71,6 +71,10 @@ public: QString errorString() const; + static inline QString versionAttribute() { return QStringLiteral("version"); } + static inline QString hrefAttribute() { return QStringLiteral("href"); } + static inline QString foldedAttribute() { return QStringLiteral("folded"); } + private: //! [2] void readXBEL(); |