[Qt-interest] How to set header on aQTableWidget to span two columns?

Sriram Durbha sriram.durbha at gmail.com
Wed Mar 4 21:03:39 CET 2009


Hi,
 Unfortunately following the FAQ linked below is not useful.  That solution
leads to a situation where the Header can be re sized independent of the
columns it is a header for.  This leads to some major inconsistency.  So I
am trying different approaches.

   1.  Make my own Table Widget from a Grid Layout ->  "Looks" like what i
   want, but lot of stuff that comes for free with QTableWidget needs to be
   redone.
   2. Make a Custom Class clled PairedLineEdits and use it as the
   QTableWidgeItem for the columns where it is needed.

Another approach might be to not display the Horizontal Header and just use
the Top Row as the Header ..
Any ideas on how to achieve this?

Thanks
Cheers
Ram

On Tue, Mar 3, 2009 at 1:09 PM, Efan... <efanharris at gmail.com> wrote:

> Ram,
> Then I think you will have to do your own painting, for the two "section"
> which you want to merge in QHeaderView,
>
> Efan...
> On Tue, Mar 3, 2009 at 12:56 PM, Sriram Durbha <sriram.durbha at gmail.com>wrote:
>
>> Hi,
>> I have since found this link
>> http://www.qtsoftware.com/developer/faqs/faq.2007-09-26.7736043425
>>
>> QTableView::setSpan() seems to work only for the viewport or the data
>> cells not the header cells.
>> I am not QTextTable will be the suitable widget for the dialog i am
>> building, mainly because it doesnt immediately look like an input widget.
>> Thanks
>> Cheers
>> Ram
>> - Show quoted text -
>>
>>
>> On Tue, Mar 3, 2009 at 12:25 PM, Israel Brewster <
>> israel at frontierflying.com> wrote:
>>
>>> On Mar 3, 2009, at 10:41 AM, Efan... wrote:
>>>
>>> Hello Raamsee splitCell of QtextTable if that helps?
>>>
>>>
>>> Actually I think mergeCells would be what he is going for, except that he
>>> doesn't have a QTextTable, he has a QTableWidget. For a QTableWidget, it
>>> looks to me like the void QTableView::setSpan() function (which
>>> QTableWidget inherits) is what is being looked for.
>>>
>>> -----------------------------------------------
>>> Israel Brewster
>>> Computer Support Technician
>>> Frontier Flying Service Inc.
>>> 5245 Airport Industrial Rd
>>> Fairbanks, AK 99709
>>> (907) 450-7250 x293
>>> -----------------------------------------------
>>>
>>>
>>> On Tue, Mar 3, 2009 at 11:02 AM, Sriram Durbha <sriram.durbha at gmail.com>wrote:
>>>
>>>>
>>>> Hi,
>>>>  I'm trying to prepare a QTableWidget which will be used to populate a
>>>> table of statistics like the one shown in the attached image.
>>>> How do i set the Headers  so that they span two columns? [ And possibly
>>>> the first header to span two rows]
>>>>
>>>> Thanks
>>>> Cheers
>>>> Ram
>>>>
>>>> _______________________________________________
>>>> 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
>>>
>>>
>>>
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090304/81d5c194/attachment.html 


More information about the Qt-interest-old mailing list