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. QGraphicsScene offscreen rendering
Forum Updated to NodeBB v4.3 + New Features

QGraphicsScene offscreen rendering

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

    Hi,

    I'm using a QGraphicsScene for the layout of various objects. This scene is basically rendered in a QGraphicsView but I would like to support also something like an offscreen rendering at this level (actually I want an accessible memory representation). The QGraphicsView has a setViewport method and I suspect that I should use it, but the method expects a QWidget where I would like to use something like a QPixmap (another QPaintDevice derived class). Is it the right direction? or not... Any solution would be appreciated.
    I'm a bit confused by the number of classes and the lack of concise synthetic view of the class hierarchy.
    By the way, is there any graphic class hierarchy chart for the 4.7 version ? (I've found one but for QT 3.2).

    1 Reply Last reply
    0
    • ? This user is from outside of this forum
      ? This user is from outside of this forum
      Guest
      wrote on last edited by
      #2

      You might not need setViewPort here. One could set multiple views to a single scene.

      You can accomplish your off screen functionality by using fitInView (to show only the rect that you are interested in) and by setting the scrollbar policies to be off

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fober
        wrote on last edited by
        #3

        [quote author="chetankjain" date="1291049448"]You might not need setViewPort here. One could set multiple views to a single scene.[/quote]

        I know that I can get multiple views but I want to switch between a standard view and an offscreen view.

        [quote author="chetankjain" date="1291049448"]You can accomplish your off screen functionality by using fitInView (to show only the rect that you are interested in)
        [/quote]

        that's already how the view works.

        Maybe I should explain more what I want to do: actually I've developed a viewer using Qt which main services are implemented in a shared library built using Qt for the graphic part. I want to make these services available in Java thru a JNI library. Since only the graphic result is important, my idea is to draw offscreen and to copy the resulting bitmap to the java environment. Thus the final graphics destination could be a standard QGraphicsView in case of a Qt application or a memory bitmap in case of Java.
        (Sorry, maybe I should have started with these explanations)

        If you want to know more about the viewer, see the "INScore project":http://inscore.sourceforge.net

        1 Reply Last reply
        0
        • A Offline
          A Offline
          alexander
          wrote on last edited by
          #4

          try next functions:

          @void QGraphicsView::render (...)
          void QGraphicsScene::render(...)@

          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