Recent

Author Topic: Combobox qt5 font size  (Read 2802 times)

OH1KH

  • Jr. Member
  • **
  • Posts: 56
Combobox qt5 font size
« on: January 10, 2022, 11:56:35 am »
EDIT: Sorry about wrong placement, This is not Installation related problem, but I can not delete this any more (why?)

Hi !
With search by words in subject resulted 0 hits.

System Fedora 35 with Lazarus 2.0.12

When form's font size is changed combobox font size does not change but TEdit font size changes.

This happens if LCL widget type is QT5.
When LCL widget type is GTK2 both font sizes are changed ok.

Code used to change font  is:

Code: Pascal  [Select][+][-]
  1. for i := 0 to aForm.ComponentCount - 1 do
  2.  begin
  3.     //edits, memo combo, spinedit ...
  4.     if (aForm.Components[i] is TEdit) then
  5.     begin
  6.       (aForm.Components[i] as TEdit).Font.Name := fEdits;
  7.       (aForm.Components[i] as TEdit).Font.Size := feSize
  8.     end;
  9.     if (aForm.Components[i] is TComboBox) then
  10.     begin
  11.       (aForm.Components[i] as TComboBox).Font.Name := fEdits;
  12.       (aForm.Components[i] as TComboBox).Font.Size := feSize
  13.     end;
  14. end;                                                              
  15.  

This seems to be Lazarus/QT5 problem, or am I doing something wrong?
« Last Edit: January 10, 2022, 12:03:40 pm by OH1KH »
--
Saku

zeljko

  • Hero Member
  • *****
  • Posts: 1264
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Combobox qt5 font size
« Reply #1 on: January 10, 2022, 12:26:37 pm »
Please open an issue and attach example project.

OH1KH

  • Jr. Member
  • **
  • Posts: 56
Re: Combobox qt5 font size
« Reply #2 on: January 10, 2022, 12:41:01 pm »
To be more precise:
The font in selection list of combobox changes ok, but when selection is done the visible font (or typed font if typing is allowed)  is not same size as in selection list (what was just set).

Well.
Then have to make small program for test & learn how to make issue with GitLab.
When I have time for that...
--
Saku

zeljko

  • Hero Member
  • *****
  • Posts: 1264
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Combobox qt5 font size
« Reply #3 on: January 11, 2022, 09:29:35 am »
You mean that font size of combobox and drop down list aren't same ?

OH1KH

  • Jr. Member
  • **
  • Posts: 56
--
Saku

zeljko

  • Hero Member
  • *****
  • Posts: 1264
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Combobox qt5 font size
« Reply #5 on: January 12, 2022, 09:24:08 am »
I've already assigned that issue to myself. Problem is that both qt4 and qt5 does not change font of QLineEdit when QComboBox is editable, actually I've tested font of QLineEdit after changing and it's correctly setted up but it seem that common theme engine does not take it into account when painting QLineEdit as child of QComboBox and it uses default application font.

OH1KH

  • Jr. Member
  • **
  • Posts: 56
Re: Combobox qt5 font size
« Reply #6 on: January 14, 2022, 08:48:37 am »
HI !
Qt,Qt5: fixed font changing of TComboBox editor. issue #39539

Works OK now, thanks.

Actually it works better than GTK2 compiled with my sample Unit1.pas.

Both edit text area and item list font changes with QT5 while GTK2 compiled version only edit text area changes and item list does keep default font.

But the object here was QT5 and it seems to be ok now.

--
Saku

 

TinyPortal © 2005-2018