Below is the implementation of QInputDialog::getText from Qt 4.7
Qt Code:
  1. QString QInputDialog::getText(QWidget *parent, const QString &title, const QString &label,
  2. QLineEdit::EchoMode mode, const QString &text, bool *ok,
  3. Qt::WindowFlags flags)
  4. {
  5. QInputDialog dialog(parent, flags);
  6. dialog.setWindowTitle(title);
  7. dialog.setLabelText(label);
  8. dialog.setTextValue(text);
  9. dialog.setTextEchoMode(mode);
  10.  
  11. int ret = dialog.exec();
  12. if (ok)
  13. *ok = !!ret;
  14. if (ret) {
  15. return dialog.textValue();
  16. } else {
  17. return QString();
  18. }
  19. }
To copy to clipboard, switch view to plain text mode 
My question is about line 13. First I thought !! is used to convert int to bool, but soon I realized the conversion takes place automatically. Is it something special about !! ?