November 7th, 2003, 11:30 PM
Hi, I was wondering if anyone could help with this QT problem.
I have a screenshot to help explain at :
Anyway, I want it so that when the "Add Customer" button is pressed the right frame displays a form to get the details of a new customer, then when "Remove customer" another form is displayed .. etc.
I tried making the form to add a customer in another widget and tried this code :
def __init__(self, parent=None):
### this is the widget which inherits QWidget that I'm
### trying to add to the frame I've put on the right side
### which I've called "self.Frame_customers_right"
self.Form_add_customer = Form_add_customer(self.Frame_customers_right)
customers_add_layout = QHBoxLayout(self.Form_add_customer)
Any help would be great
November 12th, 2003, 11:38 AM
Is that all the code you have for the popup form? If so, can you post the error trace that is put out by python when it fails?
A general tip is to use Qt Designer to create the forms, since they will then always work, meaning that the only mistakes you will make will be in the code that manipulates the forms.
November 13th, 2003, 02:44 AM
no .. it wasn't a popup .. it was in a frame.
I wanted to remove a panel in the main wndow and put in a different one.
In the end, I put both 2 obects in the same position and just used:
object.hide() with one and object2.show() with the other so only one forms objects are displayed at a time.
The layout isnt as modular as i'd have liked .. but it works
I would have preffered to make 2 widgets and put in one and delete the old one depending on the action to be performed