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

  • Home
  • SEARCH
  • 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 8940463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:02:33+00:00 2026-06-15T11:02:33+00:00

Im trying to send parameter to a Qthread that is not the main thread.

  • 0

Im trying to send parameter to a Qthread that is not the main thread.
i have this object in my main thread and i want to send it to another thread:

q = Queue()

I want so send q to this thread:

class Sender(QtCore.QThread):
def __init__(self,q):
    super(Sender,self).__init__()
    self.q=q
def run(self):

    while True:

        try: line = q.get_nowait()
         # or q.get(timeout=.1)
        except Empty: 
            pass
        else: 
           self.emit(QtCore.SIGNAL('tri()')) 

Im trying this:

class Sender(QtCore.QThread):
    def __init__(self,q):
        super(Sender,self).__init__()
        self.q=q
self.sender= Sender(q)

But im getting this error:

QObject::connect: Cannot queue arguments of type 'QTextCursor'
(Make sure 'QTextCursor' is registered using qRegisterMetaType().)

How can i do this?
Please help!

  • 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-15T11:02:34+00:00Added an answer on June 15, 2026 at 11:02 am

    There is no problem with your QThread subclass, and how you are setting it up to pass a Queue object. Though I do also recommend passing and setting an optional parent as the second parameter.

    What you are mostly likely running into is you are passing objects that perform QtGui operations (drawing related) into your thread. If that is the case, you cannot call any QtGui drawing related methods. They all must be performed in the main thread. Do any data processing in other threads and then emit signals for the main thread to do widget updates.

    Look for what you are sending into the queue, and specifically what you are doing with it inside of your thread, as a cue to the source of the error. Somewhere, you are doing something with a QTextCursor, which is trying to trigger and queue up a paint event.

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

Sidebar

Related Questions

i'm trying to send a QList as a parameter to another class but for
I am trying to send JSON object as parameter. localhost:8080/HelloWorldApplication/webresources/helloworld/get/{param} During this process I
I am using https://github.com/plataformatec/simple_form and am trying to send a extra parameter. I have
Trying to send a complex type between two systems that have the same code
I have a C# application from which I am trying to send a parameter
I'm trying to do a jquery GET and i want to send a parameter.
I'm trying to send 2 parameter from one activity to another,but for some reason
I'm trying to send object as parameter to web service on java. It always
I am trying to send data to my jsp via:xhr.send(projectCode); but apparently the parameter
I am trying to call a process using System.Diagnostics.Process, send it a parameter, just

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.