Re: [Interest] Using a QAbstractScrollArea

2019-03-23 Thread Giuseppe D'Angelo via Interest

Il 22/03/19 19:24, Bob Hood ha scritto:

I'm having a bit of a brain fart here.  I have a third-party class I'd like to
use that inherits from QAbstractScrollArea.  Qt Designer only knows about a
QScrollArea, though, which inherits QAbstractScrollArea.

How do I use this as a concrete Qt class type?  Do I inherit from QScrollArea
and then somehow change my parent to it?  Or do I have to inherit from the
third-party class, and then recreate the entire QScrollArea interface so it
"quacks" like a QScrollArea instance?


Is the question about how to use your custom class from Designer, or 
about how does QASA work and how's different from QSA?


Cheers,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts



smime.p7s
Description: Firma crittografica S/MIME
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Using a QAbstractScrollArea

2019-03-22 Thread Bob Hood

On 3/22/2019 3:53 PM, Konstantin Shegunov wrote:
On Fri, Mar 22, 2019 at 8:25 PM Bob Hood > wrote:


How do I use this as a concrete Qt class type?  Do I inherit from
QScrollArea
and then somehow change my parent to it?  Or do I have to inherit from the
third-party class, and then recreate the entire QScrollArea interface so it
"quacks" like a QScrollArea instance?


Hi!
What I usually do is to promote a placeholder that's as close to the custom 
widget as it can be. It's _probably_ going to work if you place a 
QScrollArea as placeholder and then promote it you your custom type (and 
don't modify its properties too heavily from the designer), but in case it 
doesn't you can always use a QWidget.


Hi back!  :)

I actually tried this before posting.  I placed a QScrollArea into Qt 
Designer, and then promoted it to a custom class that inherits the from the 
third-party class that inherits from QAbstractScrollArea.  Designer didn't 
complain, but when I tried to compile, the promoted class was missing the 
setWidgetResizeable() method that QScrollArea provides (since Designer assumes 
QScrollArea is the base class).


QAbstractScrollArea just seems like an odd base class to use, unless there's a 
design reason I'm missing (which is entirely possible).
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Using a QAbstractScrollArea

2019-03-22 Thread Konstantin Shegunov
On Fri, Mar 22, 2019 at 8:25 PM Bob Hood  wrote:

> How do I use this as a concrete Qt class type?  Do I inherit from
> QScrollArea
> and then somehow change my parent to it?  Or do I have to inherit from the
> third-party class, and then recreate the entire QScrollArea interface so
> it
> "quacks" like a QScrollArea instance?
>

Hi!
What I usually do is to promote a placeholder that's as close to the custom
widget as it can be. It's _probably_ going to work if you place a
QScrollArea as placeholder and then promote it you your custom type (and
don't modify its properties too heavily from the designer), but in case it
doesn't you can always use a QWidget.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Using a QAbstractScrollArea

2019-03-22 Thread Bob Hood
I'm having a bit of a brain fart here.  I have a third-party class I'd like to 
use that inherits from QAbstractScrollArea.  Qt Designer only knows about a 
QScrollArea, though, which inherits QAbstractScrollArea.


How do I use this as a concrete Qt class type?  Do I inherit from QScrollArea 
and then somehow change my parent to it?  Or do I have to inherit from the 
third-party class, and then recreate the entire QScrollArea interface so it 
"quacks" like a QScrollArea instance?


Thanks for kicking me in the head.  :)
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest