diff options
author | Andy Nichols <andy.nichols@theqtcompany.com> | 2016-06-21 12:44:31 +0200 |
---|---|---|
committer | Andy Nichols <andy.nichols@qt.io> | 2016-06-28 10:18:38 +0000 |
commit | adf6bd931fe479b058752fb615c30c87ba661f46 (patch) | |
tree | 0a6f2d5c0001dd9e024668c4bad9026e2a55696a /src/plugins/platforms/vnc/qvncintegration.cpp | |
parent | 2cf3696d9f11ae2aa2dba56a0774bea10d59a482 (diff) |
Add plugin arguments to VNC plugin
It is now possible to specify a port number to run the VNC server on, as
well as the screen properties:
Logical Size
Physical Size
Depth
Change-Id: I79b38c6e37ad5abb5e158eca9a17d7e8a86e692f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/vnc/qvncintegration.cpp')
-rw-r--r-- | src/plugins/platforms/vnc/qvncintegration.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plugins/platforms/vnc/qvncintegration.cpp b/src/plugins/platforms/vnc/qvncintegration.cpp index ee224bd36a..810c5d2a90 100644 --- a/src/plugins/platforms/vnc/qvncintegration.cpp +++ b/src/plugins/platforms/vnc/qvncintegration.cpp @@ -53,14 +53,24 @@ #include <QtPlatformSupport/private/qlibinputhandler_p.h> #endif +#include <QtCore/QRegularExpression> + QT_BEGIN_NAMESPACE QVncIntegration::QVncIntegration(const QStringList ¶mList) : m_fontDb(new QGenericUnixFontDatabase), m_services(new QGenericUnixServices) { + QRegularExpression portRx(QLatin1String("port=(\\d+)")); + quint16 port = 5900; + for (const QString &arg : paramList) { + QRegularExpressionMatch match; + if (arg.contains(portRx, &match)) + port = match.captured(1).toInt(); + } + m_primaryScreen = new QVncScreen(paramList); - m_server = new QVncServer(m_primaryScreen); + m_server = new QVncServer(m_primaryScreen, port); m_primaryScreen->vncServer = m_server; } |