Questions tagged [paintevent]

An event that is triggered when a GUI component needs to be repainted

A PaintEvent is an event that is triggered when a GUI component needs to be repainted. This is usually a result of a change to the underlying data behind the GUI component, so the GUI display needs to be repainted to reflect the change.

154 questions
2
votes
3 answers

How to draw on a Winform without having access to System.Windows.Forms.PaintEventArgs namespace?

Form what I have done so far in my program, it seems that the only way to draw anything on a winform is through System.Windows.Forms.PaintEventArgs. What if you don't have access to these arguments or this namespace and you only have access to the…
ThN
  • 3,235
  • 3
  • 57
  • 115
2
votes
1 answer

QFrame With Title

I need to implement a QFrame that has a title (see image). However, after reading QFrame's documentation and trying to re-implement the paintEvent(QPaintEvent*) method, I failed to find any solution. I was wondering if any of you could provide a…
mathlizee
  • 185
  • 2
  • 12
2
votes
1 answer

Correct way to paint progressively with pyqt5

I've a widget that is basically a circle. I want to draw it progressively so I need to draw it in steps (imo). With the following code, I have achieved what I want. However, there's a problem. I'm passing a new event to the paintEvent function,…
Btc Sources
  • 1,912
  • 2
  • 30
  • 58
2
votes
0 answers

Drawstring custom font working in a TextBox control but not working in a Form Paint event

I created a simple WinForm Form and tested a custom font file. Basically I just add several chinese characters (which do not exist) to a existing font file. Strange thing is that the font only works in WinForm controls such as TextBox, Grid..etc.…
2
votes
0 answers

DirectX 11/Windows Forms: Paint on Top of Rendered Scene

I am having a difficult time finding details on the draw order of a DirectX 11 application when rendered in a Windows Form. I know that I can assign my SwapChain to render to the handler of a control (such as a panel) which I have done already. The…
Hazel へいぜる
  • 2,751
  • 1
  • 12
  • 44
2
votes
1 answer

Drawing points on QPixmap on QWidget (pyqt5)

I have a QWidget with a QLayout on which there is a QLabel. I set a QPixmap on the label. Wherever the user clicks on the image, I want to draw a point. I defined mouseReleaseEvent (which works) and paintEvent (but no points are drawn). I've read…
Keren Meron
  • 139
  • 3
  • 14
2
votes
1 answer

How can I paint selected rows in a DataGridView based on the values in two of the cells?

I am populating a DataGridView with a semicolon-delimited text file like so: private void ExistingAppntmntRecs_Load(object sender, EventArgs e) { DataTable dt = SeparatedValsFileToDataTable(APPOINTMENTS_FILE_NAME, ";"); …
2
votes
2 answers

Calling paintEvent() from a class in pyqt4 python

I have written a class to display rectangles (the cell class). I would like to have functions inside the class to call in another class (i.e. calling cell.paintEvent(self,event) and cell.drawRectangles(self,qp) in a function defined in a Window…
Jamy codes
  • 101
  • 2
  • 8
2
votes
0 answers

Slow Paint() Performance

I want to display a customized item, basically a colored table with variable column number and width. I'm using c++ Builder XE2 Rad Studio for this. So, I created a new class inherting from TGraphicControl overwriting void __fastcall…
Julian
  • 493
  • 4
  • 22
2
votes
1 answer

C# - Drawing in a panel with "Paint"

I've been working on a project for class where I need to display on screen polygons (drawed in a Panel), but I've been reading arround here that I should work with Paint event, tho I can't make it work (started learning C# a little ago). private…
user4806706
2
votes
1 answer

How to redraw a line using values from a trackBar in realtime?

I was just wondering if you could help me with this problem. In my program I must use the paint event to draw a line which acts as a "turret". I must use a trackbar to choose the angle at which I will "fire" this turret. My problem is I'm not sure…
2
votes
1 answer

[Qt]paintEvent not getting called in custom button derived from QAbstractButton

I'm trying to create a custom button, derived from "QAbstractbutton". I have overridden the paintEvent. However, my button is not visible in my widget. What I see is that the paintEvent is not getting called even after calling update/repaint/show on…
mots_g
  • 637
  • 8
  • 27
2
votes
0 answers

Paint event does not fire when Invalidate() is called

I am working on a WPF application that has a Panel within a WindowsFormHost. The panel contains graphics that need to be redrawn every so often, and the code that draws these graphics is located within an OnPaint() event. The problem is, the…
chelsea
  • 131
  • 1
  • 1
  • 10
2
votes
1 answer

paint() vs paintEvent() in Qt

I have two questions. What is the difference between paint() of QGraphicsItem and paintEvent() of QWidget APIs? I am developing a timer kinda GUI, so I am updating the screen every 100ms with paint() API on embedded linux board. It consumes almost…
jxgn
  • 741
  • 2
  • 15
  • 36
2
votes
1 answer

QListView update - does not trigger update

I have following problem: when I call update() on QListView, its paintEvent() is not triggered unless some other event occurs over the widget (mouse move, got focus....) I am using Qt 4.8.3, and unless this is definitely bug in the version, I would…
chmirko
  • 65
  • 1
  • 7
1
2
3
10 11