July 27, 2011

kbt90 kbt90
Lab Rat
37 posts

[Solved] QMessageBox with line edit

 

Hello –

I am trying to create the effect of a QMessageBox with a line edit.

When a user clicks a button, the dialog should pop up over the main dialog for the user to input in the line edit, and once they press okay, the dialog goes away. I would like the main dialog to then be able to get the value from the line edit, without having to first store it off in settings in the dialog and retrieve it from settings in the main window.

How can I go about doing this?

Thanks,
Kate

4 replies

July 27, 2011

Eddy Eddy
Area 51 Engineer
1296 posts

Hi Kate,

Why do you want to use a QMessagebox instead of a dialogbox you created yourself?

 Signature 

Qt Certified Specialist
Qt Ambassador

July 27, 2011

kbt90 kbt90
Lab Rat
37 posts

Well I don’t want to use a QMessageBox, I just want similar behavior in the dialog.

July 27, 2011

Eddy Eddy
Area 51 Engineer
1296 posts

Ok, in that case have a look at QInputDialog [developer.qt.nokia.com]
This way you don’t have to make your own dialog.

EDIT : there is a nice example in how to use it too.

 Signature 

Qt Certified Specialist
Qt Ambassador

July 27, 2011

kbt90 kbt90
Lab Rat
37 posts

Super, thanks!

 
  ‹‹ Strange behavior of QDomDocument::toString()      Problem with thread ››

You must log in to post a reply. Not a member yet? Register here!