Помоему мой вариант проще.
Вот часть его взята, с мизерной дороботкой, у Макса Шлее:
#include <QtGui>
// ----------------------------------------------------------------------
int main (int argc, char** argv)
{
QApplication app(argc, argv);
QWidget wgt;
QVBoxLayout *l = new QVBoxLayout();
QLabel *label = new QLabel("Push on button");
QPushButton *bwm = new QPushButton("Find");
QMenu *pmnu = new QMenu();
QLineEdit *ed = new QLineEdit;
ed->setText("Write here");
QWidgetAction *action = new QWidgetAction(0);
action->setDefaultWidget(ed);
pmnu->addAction(action);
bwm->setMenu(pmnu);
l->addWidget(label);
l->addWidget(bwm);
wgt.setLayout(l);
wgt.show();
return app.exec();
}
Осталось соеденить сигналы текстового поля с чем-нибудь