Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2024-09

LCLWidgetType:=qt5 not to configure in source code ?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

John Landmesser
I can set LCLWidgetType:=qt5 in an extra build mode. But i was asking
myself why not use something like this:
Show quoted text 15 lines
unit Config; interface {$IFDEF linux} const ? WidgetType = 'qt5'; {$ELSE} ? const ? WidgetType = 'gtk2'; {$ENDIF} implementation end.

?include this unit in uses clause of mainform ... has no effect !

Ok, but why ?

Tipps are welcome ...

John Landmesser

Reply by email

Mattias Gaertner
to John Landmesser
John Landmesser wrote 22 lines
I can set LCLWidgetType:=qt5 in an extra build mode. But i was asking myself why not use something like this: > unit Config; > > interface > > {$IFDEF linux} > const > ? WidgetType = 'qt5'; > {$ELSE} > ? const > ? WidgetType = 'gtk2'; > {$ENDIF} > > implementation > > end. ?include this unit in uses clause of mainform ... has no effect ! Ok, but why ?

The LCLWidgetType is an IDE macro. The package lcl has some conditionals to add unit paths and for some widgettypes linker options. If you want to compile a lcl app without Lazarus/lazbuild and without passing command line options, then you could add unit paths to the source. You loose comfort - you have been warned.

Mattias

Reply by email

John Landmesser
to Mattias Gaertner
Mattias Gaertner wrote 35 lines
On 9/18/24 15:03, John Landmesser via lazarus wrote: > I can set LCLWidgetType:=qt5 in an extra build mode. But i was asking > myself why not use something like this: > >> unit Config; >> >> interface >> >> {$IFDEF linux} >> const >> ? WidgetType = 'qt5'; >> {$ELSE} >> ? const >> ? WidgetType = 'gtk2'; >> {$ENDIF} >> >> implementation >> >> end. > > ??include this unit in uses clause of mainform ... has no effect ! > > Ok, but why ? The LCLWidgetType is an IDE macro. The package lcl has some conditionals to add unit paths and for some widgettypes linker options. If you want to compile a lcl app without Lazarus/lazbuild and without passing command line options, then you could add unit paths to the source. You loose comfort - you have been warned. Mattias

Thanks, i keep using build modes ... better for a noob like me :-)

Reply by email