Results 1 to 4 of 4

Thread: How to update the components or repaint of a QMainWindow?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to update the components or repaint of a QMainWindow?

    You do not need to call either repaint() or update() in your example. Calling either function is unusual in a generic Qt program.

    The problem is that modify() is never called. You have connected the clicked() signal to the line edit's modify() slot... except it does not have one. The modify() function (is it declared a slot?) is a member of the Window class not the QLineEdit class. You should be seeing a warning message in the application output at run time because the connection cannot be made.
    Qt Code:
    1. connect(acep, SIGNAL(clicked()), this, SLOT(modify()));
    2. // or
    3. connect(acep, SIGNAL(clicked()), SLOT(modify()));
    To copy to clipboard, switch view to plain text mode 
    The repaint() call immediately redraws the widget it is called on. The update() call schedules a repaint() to occur some (short) time in the future when the program next returns to the event loop. Multiple calls to update() are generally merged into a single repaint of the widget at the appropriate time.

  2. The following user says thank you to ChrisW67 for this useful post:

    vitaR (18th March 2014)

Similar Threads

  1. repaint/update stops updating GUI
    By gokceng in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 28th November 2011, 14:35
  2. Replies: 4
    Last Post: 17th October 2010, 22:30
  3. Replies: 4
    Last Post: 10th June 2010, 21:25
  4. Replies: 5
    Last Post: 18th April 2007, 10:29
  5. Use of repaint/update
    By Placido Currò in forum Qt Programming
    Replies: 3
    Last Post: 3rd April 2007, 19:24

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.