473,325 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

PyQt: how to open a dialog made in designer

17
So ive got a bit of a problem here. Ive been searching the net about this for quite some time now but i just cant seem to figure out how to open a dialog that ive made in QtDesigner.
Of corse i used pyuic4 to make it into python code.

This is the code for my dialog window(it contains just a TextEdit and a LineEdit):
Expand|Select|Wrap|Line Numbers
  1. from PyQt4 import QtCore, QtGui
  2.  
  3. class Ui_Dialog(object):
  4.     def setupUi(self, Dialog):
  5.         Dialog.setObjectName("Dialog")
  6.         Dialog.resize(QtCore.QSize(QtCore.QRect(0,0,400,283).size()).expandedTo(Dialog.minimumSizeHint()))
  7.  
  8.         self.textEdit = QtGui.QTextEdit(Dialog)
  9.         self.textEdit.setGeometry(QtCore.QRect(13,14,381,231))
  10.         self.textEdit.setObjectName("textEdit")
  11.  
  12.         self.lineEdit = QtGui.QLineEdit(Dialog)
  13.         self.lineEdit.setGeometry(QtCore.QRect(20,250,371,27))
  14.         self.lineEdit.setObjectName("lineEdit")
  15.  
  16.         self.retranslateUi(Dialog)
  17.         QtCore.QMetaObject.connectSlotsByName(Dialog)
  18.  
  19.     def retranslateUi(self, Dialog):
  20.         Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
So how would i go about to get this dialog to show?
I've tried this method here beneather. It doesnt produce any errors, but the dialog doesnt appear eather.

Expand|Select|Wrap|Line Numbers
  1. def openDialog(self):
  2.     window = QtGui.QDialog()
  3.     d = TestDialog()
  4.     d.setupUi(window)
  5.     window.show()
Thanks for your help guys
Mar 4 '08 #1
0 1816

Sign in to post your reply or Sign up for a free account.

Similar topics

35
by: Vamsi Mudrageda | last post by:
I am kind of new to Python, and after trying and using wxPython, I found it kind of lacking in easy-to-read documentation, speed at loading, and GUI response-time. So I am looking for an another...
8
by: simo | last post by:
OK, so I'm at the stage where I want to make a choice between wxPython and PyQt. Currently I'm using wxPython mainly due to the fact that it has GPL Linux and Windows versions. I prefer Qt to...
4
by: Phil Thompson | last post by:
Riverbank Computing is pleased to announce the release of PyQt v3.14 available from http://www.riverbankcomputing.co.uk/. Changes since the last release include support for QScintilla v1.5. ...
3
by: Phil Thompson | last post by:
Riverbank Computing is pleased to announce the release of PyQt v4.0beta1 available from http://www.riverbankcomputing.co.uk/pyqt/. PyQt is a comprehensive set of Qt bindings for the Python...
5
by: Marcpp | last post by:
I have a program (python + pyqt), with a button I'll would to open a new dialog window to input text, when press save or ok, this text is returned to the principal program. I've seek in internet...
2
by: skawaii | last post by:
Ok, here's what's going on. I've just created a custom widget. it works great. I'm having some trouble, however, figuring out how to allow the said widget to resize. For example, when I throw the...
0
by: David Boddie | last post by:
On Fri Nov 2 12:59:48 CET 2007, Bart. wrote: You can use PyQt, Kross or PythonQt for this, but only PyQt will give you a comprehensive API "out of the box". There is code in the PyQt source...
2
by: Kevin Walzer | last post by:
is it possible to write the GUI code for PyQt applications by hand or is using the Qt Designer an essential part of the process? Coming from a Tkinter background, with a little exposure to...
6
by: king kikapu | last post by:
Hi, this is actually goes to whoever is using Eclipse and Eric4, the IDE that comes bundled with PyQt. I was using Eclipse until i saw Eric4 and i started experiment with it, very nice work. ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.