Qt World Summit: Register Today!

Problem with thread

  • I want to do simple mistake search for my redactor, it is work good, but very slonly, and i set it in the separete thread
    I am programme on the VS 2008, in release search work in 70 % alright, in 30% get error(this is due to chance), and if i want to end program when search is work programm get me error
    I want to set code of thread and thread call in exceptions, but it is dont work
    When i try to complile program in debug and start of search mistake, and it is get me error
    Here the call stack:
    the following statement, which should be executed
    @template <typename Wrapper> static inline typename Wrapper::pointer qGetPtrHelper(const Wrapper &p) { return p.data(); }@
    This is code of QDockWidget, where call mistake search
    @#include "searchMistakes.h"
    #include "QString"
    #include "searchMistakeThread/searchMistakeThread.h"
    #include "rizekqsseditor.h"

    #include "QDebug"

    searchMistakes::searchMistakes(QWidget *parent, Qt::WFlags flags)
    : QDockWidget(parent, flags)
    thread = new searchMistakesThread;

    void searchMistakes::findMistakes()
    connect(thread, SIGNAL(finished()), thread, SLOT(quit()));
    qDebug() << "Error";
    But the code of the thread is too big, but is it need i try reduce it and lay out it
    Advance many thanks for your help!

  • It looks very much like this call:

    points to the root of your problem: you are trying to manipulate GUI elements from your thread. You are not allowed to do that. Furtheremore, the fact that you subclassed QThread could point to you using QThread in the wrong way. Please read "this wiki article":http://developer.qt.nokia.com/wiki/Threads_Events_QObjects and see if you made any of the mistakes that were outlined there.

  • I know enlish very know, but as far as I could understand this possible occur because i use direct appeal objects from main thread:
    output->addItem(tr("Start of search mistakes"));
    If i will replace this to signals and slots, is it could work write?
    As i understand it will be

  • Many thanks for your, help!

Log in to reply