Functions like getInt are static, which means they create an internal instance of QInputDialog which is not directly accessible from code. If you create your own instance of QInputDialog, you must do all the initialisation yourself and then call exec() (just like an ordinary dialog). As the documentation for QInputDialog shows, this approach is more flexible than using the static functions, since it provides much more scope for customisation.
A roughly equivalent implementation of getInt would be:
import sys
from PyQt5.QtWidgets import QApplication, QInputDialog
def int_value_changed(val):
print(val)
if QApplication.instance() is None:
qapp = QApplication(sys.argv)
def getInt(parent, title, label, value=0):
dlg = QInputDialog(parent)
dlg.setInputMode(QInputDialog.IntInput)
dlg.setWindowTitle(title)
dlg.setLabelText(label)
dlg.setIntValue(value)
dlg.intValueChanged.connect(int_value_changed)
accepted = dlg.exec_() == QInputDialog.Accepted
dlg.deleteLater()
return dlg.intValue(), accepted
print(getInt(None, 'Title', 'Type Value', 5))
# print(QInputDialog.getInt(None, 'title', 'Type Value', 5))