Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3215372
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:10:12+00:00 2026-05-17T15:10:12+00:00

HI all, The following code: self.painter = QtGui.QPainter(self) self.painter.setRenderHint(QPainter.Antialiasing) self.painter.translate(482,395) self.painter.scale(300,300) self.painter.save() needle =

  • 0

HI all,

The following code:

self.painter = QtGui.QPainter(self)
self.painter.setRenderHint(QPainter.Antialiasing)
self.painter.translate(482,395)
self.painter.scale(300,300)
self.painter.save()
needle = Qt.QPolygon([QPoint(30, 0), QPoint(-30, 0), QPoint(0, 200)])
self.painter.setBrush(Qt.cyan)
self.painter.setPen(Qt.black)
self.painter.drawPolygon(needle)
self.painter.restore()

is causing my Pyqt application to crash. Does anyone have any idea why? It is part of my ui_form.py file which was automatically spat out by pyuic4. Removing / commenting it out fixes the problem. Yes, I wrote this myself instead of the compiler doing it.

Many thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:10:13+00:00Added an answer on May 17, 2026 at 3:10 pm

    Save the list which you pass the the constructor of QPolygon in a local variable. I guess that the elements get garbage collected as soon as the call returns so when you draw the polygon, they are no longer around.

    points = [QPoint(30, 0), QPoint(-30, 0), QPoint(0, 200)]
    needle = Qt.QPolygon(points)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have the following code def get(self): date = datetime.date.today() loc_query = Location.all() last_cursor
With the following code i detect all squares in a gray scale image: for
I have the following code: def testGeodatabase(self): geodatabaseList = self.gp.ListWorkspaces(*,ALL) for x in geodatabaseList:
The following code works. It animates all those components nicely CGRect logoRect = self.logoImageView.frame;
I have the following code: def maturities InfoItem.find_all_by_work_order(self.work_order).map(&:maturity) end I was thinking about changing
I write the following code all the time to handle when the enter key
I had no problem at all running the following code on a local server,
The following code (without showing it all) is my first attempt at using classes.
The following code works in all browser but IE8 and below. // Create Paragraph
The following code works in all browsers apart from IE6... var mylib = {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.