Results 1 to 2 of 2

Thread: error:variable `QPainter painter' has initializer but incomplete type

  1. #1
    Join Date
    Jun 2008
    Posts
    21
    Thanked 1 Time in 1 Post

    Default error:variable `QPainter painter' has initializer but incomplete type

    Hi,

    I am using Qt 3.3. My class inherits from QDialog.

    Qt Code:
    1. void CMediaDownload:: paintEvent(QPaintEvent* event)
    2. {
    3. QPainter painter(this);
    4. }
    To copy to clipboard, switch view to plain text mode 
    This error is thrown by compiler.
    error:variable `QPainter painter' has initializer but incomplete type
    Regards,
    node_ex.
    Last edited by jpn; 4th September 2008 at 16:09. Reason: missing [code] tags

  2. The following user says thank you to node_ex for this useful post:

    TheIndependentAquarius (5th October 2013)

  3. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 162 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: error:variable `QPainter painter' has initializer but incomplete type

    add the include for QPainter: #include "qpainter.h" (I think)

  4. The following 2 users say thank you to caduel for this useful post:

    alfaalfa (10th July 2013), TheIndependentAquarius (5th October 2013)

Similar Threads

  1. Problem with Painter in Qt4.4.1
    By merry in forum Qt Programming
    Replies: 1
    Last Post: 1st September 2008, 13:47
  2. Compile 4.4.0
    By LordQt in forum Installation and Deployment
    Replies: 18
    Last Post: 29th May 2008, 13:43

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.