Showing posts with label default parameter value. Show all posts
Showing posts with label default parameter value. Show all posts

Sunday, June 3, 2018

Qt default parameter value

What is the proper place for the default value of a parameter ? Just in function definition, or declaration, or both places? Qt code has plenty of methods using this approach i.e. QDialog::QDialog(QWidget * parent = 0, Qt::WindowFlags f = 0) so what if you're defining a new method and need a similar behavior?