The QDialogButtonBox widget automatically reorders it's buttons to meet the expectations of users on different platforms. I'd like to follow this behavior, but with my own button labels (e.g. 'Import' instead of 'OK'). How can I achieve this? Is it possible to use QMessageBox, or do I need to write my own implementation? I'm writing my application with PyQt4, and Qt Designer.
See screenshot below of QDialogButtonBox on OS X in Aqua and Cleanlooks styles.
QDialogButtonBox
can do this for you, but you will need to create a dialog to put one in first (a trivial amount of work).The docs are here (it's C++, but I'm sure can follow it), the general idea is that
ButtonRole
is used by the current style layout to rearrange the buttons.