主要有两种:
So far we have used several convenience static functions from both QMessageBox and QFileDialog. These functions create a dialog, initialize it, and call exec() on it. It is also possible, although less convenient, to create a QMessageBox or a QFileDialog widget like any other widget and explicitly call exec(), or even show(), on it.
一是调用静态函数
一是基本的方法,用于自建的对话框(modal or modaless)