Results 1 to 2 of 2

Thread: [OS X] Multiple QMainWindow instances, menubar problem

  1. #1
    Join Date
    May 2008
    Posts
    7
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default [OS X] Multiple QMainWindow instances, menubar problem

    Qt 4.5
    OS X

    I have two QMainWindow instances of the same class, I create them on the heap. No problem there. The QMainWindow have a tabbar with content from a file in each tab.
    The problem is when I call "Open" from the menubar, then the first created window open the selected file. I have no idea how I can tell the difference of which window is calling "Open" and how to open the file in the second window.

    Any ideas?

  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: [OS X] Multiple QMainWindow instances, menubar problem

    Is "Open" something OSX related or simply an action in your application? If you have two instances of the same main window class, you probably have to instances of the "Open" action as well, so it should be simple to determine which one was triggered by calling QObject::sender() from within a slot connected to its triggered() signal. Especially that the slot will be called on behalf of a particular instance of the window as well.

  3. The following user says thank you to wysota for this useful post:

    mchrk (6th January 2009)

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.