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. QPAINTER LINE IN QWIDGET PRESENTS IN PLUS FILE .CPP
Forum Updated to NodeBB v4.3 + New Features

QPAINTER LINE IN QWIDGET PRESENTS IN PLUS FILE .CPP

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 717 Views 1 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.
  • S Offline
    S Offline
    Salvatello
    wrote on 14 Oct 2014, 15:37 last edited by
    #1

    Hi, I would like to draw a line in a QWidget present in my QmainWindows . Explain.
    I have a project done by mainwindows.he main windows.cpp , prova2.he prova2.cpp and of course main.cpp .
    in mainwindows.cpp I inserted a QWidget ( disegnalinea ) .
    in prova2.cpp I inserted a QWidget ( disegnalinea2 ) .
    I would like to create a function in a file .h . this function should receive as input the QWidget ( or disegnalinea disegnalinea2 ) and I must draw the line or disegnalinea or disegnalinea2 .

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 14 Oct 2014, 19:59 last edited by
      #2

      Hi,

      It's not done like that, widget paint themselves when paintEvent is called. You can't just paint on them like that. You can find several example in Qt's sources for custom painting.

      On a side note, please stop writing all uppercased titles, in written language it's considered shouting and thus rude.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      1/2

      14 Oct 2014, 15:37

      • Login

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