Author Topic: Qt5 on Linux, issue changing TListView viewstyle to vsReport at runtime  (Read 1518 times)

Giorgio Tani

  • New Member
  • *
  • Posts: 23
With Lazarus 2.0.6 with Qt5 bindings (found in repositories of Linux Mint 20) I'm trying to use a TListView changing the viewstyle to vsReport st runtime, but the application crashes with access violation.

Running it in Lazarus with debugging shows the issue is a SIGSEGV and the execution point is function TQtTreeView.getColWidth, after some testing I found the component causing the crash was a TListView (not a treeview).

If you define the viewstyle as vsReport at compile time, the error is not triggered and the application runs fine.

If you change the viewstyle to vsReport at runtime, the error is triggered as described, but only in case you have defined at least one column for the listview - if no column is defined the error is not triggered.

Changing to other viewstyles at runtime does not trigger the error, it seems happening only for vsReport.

I tested the error case (a form with a ListView with one column defined and a few sample items and subitems) targeting GTK2 (on Linux 64 bit and Linux 32 bit), Qt4 (Linux 32 bit), and Win32 (on Windows 32 and 64 bit) and the error does not happen anywhere else, it seems specific to Qt5 only.


  • Hero Member
  • *****
  • Posts: 1674
    • tomboy-ng, a rewrite of the classic Tomboy
Giorgio, quite a lot has happened to the Qt5 widgetset recently, and Lazarus 2.0.6 is not recent !  The truth is, I am afraid, no one is going to be very interested in bug reports that target Lazarus 206.

So, I suggest you could try updating Lazarus, to do that, you have a couple of options. Firstly, I am guessing you are using the FPC and Lazarus from the Mint repositories. And that means as well as an old Lazarus you have the old FPC ?  So, building a current Lazarus from source is not a great idea.  (If I am wrong and you have FPC320, building a current Lazarus is trivial!).

So, next, if you like using the repositories, maybe the easist (and least invasive) solution is to use VirtualBox to get a current Debian Testing, its Bullseye, just working through the Debian release process.  That will get you a FPC320 and at lease Lazarus 2.0.10.

If you don't like the Virtual Box solution, then you can manually update your Linux Mint to current FPC/Lazarus, from memory, Linux Mint uses debs ?   Look at this PPA, it has some debs made for Ubuntu, they can probably be forced to install on Mint, its derived from Ubuntu (sorry, I'm not sufficently familiar with Mint to say more than that).

Next, you can manually install FPC from a tarball, well documented on the Wiki, probably best to remove the existing FPC and Lazarus before you start, lots of problems seem to happen when you have both packge and manual install present. If you are a skilled Linux user, will will manage however, its all about paths....


Once you have a working FPC (and please do the trivial test), you can then install Lazarus from source (and thats by far the best way to do it), see

Good luck !

EDIT : the other thing I should have mentioned is you could make a VERY SIMPLE project that demonstrates your problem, 'publish' from Lazarus, post the zip ball here and someone who has current software will definitly test it ....

Personally, I have never tried switching TListView mode at run time ....

EDIT 2 :  Silly of me, far easier source of debs at  - strongly recommend ....

« Last Edit: March 15, 2021, 01:11:33 am by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project -


  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3996
  • I like bugs.
Both Lazarus fixes_2_0 branch and trunk can be built with FPC 3.0.4.
There is no need to install a new FPC.
I recommend you get Lazarus trunk. It is much ahead of 2.0.12. Also LCL-QT5 part has improvements.
Then just build with "make" and start from its location  ./lazarus &
No installation needed.  Super easy.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.


TinyPortal © 2005-2018