Why don't we simply use a QLineEdit (http://qt-project.org/doc/qt-4.8/qlineedit.html) instead of implementing an entirely new dialog?