So I'm trying to build a config-setting dialog box for my application. I laid it out in QT Designer, like a lot of posts here recommended. It came out looking really nice. I generated the magic .py code using
pyuic5 -x joeconfig.ui -o ui_joeconfig.py
A magical set of loading lines gave me this as a variation on the normal starting routine:
from ui_joeconfig import Ui_Configuration
app = QApplication(sys.argv)
window = QMainWindow()
ui = Ui_Configuration()
ui.setupUi(window)
This setup allowed me to fill out all my interface labels and text boxes by prefacing their names with "ui.", like this:
ui.tvEdit.setText(cfg['mediadirs']['TV'])
ui.moviesEdit.setText(cfg['mediadirs']['Movies'])
ui.downloadEdit.setText(cfg['mediadirs']['Downloads'])
Now comes the dreaded "Close Dialog" button.
This is going to be popped open from the main app, so it should only close itself, not quit the application. I've tried every combination of quit, close, and hide methods I could find. I've been working on this for hours, something that seems so trivial.
# ui.cancelButton.clicked.connect(AAAARGH)
# ^^^^^^^----- WTF goes here?
#
Can somebody help a fellow out? I'm going a bit nuts trying to solve this. There aren't too many PyQt5 examples out there, compared to PyQt4. And I'm useless when it comes to trying to read the original Qt5 C++ documentation.
Thanks in advance.