Results 1 to 3 of 3

Thread: shared QUnstackStack among several QMainWindows ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2010
    Posts
    7
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Question shared QUnstackStack among several QMainWindows ?

    Greetings all,

    In my application,user can open several QWindows which share the same data.I needed to use one shared QUndoStack between the windows.

    Undo/Redo works fine,but when any of a QWindow closed, Undo/Redo menu get disabled.I guess its because the stack get cleared.

    Any tips? Thanks

    Here is a snapshot of my application - http://oi53.tinypic.com/2rfbztg.jpg

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: shared QUnstackStack among several QMainWindows ?

    I guess you need to write something of your own.

    How would the stack delete only those items that belong to one window?
    And if it does know how to do that, what sense does this make? Doesn't this mean that the whole undo/redo history is corrupted anyway?

  3. #3
    Join Date
    Apr 2010
    Posts
    7
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: shared QUnstackStack among several QMainWindows ?

    thanks tbscope for you answer,

    Actually , I dont want to delete items that belongs to a particular window.
    When undoing, it should do normal undo operation ,and it doesnt matter whether its same window or not.(Because my application uses MVC pattern,where I have one Data and multiple Views).
    Only problem is when I close any of the QMainWindow , my QUndoStack also get cleared.
    May be during onClose() method of QMainWindow, QT clears any QUndoStack attached to that.
    If you can just override this method,then I think I can solve the problem.



    Quote Originally Posted by tbscope View Post
    I guess you need to write something of your own.

    How would the stack delete only those items that belong to one window?
    And if it does know how to do that, what sense does this make? Doesn't this mean that the whole undo/redo history is corrupted anyway?

Similar Threads

  1. How to change between QMainWindows???
    By webquinty in forum Newbie
    Replies: 3
    Last Post: 16th October 2009, 10:46
  2. QT shared memory
    By sweetsubha2020 in forum Qt Programming
    Replies: 2
    Last Post: 18th January 2009, 05:30
  3. shared vs static
    By alisami in forum Installation and Deployment
    Replies: 3
    Last Post: 4th October 2008, 13:04
  4. Qt/Mac Shared Library
    By nareshqt in forum Qt Programming
    Replies: 0
    Last Post: 21st April 2008, 07:21
  5. STATIC vs. SHARED
    By KaptainKarl in forum Installation and Deployment
    Replies: 1
    Last Post: 27th August 2007, 16:31

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.