Solved How to put TextField/LineEdit or something like that in a MessageDialog?
-
Hello everyone, I'm trying to make some kind of MessageDialog (it could be something else if it this one doesn't work) with text input filed and 3 buttons beneath that field. I've only managed to display the dialog box with some buttons but not the input field. How should I do it?
Here is one of my attempts:
MessageDialog { id:the_dialog text: "Changing file name!" informativeText: "Do you want to save your changes?" TextEdit{ id:helloDialog width: 240 text: "123456" font.family: "Helvetica" font.pointSize: 20 color: "blue" focus: true } buttons: MessageDialog.Ok | MessageDialog.Cancel }
I want something like this:
-
@krokstr hi,
I think your TextEdit is here, but is has no visual borders thats why you can't see it.
You can use TextField also lke this :MessageDialog{ id:d contentItem:RowLayout{ TextField{ placeholderText: ".." } Button{ text:"ok" } } }
see also Popup : https://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html
and Dialog : https://doc.qt.io/qt-5/qml-qtquick-controls2-dialog.html -
Thanks for the help! Popup type did a perfect job for my purpose.
-
@krokstr Nice!
You can mark this topic Solved with the topic tools