3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
6 * \author Allan Rae <rae@lyx.org>
7 * \author Angus Leeming <a.leeming@ic.ac.uk>
13 #pragma implementation
20 #include <qlineedit.h>
22 Qt2BC::Qt2BC(string const & cancel, string const & close)
23 : GuiBC<QButton, QWidget>(cancel, close)
27 void Qt2BC::setButtonEnabled(QButton * obj, bool enabled)
29 obj->setEnabled(enabled);
33 void Qt2BC::setWidgetEnabled(QWidget * obj, bool enabled)
35 // yuck, rtti, but the user comes first
36 if (obj->inherits("QLineEdit")) {
37 QLineEdit * le(static_cast<QLineEdit*>(obj));
38 le->setReadOnly(!enabled);
40 obj->setEnabled(enabled);
43 QWidget::FocusPolicy const p =
44 (enabled) ? QWidget::StrongFocus : QWidget::NoFocus;
45 obj->setFocusPolicy(p);
49 void Qt2BC::setButtonLabel(QButton * obj, string const & label)
51 obj->setText(label.c_str());