Results 1 to 2 of 2

Thread: Communication Help Pls

  1. #1
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Communication Help Pls

    Hi,

    I have a QListWidget which is a child of some widget. This "some" widget is inturn the child of a QSplitter which is the child of QMainWindow.

    Now, When QListWidget is focused, One of the Menu Items of the application should change.

    Which is the best way to communicate to the Application Window that the ListWidget is focused in or out.

    Currently my focusInEvent and focusOutEvent emit a signal which is connected to a slot in its parent which in turn emits a signal to a slot in its parent and finally to the mainwindow.

    Is it a good way ?

    Thanks a lot.

  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: Communication Help Pls

    Yes, it's fine. Alternatively you could connect to QApplication signal focusChanged() and in the slot check if the widget receiving or losing focus is the listwidget and act upon it.

Similar Threads

  1. Communication between Threads
    By Wan-Hi in forum Newbie
    Replies: 11
    Last Post: 24th January 2013, 13:52
  2. C++ Library for serial communication
    By dec0ding in forum General Programming
    Replies: 7
    Last Post: 8th July 2007, 19:18
  3. Tabs communication
    By therealjag in forum Qt Programming
    Replies: 6
    Last Post: 18th April 2006, 19:19
  4. Threads communication
    By probine in forum Qt Programming
    Replies: 4
    Last Post: 31st March 2006, 15:46

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.