[PyKDE] Proper way to show multiple windows?

star gazer th1138x at yahoo.com
Sat Jan 25 16:31:01 GMT 2003


Ken,
 
I did the isModal() check and it returned 0 but using
nw.show() does not leave the window up it just flashes
away.  If I use nw.exec_loop() then the window stays
up but I can't open another on.  This was so easy to
do in wxpython.  It must be as easy here I just can't
figure it out

SG


--- Kenneth Godee <Ken at perfect-image.com> wrote:
> Ok, here's a couple of things to try/look at....
> 
> Did you do a isModal() on your "nw" instance?
> This will return true or false, don't
> assume it's not modal because you gave it = 0
> 
> Try nw.show()
> instead of nw.exec.loop()
> 
> Show() I believe will pass control back to calling
> program.
> 
> You might have to put the calling program/window
> into a "while"
> loop. 
> 
> Just a couple of ideas.
> 
> 
> 
> What your trying to do should work.
> The reason I wanted to see the rest of 
> the inhert calls, is because PyQt has a limit 
> of like two inherts.
> 
> 
> > SearchScreen.__init__(self,parent,name,modal,fl)
> > 
> >         def newWin(self):
> >             nw = custDetailImp()
> >             nw.exec_loop()
> 
>              
> 
> 
> 
> 
> 
> 
> 
> > 
> > ****************
> > class musicDetail(QDialog):
> >     def __init__(self,parent = None,name =
> None,modal
> > = 0,fl = 0):
> >        
> QDialog.__init__(self,parent,name,modal,fl)
> > 
> > ****************
> > --- Kenneth Godee <Ken at perfect-image.com> wrote:
> > > For the most help, please cc the list.
> > > 
> > > Ok, like I said I'm pretty new to this....
> > > But I'm still trying to see what qt class/widget
> > > your basing
> > > your class on....
> > > 
> > > nw = musicDetailimp, which inherts musicDetail,
> > > which herits ????
> > > 
> > > 
> > > For instance, I've a form that calls a fuction
> > > that produces a dialog window.....
> > > 
> > > 1.
> > > def srch_dialog(self, vparent):
> > >     srch = srch_class(parent = vparent, modal =
> 1)
> > > 
> > > 2.
> > > class srch_class(SearchForm):
> > >     def __init__(self,parent = None,name =
> > > None,modal = 0,fl = 0):
> > >        
> > > SearchForm.__init__(self,parent,name,modal,fl)  
>  
> > > 
> > > 3.
> > > class SearchForm(QDialog):
> > >     def __init__(self,parent = None,name =
> > > None,modal = 0,fl = 0):
> > >        
> QDialog.__init__(self,parent,name,modal,fl)
> > > 
> > > The widget I'm basing every thing on is QDialog.
> > > 
> > >
> >
>
----------------------------------------------------------
> > > 
> > > Ok, I've another form, maybe better example...
> > > This form has a listbox in it. When I click on a
> > > item in the list
> > > box it calls this function...
> > > 
> > > def func_addialog(self,value,invnum):
> > > # creates instance of dialog window
> > >     cac = createcopy(parent = value, modal = 1,
> fl =
> > > 0)
> > > 
> > > 
> > > class createcopy(addcopy):
> > >     def __init__(self,parent = None,name =
> > > None,modal = 0,fl = 0):
> > >        
> addcopy.__init__(self,parent,name,modal,fl)
> > > 
> > > class addcopy(QDialog):
> > >     def __init__(self,parent = None,name =
> > > None,modal = 0,fl = 0):
> > >        
> QDialog.__init__(self,parent,name,modal,fl)
> > > 
> > >
> >
>
----------------------------------------------------------
> > > Another thing I find helpfull is to make sure 
> > > the window your is truley modal or not?
> > > Have you used the isModal()?, I've had many
> times
> > > I thought I called it one thing and turned out
> to be
> > > another.
> > > Also look into the difference between....
> > > exec_loop() and show()
> > > 
> > > Just some thoughts.
> > > Ken
> > > 
> > > 
> > > 
> > > On Thu, 23 Jan 2003 21:21:08 -0800 (PST)
> > > star gazer <th1138x at yahoo.com> wrote:
> > > 
> > > > Thanks for the help.
> > > > here is a snippet of the mainclass...
> > > > class searchMenuImp(SearchScreen):
> > > >     
> > > >         def __init__(self,parent = None,name =
> > > > None,modal = 0,fl = 0):
> > > >            
> > > >
> SearchScreen.__init__(self,parent,name,modal,fl)
> > > >            
> > > self.lv_search.setAllColumnsShowFocus(1)  
> > > >   
> > > >     
> > > >         def newWin(self):
> > > >             nw = musicDetailImp()
> > > >             nw.exec_loop()
> > > > 
> > > > 
> > > > from a imported file is the ref to ...
> > > > 
> > > > class musicDetailImp(musicDetail):
> > > >    def __init__(self,parent = None,name =
> > > None,modal =
> > > > 0,fl = 0):
> > > >      
> > > musicDetail.__init__(self,parent,name,modal,fl)
> > > > 
> > > > 
> > > > Thanks
> > > > 
> > > > Star Gazer
> > > > 
> > > >   
> > > > --- Kenneth Godee <Ken at perfect-image.com>
> wrote:
> > > > > On Thu, 23 Jan 2003 16:08:03 -0800 (PST)
> > > > > star gazer <th1138x at yahoo.com> wrote:
> > > > > 
> > > > > > I'm trying to figure out the correct way
> to
> > > > > display
> > > > > > multiple windows, filled with info, based
> on a
> > > > > mysql
> > > > > > lookup by double-clicking on a line in a
> > > QListView
> > > > > > box. I have the lookup working the
> Qlistview
> > > > > working
> > > > > > and I have the info screen working.  The
> > > problem
> > > > > is I
> > > > > > am not sure of the correct way to display
> the
> > > info
> > > > > > screens. In Wxpython I did the following
> > > > > procedure, it
> > > > > > allowed me to dbl-clk on as many items as
> I
> > > wanted
> > > > > to
> > > > > > just by going back to the master window
> and
> > > > > dbl-clking
> > > > > > on another line and it would open another
> 
=== message truncated ===


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com




More information about the PyQt mailing list