[Gambas-user] About qt, a little issue

Gianluigi bagonergi at gmail.com
Mon Jun 17 12:20:04 CEST 2019


Hi Fabien,
with profiling enabled, they seem equivalent here.
'---------------------------------------------------
Public Sub Main()

  Fabien
  'Gianluigi

End

Private Sub Fabien()

  Dim s As String = "3.13.90"
  Dim ars As String[]

  's = System.FullVersion
  ars = Scan(s, "*.*.*")
  If ars[0] = "3" Then
    If Len(ars[1]) = 1 Then
      s = ars[0] & ".0" & ars[1] & "." & ars[2]
    Endif
  Else
    Print "#Unable to proceed"
    Quit
  Endif
  If s > "3.08.0" Then
    Print "Project A"
  Else
    Print "Project B"
  Endif

End

Private Sub Gianluigi()

  Dim s As String = "3.13.90"

  's = System.FullVersion
  If Scan(s, "*.*.*")[0] = "3" Then
    If Len(Scan(s, "*.*.*")[1]) = 1 Then
      s = Scan(s, "*.*.*")[0] & ".0" & Scan(s, "*.*.*")[1] & "." & Scan(s,
"*.*.*")[2]
    Endif
  Else
    Print "#Unable to proceed"
    Quit
  Endif
  If s > "3.08.0" Then
    Print "Project A"
  Else
    Print "Project B"
  Endif

End
'----------------------------------------------
Regards
Gianluigi

Il giorno lun 17 giu 2019 alle ore 10:41 Fabien Bodard <gambas.fr at gmail.com>
ha scritto:

> not better but :
>
> Dim s As String
> Dim ars as string[]
>   s = System.FullVersion
>   ars=scan(s,"*.*.*")
> If ars[0] = "3" Then
>     If Len(ars[1]) = 1 Then
>       s = ars[0] & ".0" & ars[1] & "." & ars[2]
>     Endif
>   Else
>     Print "#Unable to proceed"
>     Quit
>   Endif
>   If s > "3.08.0" Then
>     'Component.Load...
>     Shell "./ProgA.gambas"
>   Else
>     'Component.Load...
>     Shell "./ProgB.gambas"
>   Endif
>
> Le dim. 16 juin 2019 à 19:49, Gianluigi <bagonergi at gmail.com> a écrit :
>
>> You mean something like this?
>> '----------------------------
>> Public Sub Main()
>>
>>   Dim s As String
>>
>>   s = System.FullVersion
>>   If Scan(s, "*.*.*")[0] = "3" Then
>>     If Len(Scan(s, "*.*.*")[1]) = 1 Then
>>       s = Scan(s, "*.*.*")[0] & ".0" & Scan(s, "*.*.*")[1] & "." &
>> Scan(s, "*.*.*")[2]
>>     Endif
>>   Else
>>     Print "#Unable to proceed"
>>     Quit
>>   Endif
>>   If s > "3.08.0" Then
>>     'Component.Load...
>>     Shell "./ProgA.gambas"
>>   Else
>>     'Component.Load...
>>     Shell "./ProgB.gambas"
>>   Endif
>>
>> End
>> '-----------------------------
>> it seems to me a good solution.
>>
>> But maybe others have better solutions ...
>>
>> Regards
>> Gianluigi
>>
>> Il giorno dom 16 giu 2019 alle ore 19:11 Jorge Carrión <shordi at gmail.com>
>> ha scritto:
>>
>>> It doesn't work, Gianluigi. I can't create the installation packages
>>> without link with qt4 or qt5 first, and I can't change the qt version to
>>> work at run time.
>>> I think that the only one solution is create both packages qt4 or qt5
>>> and a shellscript that launches one or another depending of S.O. version.
>>> Its a little trickie, but can't imagine other solution... (well... maybe
>>> a little proyect that *install *one or other depending of S.O.
>>> version).
>>> I'll think about this a little more, I guess.
>>>
>>> Thanks for you interest.
>>>
>>> El sáb., 15 jun. 2019 a las 17:46, Jorge Carrión (<shordi at gmail.com>)
>>> escribió:
>>>
>>>> Oh! I didn't knew I can load components at run time!
>>>> I'll try that.
>>>> Thanks a lot Gianluigi.
>>>>
>>>>
>>>> El sáb., 15 jun. 2019 13:23, Gianluigi <bagonergi at gmail.com> escribió:
>>>>
>>>>> ... or
>>>>>
>>>>> Public Sub Main()
>>>>>
>>>>>   If System.FullVersion > ... Then
>>>>>     Component.Load...
>>>>>   Esle
>>>>>   ...
>>>>>   Endif
>>>>>
>>>>> End
>>>>>
>>>>> Regards
>>>>> Gianluigi
>>>>>
>>>>> Il giorno sab 15 giu 2019 alle ore 13:02 Gianluigi <
>>>>> bagonergi at gmail.com> ha scritto:
>>>>>
>>>>>> Hi Jorge,
>>>>>> I probably didn't understand, but shouldn't you use gb.form.editor
>>>>>> (with gb.gui.qt)?
>>>>>>
>>>>>> Regards
>>>>>> Gianluigi
>>>>>>
>>>>>> Il giorno sab 15 giu 2019 alle ore 11:00 Jorge Carrión <
>>>>>> shordi at gmail.com> ha scritto:
>>>>>>
>>>>>>> Hi everybody,
>>>>>>>
>>>>>>> I have a project that uses the textedit component from gb.qtX.ext
>>>>>>> Component. With latest versions of SO (Linuxmint 19 + Cinnamon)It works
>>>>>>> fine  but with older versions not. I can use the gb.qt4.ext component but
>>>>>>> it generates some problems with latest versions (menu's icons not visible).
>>>>>>> If I try to use the gb.gui.qt component (That should be the answer,
>>>>>>> isn't it?) then I can't link either gb.qt4.ext or gb.qt5.ext
>>>>>>> Is there a way to do that?
>>>>>>>
>>>>>>> Best regards
>>>>>>>
>>>>>>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net
>>>>>>> ]----
>>>>>>>
>>>>>>
>>>>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net
>>>>> ]----
>>>>>
>>>>
>>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>>>
>>
>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>>
>
>
> --
> Fabien Bodard
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190617/dd4014b6/attachment.html>


More information about the User mailing list