পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Friday, March 31, 2017

PyQt - Drawing API

All the QWidget classes in PyQt are sub classed from QPaintDevice class. A QPaintDevice is an abstraction of two dimensional space that can be drawn upon using a QPainter. Dimensions of paint device are measured in pixels starting from the top-left corner.

QPainter class performs low level painting on widgets and other paintable devices such as printer. Normally, it is used in widget’s paint event. The QPaintEvent occurs whenever the widget’s appearance is updated.
The painter is activated by calling the begin() method, while the end() method deactivates it. In between, the desired pattern is painted by suitable methods as listed in the following table.
S.No. Methods & Description
1 begin()
Starts painting on the target device
2 drawArc()
Draws an arc between the starting and the end angle
3 drawEllipse()
Draws an ellipse inside a rectangle
4 drawLine()
Draws a line with endpoint coordinates specified
5 drawPixmap()
Extracts pixmap from the image file and displays it at the specified position
6 drwaPolygon()
Draws a polygon using an array of coordinates
7 drawRect()
Draws a rectangle starting at the top-left coordinate with the given width and height
8 drawText()
Displays the text at given coordinates
9 fillRect()
Fills the rectangle with the QColor parameter
10 setBrush()
Sets a brush style for painting
11 setPen()
Sets the color, size and style of pen to be used for drawing

No comments:

Post a Comment