Results 1 to 2 of 2

Thread: Non-Reentrant method in overrided resizeEvent method problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2010
    Posts
    20
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Non-Reentrant method in overrided resizeEvent method problem

    I write a table class which can reload items after a resize event.

    But the the reloadControls() method is non-reentrant

    After i resize the table to a smaller size, two reloadControls() confilcts. The controls loaded twice,

    So ,how can i prevent this situation, Cos when you resize a window,resizeEvent are raised several times.

    Qt Code:
    1. class ClientTableWidget(QtGui.QTableWidget):
    2.  
    3. def resizeEvent(self,event):
    4. if self.rowCount()!=0:
    5. self.reloadControls()
    6. QtGui.QTableWidget.resizeEvent(self, event)
    7.  
    8. def reloadControls(self):
    9. self.clear()
    10. if self.rowCount()==0:
    11. for key in self.c_dict:
    12. self.addItem( self.c_dict[key])
    To copy to clipboard, switch view to plain text mode 
    sample images:
    after loading

    after enlarging the window size, items' number did not change, there is no conflict

    but when i resize the window to a smaller size, items loaded twice :
    Last edited by vertusd; 25th November 2010 at 10:17.

Similar Threads

  1. resizeEvent help pls
    By munna in forum Newbie
    Replies: 10
    Last Post: 9th July 2010, 08:38
  2. hook resizeEvent
    By prashant in forum Qt Programming
    Replies: 6
    Last Post: 7th September 2009, 11:35
  3. What cannot be done in resizeEvent(..)?
    By nifei in forum Qt Programming
    Replies: 2
    Last Post: 29th December 2008, 02:48
  4. Reimplement of resizeEvent
    By Shawn in forum Qt Programming
    Replies: 20
    Last Post: 27th May 2007, 10:04
  5. Question about resizeEvent
    By SkripT in forum Qt Programming
    Replies: 1
    Last Post: 28th February 2006, 16:13

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.