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. [Solved] Graphic view to widget
Forum Updated to NodeBB v4.3 + New Features

[Solved] Graphic view to widget

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

    Hello.

    I have been learning Qt for some time now reading book C++ GUI Programming with Qt4. The book is exellent, but now I want to combine two different views. I have modified on examples of the book. Right side layout is QTextEdit and get it working.

    What I want to replace QTextEdit with (some) graphical view where let say Button 1 prints out line, Button 2 square etc. How should I make it?

    http://aijaa.com/2Fwhea

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jalomann
      wrote on last edited by
      #2

      I paste my code here.

      http://pastebin.com/DTqEmXDb

      I have tried to show grbox in the place of QTextEdit. If I run OvenTimer in it's own project it is running.

      1 Reply Last reply
      0
      • I Offline
        I Offline
        issam
        wrote on last edited by
        #3

        Hi,
        Do you mean you want to draw a diagram that contains circles and shapes graphics items ?

        http://www.iissam.com/

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jalomann
          wrote on last edited by
          #4

          Yes. Exactly. I want to draw let's say one simple square where the larger white box is in my widget. I think the object should be defined as QGraphicScene or so but I can't figure it out how.

          1 Reply Last reply
          0
          • I Offline
            I Offline
            issam
            wrote on last edited by
            #5

            Ok,
            There is a good example in your Qt installation directory : /usr/lib/qt4/examples/graphicsview/diagramscene/

            It's very helpful and simple :)

            "for more information":http://doc.qt.digia.com/4.7-snapshot/graphicsview-diagramscene.html

            http://www.iissam.com/

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Macro
              wrote on last edited by
              #6

              [quote author="issam" date="1351454122"]Ok,
              There is a good example in your Qt installation directory : /usr/lib/qt4/examples/graphicsview/diagramscene/

              It's very helpful and simple :)

              "for more information":http://doc.qt.digia.com/4.7-snapshot/graphicsview-diagramscene.html

              [/quote]

              Yeah.. This is a very good example and its very useful.... Thanks a lot...

              1 Reply Last reply
              0
              • R Offline
                R Offline
                romeo.rbw
                wrote on last edited by
                #7

                There is a video tutorial, may be helpful from VoidRealm in Youtube. When I make a scene, it was very helpful (tutorial 81, 82, and 83).

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  jalomann
                  wrote on last edited by
                  #8

                  Thank you for exellent links. I got it done. :)

                  http://aijaa.com/cPWcy8

                  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