Results 1 to 7 of 7

Thread: launching animated window from already open window

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2012
    Posts
    35
    Thanks
    1
    Thanked 7 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default launching animated window from already open window

    I managed to animate open a window on startup, but I want to open a different window from already open window by pressing the button, in my case already open window is open in fullscreen mode with window.raise_()

    Not sure but is this why the window I am trying to animate open by pressing a button is not opening
    Qt Code:
    1. from PyQt4 import QtCore,QtGui
    2.  
    3. import sys
    4.  
    5. class WindLauncher(QtGui.QMainWindow):
    6. """ docstring for WindLauncher
    7. """
    8. def __init__(self):
    9. super(WindLauncher, self).__init__()
    10. self.btn = QtGui.QPushButton("Launch")
    11. self.btn.clicked.connect(self.launchWin)
    12. self.setCentralWidget(self.btn)
    13.  
    14.  
    15. def launchWin(self):
    16. main = MyTableView()
    17. sw = QtGui.QDesktopWidget().screenGeometry(main).width()
    18. sh = QtGui.QDesktopWidget().screenGeometry(main).height()
    19. animation = QtCore.QPropertyAnimation(main, "geometry")
    20. animation.setDuration(500);
    21. animation.setStartValue(QtCore.QRect(0, -(sh), sw, sh));
    22. animation.setEndValue(QtCore.QRect(0, 0, sw, sh));
    23. animation.start();
    24. self.show()
    25. self.raise_()
    26.  
    27. class MyTableView(QtGui.QTableView):
    28. """docstring for MyTableView"""
    29. def __init__(self, parent=None):
    30. super(MyTableView, self).__init__(parent)
    31.  
    32.  
    33. if __name__ == "__main__":
    34. application = QtGui.QApplication(sys.argv)
    35. main = WindLauncher()
    36. main.show()
    37. main.raise_()
    38. sys.exit(application.exec_())
    To copy to clipboard, switch view to plain text mode 
    Last edited by krystosan; 11th December 2013 at 18:38.

Similar Threads

  1. Replies: 2
    Last Post: 14th January 2013, 07:07
  2. Replies: 3
    Last Post: 23rd December 2010, 06:55
  3. Replies: 2
    Last Post: 17th September 2010, 11:44
  4. Replies: 0
    Last Post: 10th September 2010, 13:23
  5. Open a window inside another window
    By passerb in forum Qt Programming
    Replies: 6
    Last Post: 18th October 2009, 13:24

Tags for this Thread

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.