Qt-interest Archive, February 2007
Lazy tree model
Pages: Prev | 1 | 2 | Next
Message 16 in thread
> Why not QWidget?
No idea, ask the original poster.
> > > filter key events globally. Not that this is much nicer.
> >
> > Why not just override reject()?
I don't know if you can distinguish a 'reject' caused by the esc
key or the normal cancel button. If you can this really might be the
most elegant solution.
Guido
--
[ signature omitted ]
Message 17 in thread
"Guido Seifert" <wargand@xxxxxx> wrote in message
news:20070208063933.GA25877@xxxxxxxxxxxxxxxxxxx
> > Why not QWidget?
>
> No idea, ask the original poster.
>
> > > > filter key events globally. Not that this is much nicer.
> > >
> > > Why not just override reject()?
>
> I don't know if you can distinguish a 'reject' caused by the esc
> key or the normal cancel button. If you can this really might be the
> most elegant solution.
Not directly but you can easily know when a button is clicked.
What we usually do is add a slot fired on the cancel button and
call QDialog::reject() there.
--
[ signature omitted ]
Message 18 in thread
Hmmm... I'll check and see. I don't think I'm doing anything that
demands a QDialog. Although, I created the windows in designer... That
might automagically make it a QDialog. I'll have to check to see what I
can do.
-----Original Message-----
From: Anderson Medeiros Gomes [mailto:amg1127@xxxxxxxxx]
Sent: Wednesday, February 07, 2007 2:51 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: ESC kills program.
If you filter the ESCAPE key by using QWidget::keyPressEvent(), you
must do it for all windows in your application. So, you will write
unnecessary code.
Use QWidget instead of QDialog in your window classes, unless you are
using some QDialog-exclusive feature.
2007/2/7, Allen, Matthew <allenm@xxxxxxxxxxxxxxxxxxxxxx>:
> Qdialog...
>
> So there isn't a way to get ESC to be ignored? I'm trapping the X
button
> close event right now.
>
> -----Original Message-----
> From: Anderson Medeiros Gomes [mailto:amg1127@xxxxxxxxx]
> Sent: Wednesday, February 07, 2007 4:25 AM
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Re: ESC kills program.
>
> Your window class inheris QWidget or QDialog?
>
> If you are using QDialog, it will close the window when ESC is hit and
> you
> can't ignore the closeEvent().
>
> > Allen, Matthew schrieb:
> > > I've got an issue where someone hitting ESC kills my program. I am
> > > handling the closeEvent() which I thought was caused by ESC or
> closing
> > > the window. Thoughts on what ESC sends? Or how to trap ESC?
> >
> > QWidget::keyPressEvent()?
> >
> > Martin
>
>
>
> --
> Anderson Medeiros Gomes
> amg1127@xxxxxxxxx
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
--
[ signature omitted ]
Message 19 in thread
On Tuesday 06 February 2007 22:48, M. Ritscher wrote:
> On Tuesday 06 February 2007 10:34, Benjamin Meyer wrote:
> > > (Not that I care much about the animation, it's just that I want to
> > > understand it).
> >
> > You should call beginInsertRows() before actually inserting the rows :)
>
> Well, but for that I need to know the number of rows I want to add, don't
> I?
In your current model's code, no you don't know, but you can expose the
functions similar to the way qtreewidget/qtablewidget/qlistwidget do it so
that the items could call beginInsertRows before inserting items.
-Benjamin Meyer
--
[ signature omitted ]
Message 20 in thread
on Sun, 4 Feb 2007 23:14:38 M. Ritscher wrote
>I have tried to follow Benjamin Meyer's example of a model populating a
>treeview lazily using fetchmore and canfetchmore.
>It works for the root node but for some reason I'm missing to detect, not >for the subnodes.
I just discovered that the children are displayed after opening, closing and reopening the node.
The second time round canFetchMore doesn't seems to be called but rowCount now (since the child was populated the first time round) returns not 0 for the node.
The problem seems to be that rowCount is not called again for that node after canFetchMore was called. I only see calls to rowCount for the root node after expanding and fetchMore.
(qt.4.2.2)
Completely puzzled at the moment!
Meinhard
--
[ signature omitted ]