From 0b8e11bd3f39d15873133711aabe190f47b98fa1 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Mon, 5 Nov 2007 23:12:08 +0000 Subject: [PATCH] Qt4 - make GNOME and KDE people happy. --- .../gui/qt4/components/preferences_widgets.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp index 4a5058bb88..f488406fa7 100644 --- a/modules/gui/qt4/components/preferences_widgets.cpp +++ b/modules/gui/qt4/components/preferences_widgets.cpp @@ -45,6 +45,7 @@ #include #include #include +#include QString formatTooltip(const QString & tooltip) { @@ -1120,6 +1121,7 @@ KeyInputDialog::KeyInputDialog( QList& _values, values = _values; conflicts = false; keyToChange = _keyToChange; + setWindowTitle( qtr( "Hotkey for " ) + qfu( keyToChange) ); QVBoxLayout *l = new QVBoxLayout( this ); @@ -1128,16 +1130,16 @@ KeyInputDialog::KeyInputDialog( QList& _values, l->addWidget( selected , Qt::AlignCenter ); l->addWidget( warning, Qt::AlignCenter ); - QHBoxLayout *l2 = new QHBoxLayout(); + QDialogButtonBox *buttonBox = new QDialogButtonBox; QPushButton *ok = new QPushButton( qtr("OK") ); - l2->addWidget( ok ); QPushButton *cancel = new QPushButton( qtr("Cancel") ); - l2->addWidget( cancel ); - - BUTTONACT( ok, accept() ); - BUTTONACT( cancel, reject() ); + buttonBox->addButton( ok, QDialogButtonBox::AcceptRole ); + buttonBox->addButton( cancel, QDialogButtonBox::RejectRole ); - l->addLayout( l2 ); + l->addWidget( buttonBox ); + + CONNECT( buttonBox, accepted(), this, accept() ); + CONNECT( buttonBox, rejected(), this, reject() ); } void KeyInputDialog::checkForConflicts( int i_vlckey ) -- 2.39.5