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

T Lee Davidson t.lee.davidson at gmail.com
Sat Jul 8 00:27:53 CEST 2023


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


-- 
Lee



More information about the User mailing list