How do I show a message box with Qt Quick Controls?
问题 What is the equivalent of QMessageBox::information() when one wishes to write a QML application using Qt Quick Controls? 回答1: In Qt 5.2 there is MessageDialog: http://doc.qt.io/qt-5/qml-qtquick-dialogs-messagedialog.html import QtQuick 2.2 import QtQuick.Dialogs 1.1 MessageDialog { id: messageDialog title: "May I have your attention please" text: "It's so cool that you are using Qt Quick." onAccepted: { console.log("And of course you could only agree.") Qt.quit() } Component.onCompleted: