Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to check whether the windows are already open..
Forum Updated to NodeBB v4.3 + New Features

How to check whether the windows are already open..

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 2.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    endla.ravi
    wrote on last edited by
    #1

    Hi...

    im designing a Messenger,and more like a yahoo messenger

    When a message comes at the client side,it should check whether the chat box pertaining to that user is already open or not.

    If i had the instance with me,i would have checked it by any means.But the problem is chat boxes are created some where else.

    Is there any way to check all the windows that are open in the program...

    Thanks in advance..

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      If you mean topLevel widgets, you can try "QApplication::topLevelWidgets()":http://doc.qt.nokia.com/4.7/qapplication.html#topLevelWidgets

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        You should have a "container class":http://doc.qt.nokia.com/latest/containers.html holding your chat windows. I'd suggest a "QHash":http://doc.qt.nokia.com/latest/qhash.html with the nickname as key and a pointer to the messenger window/widget as value.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved