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. Multiple QGraphicsScene's view by one QGraphicsView's ?

Multiple QGraphicsScene's view by one QGraphicsView's ?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.1k 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.
  • U Offline
    U Offline
    uberMaximus
    wrote on last edited by
    #1

    Is this even possible?

    I am trying to put multiple QGraphicsScene's into a widget, and then have tab bars along the top as a QTabBar.
    The changing of the tabs in the QTabBar, trigger the single QGraphicsView to .setScene() to other QGraphicsScene's.

    The problem I am having is that I get:

    RuntimeError: 'init' method of object's base class (SubClassed_QGraphicsScene) not called.

    Does anyone have any suggestions?

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

      Hi and welcome to devnet,

      Can you show the code that triggers this ?

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

      1 Reply Last reply
      1
      • U Offline
        U Offline
        uberMaximus
        wrote on last edited by
        #3

        Ah, your question has solved my answer I think.

        They are basically being garbage collected before I get a chance to use them, as I am just creating them as instances without a QObject parent.

        I will try that and see how I go.

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

          Do you mean you are allocating them on the stack ?

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

          1 Reply Last reply
          0
          • U Offline
            U Offline
            uberMaximus
            wrote on last edited by
            #5

            No, I had a get method that created a copy then returned it, and therefore the original object no longer existed.

            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