How do I print the generated QR code using Nayku's library in a pdf file?
I am using a third party library : https://github.com/nayuki/QR-Code-generator using c++.So far what I have reached in my code is printing the QR code in the console.My app generates a pdf file that I...
View ArticleHow to draw a picture instead of the slider of a QSlider?
I have created a class that inherits from QSlider and I want to draw a picture on the slider (grabber) instead of showing the plain one.How to do it?
View ArticleGet visible area of QPainter
I have an owner-drawn QWidget inside a QScrollArea, so when painting, and I want to paint only the parts that are visible. To do so, I need to have the rectangle of the visible area of the QPainter.The...
View ArticleQt 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 ArticleQPainter draws text on QPixmap, but the text is ugly
I have code that draws a console onto a QMainWindow.If I use the paintEvent, everything looks beautiful.If I paint the text to a QPixmap, and then in my paintEvent copy it over,then the text looks...
View ArticlePyQt 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 ArticleHTML 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 ArticleQt 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 ArticleHow 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 ArticlePaint 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 ArticleQT 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 ArticleUsing 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"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 ArticlePIL 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 Articleqt 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 ArticleHow 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 ArticleCannot 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 ArticleWhy 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 ArticlePySide 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 ArticleQt: 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