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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:39:48+00:00 2026-05-27T13:39:48+00:00

I have a deque type list (a queue) which I’d like to show and

  • 0

I have a deque type list (a queue) which I’d like to show and update in QTextEdit.
There is a function uuenda_kama in class MyForm which should do this (and some other s*** too). First pass of this function when textEdit is empty, it works like a charm, all necessary fields are updated. But on second pass as there has some text added to it, it crashes throwing me a Visual Studio debugger in face.
Tried commenting different parts out and came out that line “self.ui.textEdit.clear()” is causing this. What is wrong with it and why is it working on first pass? What can I do to fix it?
Code I have right now:

class MyForm(QtGui.QMainWindow):
    ...
    def uuenda_kama(self):
        while True:
        ...
        if vana_que != list(que):
            self.ui.textEdit.clear()
            for i in que:
                self.ui.textEdit.append(i)
            vana_que = list(que)
        sleep(1)

if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)
    myapp = MyForm()
    uuendamine = Thread(target=myapp.uuenda_kama)
    uuendamine.start()
    myapp.show()
    sys.exit(app.exec_())
  • 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-27T13:39:49+00:00Added an answer on May 27, 2026 at 1:39 pm

    You should not be creating a standard python thread outside of the entire app that runs methods on your qwidgets. Instead you should have a QThread that runs non-gui related logic and then emits a signal when it wants the main thread to affect the GUI

    Refer to this other question for a good example: Howto change progress by worker thread

    You should never call gui methods directly outside of the main thread.

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

Sidebar

Related Questions

I have: void add_all_msgs(std::deque<Message>::iterator &iter); How can I make that function generic, so it
I have a class that i want to push_back into a deque. The problem
I have a deque: deque<char> My_Deque; My_Path.push_front('a'); My_Path.push_front('b'); My_Path.push_front('c'); My_Path.push_front('d'); My_Path.push_front('e'); There are such
I have a function of a Table class that should add a player to
If I have a deque or list that's being manipulated on different threads, can
I have something like: #include MyImage.hpp // MyImage wraps the Qt library image class
I have a simple function that loops while there are still elements in a
I have the following queue class (taken from wordpress): #include<iostream.h> class Queue { private:
So I have a list of 85 items. I would like to continually reduce
I have the following code, which does some iterator arithmetic: template<class Iterator> void Foo(Iterator

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.