7

I need Qt Dialog with ok and cancel buttons with standard functionality, placed on the right side of its layout. I need to inherit from it and add other widgets to its layout. I can implement it myself, but maybe there is something standard, in that case I prefer to use it, since it will be more portable.

QMessageBox shows a message, I need something more general, only QDialog and standard buttons, or maybe QDialog has an option which activates them.

ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97
Ashot
  • 10,807
  • 14
  • 66
  • 117
  • QMessageBox is a QDialog with "OK" and "Cancel" buttons already in it. I've never tried to subclass it, though. It may point you in the right direction. – Tyler Jandreau Jun 19 '13 at 12:29
  • QMessageBox shows a message, I need something more general, only QDialog and standart buttons, or maybe QDialog has an option which activates them – Ashot Jun 19 '13 at 12:30

2 Answers2

12

Subclass QDialog and use a QDialogButtonBox for the standard buttons (docs).

Smar
  • 8,109
  • 3
  • 36
  • 48
cmannett85
  • 21,725
  • 8
  • 76
  • 119
0

In case you use QT Designer, learnpyqt.com has this nice tutorial in which they describe how to build a QDialog with multiple input fields. QT Designer can be downloaded as described here on stackoverflow in a comment.

subjord
  • 109
  • 1
  • 10