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

Improve QImage::setPixel messages

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 5.10.1
    • GUI: Painting
    • None

    Description

      Qimage::setPixel() will on occasion print some warnings to the console. However this is less than ideal, and they could be made more descriptive.

       

      One message:

      QImage::setPixel: Index 144 out of range

      This means the pixel value being set is out of range.  It would be nice if it said what it is, o we'd know, oh, I'm cramming  32 bit data into an 8-bit image, or a 64bit into a 32. I'm not even sure what the index or range being referred to are. I set x,y, and a value. If it's not in the color palette, then it should say that. 

       

      Another message:

      QImage::setPixel: coordinate (30354,3443) out of range

       This one is a little better, but it'd be nice to know what the valid dimensions are:

      QImage::setPixel: coordinate (30354,3443) outside (30354,3442) 

      Usually these will be off-by one errors, but could be other causes.

       

      Finally, it would  be really cool if we could somehow have setPixel throw an exception or take bool *ok=NULL, or something so we can interrupt our program (if (!ok) frap into a breakpoint) and find the issue. Tracking these errors down as s they stream to the console hundreds at a time is frustrating. 

       

      Many thanks.

      Attachments

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

        Activity

          People

            sletta Gunnar Sletta
            scorp1us Jason Hihn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes