[Qt-interest] createEditor() larger than parent cell

Malyushytsky, Alex alex at wai.com
Sat Apr 11 03:17:59 CEST 2009


Israel,

There is nothing impossible, but there are some thing difficult to implement.

According to my understanding you can't make it to be drawn outside the cell, using standard QTable feature. The whole idea of the table is that the drawing occurs withing cell, so drawing of the cell is independent.
Otherwise it would be order dependant.

I would consider removing frame from the spinbox (if you don't), or just increasing cell height, but would nott go the way you chosen, but if you want you can have work around.

First you would have to subclass QSpinBox and make it draw itself the way you like if you place it over the cell (so it does not overlap gridlines except with arrows).

Then when createEditor() is called you, you would have to create an instance of it, position it over the cell and show.
You will have to close editor when it lose focus and do what QtableView does with thuch editors yourself.

It is not easy, but it should work.
I've do similar things for other purposes.
But in my opinion, this is not a reasonable case.

Regards,
      Alex





-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Israel Brewster
Sent: Friday, April 10, 2009 2:12 PM
To: qt-interest List
Subject: [Qt-interest] createEditor() larger than parent cell

I asked this a while ago, but didn't get any response, so I figured
I'd ask again. I have a QTableView and custom QItemDelegate in the
createEditor() function of which I am making a QSpinBox. I would like
to make the QSpinBox somewhat larger than the parent cell, i.e. let
the up and down arrows of the spin box overlap the next cell while
editing (or go off the edge of the table slightly if the last cell). I
tried just setting the size in the create editor function, but this
doesn't appear to stick. How can I manage this? Or is it simply
impossible? Thanks.

-----------------------------------------------
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


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."

"Please consider our environment before printing this email."




More information about the Qt-interest-old mailing list