[Qt-interest] QWidget::SetTabOrder question?
Jeffery MacEachern
j.maceachern at gmail.com
Wed Aug 11 00:26:54 CEST 2010
On Tue, Aug 10, 2010 at 14:23, Eric Clark <eclark at ara.com> wrote:
> Sorry about sending this to you directly Jeff.
>
> -----Original Message-----
> From: Eric Clark
> Sent: Tuesday, August 10, 2010 4:22 PM
> To: 'Jeffery MacEachern'
> Subject: RE: [Qt-interest] QWidget::SetTabOrder question?
>
> I guess I could call it until there is no previous... What I really have is a collection of widgets (two or more) that are linked via the setTabOrder function. When I
> get to the last widget, I would like to link that widget back to the first widget in the chain to have the last tab go back to the beginning. By the time I get to the
> last widget, I no longer know the first widget in the chain. I was hoping to find a function where I could index the chain or get the first widget in the chain easily
> without having to keep calling previousInFocusChain over and over until there is no previous. I was unaware of the functions you gave me,
I was unaware of them as well - I just quickly checked the docs when
you asked. There might be a better way of doing it that I'm not aware
of.
> so I will probably, for now, write a function that gets the first by calling previousInFocusChain until no more. Can you tell me if these functions are strictly used
> for the tab order? Or do the functions include Qt's default tab order? What I mean is, if I call previousInFocusChain recursively until it returns 0, will that widget
> be the first widget in my tab order?
I'm not entirely sure what you mean. Are you trying to make the
taborder of a specific subset of the widgets in your window wrap
around, as opposed to continuing on to other widgets? If so, I think
you might need to fiddle with the focus settings of the other widgets.
As I said, I've never actually used these functions, so I'm not
certain.
>
> Thanks,
> Eric
- Jeffery MacEachern
>
>> -----Original Message-----
>> From: Jeffery MacEachern [mailto:j.maceachern at gmail.com]
>> Sent: Tuesday, August 10, 2010 4:14 PM
>> To: Eric Clark
>> Cc: Qt Interest (qt-interest at trolltech.com)
>> Subject: Re: [Qt-interest] QWidget::SetTabOrder question?
>>
>> Is QWidget::{next,previous}InFocusChain() what you're looking for?
>> - Jeffery MacEachern
>>
>>
>>
>> On Tue, Aug 10, 2010 at 12:59, Eric Clark <eclark at ara.com> wrote:
>> > Hello All,
>> >
>> >
>> >
>> > I was wondering if there is a way to get the tab order after it has
>> > already been set. For example, if I have this:
>> >
>> >
>> >
>> > QWidget *widget1 = new QWidget();
>> >
>> > QWidget *widget2 = new QWidget();
>> >
>> >
>> >
>> > QWidget::setTabOrder(widget1, widget2);
>> >
>> >
>> >
>> > Is there any way for me to ask what widget is first in the order and
>> > get back a pointer to widget1?
>> >
>> >
>> >
>> > Thank you in advance!
>> >
>> > Eric
>> >
>> > _______________________________________________
>> > Qt-interest mailing list
>> > Qt-interest at trolltech.com
>> > http://lists.trolltech.com/mailman/listinfo/qt-interest
>> >
>> >
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list