What is the difference between these two methods? Both display window ...
 QWidget::exec() and QWidget::show()
 QWidget::exec() and QWidget::show()
		What is the difference between these two methods? Both display window ...
Qt 5.3 Opensource & Creator 3.1.2
 Expert
					
					
						Expert
					
					
                                        
					
						
							
								 
							
						
					
					
						 
    
    
    
    
    
    
   
    
    
       
    
    
    
    
   Re: QWidget::exec() and QWidget::show()
 Re: QWidget::exec() and QWidget::show()
		exec() blocks the application flow while show() doesn't.
exec is mainly used for modal dialogs.
 Re: QWidget::exec() and QWidget::show()
 Re: QWidget::exec() and QWidget::show()
		So, then:
Qt Code:
To copy to clipboard, switch view to plain text mode
and
are identical?
Qt 5.3 Opensource & Creator 3.1.2
 Expert
					
					
						Expert
					
					
                                        
					
						
							
								 
							
						
					
					
						 
    
    
    
    
    
    
   
    
    
       
    
    
    
    
   Re: QWidget::exec() and QWidget::show()
 Re: QWidget::exec() and QWidget::show()
		Not really.
After calling show() the program flow will continue.
When you call exec() it will not return until you close the dialog.
BTW, exec is available only for QDialog.
Why don't you check the docs about exec and show? They explain it very well.
 Re: QWidget::exec() and QWidget::show()
 Re: QWidget::exec() and QWidget::show()
		Yes, I am checking now, but just final question. So show method initiates its own thread or not?
Qt 5.3 Opensource & Creator 3.1.2
 Re: QWidget::exec() and QWidget::show()
 Re: QWidget::exec() and QWidget::show()
		no it doesn't.
Actually as far as I understand, QDialog::exec() does not either - it just intervenes in the vent loop and does not allow new events to get in - but I didn't check QDialogs code, so I am not 100% sure about this.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
 Expert
					
					
						Expert
					
					
                                        
					
						
							
								 
							
						
					
					
						 
    
    
    
    
    
    
   
    
    
       
    
    
    
    
   Re: QWidget::exec() and QWidget::show()
 Re: QWidget::exec() and QWidget::show()
		No, you're right. No thread is started by QDialog::exec nor show(). That would make no sense. The event loop of the parent window is used to process the dialog events.
MarkoSan (19th October 2007)
Bookmarks