[Qt-interest] Add "external" graphical elements to a derived widget?

K. Frank kfrank29.c at gmail.com
Sat Mar 20 17:17:21 CET 2010


André -

Thanks.

On Sat, Mar 20, 2010 at 9:30 AM, André Somers <andre at familiesomers.nl> wrote:
> Hi,
> I don't think there is an easy way to do what you want.

Yes, I don't see any way either.

> I would go for your approach 2, deriving from QWidget or QFrame and
> putting the (modified) QTableWidget inside of it.
> ...

I have two follow-up questions:

First, could you give me a little guidance on the difference between QWidget
and QFrame, and whether I might prefer one over the other?

Second -- and this is not a big deal -- when I derive my custom widget from
QWidget, then to use it in Qt designer, I drop a QWidget on my form, and
then promote it to my custom widget.  A minor inconvenience with this is
that the place-holder QWidget behaves a little differently in Qt designer
that does QTableWidget or my custom widget.  It looks different, and it
sizes itself differently in layouts, and such.  Is there any (easy) way to get
my place-holder widget (in my test case, a QWidget) to mimic in Qt designer
more closely QTableWidget (or my custom widget)?

Your advice is appreciated.


K. Frank


> ...
> André
> -----Oorspronkelijk bericht-----
> Onderwerp: [Qt-interest] Add "external" graphical elements to a derived
> widget?
>
> Hi List -
> I would like to derive a widget from QTableWidget, but have the custom
> widget contain
> some additional graphical elements (check boxes, and labels, and the
> like) that appear above the table proper.
> ...




More information about the Qt-interest-old mailing list