[PyKDE] Newbie: Initiate

Andreas Pakulat apaku at gmx.de
Sun Feb 12 12:40:50 GMT 2006


On 11.02.06 21:37:53, Jim Bublitz wrote:
> On Saturday 11 February 2006 18:39, Kuljo wrote:
> > Hi Mikhail,
> > thanks for your contribution. But I think, I did not
> > described my problem clear enough:
> > I have a kListBox1 which I want to fill with the names of
> > the directories out of a higher level directory. For this
> > purpose I have made a slot in the .ui.h file:
> >
> >     void MyBrain::listChapters()
> >     {
> >
> > self.kListBox1.insertStrList(listdir(getenv('HOME')+'/.mybrain'))
> >     }
> >
> > Now, the problem is, how should I activate this slot (which
> > works fine) without any user interaction so, that as soon as
> > the form starts up the listbox is already filled with data.
> > Sure, if I introduced a button and a connection e.g.
> >
> >     pushButton1 clicked() MyBrain listChapters()
> >
> > it does work swell. But it is, what I don't want.
> > I'm looking for a signal, which triggers this action
> > earliest at the creating of the kListBox1 but latest the
> > form is presented to the users.
> > Kind regards Lajos
> 
> Just call the slot that loads the data directly, as you would any other 
> function or method.

That only works when he subclasses the class created with designer. As
far as I can tell he doesn't want that. But he might have to, as that's
the only chance to call this function before the widget is shown.

Andreas

-- 
You'll wish that you had done some of the hard things when they were easier
to do.




More information about the PyQt mailing list