Re: [Interest] promoting a QGuiApplication to a QApplication?

2018-07-11 Thread René J . V . Bertin
On Wednesday July 11 2018 14:27:25 Furkan Üzümcü wrote: >dynamic_cast returns nullptr when the class you are casting is cannot be >cast down to Type. Casting does not create a new instance for you. Yeah, I think I was misinformed or I misunderstood something at some point when someone first int

Re: [Interest] promoting a QGuiApplication to a QApplication?

2018-07-11 Thread Furkan Üzümcü
> That's > what dynamic_cast also does when it doesn't simply return the original > pointer, no? dynamic_cast returns nullptr when the class you are casting is cannot be cast down to Type. Casting does not create a new instance for you. Regards, Furkan Üzümcü On Jul 11, 2018, 13:33 -0400, René J

Re: [Interest] promoting a QGuiApplication to a QApplication?

2018-07-11 Thread Thiago Macieira
On Wednesday, 11 July 2018 10:30:37 PDT René J.V. Bertin wrote: > On Wed, 11 Jul 2018 08:01:25 -0700, Thiago Macieira wrote: > > There's no such C++ concept as "promote a class". What you're asking is > > not possible. > > I think I got confused myself with dynamic_cast, but of course what I had >

Re: [Interest] promoting a QGuiApplication to a QApplication?

2018-07-11 Thread J.V. Bertin
On Wed, 11 Jul 2018 08:01:25 -0700, Thiago Macieira wrote: > There's no such C++ concept as "promote a class". What you're asking is > not possible. I think I got confused myself with dynamic_cast, but of course what I had in mind was not modifying the instance itself, but create a new QApplica

Re: [Interest] promoting a QGuiApplication to a QApplication?

2018-07-11 Thread Thiago Macieira
On Wednesday, 11 July 2018 07:48:31 PDT René J.V. Bertin wrote: > The only guarantee I can think of is would be promoting a QGuiApplication > instance to QApplication at runtime, in the plugin. There's no such C++ concept as "promote a class". What you're asking is not possible. If the QCoreAppl

Re: [Interest] promoting a QGuiApplication to a QApplication?

2018-07-11 Thread René J . V . Bertin
On Wednesday July 11 2018 17:20:51 Konstantin Tokarev wrote: Hi > If application object is created as QGuiApplication, you obviously cannot > cast it to QApplication. Maybe for casting, but > If you want to do something only when application object is created as > QApplication (or its subcla

Re: [Interest] promoting a QGuiApplication to a QApplication?

2018-07-11 Thread Konstantin Tokarev
11.07.2018, 12:29, "René J.V. Bertin" : > Hi, > > I'm tinkering with using a Qt plugin that expects a QApplication in a > QGuiApplication (specifically, a QML application using QGuiApplication). > I'm not doing anything that causes a straight crash (or haven't run into that > one fatal instruct