Recent

Author Topic: TSelectDirectoryDialog doesn't close after Execute - qt5  (Read 360 times)

krzynio

  • Full Member
  • ***
  • Posts: 109
    • Krzynio's home page
TSelectDirectoryDialog doesn't close after Execute - qt5
« on: January 18, 2025, 05:57:40 pm »
Hi!

TSelectDirectoryDialog doesn't close after Execute.
The window closes only after the entire loop code below has been executed.
I noticed this behavour is under qt5 only.
Under gtk2 works fine.
Please suggest a solution for qt5.

The part of my code:
Code: Pascal  [Select][+][-]
  1.   if sDir.Execute then begin
  2.     // here the dialog should close but remains open
  3.     sDir.Close; // This also doesn't help
  4.     Application.ProcessMessages; // I tried this but it doesn't help
  5.  
  6.     dt := Now;
  7.  
  8.     m1.Clear;
  9.     m1.Lines.Add('Analizuję folder: '+sDir.FileName);
  10.  
  11.     FileList := TStringList.Create;
  12.     FindAllFiles(FileList, sDir.FileName, '*.mst', False);
  13.     if FileList.Count=0 then begin
  14.       FileList.Free;
  15.       m1.Lines.Add('Brak plików w folderze.');
  16.       Exit;
  17.                 end;
  18.  
  19.     Screen.Cursor := crHourGlass;
  20.  
  21.     sd := FormatDateTime('YYYYMMDD', dt1.Date);
  22.     m1.Lines.Add('Search date is: '+sd);
  23.  
  24.     SQLQuery := TStringList.Create;
  25.     for FileName in FileList do begin
  26.       sb1.SimpleText := FileName;
  27.       sb1.Repaint;
  28.             try
  29.                     CSVDoc := TCSVDocument.Create;
  30.                     with CSVDoc do begin
  31.                             Delimiter := ',';
  32.     ...
  33.     ...
  34.  

Lazarus 3.6, FPC 3.2.2, Linux Debian Trixie, Gnome
« Last Edit: January 18, 2025, 06:06:09 pm by krzynio »
Debian 12.8 x64, / Windows 11 PL - latest updates
Lazarus 3.6

 

TinyPortal © 2005-2018