Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qdbusviewer.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef QDBUSVIEWER_H
5#define QDBUSVIEWER_H
6
7#include <QtWidgets/QWidget>
8#include <QtDBus/QDBusConnection>
9#include <QtCore/QRegularExpression>
10
12
14QT_FORWARD_DECLARE_CLASS(QTreeView)
15QT_FORWARD_DECLARE_CLASS(QTreeWidget)
16QT_FORWARD_DECLARE_CLASS(QStringListModel)
17QT_FORWARD_DECLARE_CLASS(QLineEdit)
18QT_FORWARD_DECLARE_CLASS(QTextBrowser)
19QT_FORWARD_DECLARE_CLASS(QDomDocument)
20QT_FORWARD_DECLARE_CLASS(QDomElement)
21QT_FORWARD_DECLARE_CLASS(QSplitter)
22QT_FORWARD_DECLARE_CLASS(QSettings)
23
24struct BusSignature
25{
26 QString mService, mPath, mInterface, mName;
27 QString mTypeSig;
28};
29
30class QDBusViewer: public QWidget
31{
33public:
35
36 void saveState(QSettings *settings) const;
37 void restoreState(const QSettings *settings);
38
39public slots:
40 void refresh();
41
42private slots:
43 void serviceChanged(const QModelIndex &index);
44 void showContextMenu(const QPoint &);
45 void connectionRequested(const BusSignature &sig);
46 void callMethod(const BusSignature &sig);
47 void getProperty(const BusSignature &sig);
48 void setProperty(const BusSignature &sig);
49 void dumpMessage(const QDBusMessage &msg);
50 void dumpError(const QDBusError &error);
51 void refreshChildren();
52
53 void serviceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
54
55 void serviceFilterReturnPressed();
56 void activate(const QModelIndex &item);
57
58 void logError(const QString &msg);
59 void anchorClicked(const QUrl &url);
60
61private:
62 void serviceRegistered(const QString &service);
63 void logMessage(const QString &msg);
64 void showEvent(QShowEvent *) override;
65 bool eventFilter(QObject *obj, QEvent *event) override;
66
67 QDBusConnection c;
68 QString currentService;
69 QTreeView *tree;
70 QAction *refreshAction;
71 QStringListModel *servicesModel;
72 ServicesProxyModel *servicesProxyModel;
73 QLineEdit *serviceFilterLine;
74 QTableView *servicesView;
75 QTextBrowser *log;
76 QSplitter *topSplitter;
77 QSplitter *splitter;
78 QRegularExpression objectPathRegExp;
79};
80
81#endif
~MainWindow() override
void addCustomBusTab(const QString &bus)
MainWindow(QWidget *parent=nullptr)
bool eventFilter(QObject *obj, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
void saveState(QSettings *settings) const
void restoreState(const QSettings *settings)
void showEvent(QShowEvent *) override
This event handler can be reimplemented in a subclass to receive widget show events which are passed ...
The QTableView class provides a default model/view implementation of a table view.
Definition qtableview.h:18
static QString sessionTabGroup()
static QString systemTabGroup()
static QString windowGeometryKey()