summaryrefslogtreecommitdiffstats
path: root/examples/network/dnslookup/dnslookup.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-03-11 09:35:35 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-15 10:44:41 +0100
commit51e5378113ac185ce9b3f64417416243050f6335 (patch)
treed99bbe1bf9f5c8359282b5aa6ce242a1a426e499 /examples/network/dnslookup/dnslookup.h
parent00fe7bd975be844a63d688a12d10a2e9611baf4a (diff)
Use QCommandLineParser in example dnslookup.
Show how use QCommandLineParser with additional parameter checking for custom options and positional arguments. Also explain how to display help in GUI applications. Change-Id: I03513e09b7dd5b150259593da0af2ef2a281cab2 Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'examples/network/dnslookup/dnslookup.h')
-rw-r--r--examples/network/dnslookup/dnslookup.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/examples/network/dnslookup/dnslookup.h b/examples/network/dnslookup/dnslookup.h
index d76756bad0..4d0232be8a 100644
--- a/examples/network/dnslookup/dnslookup.h
+++ b/examples/network/dnslookup/dnslookup.h
@@ -38,11 +38,21 @@
**
****************************************************************************/
-#include <QObject>
+#include <QDnsLookup>
+#include <QHostAddress>
-QT_BEGIN_NAMESPACE
-class QDnsLookup;
-QT_END_NAMESPACE
+//! [0]
+
+struct DnsQuery
+{
+ DnsQuery() : type(QDnsLookup::A) {}
+
+ QDnsLookup::Type type;
+ QHostAddress nameServer;
+ QString name;
+};
+
+//! [0]
class DnsManager : public QObject
{
@@ -50,6 +60,7 @@ class DnsManager : public QObject
public:
DnsManager();
+ void setQuery(const DnsQuery &q) { query = q; }
public slots:
void execute();
@@ -57,5 +68,6 @@ public slots:
private:
QDnsLookup *dns;
+ DnsQuery query;
};