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. No Canvas item (or anything else to visualize python figures) in Qt Creator
QtWS25 Last Chance

No Canvas item (or anything else to visualize python figures) in Qt Creator

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 2.2k Views
  • 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.
  • G Offline
    G Offline
    gbrown
    wrote on last edited by
    #1

    Dear all,

    I just transitioned to Qt5 and the new Qt Creator.

    On Qt4 and the old Qt Designer, there was a MatplotlibWidget, that I could use with python/pyQt to visualize my python generated figures.

    However, I can not find a way for this in the new Qt Creator. Most solutions I found to treat my problem needed a Canvas item, which is non-existent in my Qt Creator. Is this a Creator bug or am I doing something wrong?

    The only thing I wanna do: matplotlib.pyplot.imshow(someData) and see this in mt Qt Window.

    Best regards,

    gbrown

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

      Hi and welcome to devnet,

      That's unrelated to Qt Creator.

      Do you meant that MatplotlibWidget ?

      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
      • G Offline
        G Offline
        gbrown
        wrote on last edited by
        #3

        Hi thanks for the quick answer!
        Sorry if it is unrelated to Qt Creator, but at least IN the old Qt Designer, there already was this MatplotlibWidget that I could just drag and drop. This was then a part of the saved .ui file.

        I am not sure how this would work with the link you provided. It seems like something, that I would create within the python code and not in the Qt Creator?

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

          The link from my question was to know whether it was what you were using.

          As for your old setup, you likely had a package installed that provided a Qt Designer plugin for that widget. So if you still have it around, I'd start by checking what packages you had installed that provided that and see if it still available for your more recent setup.

          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
          • G Offline
            G Offline
            gbrown
            wrote on last edited by
            #5

            Ah I see. Unfortunately, in the old setup, we used a huge collection of packages, called python(x,y), which delivers the Qt Designer already with a MatplotlibWidget. I don't know, where I would find the exact files needed for this and I also cannot tell, if the linked class is the one, that has been used.

            I have also tried to copy the corresponding matplotlibwidget.py files into the Qt plugins directory... however, I still don't see any item in the Qt Creator, that I can use to plot my figures into : (

            I would also be glad about any other approach, how to plot my python figures with anything provided by the Qt Creator itself.

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

              Qt Designer (and Qt Creator for that matter) plugins are written in C++ not python.

              Again, it's not a Qt Creator issue. Qt Creator is only an IDE. That package you were using provided a plugin that allowed to integrate its stuff more easily.

              Since you already know the class you want to use, you can still build your UI although with a bit more manual code.

              Again, I'd recommend checking whether that collection of package still is available.

              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
              • G Offline
                G Offline
                gbrown
                wrote on last edited by
                #7

                Alright, thanks for the help. I guess, there is no way around some manual code for the UI.

                Thanks!

                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