Qt D-bus Error , How to use Qt D-Bus under windows ?
-
Hello everyone,
I'm trying to run a Qt d-bus example (chat) on Windows. It compiles fine but I still getting this error below.
Cannot connect to the D-Bus session bus.
Please check your system settings and try again.
QEventDispatcherWin32::wakeUp: Failed to post a message (Handle de fenêtre non valide.)I installed D-Bus on Windows through a ready made installer found in Google archives
https://code.google.com/archive/p/dbus-windows-installer/downloads
unfortunately I still getting the same error,
![alt text]( image url)
![alt text]( image url)maybe someone can give me idea ,how to use Qt D-bus on windows ?
Or how to run dbus-daemon under windows ?thank you very much for your help
-
For more information , After reviewed this answer :
https://stackoverflow.com/questions/34342061/specify-dbus-session-address-on-windows
i still can't set up it under my Machine, i obtain this error:
![alt text]( image url)
thank you in advance for your help -
@Alex42 Have you tried this windows dbus port from freedesktop.org?
Never tried it. Might be better than that archived dbus code you found on google. -
@Alex42 said in Qt D-bus Error , How to use Qt D-Bus under windows ?:
the problem it's how to run d-bus daemon on the windows , ( or how to use Qt D-Bus under Windows )
This is outside of Qt. I suggest you also search on the Internet.
-
@Alex42 said in Qt D-bus Error , How to use Qt D-Bus under windows ?:
how to use Qt D-bus on windows ?
In your main.cpp, before any other Qt code, paste this:
int main(int argc, char *argv[]) { #ifdef Q_OS_WINDOWS // This variable comes from dbus-env.bat qputenv("DBUS_SESSION_BUS_ADDRESS", "autolaunch:"); #endif
If you also have all the DBus files, DLLs etc. in the same directory as your .exe, it will work.