@jdent said in what determines the order of the pushbuttons in a dialog?:
QDialogButtonBox* buttonBox = new QDialogButtonBox;
buttonBox->addButton(submitButton, QDialogButtonBox::AcceptRole);
buttonBox->addButton(revertButton, QDialogButtonBox::ResetRole);
buttonBox->addButton(closeButton, QDialogButtonBox::RejectRole);
The thing is, these roles make life easier, because they automatically accept or reject your dialog when being clicked. But like @JonB said, nobody forces you to use a QDialogButtonBox in your dialog. It's nice to have, but if you don't like the OS default order (on some OS "OK" is left and "Cancel" right and on some it's reversed), you can put them in a regular layout and manually handle the accept() / reject() states.