Connection to worker(QThread) get broken in 5.12 update



  • Good evening everyone.

    My old project was made with 5.10 version, it works perfectly by then. No warnings in runtime. And today i opened it in my new Qt 5.12, just compile it, program runs well(as i thought), but i notice some changes, from QCreator side and QDesigner. Like option in Designer "horizontalHeaderMinimumSize(int)" was changed by framework from my old "1" value, to default(60 or smth), i about 20 minutes could'nt figure out why my simple part of code

    ui->tabWidMain->setColumnWidth(0, 6);
    

    not working anymore, because i know everything was fine before, so not by my actions such things work incorrect.

    But that quite simple example, hard task comes with thread, it gives me that message to Application Output in runtime when user trigger certain SIGNAL:

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

    At first version it was DWORD, but i changed it to HANDLE, so matter of this error is not a type i suppose, it is something with connection or i don't know what else it may be.

    While app was build on 5.10 it runs well, and thread with this single function was running properly as it should, now thread never starts, no reaction when SIGNAL triggered(only that message to output). I did not change anything really in this app, something get change without my knowledge like that parameter "horizontalHeaderMinimumSize(int)".

    Help please. The code in constructor:

    workerProc = new worker;
    procThread = new QThread;
    workerProc->moveToThread(procThread);
    connect(this, SIGNAL(sendHDL(HANDLE)), workerProc, SLOT(recieveProcHDL(HANDLE)));
    procThread->start(QThread::LowPriority);
    

  • Moderators

    Have you used qRegisterMetaType() like the error suggests?


  • Moderators

    I feel for you, by the way. Every new release since 5.9 kept breaking the projects I was working on. And 5.12... well, hard to comment on that. The UIs are completely broken or don't show at all.



  • @sierdzio uh really?
    hadn‘t yet the time to download it. I was hoping for magical fixes of a couple of issues I had

    I have a release date next week and I kind of wanted to use the new lte 😭



  • @sierdzio said in Connection to worker(QThread) get broken in 5.12 update:

    Have you used qRegisterMetaType() like the error suggests?

    Nope, i never used it before 'cause it never ask for it and everything was working perfectly.

    EDIT:
    Now i used it(in constructor, before everything). No messages to Output now, but thread still not working... And such stuff makes no sense i don't know:

    qRegisterMetaType<HANDLE>("HANDLE");
    

  • Lifetime Qt Champion

    Hi,

    Use the version without parameter. This one is for registering aliases.



  • @SGaist said in Connection to worker(QThread) get broken in 5.12 update:

    Use the version without parameter. This one is for registering aliases.

    already tried that at first, same effect like i'd not using it at all, same error and thread not working.



  • I totally removed that function, now thread works, i confused. Making projects on different versions definitely bad idea.

    But found new one. It tells that QListWidget don't have such SIGNAL anymore:

    QObject::connect: No such signal QListWidget::itemClicked(QListWidgetItem) in ..\OD\finalresult.cpp:36
    QObject::connect: (receiver name: 'FinalResult')

    Here this line 36:

    connect(&valList, SIGNAL(itemClicked(QListWidgetItem)), this, SLOT(listItemSelected(QListWidgetItem)));
    

    Again, everything was working, after run in 5.12 such dumb errors. itemClicked is not even my signal, it's Qt's...

    EDIT:
    Forgot ampersand sign*)


  • Moderators

    @Engelard said in Connection to worker(QThread) get broken in 5.12 update:

    Like option in Designer "horizontalHeaderMinimumSize(int)" was changed by framework from my old "1" value, to default(60 or smth), i about 20 minutes could'nt figure out why my simple part of code

    Use source control (like Git). This will make such changes easy to detect.

    @Engelard said in Connection to worker(QThread) get broken in 5.12 update:

    I totally removed that function, now thread works, i confused. Making projects on different versions definitely bad idea.

    But found new one. It tells that QListWidget don't have such SIGNAL anymore:

    I suspect you have stale files somewhere.

    1. Close Qt Creator.
    2. Delete your build folders.
    3. Delete your *.pro.user file
    4. Open your project again and rebuild.

    Does this make the errors go away?


  • Moderators

    @J.Hilk said in Connection to worker(QThread) get broken in 5.12 update:

    @sierdzio uh really?
    hadn‘t yet the time to download it. I was hoping for magical fixes of a couple of issues I had

    I have a release date next week and I kind of wanted to use the new lte 😭

    Try it out, maybe it'll work for you. I didn't yet have the time to check and report the issues, but it is mighty annoying that working apps suddenly have all their layouts completely broken - and no warnings or errors on the console. "Dear developer, guess what we've changed" kind of thing.

    I think I tried it back in Beta1 stage and the app worked, so maybe it will be fixed soon. As far as I know, Qt 5.12.1 already has 200+ bug fixes prepared (if you wonder why on earth would they release 5.12.0 when they already have hundreds of patches ready... I guess they rushed it so they can release during Qt conference).


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.