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 draw only on lift area in a widgte
QtWS25 Last Chance

QPaintEvent draw only on lift area in a widgte

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 983 Views
  • 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.
  • T Offline
    T Offline
    taxmax
    wrote on last edited by
    #1

    Hallo everybody,

    I have a problem with my QPaintEvent and QWidget. I have a widget and i also have a subclass. I create an instance of my class like this: myClass = newClass(ui.mywidget). In this class i will draw some lines with the QPint event. I can see the lines, but only in the left upper area in the widget and not everywhere. So when i draw a line like this: painter.drawLine(10,10,300,300), i only see the lines till 100, 100.

    Can anybody help me??

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dbzhang800
      wrote on last edited by
      #2

      It's not a good idea to draw on a widget which has sub-widgets on it.

      As they will be covered by sub widgets

      1 Reply Last reply
      0
      • P Offline
        P Offline
        poorBob
        wrote on last edited by
        #3

        1+1=2 is right that it is not a good idea ;),

        but anyway can You place the Your paintEvent() implamentation?

        I guess that Your line is covered be other widgets which are painted in the "upper" layer :).

        with best regards,
        Robert

        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