Quantcast
Channel: Active questions tagged qpainter - Stack Overflow
Browsing all 36 articles
Browse latest View live

How to drag and draw a rectangle over an image in a QLabel? PyQt5 [duplicate]

I have a QLabel that displays a Pixmap and I want the user to be able to drag inside that label and draw a rectangle.Just like how this code works.However my label is loaded from a .ui file so I cant...

View Article



How to use Flutter Canvas for PDF export and printing

QuestionIs there a way in Flutter to generate a PDF directly from a Flutter Canvas? Without writing separate drawing/rendering code for PDF export?DetailsWe are currently implementing an application in...

View Article

QSS properties for custom widget: How to implement hover and pressed states

I found this example on the web on how to implement custom properties accessible from QSS for custom QWidgets: https://wiki.qt.io/Qt_Style_Sheets_and_Custom_Painting_ExampleDoes anyone know how can I...

View Article

Image may be NSFW.
Clik here to view.

Change appearance of selective column/row separator lines in QTableWidget

I want to separate specific columns/rows in a QTableWidget using a bold colored line.I could easily achieve a separation by drawing lines on both sides of the the cells adjacent to the column...

View Article

Borderless Transparent QWidget' content not drawn when put inside another...

In my project, I need to place a window inside the window containing the program icons on Windows desktop.The specific method is to use the Windows API to find the handle of that window, and then set...

View Article


How can I draw an ellipse using QPainter?

I want to draw ellipse in UI but my code doesn't work.QWidget::paintEngine: Should no longer be calledQPainter::begin: Paint device returned engine == 0, type: 1mainwindow.cpp:#include...

View Article

How can I rotate an ellipse in a QPainterPath in Qt?

i know i can draw an ellipse in Qt with QPainter. But i want to rotate the Ellipse inside a QPainterpath. Does anybody know how i can do that?The goal is to subtract two ellipses. I know that i can...

View Article

How to draw with QPainter on top of already placed QLabel or QPixmap?

While experimenting with Python and PyQt5 I got stuck on a problem. I have in my GUI few labels (QLabel) and images (QPixmap) and I want to draw something on them, depending on what the main program...

View Article


Image may be NSFW.
Clik here to view.

Bits visualization using Qt

I'm writing a program that can display file in bit view. Bits are visualized as filled and empty circles. Orogram allows to group bits by period, select bits, highlight columns and rows etc. I'm using...

View Article


Qt6 : Applying fonts without any anti-aliasing - any strategy not respected

I'm trying to render text with a QPainter and I do not want anti-aliasing applied. I am fairly new to QT, so might be doing something wrong here. No matter what i've tried there is always some sort of...

View Article

Image may be NSFW.
Clik here to view.

PyQt - How to use arcs to achieve a specfic shape outline

I have a shape drawn with QPainter, which I need to be able to update dynamically, from a single variable called 'width'. I have attached an image to hopefully show what I mean...Basically the shape...

View Article

Image may be NSFW.
Clik here to view.

QPainter draws the ellipse at the very top left, ignoring the initial coords

I want to draw an ellipse using QPainter and QPainterPath.I have a set of coordinates of my desired ellipse in form of a string, and want the ellipse to be drawn based on these coordinates.However, the...

View Article

Cannot write to temp files using wkhtmltopdf in Rails

I'm using Terrapin to execute wkhtmltopdf from command line inside Rails.Terrapin::CommandLine.path = "/usr/bin/wkhtmltopdf"pdfCommand = Terrapin::CommandLine.new("xvfb-run wkhtmltopdf :html_source...

View Article


How do I add tooltips to plot elements in PyQt5?

I have a custom widget that inherits from Qlabel which has a painEvent member that plots a bunch of points, and I need to set a different tooltip for every point.Here's a simplified standalone example...

View Article

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...

View Article


How to break up a screen/window's QPainter to paint only a portion?

I am coding a game - I have a Board class that is composed of a table/grid of "Spaces" - both Spaces and the Board have a virtual method 'render' being passed a QPainter reference. I want to (if...

View Article

PyQt - Create a function that draws something with parameters provided

I am working on a project that I need to draw, for example, a rectangle every time the QPushButton is pressed using QPainter. This is the first problem, the second one here is that I need some...

View Article


Image may be NSFW.
Clik here to view.

QPainter::drawLine has problem in Large image's width

Recently, I had a problem in my application (So I provided a mini example of the problem) that I faced when creating large-scale images, and when I looked at the output image, it was not fully drawn! I...

View Article

QPainter fails when calling begin

I'm trying to paint a PNG file on a QsplashScreen.Im' trying to do it via QPainter. The reason I want to do it via QPainter is because I want it to minimize smoothly (until it disappear), When I'm just...

View Article

How to restore QPainter.setBrush

I need to paint three rectangles (just for example) one after another in painEvent method. I can't find the answer why after setting Brush for first rectangle and then restoring QPainter with restore...

View Article
Browsing all 36 articles
Browse latest View live




Latest Images