Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old November 7th, 2003, 10:30 PM
lazy_yogi lazy_yogi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 325 lazy_yogi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 58 m 36 sec
Reputation Power: 6
Qt Question

Hi, I was wondering if anyone could help with this QT problem.

I have a screenshot to help explain at :
http://www.cse.unsw.edu.au/~elip/screenshot.jpg

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 :


Code:

class formConnect(BaseGUI):

    def __init__(self, parent=None):
        BaseGUI.__init__(self, parent)

        self.connect(self.btn_customersadd,SIGNAL('clicked()'),self.setAddCustomerForm)

    def setAddCustomerForm(self):

        ### 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)
        customers_add_layout.setSpacing(0)
        customers_add_layout.setMargin(0)



Any help would be great
Thanx

Reply With Quote
  #2  
Old November 12th, 2003, 10:38 AM
telex4's Avatar
telex4 telex4 is offline
Wacky hack
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2001
Location: London, England
Posts: 512 telex4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 25 m 29 sec
Reputation Power: 8
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.

Reply With Quote
  #3  
Old November 13th, 2003, 01:44 AM
lazy_yogi lazy_yogi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 325 lazy_yogi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 58 m 36 sec
Reputation Power: 6
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

Cheers,
Eli

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Qt Question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway