Ignore:
Timestamp:
01/25/13 11:00:53 (15 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Check if widget menu was constructed in changeEvent.

The event can fire before the init method completes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/application/canvasmain.py

    r11272 r11281  
    15071507        def changeEvent(self, event): 
    15081508            if event.type() == QEvent.WindowStateChange: 
    1509                 # Enable/disable window menu based on minimized state 
    1510                 self.window_menu.setEnabled(not self.isMinimized()) 
     1509                # Can get 'Qt.WindowNoState' before the widget is fully 
     1510                # initialized 
     1511                if hasattr(self, "window_state"): 
     1512                    # Enable/disable window menu based on minimized state 
     1513                    self.window_menu.setEnabled(not self.isMinimized()) 
     1514 
    15111515            QMainWindow.changeEvent(self, event) 
    15121516 
Note: See TracChangeset for help on using the changeset viewer.