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. #3
    Join Date
    Nov 2012
    Posts
    35
    Thanks
    1
    Thanked 7 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: launching animated window from already open window

    Quote Originally Posted by ChrisW67 View Post
    What are the values of sw and sh at lines 17 and 18? What screen is an unshown widget on?
    Looking at that I updated my code but still it seems doesn't work, I just see a flickr

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

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
  •  
Qt is a trademark of The Qt Company.