[Qt-interest] Setting focus to a QTableWidget cell
Israel Brewster
israel at frontierflying.com
Thu Apr 2 22:44:03 CEST 2009
On Apr 2, 2009, at 7:44 AM, Duane Hebert wrote:
>
> "Raja Sekharan" <websweetweb at gmail.com> wrote in message news:gr2m1a$j2n$1 at eple.troll.no
> ...
>> Hi,
>>
>> In a table widget, I am trying to insert a new row and give the
>> user the
>> text cursor for the first cell in the row. But all I am able to do
>> with
>> setCurrentItem is select the cell, not focus it and give it the text
>> cursor. How do I automate the user action of the double clicking on
>> the
>> cell to edit it?
>
> How about QTableWidget::editItem ( QTableWidgetItem * item ) using
> the current item?
One caveat that I've run into with this is that you need to make sure
to BOTH set currentItem and editItem. It is perfectly happy to let you
edit an item that is not the current item, but then when you hit tab
or whatever to move to the next field, you find yourself experiencing
odd behavior. Or at least I did.
-----------------------------------------------
Israel Brewster
Computer Support Technician II
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------
> _______________________________________________
> 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