Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Simple 2d graphics using qt
Forum Updated to NodeBB v4.3 + New Features

Simple 2d graphics using qt

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 3.2k 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.
  • S Offline
    S Offline
    sweety
    wrote on last edited by
    #1

    hello,i m quite new to qt.I m developing a project which is supposed to display vector image in a visualizer..the project contains visualizer class inherited from QMainWindow.
    Main.cpp creates visualizer object "visualizer w and w.show"
    visualizer.ui contains a menubar,toolbar,Qtreeview and QtabWidget.
    I have another vecImg class that reads vector file and stores points,lines n polygon info. I want to display the info of vecImg class in
    QTabWidget of the ui.
    main.cpp calls visualizer which in turn invokes vecImg.cpp

    I tried inheriting vecImg from QWidget and override paintEvent to draw lines on tabWidget but that didn't work.

    What should I do to draw vecImg containing info on QTabWidget of the visualizer.ui?

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

      Maybe "this":http://developer.qt.nokia.com/doc/qt-4.8/qgraphicspolygonitem.html is (QGraphicsPolygonItem) what you are looking for.
      There is also an example "Diagram Scene Example" in Qt Creator on how to use it.
      Hope it helps.

      Regards,
      Jake


      Code is poetry

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sweety
        wrote on last edited by
        #3

        Hey thanks,QGraphicScene class helped me!
        its working !

        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