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 8590993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:25:24+00:00 2026-06-11T23:25:24+00:00

There is a button in my pyqt gui that when clicked runs a function

  • 0

There is a button in my pyqt gui that when clicked runs a function that does some lengthy math calculations. Inside this function there were a lot of print statements like:

print "finished calculating task1 going on to task2"

So by using print statements like that i didn’t need to have let’s say a progressbar for example to indicate program progress. I added a QTextEdit widget in my gui and replaced all print statements in that function with:

MyTextEdit.append('message')

where MyTextEdit is a QTextEdit widget and message is the message i would like the function to print.

Example:

MyTextEdit.append('finished calculating task1 going on to task2')
task2 #lengthy second task
MyTextEdit.append('finished calculating task2 going on to task3')
task3 #lengthy third task

When i click the button and the function runs, all calculations inside that function have to finish and then all messages are appended to the QTextEdit widget.

I thought that each time a MyTextEdit.append('message') is executed it would run immediately and the widget would display the message at that very instant and not at the end along all other messages.

What am i doing wrong?

I had the idea of doing this by reading this post

  • 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-06-11T23:25:26+00:00Added an answer on June 11, 2026 at 11:25 pm

    Just make a call to QCoreApplication.processEvents after each append

    You can get your instance of QCoreApplication with the static method QCoreApplication.instance

    This will ask Qt to “refresh” your gui before finishing the tasks that are being executed, as the command processes all pending events.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any button or shortcut that can make publish job instead of clicking
Is there ASP button that won't submit post form data. Whenever I click an
Here's my code...we can find a button tag in this code. There for button
In System.Windows. Forms .Button there is a property DialogResult , where is this property
I am building a GUI for image processing in PyQt. One task that I
Is there a button in ExtJS with increment/decrement feature (something like that )? I
this is ma program.in this program on delete button there didnt perform onclick listener
I'm having button (class that extends Sprite ). In the middle of button there's
I am writing a GUI program using PyQt4. There is a button in my
I have a page that when the user clicks a button there is a

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.