Revamp Local Fortune Client Example: Fix include order

Fix include order to respect the Coding Conventions.

Include individual headers instead of "generic" headers.

Remove QT_{BEGIN,END}_NAMESPACE because these are private Qt macros that
should not be used in the examples.

Task-number: QTBUG-117036
Pick-to: 6.6 6.5
Change-Id: I33f9c54098824bfcfacac7c2f624554e105a291a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This commit is contained in:
Rym Bouabid 2023-09-13 17:12:20 +02:00
parent fedb1f5b76
commit b83736be05
3 changed files with 12 additions and 12 deletions

View File

@ -1,11 +1,14 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QtWidgets>
#include <QtNetwork>
#include "client.h"
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QGuiApplication>
#include <QMessageBox>
#include <QTimer>
Client::Client(QWidget *parent)
: QDialog(parent),
hostLineEdit(new QLineEdit("fortune")),

View File

@ -4,15 +4,12 @@
#ifndef CLIENT_H
#define CLIENT_H
#include <QDialog>
#include <QDataStream>
#include <QDialog>
#include <QLabel>
#include <QLineEdit>
#include <QLocalSocket>
QT_BEGIN_NAMESPACE
class QLabel;
class QLineEdit;
class QPushButton;
QT_END_NAMESPACE
#include <QPushButton>
class Client : public QDialog
{

View File

@ -1,10 +1,10 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QApplication>
#include "client.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);