Results 1 to 5 of 5

Thread: QWidget item in QGraphicsScene

  1. #1
    Join Date
    Oct 2006
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QWidget item in QGraphicsScene

    Can I use my widgets to show in QGraphicsScene? Thank you very much.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QWidget item in QGraphicsScene

    Not directly. You might mimic the looks, but not the behaviour. Why do you want to have widgets there?

  3. #3
    Join Date
    Oct 2006
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWidget item in QGraphicsScene

    I am going to model the chemical processes. And I am going to plot function using Qwt. These plots must place with other primitives on QGraphicsScene.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QWidget item in QGraphicsScene

    Qwt is basically tightly coupled with widgets. You can create a plot as a widget, show it on the screen, grab its contents using QWidget::grabWidget(), hide the widget and use the pixmap created to render it onto a graphics item. It will be quite slow though, so if you want to have something close to real-time updates, I suggest you implement your own plotting as a graphics item directly, especially that you'll be able to use many features it has and which are not handled by Qwt (like the level of detail).

  5. The following user says thank you to wysota for this useful post:

    IUnknown (27th October 2006)

  6. #5
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWidget item in QGraphicsScene

    Curves, spectrograms, markers .. are QwtPlotItems - no widgets. I´m pretty sure that it wouldn't be very difficult to embedd them in a QGraphicsItem.

    But maybe it´s enough to implement the chemical primitives as QwtPlotItems, painting them on the QwtPlot canvas. I wouldn´t expect much difference in writing the painting code for a new type of QwtPlotItem compared to writing it for a QGraphicsItem.

    QGV and Qwt are both frameworks for graphic primitives. But without a deeper knowledge about the requirements of an application it is hard to recommend which one should be used.

    Uwe

    @wysota: sometimes not answering is the better idea.

Similar Threads

  1. Transparent QWidget on QGLWidget
    By showhand in forum Qt Programming
    Replies: 2
    Last Post: 27th November 2006, 01:00
  2. QTableWidget item checkable and combo?
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 10th October 2006, 07:12
  3. Replies: 1
    Last Post: 2nd May 2006, 21:11
  4. what item QCanvasItemList is holding..
    By Kapil in forum Newbie
    Replies: 17
    Last Post: 25th April 2006, 14:57
  5. how change the QListBox item position by pixel
    By roy_skyx in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2006, 01:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.