Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt D-bus Error , How to use Qt D-Bus under windows ?
Forum Updated to NodeBB v4.3 + New Features

Qt D-bus Error , How to use Qt D-Bus under windows ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 6 Posters 2.0k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alex42
    wrote on last edited by
    #1

    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](D1.PNG image url)
    ![alt text](D2.PNG 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

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Alex42
      wrote on last edited by
      #2

      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](D3.PNG image url)
      thank you in advance for your help

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Alex42
        wrote on last edited by
        #3

        work in progress ![alt text](D4.PNG image url)

        idlefrogI 1 Reply Last reply
        0
        • A Alex42

          work in progress ![alt text](D4.PNG image url)

          idlefrogI Offline
          idlefrogI Offline
          idlefrog
          wrote on last edited by
          #4

          @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.

          A 1 Reply Last reply
          0
          • M Offline
            M Offline
            mchinand
            wrote on last edited by
            #5

            Is there a reason why you want to use D-Bus on Windows?

            A 1 Reply Last reply
            0
            • M mchinand

              Is there a reason why you want to use D-Bus on Windows?

              A Offline
              A Offline
              Alex42
              wrote on last edited by
              #6

              @mchinand I let you take a look at my question in another topic,here
              https://forum.qt.io/topic/131878/how-to-use-signals-slots-to-make-inter-process-communication-in-qt

              1 Reply Last reply
              1
              • idlefrogI idlefrog

                @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.

                A Offline
                A Offline
                Alex42
                wrote on last edited by
                #7

                @idlefrog yes i tried it, but i don't found more explanation about to run dbus-daemon on windows

                artwawA 1 Reply Last reply
                0
                • A Alex42

                  @idlefrog yes i tried it, but i don't found more explanation about to run dbus-daemon on windows

                  artwawA Offline
                  artwawA Offline
                  artwaw
                  wrote on last edited by
                  #8

                  @Alex42 I strongly believe you'd have it done faster by setting up interprocess communication using TCP socket. But then again, it is Windows, so who knows.

                  For more information please re-read.

                  Kind Regards,
                  Artur

                  M 1 Reply Last reply
                  1
                  • artwawA artwaw

                    @Alex42 I strongly believe you'd have it done faster by setting up interprocess communication using TCP socket. But then again, it is Windows, so who knows.

                    M Offline
                    M Offline
                    mchinand
                    wrote on last edited by
                    #9

                    I agree with @artwaw. Check out the fortune example client and server.

                    A 1 Reply Last reply
                    0
                    • M mchinand

                      I agree with @artwaw. Check out the fortune example client and server.

                      A Offline
                      A Offline
                      Alex42
                      wrote on last edited by
                      #10

                      @mchinand, As you see, the problem it's not in the TCP/IP ( local server / socket ,shared memory ,QProcess class, QT Network ) , the problem it's how to run d-bus daemon on the windows , ( or how to use Qt D-Bus under Windows )

                      jsulmJ 1 Reply Last reply
                      0
                      • A Alex42

                        @mchinand, As you see, the problem it's not in the TCP/IP ( local server / socket ,shared memory ,QProcess class, QT Network ) , the problem it's how to run d-bus daemon on the windows , ( or how to use Qt D-Bus under Windows )

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        @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.

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • sierdzioS Offline
                          sierdzioS Offline
                          sierdzio
                          Moderators
                          wrote on last edited by
                          #12

                          @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.

                          (Z(:^

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved