Results 1 to 2 of 2

Thread: Problem with MyGraphicsView->winId()

  1. #1

    Default Problem with MyGraphicsView->winId()

    Hi,
    I have a gui program with a QGraphicsView and other widgets, and with a timer (1 second) that updates the graphical interface.

    I need to use old libraries to draw some graphics in my QGraphicsView so I need to obtain the Display and Window Handle to pass to xlib libraries. So I do the following:

    Display *d = QX11Info::display();
    WId w = ui->graphicsView->winId();

    The problem is that when I call the function winId, my QGraphicsView stops repainting (but not updating because I see changes when I minimize and maximize again my application). If I comment this line (the second one) my Graphical interface works as expected.

    I'm not new in programming but I don't understand this behavior.

    Thanks for your help.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem with MyGraphicsView->winId()

    Can you try getting the winId of the view's "viewport" widget?

    Cheers,
    _

Similar Threads

  1. Get the winId from a QProcess
    By Zioza in forum Qt Programming
    Replies: 2
    Last Post: 1st August 2013, 12:33
  2. About FramelessWindowHint and winId
    By Wong in forum Qt Programming
    Replies: 2
    Last Post: 19th May 2011, 08:19
  3. winId() crashed
    By nedivi in forum Qt Programming
    Replies: 1
    Last Post: 6th March 2011, 23:03
  4. Can't get Widget from WinID()
    By abbapatris in forum Qt Programming
    Replies: 3
    Last Post: 9th July 2008, 17:25
  5. Problem with the QWidget::winId() method
    By yellowmat in forum Qt Programming
    Replies: 5
    Last Post: 22nd April 2008, 12:15

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.