MCPcopy Create free account
hub / github.com/KDAB/GammaRay / SelectionModelClient

Method SelectionModelClient

client/selectionmodelclient.cpp:21–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19using namespace GammaRay;
20
21SelectionModelClient::SelectionModelClient(const QString &objectName, QAbstractItemModel *model,
22 QObject *parent)
23 : NetworkSelectionModel(objectName, model, parent)
24 , m_timer(new QTimer(this))
25{
26 m_timer->setSingleShot(true);
27 m_timer->setInterval(125);
28 Q_ASSERT(model);
29 // We do use a timer to group requests to avoid network overhead
30 auto startTimer = [this]() { m_timer->start(); };
31 connect(model, &QAbstractItemModel::modelAboutToBeReset, this, &SelectionModelClient::clearPendingSelection);
32 connect(model, &QAbstractItemModel::rowsInserted, m_timer, startTimer);
33 connect(model, &QAbstractItemModel::rowsMoved, m_timer, startTimer);
34 connect(model, &QAbstractItemModel::columnsInserted, m_timer, startTimer);
35 connect(model, &QAbstractItemModel::columnsMoved, m_timer, startTimer);
36 connect(model, &QAbstractItemModel::layoutChanged, m_timer, startTimer);
37 connect(m_timer, &QTimer::timeout, this, &SelectionModelClient::timeout);
38
39 m_myAddress = Client::instance()->objectAddress(objectName);
40 connect(Client::instance(), &Endpoint::objectRegistered,
41 this, &SelectionModelClient::serverRegistered);
42 connect(Client::instance(), &Endpoint::objectUnregistered,
43 this, &SelectionModelClient::serverUnregistered);
44 connectToServer();
45}
46
47SelectionModelClient::~SelectionModelClient()
48{

Callers

nothing calls this directly

Calls 2

objectAddressMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected