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. QObject / QWidget to QJsonObject
Forum Updated to NodeBB v4.3 + New Features

QObject / QWidget to QJsonObject

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 448 Views 2 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.
  • SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by
    #1

    Is there any built in function that will create a JSON version of a passed object which has been derived from QObject or QWidget?

    Kind Regards,
    Sy

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      No, how should this work?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by SPlatten
        #3

        What I'm looking for is a way of representing any object in a JSON fashion, ideally recursively drilling down into members and repeating the process for example:

        {"geometry":{"x":0, "y":0, "width":100, "height":100},
        ...
        }
        

        If one doesn't already exist then I will write it.

        Kind Regards,
        Sy

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          No there's not. You'll have to write it yourself.

          IIRC, there was a thread about that in the Python sub forum.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          SPlattenS 1 Reply Last reply
          1
          • SGaistS SGaist

            Hi,

            No there's not. You'll have to write it yourself.

            IIRC, there was a thread about that in the Python sub forum.

            SPlattenS Offline
            SPlattenS Offline
            SPlatten
            wrote on last edited by
            #5

            @SGaist , thank you, its now on my list of things to do.

            Kind Regards,
            Sy

            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