Results 1 to 5 of 5

Thread: How to know when the server has completed the painting of the widget...??

  1. #1
    Join Date
    Oct 2009
    Posts
    66
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Question How to know when the server has completed the painting of the widget...??

    Hi,
    I am doing a show on a particular widget, how can i come to know that the server has finished the painting of the widget and the widget is shown in the Ui. Does qt provide some flag or signal which tells me that the widget drawing is complete and the widget is shown...???


    regards,
    sudhish

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: How to know when the server has completed the painting of the widget...??

    You can play around with -sync
    See http://qt.nokia.com/doc/4.6/qapplica...l#QApplication
    It's nice to be important but it's more important to be nice.

  3. #3
    Join Date
    Apr 2010
    Location
    Bangalore
    Posts
    24
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: How to know when the server has completed the painting of the widget...??

    Hi,

    You can override paintEvent method for the widget and declare a signal that emits a string which basically shows whether paint on the widget is finished or not?

    your app.h

    protected:
    void paintEvent(QPaintEvent *e);

    signal:

    void catchevent(QString const);

    your app.cpp

    void widget:aintEvent(QPaintEvent *e)
    {

    emit catchEvent("paintEvent");

    }

    in main.cpp

    you can use a TextEdit and append those events.

    QTextEdit textedit;
    connect(&widget,SIGNAL(catchEvent(QString)),&texte dit,SLOT(append(QString)));

    widget.show();
    textedit.show();

    you could actually appreciate the process you are interestered in.

  4. #4
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: How to know when the server has completed the painting of the widget...??

    The problem with this approach is that for example on X11 the QPainter calls return although painting is not yet finished. This is because X11 does asynchronous painting by default.

  5. #5
    Join Date
    Oct 2009
    Posts
    66
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How to know when the server has completed the painting of the widget...??

    That's true as the paintEvent returns placing the request to the server, moreover i dont want to do this on each and every paint event, i just want to know as to when the widget painting was done or widget was completely shown on the screen.

    I tried using the events like
    Qt Code:
    1. QEvent::Show 17 Widget was shown on screen (QShowEvent).
    To copy to clipboard, switch view to plain text mode 
    but this also comes before widget is actually shown on the screen. Is there a signal or event by which i can know that the widget is finally shown on the screen??

Similar Threads

  1. Replies: 5
    Last Post: 19th March 2010, 19:13
  2. Accelerate Widget Painting
    By jpujolf in forum Qt Programming
    Replies: 0
    Last Post: 23rd September 2008, 16:33
  3. Fast painting scrollable widget
    By bunjee in forum Qt Programming
    Replies: 20
    Last Post: 24th October 2007, 20:47
  4. painting a widget outside a paintEvent
    By jayw710 in forum Qt Programming
    Replies: 1
    Last Post: 26th June 2007, 00:18
  5. Painting outside widget geometry?
    By mbjerkne in forum Qt Programming
    Replies: 2
    Last Post: 8th February 2006, 15:59

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.