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. Using glib in Qt meet problem.
Forum Updated to NodeBB v4.3 + New Features

Using glib in Qt meet problem.

Scheduled Pinned Locked Moved General and Desktop
7 Posts 6 Posters 4.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.
  • X Offline
    X Offline
    xhsoldier
    wrote on last edited by
    #1

    I have compiled the http://gupnp.org/ source code, gupnp, gupnp-av successfully without using Qt
    Then I port gupnp-tools to QT, and it will link gupnp and gupnp-av, but meet a problem.

    The gupnp is based on GObject, and It will use the GDBusInterfaceInfo class which is declared as below:
    struct _GDBusInterfaceInfo
    {
    ...
    GDBusSignalInfo **signals;
    ...
    }
    Here is the conflict with Qt signals, thus compile failed.

    any ideas?

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

      maybe wrapping gupnp class/structs/objects definitions into separate namespace will make a trick?!

      God is Real unless explicitly declared as Integer.

      1 Reply Last reply
      0
      • X Offline
        X Offline
        xhsoldier
        wrote on last edited by
        #3

        fix it:
        using
        #define QT_NO_KEYWORDS
        in every file where you have that problem.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          Since you have a solution, please mark your post with [Solved] .

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          0
          • X xhsoldier

            I have compiled the http://gupnp.org/ source code, gupnp, gupnp-av successfully without using Qt
            Then I port gupnp-tools to QT, and it will link gupnp and gupnp-av, but meet a problem.

            The gupnp is based on GObject, and It will use the GDBusInterfaceInfo class which is declared as below:
            struct _GDBusInterfaceInfo
            {
            ...
            GDBusSignalInfo **signals;
            ...
            }
            Here is the conflict with Qt signals, thus compile failed.

            any ideas?

            A Offline
            A Offline
            a.butirsky
            wrote on last edited by
            #5

            Hi @xhsoldier , could you share your port of gupnp-tools to QT please?

            1 Reply Last reply
            0
            • X Offline
              X Offline
              xinghai
              wrote on last edited by
              #6

              add CONFIG += no_keywords in your *.pro
              all uses of the macros have to be replace by Q_xxx

              1 Reply Last reply
              0
              • H Offline
                H Offline
                homocogitum
                wrote on last edited by
                #7

                I have found better and more convenient solution.
                You should do only one thing - include your glib headers before Qt headers - so it's unaffected by Qt defines.
                Using this approach, you don't need to change macro names and anything else.

                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