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. Signaling a slot in a different application on a Symbian device
Forum Updated to NodeBB v4.3 + New Features

Signaling a slot in a different application on a Symbian device

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 3.6k Views 1 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.
  • M Offline
    M Offline
    mikelupo
    wrote on last edited by
    #1

    I don't think this could get more complicated. I have application (a) and application (b). Both QT applications resident (and running) on a Symbian device. From Application (a) I would like to signal a slot in application (b). Note: application (b) uses a namespace. It's also a flat .exe (no lib or dll)

    Is this even possible?
    if yes, do I need to include any .h files from application (b) inside of application (a) to get the object for application (b)'s slot?

    Thanks in advance,
    Mike

    Never pet your dog when it's on fire...

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      You cannot do this with standard Qt signal/slot or C++ method calls. You need some interprocess communication (IPC) protocol. There are some hints on the "Inter-Process Communication in Qt":http://doc.trolltech.com/stable/ipc.html page of the docs.

      Another approach (instead of TCP/IP) would be to use local sockets:
      "QLocalServer":http://doc.qt.nokia.com/stable/qlocalserver.html seems to be a good choice. Application a would create the server and application b would use a "QLocalSocket":http://doc.qt.nokia.com/stable/qlocalsocket.html to connect to the server. The server creates another local socket once a connection comes in. You must serialize your messages though. But as you use Qt on both ends, this is quite easy, you can put a QDataStream on top of both local sockets (they are QIODevice subclasses).

      http://www.catb.org/~esr/faqs/smart-questions.html

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

        You might also look into other solutions:

        • Qt supports DBUS, but I don't know if that works on Symbian. It is mainly a Linux thing.
        • The Qxt library has some RPC classes that may be of use. QxtRPCPeer might work for you. With some limitations, it will take care of all the (de)serialization for you.
        • QSharedMemory also comes to mind; though it is quite low level, it is a fast way to communicate between apps.
        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          QtDBUS is - according to the docs - only for the Unix ports. I'm not sure if the Symbian world counts i.

          I thought about QSharedMemory too, but it has no signalling mechanisms, so one would have watch the memory segment for state changes manually. On the other hand, the local sockets send signals when something comes in. It seemed the most easy to use approach to me.

          http://www.catb.org/~esr/faqs/smart-questions.html

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

            Sure, it all depends on what you want to achieve in the end. You could even combine the two approaches: signal through a local socket, and use the shared memory to actually move the data around. Might be more efficient for larger blobs of data.

            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