Of course, i can:)

bool ok;
const int value = string.toInt(&ok);
if (ok)
    qDebug() << "value is" << value;

// ====
const auto value = string.toInt();
if (value)
    qDebug() << "value is" << *value;

Иван Комиссаров

21 авг. 2014 г., в 13:09, Poenitz Andre <[email protected]> написал(а):

Иван Комиссаров [[email protected]] wrote:
>> The goal is to get rid of ugly "int QString::toInt(bool *ok = 0)" functions.
> 
> Can you maybe spell out some code to demonstrate why this is
> ugly, and how the use of QOptional would improve that?
> 
> Andre'
> 
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to