我正在尝试使用QInputDialog
将用户输入作为单个字符串读取,格式为名字:姓氏:员工编号
我该怎么做?
答案 0 :(得分:0)
bool ok;
QString text = QInputDialog::getText( this, tr("Label dialog"),
tr("Enter employee data as firstName:lastName:empNumber"),
QLineEdit::Normal, "", &ok );
if( ok && !text.isEmpty() )
{
// pull apart the results here.
}