32 #include <QPushButton> 34 #include <QHBoxLayout> 36 #include <QApplication> 42 button_ =
new QPushButton(
this);
44 button_->setCursor(Qt::ArrowCursor);
47 button_->setFocusPolicy(Qt::NoFocus);
62 setTextMargins(padding, padding, height(), padding);
65 QLineEdit::resizeEvent(event);
69 int button_width = height() - 2 * padding;
70 int button_height = button_width;
71 button_->setGeometry(width() - button_width - padding, padding, button_width, button_height);
83 QKeyEvent*
event =
new QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier);
84 QApplication::postEvent(
this, event);
85 event =
new QKeyEvent(QEvent::KeyRelease, Qt::Key_Return, Qt::NoModifier);
86 QApplication::postEvent(
this, event);