Results 1 to 4 of 4

Thread: Signal QDataTable

  1. #1
    Join Date
    Sep 2006
    Posts
    42
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Signal QDataTable

    Hello all,

    It would like to know as I make to "emit" a "signal" of my Thread class where it processes update events, for my Form where if it finds the QDataTable.

    Necessary that the QThread method:: run () of thread returns the "QDataTable::refresh()", this must be simple more is not obtaining to make.

    It will be that somebody can show an example to me, please.

    Thanks,

    Cris.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Signal QDataTable

    Could you please try to describe your problem using correct English? After reading your question a few times I still can't make anything of it. Maybe if you posted some code which would illustrate your problem, it would be easier to understand what you request. If not, please try using a dictionary or an English speaking friend.

  3. #3
    Join Date
    Sep 2006
    Posts
    42
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Signal QDataTable

    Sorry for the bad English wysota,

    I am having difficulty in "emitting a signal" of my class Thread for form1 where I want that it makes an update "refreshs".

    /**
    *Class Thread.h
    */
    #ifndef THREAD_H
    #define THREAD_H

    #include <qthread.h>

    class Thread : public QThread
    {
    public:
    Thread();

    virtual void refreshSql();

    virtual void run();
    virtual void stop();

    };

    #endif
    /*******************************/

    /*
    * Thread.cpp
    */
    #include "thread.h"
    Thread::Thread(){}

    void Thread::run()
    {
    ......
    /* My Code ==> emit Form1->dataTable->refresh();*/
    .....
    }

    It would like in this method Thread::run() emit a signal for my QDataTable in form1 to be brought update, and I am not to implement this.

    something it type.

    emit Form1->dataTable->refresh();

    Cris.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Signal QDataTable

    I assume you are using Qt3. In that case emitting a signal from a worker thread to a widget is not thread safe. You should post an event to the widget instead - either a custom one which you will then handle yourself by implementing customEvent() and calling update() there or you can try to send a QPaintEvent event, so that it is handled by Qt internally.

    Of course you'll need a pointer to the table somewhere (I guess that was your main problem). You should store it in the thread class from some point where you can access both the thread and the form in question.

    I hope that helps.

Similar Threads

  1. Replies: 2
    Last Post: 17th May 2006, 21:01
  2. no such signal QListBox::currentChanged()
    By jopie bakker in forum Newbie
    Replies: 2
    Last Post: 2nd March 2006, 15:17
  3. send signal from QCombobox
    By raphaelf in forum Qt Programming
    Replies: 22
    Last Post: 28th February 2006, 14:18
  4. signal slot conection using a string, not a SLOT
    By rianquinn in forum Qt Programming
    Replies: 6
    Last Post: 5th February 2006, 18:52
  5. No such signal...
    By chaimar in forum Qt Programming
    Replies: 12
    Last Post: 24th January 2006, 22:33

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.