最简单的Qt对话框

Ger*_*ddc 2 c++ qt dialog bluetooth qml

我有一个C ++函数,用于检查蓝牙是否已激活。我想显示一个简单的对话框,告诉用户激活他的蓝牙并再试一次。因为我有QML接口,所以可以通过C ++或QML完成。

JRi*_*out 5

您可以使用内置的信息消息框:

#include <QApplication>
#include <QDebug>
#include <QMessageBox>

int main(int argc, char *argv[]) {
    QApplication app(argc, argv);
    QMessageBox::information(0, "Try Again", "Please try to activate your Bluetooth again.");
}
Run Code Online (Sandbox Code Playgroud)