32 #include <QPushButton> 34 #include <QHBoxLayout> 36 #include <QApplication> 44 button_ =
new QPushButton(
this );
46 button_->setCursor( Qt::ArrowCursor );
48 button_->setAutoDefault(
false );
49 button_->setFocusPolicy( Qt::NoFocus );
64 setTextMargins( padding, padding, height(), padding );
67 QLineEdit::resizeEvent( event );
71 int button_width = height() - 2 * padding;
72 int button_height = button_width;
73 button_->setGeometry( width() - button_width - padding, padding,
74 button_width, button_height );
86 QKeyEvent*
event =
new QKeyEvent( QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier );
87 QApplication::postEvent(
this, event );
88 event =
new QKeyEvent( QEvent::KeyRelease, Qt::Key_Return, Qt::NoModifier );
89 QApplication::postEvent(
this, event );