Results 1 to 1 of 1

Thread: how to open a Dialog window on top of my mainwindow

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default how to open a Dialog window on top of my mainwindow

    When I try go show a window (AddUserGui) it just resize the Ui_MainWindow. I think the problem occurs when I send "self" as a argument. How do you solve this? or is this a stuipd way to do it?


    Qt Code:
    1. from PyQt4 import QtCore, QtGui
    2. from libarylib import *
    3. from bibgui import Ui_MainWindow
    4. from addusergui import Ui_Dialog as AddUserGui
    5. import sys
    6.  
    7.  
    8. class mainGuiWindow(QtGui.QMainWindow):
    9.  
    10. def __init__(self, parent=None):
    11. QtGui.QWidget.__init__(self, parent)
    12. self.ui = Ui_MainWindow()
    13. self.ui.setupUi(self)
    14.  
    15. self.connect(self.ui.pushButton_3, QtCore.SIGNAL("clicked()"), self.addUser)
    16.  
    17.  
    18.  
    19. def addUser(self):
    20. self.adduser = AddUserGui()
    21. self.adduser.setupUi(self) #<-- this don't work
    22.  
    23.  
    24.  
    25.  
    26.  
    27.  
    28.  
    29.  
    30. if __name__ == "__main__":
    31. app = QtGui.QApplication(sys.argv)
    32. myapp = mainGuiWindow()
    33. myapp.show()
    34. sys.exit(app.exec_())
    To copy to clipboard, switch view to plain text mode 
    Last edited by implor; 10th May 2010 at 00:39.

Similar Threads

  1. Open Dialog from MainWindow.
    By halvors in forum Qt Programming
    Replies: 8
    Last Post: 1st April 2010, 02:09
  2. Open mainwindow
    By cwnelatury in forum Newbie
    Replies: 1
    Last Post: 17th April 2009, 23:46
  3. Communication between MainWindow and a dialog
    By Backslash in forum Newbie
    Replies: 9
    Last Post: 3rd August 2007, 05:27
  4. Opening a Dialog from a MainWindow FileMenu
    By nbkhwjm in forum Newbie
    Replies: 4
    Last Post: 17th April 2007, 13:24
  5. Replies: 3
    Last Post: 23rd July 2006, 19:02

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.