Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-32406

->text().toDouble() returns zero on empty string

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.1.0
    • GUI: Text handling
    • None

      I don't believe it safe to return zero on an empty to .toDouble() call. Many packages return either nans or throw some kind of an error.

      In my case 0.0 is a perfectly good value to return, but I can't have an empty string.

      double move_to_position = ui.txtBox->text().toDouble();//Weird stuff when txtBox is not empty.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            esabraha Eskil Abrahamsen Blomfeldt
            kandel3 Mikhail Kandel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes