<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[NetworkManager StatusChanged D-Bus signal not being received.]]></title><description><![CDATA[<p dir="auto">I'm trying to put together some code to check the NetworkManager status. The final goal is to run this on an embedded system, but for testing I am running this on Ubuntu 24, where I think it should be working.</p>
<p dir="auto">I am trying to connect to the StateChanged D-Bus signal, with the following code :-</p>
<pre><code>const QString s_NMService( "org.freedesktop.NetworkManager" );
const QString s_NMObjectPath( "/org/freedesktop/NetworkManager" );
const QString s_NMInterface( "org.freedesktop.NetworkManager" );

CNetworkManager::CNetworkManager(QObject *parent)
		: QObject(parent),
//QDBusInterface's constructor makes a non-obvious blocking call to introspect the D-Bus service
		m_NM( s_NMService, s_NMObjectPath, s_NMInterface, QDBusConnection::systemBus() )
{
	const QVariant VarState( m_NM.property( "State" )  );
	m_NMState = static_cast&lt;ENMState&gt;( VarState.toUInt() );

	m_bWasConnected = QDBusConnection::systemBus().connect(
						s_NMService, s_NMObjectPath, s_NMInterface,
						"StateChanged", "(u)",
						this, SLOT(SetNMState(uint)) );
	m_Connect = connect( &amp;m_NM, SIGNAL(StateChanged(uint)), this, SLOT(SetNMState(uint)) );

</code></pre>
<p dir="auto">However, my debugger tells me that, although the State is correctly fetched initially, the slot function is not called (it should be called twice, of course, since I tried to connect in 2 different ways).</p>
<p dir="auto">I have noticed <a href="https://forum.qt.io/topic/5817/d-bus-signals-cause-segmentation-faults">this</a> so in some sense I am in a better situation ;-)</p>
<p dir="auto">Clearly networkmanager is not the problem :-</p>
<pre><code>~$ nmcli monitor 
NetworkManager is running
enp0s3: deactivating
enp0s3: disconnected
There's no primary connection
Networkmanager is now in the 'connected (local only)' state
Connectivity is now 'limited'
enp0s3: using connection 'netplan-enp0s3'
enp0s3: connecting (prepare)
Networkmanager is now in the 'connecting' state
enp0s3: connecting (configuring)
enp0s3: connecting (getting IP configuration)
'netplan-enp0s3' is now the primary connection
enp0s3: connecting (checking IP connectivity)
enp0s3: connecting (starting secondary connections)
enp0s3: connected
Networkmanager is now in the 'connected (site only)' state
Networkmanager is now in the 'connected' state
Connectivity is now 'full'
</code></pre>
<p dir="auto">I've checked the names and variable types using D-Feet.</p>
<p dir="auto">I also tried running with sudo privileges.</p>
<p dir="auto">Now I've run out of ideas.</p>
<p dir="auto">Qt v6.8.3</p>
<p dir="auto">If anyone with experience can spot my mistake, it would be appreciated, otherwise I will have to revert to the ugly polling option.</p>
<p dir="auto">TIA</p>
<p dir="auto">Tim</p>
]]></description><link>https://forum.qt.io/topic/164737/networkmanager-statuschanged-d-bus-signal-not-being-received.</link><generator>RSS for Node</generator><lastBuildDate>Thu, 25 Jun 2026 23:24:57 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164737.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 01 Jun 2026 12:07:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to NetworkManager StatusChanged D-Bus signal not being received. on Mon, 01 Jun 2026 12:52:46 GMT]]></title><description><![CDATA[<p dir="auto">Or, more likely it was the dumb mistake of doing a quick hack for testing, which deleted my test object...</p>
]]></description><link>https://forum.qt.io/post/838499</link><guid isPermaLink="true">https://forum.qt.io/post/838499</guid><dc:creator><![CDATA[Vaquita Tim]]></dc:creator><pubDate>Mon, 01 Jun 2026 12:52:46 GMT</pubDate></item><item><title><![CDATA[Reply to NetworkManager StatusChanged D-Bus signal not being received. on Mon, 01 Jun 2026 12:37:37 GMT]]></title><description><![CDATA[<p dir="auto">I will check to see if it's due to <a href="https://qt-project.atlassian.net/browse/QTBUG-135928" target="_blank" rel="noopener noreferrer nofollow ugc">this bug</a></p>
]]></description><link>https://forum.qt.io/post/838496</link><guid isPermaLink="true">https://forum.qt.io/post/838496</guid><dc:creator><![CDATA[Vaquita Tim]]></dc:creator><pubDate>Mon, 01 Jun 2026 12:37:37 GMT</pubDate></item></channel></rss>