Results 1 to 7 of 7

Thread: event or thread

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2008
    Posts
    22
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: event or thread

    thanks for the response.

    I have spent my afternoon in it and the socket looks an importante notion but i haven't yet understood how use it.

    just to be sure : i can't connect a thread just like that ?
    int main()
    {
    MyThread a;
    MyThread b;
    a.start();
    b.start();
    QObject::connect(a, SIGNAL(thekey()), b, SLOT(recep()));

    error:
    tread.cpp: In function «int main()»:
    tread.cpp:44: erreur: incomplete type «QObject» used in nested name specifier
    tread.cpp:45: erreur: incomplete type «QObject» used in nested name specifier

    that would be very easy.

    i will try the socket thank you for your help

  2. #2
    Join Date
    Sep 2008
    Posts
    60
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: event or thread

    Take a look at the attached example where I used Caduel's advice (QSocketNotifier). It works with /dev/input/mouse1 on my laptop and is specific to mouse events (size of event is 3 bytes). But it'll give you a starting point on how to use signals and slots without using threads.

    I run it like this: sudo ./device /dev/input/mouse1
    Attached Files Attached Files

  3. #3
    Join Date
    Sep 2008
    Posts
    22
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: event or thread

    it's magic, i think it is exactly what i want.
    i will put it for qt3.

    thank you very much

  4. #4
    Join Date
    Sep 2008
    Posts
    22
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: event or thread

    it's ok that running I love the sockets now

Similar Threads

  1. Qt event queue overloading?
    By gct in forum Qt Programming
    Replies: 3
    Last Post: 17th March 2008, 18:39
  2. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  3. Main Thread Event loop
    By ^NyAw^ in forum Qt Programming
    Replies: 1
    Last Post: 20th March 2007, 12:10
  4. Problem closing a QMainWindow in Qt4.2
    By ian in forum Qt Programming
    Replies: 11
    Last Post: 17th October 2006, 00:49
  5. Workload in a QThread blocks main application's event loop ?
    By 0xBulbizarre in forum Qt Programming
    Replies: 14
    Last Post: 9th April 2006, 21:55

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
  •  
Qt is a trademark of The Qt Company.