Revamp Local Fortune Server Example: Fix includes

Fix include order to respect the Coding Conventions.

Add needed includes to avoid Transitive includes.

Remove uneeded classes.

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

Task-number: QTBUG-117064
Pick-to: 6.6 6.5
Change-Id: Ie98d4fbddb18d5578e2651bdb4850527ff984582
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This commit is contained in:
Rym Bouabid 2023-09-14 17:28:27 +02:00
parent 7b63372c2f
commit f77c7e1bf5
3 changed files with 10 additions and 10 deletions

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 "server.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);

View File

@ -3,8 +3,13 @@
#include "server.h"
#include <QtWidgets>
#include <QtNetwork>
#include <QGuiApplication>
#include <QHBoxLayout>
#include <QLabel>
#include <QLocalSocket>
#include <QMessageBox>
#include <QPushButton>
#include <QRandomGenerator>
Server::Server(QWidget *parent)
: QDialog(parent)

View File

@ -5,12 +5,7 @@
#define SERVER_H
#include <QDialog>
QT_BEGIN_NAMESPACE
class QLabel;
class QPushButton;
class QLocalServer;
QT_END_NAMESPACE
#include <QLocalServer>
class Server : public QDialog
{