Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QPaintEvent error incomplete type

QPaintEvent error incomplete type

Scheduled Pinned Locked Moved Solved General and Desktop
qpainter qtextd
5 Posts 2 Posters 1.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    ofmrew
    wrote on last edited by
    #1

    I get a compile error of incomplete type when compiling:

    void MyFirstWidget::paintEvent(QPaintEvent * e)
    {
    QRect rw = this->rect();
    QPainter painter(this);
    QRect r = e->rect();

    if (drawValue == 1)
        painter.drawLine(1 , 1, 1000, 1000);
    

    }

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi! You probably forgot #include <QPaintEvent>.

      1 Reply Last reply
      3
      • O Offline
        O Offline
        ofmrew
        wrote on last edited by
        #3

        You are correct I forgot the #include <QPaintEvent> Thanks, that fixed it. My C++ is rusty.

        O 1 Reply Last reply
        0
        • O ofmrew

          You are correct I forgot the #include <QPaintEvent> Thanks, that fixed it. My C++ is rusty.

          O Offline
          O Offline
          ofmrew
          wrote on last edited by
          #4

          @ofmrew How do I mark it as resolved?

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            There is the button "Topic Tools", and then: "Mark as solved". See https://forum.qt.io/topic/71830 for a short visual help.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved