Results 1 to 2 of 2

Thread: Non-Reentrant method in overrided resizeEvent method problem

  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 11:17.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Non-Reentrant method in overrided resizeEvent method problem

    Two resize events cannot be processed at the same time so they cannot cause conflicts, this is not a reentrancy issue. The behaviour has to be caused by something else.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

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