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

How to use qwidget double buffer

I have a QWidget that has a very cpu intensive paint event handler. But it hardly needs updating, although it is moved on screen. I know how to implement a double buffer paint mechanism, but as all QWidgets already have a double buffering system, I…
arashka
  • 1,226
  • 3
  • 17
  • 30
2
votes
1 answer

Create a line when press a button

I want to make an drawing program "in real time". I have two text boxes and a button in my form. I want to enter two values in the text boxes, push the button and the draw the line. I tried to call from the b_Click (b is the button) the Form_paint…
user4215067
2
votes
1 answer

C++/Qt : change (the size of) a QImage that is being painted

I apologize if I give more details than necessary. I have a class Canvas that looks like this: class Canvas : public QWidget { Q_OBJECT public: explicit Canvas(int width = 700, int height = 700, QWidget *parent = 0); void…
Seub
  • 2,451
  • 4
  • 25
  • 34
2
votes
1 answer

Custom Node painting in JavaFX

In PySide you can override the paintEvent() method of a QWidget to control how the widget is painted on the screen. Is there an equivalent for Node in JavaFX? In context: I'm in need of a way to display a custom image format on the screen.…
midrare
  • 2,371
  • 28
  • 48
2
votes
2 answers

Drawing lines programmatically with Qt

I want to add lines programmatically in a QLabel between two points. From what I found, it seems that the only way to do it is to subclass a QWidget to change the PaintEvent() protected method. So, I create a new class 'QLineObject' from QWidget.…
Boris88
  • 297
  • 2
  • 14
2
votes
1 answer

DataGridView CellPainting: Highlight word in cell considering cell's content direction

This is the case: I want to search for a word in a whole DataGridView through looping it's Rows, and then for each match I highlight the word. The major inflexibility I face is that columns have different…
Mahdi Tahsildari
  • 13,065
  • 14
  • 55
  • 94
2
votes
2 answers

Moving Object with Paint Event

I have a test tomorrow, and we must use the paint event to redraw our objects, we may not use a timer. As the MSDN says: "The Paint event is raised when the control is redrawn.", but that,occurs for my known, only when the form is minimized, or got…
Nick Peelman
  • 585
  • 1
  • 10
  • 28
2
votes
1 answer

Stabilize QWidget::paintEvent() calls frequency

As i understand, paintEvent() is executed in 'main loop' of QApplication object, and can spend time for its internal system tasks, delaying execution of queued slots or other events. But what if i need to play very smooth animation and i notice…
pavelkolodin
  • 2,859
  • 3
  • 31
  • 74
1
vote
0 answers

Can I use a wxPaintDC instance as a class member?

I have made a class wxRectangleDrawing, which has 3 methods, 1 for catching the paint event and creating the dc object, one for drawing my desired rectangle with that dc object, and one for clearing that dc. The only problem is I cannot clear that…
zoinkers
  • 13
  • 3
1
vote
1 answer

paintEvent not being called in custom widget

I am trying to paint a rectangle at the mouse location every time it is clicked. Currently, the setup is as follows: TableMaker is my main window and was mostly generated in Qt Designer. I have subclassed a QWidget, RenderArea, and added it inside a…
1
vote
1 answer

Selection in DataGridView does not work after CellPaintEvent

I have a Datagridview. I need to use a CellPainting Event to customize the appereance of my DataGridview. I used the code of the msd documentation: MSD Documentation Evrything works perfect, i was able to customize my Datagridview like i needed…
21021
  • 31
  • 5
1
vote
1 answer

PyQt Child Widget does not receive paintEvent

I created a widget in qt designer and transformed the ui file using pyuic to a python class called Ui_wid_canvas. This is supposed to be used as special canvas: # file mgcanvas.py from PyQt4 import QtCore, QtGui class Ui_wid_canvas(object): def…
cledith
  • 31
  • 2
  • 6
1
vote
0 answers

How can I control or stop the paint event of the dynamic user control from the main form?

I have a big problem with a small matter. I'm coding a messaging app. This is the layout I use: Main Form --> container (UserControl) --> bubble(UserControl) I am sending these parameters to the container this.container1.addOutMessage(message,…
quahvaen
  • 31
  • 1
  • 3
1
vote
0 answers

C# How can I fill the intersection between two GraphicsPath with the color of the last one drawn?

I have to develop a painting application in C# using the mouse movement, so I decided to use a List of GraphicsPath where I store the path for each drawing (consider the drawing as the path painted between a mouseDown and mouseUp event). Each path…
MarioAF
  • 23
  • 4
1
vote
0 answers

Drawing 3D models of WPF in real time

In my robot control program, there should be a 3D model of the robot moving simultaneously with a real robot. I uploaded the 3D model and update its position after releasing the Slider with the mouse. Everything works, but with a real time update of…
1 2
3
10 11