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

QVariant assigned from null QString becomes non-null QVariant

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.8.2
    • None
    • Linux/Wayland

    Description

      I have this short example to reproduce:

      int main(int argc, char *argv[])
      {
          QString value;
          qDebug() << value << value.isNull();
      
          QVariant var = value;
          qDebug() << var << var.isNull();
      
          return 0;
      } 

      When compiled with Qt 5.15.2, the result is:

      "" true
      QVariant(QString, "") true 

      and with 6.8.2 it's:

      "" true
      QVariant(QString, "") false 

      In other words, QString->QVariant conversion loses null/non-null information and it can be critical - it basically loses data.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            vipe Vipe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes