Results 1 to 7 of 7

Thread: QImage::fill can't digest what I feed it

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2012
    Location
    San Diego, California
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QImage::fill can't digest what I feed it

    I am stumped by this compile error, sure that it's some very simple "obvious" doof-up. I'm hoping to create an image filled with a color.

    QImage qim( QSize(24,24), QImage::Format_ARGB32 );
    qim.fill( QColor("#FFD07F") );

    The compiler from Visual Studio 10 (using command line tools) gripes with:

    main.cpp(51) : error C2664: 'QImage::fill' : cannot convert parameter 1 from 'QColor' to 'uint'

    Line 51 being the qim.fill() call. The Qt doc for QImage says QImage::fille(const QColor &) exists, and QColor should be fine with a string containing web-style color like that. It sure looks like everything is fine in the source code.

    What the heck is the problem?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QImage::fill can't digest what I feed it

    Curious. GCC compiles this without issue on Linux and Windows, as you would expect.
    Qt Code:
    1. #include <QtGui>
    2.  
    3. int main(int argc, char **argv)
    4. {
    5. QApplication app(argc, argv);
    6. QImage qim( QSize(24,24), QImage::Format_ARGB32 );
    7. qim.fill( QColor("#FFD07F") );
    8. return 0;
    9. }
    To copy to clipboard, switch view to plain text mode 
    Does your compiler choke on the example above?

  3. #3
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    512
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QImage::fill can't digest what I feed it

    Hi, which Qt version do you use?
    QImage::fill(const QColor & color) has been introduced with Qt 4.8, so if you use an earlier version, you compiler is correct

    Ginsengelf

Similar Threads

  1. How do I remove the BusyIndicator after you read a feed?
    By LucioMSP in forum Qt Programming
    Replies: 0
    Last Post: 20th February 2012, 17:15
  2. Linguist: line feed
    By Markus_AC in forum Qt Tools
    Replies: 1
    Last Post: 10th October 2011, 21:18
  3. Replies: 1
    Last Post: 9th May 2011, 15:19
  4. How to stop form feed after printing
    By Prabha in forum Qt Programming
    Replies: 0
    Last Post: 17th August 2010, 10:30
  5. QTextEdit and Form Feed character
    By gvlaovic in forum Qt Programming
    Replies: 1
    Last Post: 15th September 2007, 12:37

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.