summaryrefslogtreecommitdiffstats
path: root/examples/network
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network')
-rw-r--r--examples/network/multistreamclient/chatconsumer.h4
-rw-r--r--examples/network/multistreamclient/movieconsumer.h6
-rw-r--r--examples/network/multistreamclient/timeconsumer.h6
-rw-r--r--examples/network/multistreamserver/chatprovider.h6
-rw-r--r--examples/network/multistreamserver/server.h2
-rw-r--r--examples/network/multistreamserver/timeprovider.h2
-rw-r--r--examples/network/torrent/mainwindow.cpp18
7 files changed, 22 insertions, 22 deletions
diff --git a/examples/network/multistreamclient/chatconsumer.h b/examples/network/multistreamclient/chatconsumer.h
index 9e12f99359..e10c0d7850 100644
--- a/examples/network/multistreamclient/chatconsumer.h
+++ b/examples/network/multistreamclient/chatconsumer.h
@@ -64,8 +64,8 @@ class ChatConsumer : public Consumer
public:
explicit ChatConsumer(QObject *parent = nullptr);
- QWidget *widget() Q_DECL_OVERRIDE;
- void readDatagram(const QByteArray &ba) Q_DECL_OVERRIDE;
+ QWidget *widget() override;
+ void readDatagram(const QByteArray &ba) override;
private slots:
void returnPressed();
diff --git a/examples/network/multistreamclient/movieconsumer.h b/examples/network/multistreamclient/movieconsumer.h
index 74321a8505..3f78bf2060 100644
--- a/examples/network/multistreamclient/movieconsumer.h
+++ b/examples/network/multistreamclient/movieconsumer.h
@@ -63,9 +63,9 @@ class MovieConsumer : public Consumer
public:
explicit MovieConsumer(QObject *parent = nullptr);
- QWidget *widget() Q_DECL_OVERRIDE;
- void readDatagram(const QByteArray &ba) Q_DECL_OVERRIDE;
- void serverDisconnected() Q_DECL_OVERRIDE;
+ QWidget *widget() override;
+ void readDatagram(const QByteArray &ba) override;
+ void serverDisconnected() override;
private:
QLabel *label;
diff --git a/examples/network/multistreamclient/timeconsumer.h b/examples/network/multistreamclient/timeconsumer.h
index 3faa4a6b1a..84a7796699 100644
--- a/examples/network/multistreamclient/timeconsumer.h
+++ b/examples/network/multistreamclient/timeconsumer.h
@@ -64,9 +64,9 @@ class TimeConsumer : public Consumer
public:
explicit TimeConsumer(QObject *parent = nullptr);
- QWidget *widget() Q_DECL_OVERRIDE;
- void readDatagram(const QByteArray &ba) Q_DECL_OVERRIDE;
- void serverDisconnected() Q_DECL_OVERRIDE;
+ QWidget *widget() override;
+ void readDatagram(const QByteArray &ba) override;
+ void serverDisconnected() override;
private slots:
void timerTick();
diff --git a/examples/network/multistreamserver/chatprovider.h b/examples/network/multistreamserver/chatprovider.h
index b6ff61a917..c52fa89240 100644
--- a/examples/network/multistreamserver/chatprovider.h
+++ b/examples/network/multistreamserver/chatprovider.h
@@ -59,9 +59,9 @@ class ChatProvider : public Provider
public:
explicit ChatProvider(QObject *parent = nullptr);
- void readDatagram(QSctpSocket &from, const QByteArray &ba) Q_DECL_OVERRIDE;
- void newConnection(QSctpSocket &client) Q_DECL_OVERRIDE;
- void clientDisconnected(QSctpSocket &client) Q_DECL_OVERRIDE;
+ void readDatagram(QSctpSocket &from, const QByteArray &ba) override;
+ void newConnection(QSctpSocket &client) override;
+ void clientDisconnected(QSctpSocket &client) override;
};
#endif
diff --git a/examples/network/multistreamserver/server.h b/examples/network/multistreamserver/server.h
index d9a38e61a4..2380d6ffd6 100644
--- a/examples/network/multistreamserver/server.h
+++ b/examples/network/multistreamserver/server.h
@@ -72,7 +72,7 @@ public:
virtual ~Server();
public slots:
- int exec() Q_DECL_OVERRIDE;
+ int exec() override;
private slots:
void newConnection();
diff --git a/examples/network/multistreamserver/timeprovider.h b/examples/network/multistreamserver/timeprovider.h
index f99cdbc717..a4d08fd67c 100644
--- a/examples/network/multistreamserver/timeprovider.h
+++ b/examples/network/multistreamserver/timeprovider.h
@@ -59,7 +59,7 @@ class TimeProvider : public Provider
public:
explicit TimeProvider(QObject *parent = nullptr);
- void readDatagram(QSctpSocket &from, const QByteArray &ba) Q_DECL_OVERRIDE;
+ void readDatagram(QSctpSocket &from, const QByteArray &ba) override;
};
#endif
diff --git a/examples/network/torrent/mainwindow.cpp b/examples/network/torrent/mainwindow.cpp
index efdf187174..f80c2c6975 100644
--- a/examples/network/torrent/mainwindow.cpp
+++ b/examples/network/torrent/mainwindow.cpp
@@ -129,12 +129,12 @@ MainWindow::MainWindow(QWidget *parent)
// Set header resize modes and initial section sizes
QFontMetrics fm = fontMetrics();
QHeaderView *header = torrentView->header();
- header->resizeSection(0, fm.width("typical-name-for-a-torrent.torrent"));
- header->resizeSection(1, fm.width(headers.at(1) + " "));
- header->resizeSection(2, fm.width(headers.at(2) + " "));
- header->resizeSection(3, qMax(fm.width(headers.at(3) + " "), fm.width(" 1234.0 KB/s ")));
- header->resizeSection(4, qMax(fm.width(headers.at(4) + " "), fm.width(" 1234.0 KB/s ")));
- header->resizeSection(5, qMax(fm.width(headers.at(5) + " "), fm.width(tr("Downloading") + " ")));
+ header->resizeSection(0, fm.horizontalAdvance("typical-name-for-a-torrent.torrent"));
+ header->resizeSection(1, fm.horizontalAdvance(headers.at(1) + " "));
+ header->resizeSection(2, fm.horizontalAdvance(headers.at(2) + " "));
+ header->resizeSection(3, qMax(fm.horizontalAdvance(headers.at(3) + " "), fm.horizontalAdvance(" 1234.0 KB/s ")));
+ header->resizeSection(4, qMax(fm.horizontalAdvance(headers.at(4) + " "), fm.horizontalAdvance(" 1234.0 KB/s ")));
+ header->resizeSection(5, qMax(fm.horizontalAdvance(headers.at(5) + " "), fm.horizontalAdvance(tr("Downloading") + " ")));
// Create common actions
QAction *newTorrentAction = new QAction(QIcon(":/icons/bottom.png"), tr("Add &new torrent"), this);
@@ -174,14 +174,14 @@ MainWindow::MainWindow(QWidget *parent)
bottomBar->addWidget(new QLabel(tr("Max download:")));
bottomBar->addWidget(downloadLimitSlider);
bottomBar->addWidget((downloadLimitLabel = new QLabel(tr("0 KB/s"))));
- downloadLimitLabel->setFixedSize(QSize(fm.width(tr("99999 KB/s")), fm.lineSpacing()));
+ downloadLimitLabel->setFixedSize(QSize(fm.horizontalAdvance(tr("99999 KB/s")), fm.lineSpacing()));
bottomBar->addSeparator();
uploadLimitSlider = new QSlider(Qt::Horizontal);
uploadLimitSlider->setRange(0, 1000);
bottomBar->addWidget(new QLabel(tr("Max upload:")));
bottomBar->addWidget(uploadLimitSlider);
bottomBar->addWidget((uploadLimitLabel = new QLabel(tr("0 KB/s"))));
- uploadLimitLabel->setFixedSize(QSize(fm.width(tr("99999 KB/s")), fm.lineSpacing()));
+ uploadLimitLabel->setFixedSize(QSize(fm.horizontalAdvance(tr("99999 KB/s")), fm.lineSpacing()));
#ifdef Q_OS_OSX
setUnifiedTitleAndToolBarOnMac(true);
@@ -220,7 +220,7 @@ QSize MainWindow::sizeHint() const
// Add up the sizes of all header sections. The last section is
// stretched, so its size is relative to the size of the width;
// instead of counting it, we count the size of its largest value.
- int width = fontMetrics().width(tr("Downloading") + " ");
+ int width = fontMetrics().horizontalAdvance(tr("Downloading") + " ");
for (int i = 0; i < header->count() - 1; ++i)
width += header->sectionSize(i);