Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QPixmap::grabWidget failure

QPixmap::grabWidget failure

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 2 Posters 4.1k 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.
  • D Offline
    D Offline
    DonSev
    wrote on last edited by
    #1

    Hi Guys,
    I'm working on to an application, and I want to used QPixmap::grabWidget function to save a pixmap of my widget. The build is well, but I have an error when I run the application:
    @ASSERT failure in QGLPainter: "begin() has not been called or it failed", file painting/qglpainter.cpp, line 770@
    This is a part of my code:
    @ QPixmap originalPixmap0 = QPixmap();

    // originalPixmap = QPixmap::grabWindow(My_Widget->winId());
    originalPixmap0 = QPixmap::grabWidget(My_Widget);@
    If I use the grabWindows, it's work well. But I want to use grabWidget to hide my widget and still have it on my Pixmap.

    Does anyone can help me to found where is came from?
    Thank you
    Don

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      I'm not sure gradWidget works with an openGL widget at all...

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DonSev
        wrote on last edited by
        #3

        Thanks for the reply.
        Thereby, from what you said, I can not use grabWidget, and I have to used grabWindow. But, it is not possible to get a pixmap from an hidden Qwidget with grabWindow, is it?
        What I want to do is some like:
        @My_Widget->hide();
        ...
        QPixmap originalPixmap0 = QPixmap();
        originalPixmap = QPixmap::grabWindow(My_Widget->winId());@
        Using that way, I want to have a Pixmap of my widget, without displayed it on the screen. I have tried this, and the saved QPixmap was a screenshoot of my desktop, not an image of my widget.

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

          I said that I doubt that it works, not that I'm sure it does not work. It would the first thing I'd look into to find the cause of your issue.

          I don't know if there are ways to render openGL into a pixmap without it being displayed on screen.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            DonSev
            wrote on last edited by
            #5

            Thanks for your answer. I gonna have a look on this. And I hope to find a way to do this.

            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