[Gambas-user] qt4/qt5 and gb.gui.qt

gbWilly gbWilly at protonmail.com
Sat Jul 8 02:25:30 CEST 2023

------- Original Message -------
On Saturday, July 8th, 2023 at 00:27, T Lee Davidson <t.lee.davidson at gmail.com> wrote:

> On 7/7/23 16:07, gbWilly via User wrote:
> > Hi all,
> > 
> > I'm working on some old projects that have been laying around catching dust for years.
> > Now all these projects use gb.qt4 and qt4.ext.
> > 
> > Since I still have a few old systems running qt4 and the newer systems running qt5 I decided to go for gb.gui.qt, so that
> > applications will install on all systems regardless of qt4 or qt5.
> > 
> > So far so good, but what about gb.qt4.ext. It provides me with TextEditor which I use in some projects. There is no
> > gb.gui.qt.ext component to provide me with TextEdit in the IDE and my compiler complains and doesn't open my forms with
> > TextEditor on them.
> > 
> > So, if I want TextEditor I need to choose for either qt4 or qt5, which kinda makes no sense if you want to make packages that
> > work on both environments.
> > 
> > Any foreseen solutions for this problem?
> > Anybody else run into this maybe?
> > 
> > gbWilly
> > 
> > Sent with Proton Mail https://proton.me/ secure email.
> Perhaps load it dynamically based upon which graphical toolkit version got loaded:
> Public Sub Form_Open()
> If Component.IsLoaded("gb.qt5") Then
> Component.Load("gb.qt5.ext")
> Else
> Component.Load("gb.qt4.ext")
> Endif
> End

Hi Lee,

I have two problems with that:
1. To be able to use TextEditor in IDE during desing and coding I need to activate gb.qt5.ext on my system (as I have no qt4 on this system, nor gb.qt4 packages). This will activate gb.qt5 as well which in its turn creates an incompatibility with the selected gb.gui.qt. So, to design and test I have stick with qt5, no problem, but.... see 2.
2. If I now make a package to install on a qt4 system it will not install, as it packaged with gb.qt5 and gb.qt5.ext, and these systems only have gb.qt4 and gb.qt4.ext (older systems as I said).

So, to make a package for both qt4 and qt5 I need gb.gui.qt which will install depending on what is available on the target system. I can't package for gb.gui.qt as I have no gb.gui.qt.ext. And no gb.gui.ext also complains during compilation with a TextEditor on a form, so forget making a package without it, unless you remove the TextEditor of course...

As a workaround I would need to make a package on a qt5 system with gb.qt5 and gb.qt5.ext enabled as dependency and next on an older system make a package with gb.qt4 and gb.qt4.ext enabled as dependency.

So, I have a workaround, but it kind off makes no sense to have no gb.gui.qt.ext component so you can package applications using TextEditor gb.qt4/gb.qt5 independent.

But anayway thanks for thinking along,


More information about the User mailing list