5种QT标准对话框:
详细转:http://c.biancheng.net/view/1870.html
转载自:http://c.biancheng.net/view/1870.html
个人使用记录:
long minValue = 1, maxValue = 999999999, stepValue = 1; //范围,步长
int area_min= 200;
bool key_connected, ok;
int inputValue = QInputDialog::getInt(this, tr("连通域"), tr("请输入area_min:"), area_min, minValue, maxValue, stepValue, &ok);//输入数字型弹窗
if (ok)//确认是否已经输入
{
area_min = inputValue;
}
else {
return;
}
//bool判断弹窗
QMessageBox::StandardButton rb = QMessageBox::question(this, "是否需要黑白颠倒", "目标区域是黑色的吗?", QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
if (rb == QMessageBox::Yes)
{
key_connected = 1;//需要再做颠倒
}
else if (rb == QMessageBox::No)
{
key_connected = 0;//不需要颠倒
}