You connect the button's clicked signal to the dialog's show (or exec) slot. documentation for signal and slots.