Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, April 2008
Polish Event on QFileDialog?


Message 1 in thread

Qt 4.3.4, Red Hat Enterprise Linux 5

>i create a MyQFileDialog with "new" (not the static function)
>then call "show()" on this object and the Polish events never occurs...
>Any clue about the reason?


On Thu, Apr 10, 2008 at 6:45 PM, Véronique LEFRERE <veronique.lefrere@xxxxxx>
wrote:

>  Linux RedHat and what Qt release?
>
>
> Yannick Barbeaux a écrit :
>
> no, I do not use the static function because I do not want the filedialog
> to be modal.
> i create a MyQFileDialog with "new"
> then call "show()" on this object and the Polish events never occurs...
> Any clue about the reason?
>
> (Note: i work with Linux RedHat, not windows)
>
> On Thu, Apr 10, 2008 at 11:33 AM, LEFRERE Véronique <
> veronique.lefrere@xxxxxx> wrote:
>
> > in qfiledialog detailed description we can read...
> >
> > "The easiest way to create a QFileDialog is to use the static functions.
> > On Windows, these static functions will call the native Windows file dialog"
> >
> > maybe you call native window file dialog so this can be the reason of no
> > event::Polish in event handler?
> > to be confirmed.
> >
> >
> >
> > Quoting Yannick Barbeaux <ybarbeaux@xxxxxxxxx>:
> >
> >  I reimplemented the event handler so as to catch the polish event
> > > for a QFileDialog but the event doesn't seem to occur never?? Would
> > > the
> > > QFileDialog be a special case?
> > >
> > > bool MyQFileDialog::event(QEvent *event)
> > > {
> > >   if (event->type() == QEvent::Polish)
> > >   {
> > >        std::cout<<"Polish...\n";
> > >        return true;
> > >   }
> > >
> > >   event->accept();  // propagate event
> > >
> > >   return true;   // ?
> > > }
> > >
> > > On Wed, Apr 9, 2008 at 4:53 PM, Ross Bencina <
> > > rossb-lists@xxxxxxxxxxxxxx>
> > > wrote:
> > >
> > >  Hi Yannick
> > > >
> > > > perhaps QEvent::Polish could help you, although I'm not sure if it's
> > > > guaranteed to be sent just once.
> > > >
> > > > Ross.
> > > >
> > > > ----- Original Message ----- From: Yannick Barbeaux
> > > > To: qt-interest@xxxxxxxxxxxxx
> > > > Sent: Thursday, April 10, 2008 12:05 AM
> > > > Subject: equivalent of gtk Realize Event in QT ?
> > > >
> > > >
> > > >
> > > > I am looking for an equivalence of the Gtk  Realize Event on widget
> > > > in QT
> > > >
> > > > e.g. an Event  that occurs just once before the widget is shown
> > > > but does not occur everytime I hide then re-show the widget
> > > > (one option is to reimplement the show event and set a flag realized
> > > > to
> > > > true the first time so as to execute the desired code only once)
> > > >
> > > > void MyQWidget::showEvent(QShowEvent *event)
> > > > {
> > > >  if (r_isRealized == false)
> > > >  {
> > > >     r_isRealized = true;       // will execute this code only once
> > > >
> > > >     // more code here...
> > > >  }
> > > >
> > > >  event->ignore()
> > > > }
> > > >
> > > >
> > > > but would anyone have a better option to suggest?
> > > >
> > > >
> > >
> >
>