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

How to make Qt widgets fade in or fade out?

I am trying to fade in and fade out a QLabel or for that matter any QWidget subclass. I have tried with QGraphicsEffect, but unfortunately it works well only on Windows and not on Mac. The only other...

View Article


Drawing line to QImage

I am trying to draw line to QImage and show it in Qlabel. However I have some issues that I cannot solve. QPixmap px; px.fromImage (imgRaw); // define in header file QImage imgRaw; QPainter p...

View Article


Image may be NSFW.
Clik here to view.

Why is the position of the circles incorrect? [duplicate]

I am trying to use PyQt6 to design a program that draws a red circle at the position where the user clicks. However, when I click on the image in the window, the circle is not drawn exactly where I...

View Article

Qt: QWidget::paintEngine: Should no longer be called

I'm trying to make an app where you can draw with your finger on a canvas.To achieve this, I'm subclassing QWidget as MFCanvas, registered the class in QML withqmlRegisterType<>(), implementing...

View Article

Image may be NSFW.
Clik here to view.

PySide How to apply smoothing (antialiasing)?

There is a drawn arrow indicator. Everything works well, but deep irregularities (burrs) remain on the red sectors. How to remove it?from PySide6.QtGui import QPainter, QColor, QPolygon, QPaintEvent,...

View Article


Why is Qt QPainter always inaccurate when drawing in pixel units?

QPainter painter;painter.begin(this);qreal scale = 1.0 / this->devicePixelRatioCache;painter.scale(scale, scale);I need very high pixel granularity accuracy because in my project, one pixel...

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 to keep QPixamp quality in QPainter::drawPixmap when QPainter::scale(x,y)...

I am using QWidget and its paintEvent.Im using QPainter::scale(zoom,zoom) to scale background images on the widget.Then I want to paint some foreground icons and keep their size the same all the time...

View Article


Image may be NSFW.
Clik here to view.

qt drawing outlined text with QPainterPath

i have to draw outlined striked out text on QImage like that:I do it as follows:QPainter painter(this);QPainterPath path;QFont...

View Article


Image may be NSFW.
Clik here to view.

PIL Image to PixMap Error on QImage Conversion

The following code block:class MDraw(QtWidgets.QGraphicsView): def __init__(self, parent): super(MDraw, self).__init__(parent) self.data = None self.width = 0 self.height = 0 def resizeEvent(self,...

View Article

"scale from center of rectangle" not work with world transform matrix

I have a qtquick project with a main.qml and an EaDrawArea which inherits from QQuickPaintedItem and is accessible from the main.qml. there is a Slider in the qml which is binding to m_scale (3 to 100)...

View Article

Image may be NSFW.
Clik here to view.

Using QPainter’s drawPixmap/drawImage to draw images, the images look blurry

I used QPainter’s drawPixmap() to draw an image, and the result is shown as B in the following picture.Then, I opened the same image in the image viewer program provided by Windows, zooming it even...

View Article

Image may be NSFW.
Clik here to view.

QT the pixel difference that occurs when drawing a font table on the screen...

I am drawing a font table in Qt. I noticed that when I draw the table directly on the screen and when I draw it first on an qimage and then draw this image on the screen, the letters are shifted a few...

View Article


Paint device returned engine == 0, type: 1

I have seen many answers for the same Question, I have already gone through them but none them solved my problem, I am getting the error QWidget::paintEngine: Should no longer be called...

View Article

Image may be NSFW.
Clik here to view.

How to fix a rendering issue with QItemDelegateClass::drawCheck?

I have a custom delegate which is added to the first column of a QTableView. The code is below. I am experiencing a strange rendering issue for the checkboxes on the table view.When all checkboxes...

View Article


Image may be NSFW.
Clik here to view.

Qt textedit with bookmark in scrollbar

I wanted to create the bookmarks for my text editor while searching for a word in the text, the scrollbar should colored the bar in green like in the qt editor.I need help guys!! do you have an idea to...

View Article

HTML to PDF using Qt not show all characters

I am having an issue with exporting HTML to PDF using Qt version 6.8. Some characters simply do not appear in the final file, and interestingly, if I try to select the text and press Ctrl+C and then...

View Article


PyQt Painter shape as button [duplicate]

import sysfrom PyQt6 import QtWidgets, QtGui, QtCoreclass PainterButton(QtWidgets.QWidget): def __init__(self): super().__init__() def paintEvent(self, event): painter = QtGui.QPainter(self)...

View Article
Browsing all 58 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>