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
1
vote
1 answer

PySide2 paint on widget created by designer

This issue is with VS Code on Win10 and Python 3.6.6. I'm new both to Python and PySide2. I've read a lot of topics on this here at StackOverflow and possibly this is a duplicate of another topic, but I'm not able to get my widget painted. I…
Cobse
  • 73
  • 11
1
vote
1 answer

How do I raise an event when a WPF control ( Image control) is redrawn?

I have a winforms paint event handler that handles the paint event for a picturebox. As the paint event description says, "...the event is fired when the control is redrawn". I do not quite understand this and I wish to raise the same event in WPF…
Ken Janka
  • 121
  • 3
  • 19
1
vote
4 answers

How to use the Paint event to draw shapes at mouse coordinates

I recently started programming in C# obviously and was trying to do a simple WinForms app that takes mouse coordinates and scales a Rectangle according to the coordinates. The issue I am facing is that I don't know how to call a method that uses…
kuskus
  • 23
  • 1
  • 6
1
vote
1 answer

Double Buffering giving black window

I am having an application which shows the data (stock market) in an user control made by me. In my application, there may be more than one user control on single screen to analyse multiple stocks. Given that functionality, user can move from 1…
Arpit Gupta
  • 1,209
  • 1
  • 22
  • 39
1
vote
2 answers

PyQt5: Draw a line by clicking QPushButton

I am trying to make it such that when I click a QPushButton a line is drawn. However the code I have right now makes the line at the beginning when the code is initiated and not after. The QPushButton doesn't seem to do any drawing. I also don't…
riyadude
  • 337
  • 6
  • 18
1
vote
1 answer

Building a ray tracer with Qt, cannot display pixel by pixel in paintEvent

I am using Qt to build a ray tracer with GUI. The ideal effect is to paint a pixel immediately after computing the RGB value of that pixel, as in most professional renderer. But I find out that my tracer could only display the entire rendered image…
PhoMan24
  • 13
  • 5
1
vote
1 answer

Qt Custom ProgressBar can't refresh (paintEvent)

i've created a custom progress bar, but when i call the SetValue() method the paintEvent method (overrided) is not called, so the progress bar show just the veryfirst value. This is the Header grafica_progressbar.h #ifndef GRAFICA_PROGRESSBAR_H …
1
vote
3 answers

Qt: Why does my paintEvent() erase everything before doing its job?

I'm trying to make my widget paint a rectangle with every paintEvent it receives. The rectangles are supposed to increase in size by 1px at a time, filling a square. What I get, however, is only the latest (and largest) rectangle. void…
Jersey
  • 423
  • 4
  • 13
1
vote
1 answer

C#.NET .. is it a bad practice to draw outside the Paint event handler?

To clearup what I meant by my question.. I got used when making a game in C# using the .NET framework, to implement my own DrawScene() method and call it whenever I want to redraw the game's graphics (basically after any instance in the game has…
Stefan Madlo
  • 53
  • 1
  • 2
  • 7
1
vote
1 answer

Draw vertical lines on QTextEdit in PyQt

I am trying to develop a GUI that contains a QTextEdit widget. When the gui loads, it pulls in data from a file where the data is in columns of fixed widths. I want the user to be able to click at various points in the QTextEdit widget, to mark the…
Adrian Mc
  • 148
  • 9
1
vote
1 answer

Qt5: paintEvent is not called after an update() in mouseMoveEvent

I am using a QAbstractScrollArea + a custom QWidget derivative widget as "the" widget (having sizeHint() overriden). The application needs to constantly update the QWidget content during mouseMove (kind of a drag, but not exactly, it is a drawing…
harsszegi
  • 369
  • 2
  • 15
1
vote
1 answer

Drawing Framework in C# to avoid flickering

I am just beginning to learn C# and I would like to seek advice on good practices when it comes to painting to avoid flickering. I have used methods as mentioned on here, such as double buffering and turning on WS_EX_COMPOSITED, but the method that…
John Tan
  • 1,331
  • 1
  • 19
  • 35
1
vote
1 answer

Qt 5.2 calling QTableWidget::update does not result in QTableWidget::paintEvent

I have a problem: calling QTableWidget::update does not result in QTableWidget::paintEvent. Brief description: - QTableWidgetEx - a class derived from QTableWidget, with paintEvent overriden. - Some code creating QTableWidgetEx and two menu items…
Yuri Yaryshev
  • 991
  • 6
  • 24
1
vote
2 answers

How do I stop paintEvent from painting children widgets?

I'm trying to add rounded corners to a QDialog. I'm defining my own paintEvent method to create rounded corners. It's working, but it's adding rounded borders to everything. Even the cursor is getting a border. Is there any way to disable this…
Jordan
  • 476
  • 7
  • 16
1
vote
0 answers

QWidget::repaint() skipped by "sticked" flag Qt::WA_UpdatesDisabled

So, situation: Qt 4.8.4, MSVS 2012. I have six QToolButton inside QWidget (this QWidget is inside another QWidget ), QToolButtons located in QHBoxLayout. When I quickly press left mouse button on one of QToolButton, then move mouse out of…
user3302274
  • 252
  • 2
  • 6