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.5
Change-Id: Ie98d4fbddb18d5578e2651bdb4850527ff984582
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit f77c7e1bf54288bd6720e8a41b7ac9a0486c93d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Rym Bouabid 2023-09-14 17:28:27 +02:00 committed by Qt Cherry-pick Bot
parent abdab47635
commit 500b747bb9
3 changed files with 10 additions and 10 deletions

View File

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

View File

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

View File

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