rsslisting example: Tidy up #include usage

Replace one #include with a forward-declaration - in rsslisting.h QUrl
is only passed by reference to a function. Shuffle order of existing
forward declarations to be alphabetic, in the process.

Shuffle #include order in sources so that this example's own headers
appear before the Qt ones.

Pick-to: 6.5
Task-number: QTBUG-111228
Change-Id: I69a9e091c77f9d3190c0217c8bd9262e056f66fc
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
This commit is contained in:
Edward Welbourne 2023-05-05 11:10:27 +02:00
parent 00ccc56434
commit 3cdc65c2ec
3 changed files with 4 additions and 7 deletions

View File

@ -7,9 +7,8 @@ main.cpp
Provides the main function for the RSS news reader example. Provides the main function for the RSS news reader example.
*/ */
#include <QtWidgets>
#include "rsslisting.h" #include "rsslisting.h"
#include <QtWidgets>
/*! /*!
Create an application and a main widget. Open the main widget for Create an application and a main widget. Open the main widget for

View File

@ -16,13 +16,12 @@ data to an XML reader in pieces. This allows the user to interrupt
its operation, and also allows very large data sources to be read. its operation, and also allows very large data sources to be read.
*/ */
#include "rsslisting.h"
#include <QtCore> #include <QtCore>
#include <QtWidgets> #include <QtWidgets>
#include <QtNetwork> #include <QtNetwork>
#include "rsslisting.h"
/* /*
Constructs an RSSListing widget with a simple user interface, and sets Constructs an RSSListing widget with a simple user interface, and sets
up the XML reader to use a custom handler class. up the XML reader to use a custom handler class.

View File

@ -8,14 +8,13 @@
#include <QNetworkReply> #include <QNetworkReply>
#include <QWidget> #include <QWidget>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QUrl>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QLineEdit; class QLineEdit;
class QPushButton;
class QTreeWidget; class QTreeWidget;
class QTreeWidgetItem; class QTreeWidgetItem;
class QPushButton; class QUrl;
QT_END_NAMESPACE QT_END_NAMESPACE
class RSSListing : public QWidget class RSSListing : public QWidget