View Issue Details

IDProjectCategoryView StatusLast Update
0034558LazarusLCLpublic2018-11-19 20:04
ReporterTerry Mitchell Assigned ToZeljan Rikalo  
Status resolvedResolutionfixed 
Summary0034558: Qt5 fails to list networked printers
DescriptionQt5 fails to list networked printer installed on a computer. It will only list printers that are directly connected to computer.

Works correctly in GTK2 and QT.
Steps To ReproducePut a listbox on a form and assign a button to fill the listbox with:


Make sure printers are in uses, and Printers4lazarus package is in project.

Test code with GTK2, QT, QT5.
TagsNo tags attached.
Fixed in Revision59593,59594
Attached Files


Terry Mitchell

2018-11-16 16:05

reporter   ~0112004

This needs to be moved to the Lazarus project.

Zeljan Rikalo

2018-11-17 09:49

developer   ~0112013

Please attach example project.

Terry Mitchell

2018-11-17 16:07

reporter (129,048 bytes)

Zeljan Rikalo

2018-11-18 13:21

developer   ~0112043

Please test and close if ok.
IMPORTANT NOTE: You should rebuild libQt5Pas C bindings since I've added QPrinterInfo_availablePrinterNames() which is now used to enumerate printers.
Not sure if this will be a part of next lazarus major version libQt5Pas bindings are changed.

Andrey Zubarev

2018-11-18 19:37

reporter   ~0112051

I update lazarus, recompile (qmake and make install) qt5pas, but lazarus not linking((

make: Entering directory '/home/zamtmn/SharedEXT4/hdd/src/fpc/lazarus'
/usr/bin/make -C ide idepkg
make[1]: Entering directory '/home/zamtmn/SharedEXT4/hdd/src/fpc/lazarus/ide'
../tools/svn2revisioninc ..
Created /home/zamtmn/SharedEXT4/hdd/src/fpc/lazarus/ide/ for revision: 59595M
/usr/bin/make --assume-new=lazarus.pp lazarus OPT=' @/home/zamtmn/.lazarus/idemake.cfg'
make[2]: Entering directory '/home/zamtmn/SharedEXT4/hdd/src/fpc/lazarus/ide'
/home/zamtmn/SharedEXT4/hdd/bin/fpc/lib/fpc/3.3.1/ppcx64 -gl -vbqewnhi -Sci -dlclqt5 -Fu../designer -Fu../debugger -Fu../debugger/frames -Fu../converter -Fu../packager -Fu../packager/frames -Fu../components/custom -Fuframes -Fu. -Fiinclude -Fiinclude/linux -Fi../images -FE.. -FU../units/x86_64-linux/qt5 -Cg -Fl/usr/lib/gcc/x86_64-linux-gnu/7 -Flinclude -Fl/etc/*.conf @/home/zamtmn/.lazarus/idemake.cfg -dx86_64 lazarus.pp
Hint: (11030) Start of reading config file /etc/fpc.cfg
Hint: (11031) End of reading config file /etc/fpc.cfg
Hint: (11030) Start of reading config file /home/zamtmn/.lazarus/idemake.cfg
Hint: (11031) End of reading config file /home/zamtmn/.lazarus/idemake.cfg
Free Pascal Compiler version 3.3.1 [2018/10/10] for x86_64
Copyright (c) 1993-2018 by Florian Klaempfl and others
(1002) Target OS: Linux for x86-64
(3104) Compiling lazarus.pp
(9022) Compiling resource /home/zamtmn/SharedEXT4/hdd/src/fpc/lazarus/units/x86_64-linux/qt5/lazarus.or
(9015) Linking ../lazarus
/home/zamtmn/SharedEXT4/hdd/src/fpc/lazarus/components/printers/lib/x86_64-linux/qt5/osprinters.o: In function `ENUMQPRINTERS':
/home/zamtmn/SharedEXT4/hdd/src/fpc/lazarus/components/printers//qt/ undefined reference to `QPrinterInfo_availablePrinterNames'
make[2]: *** [lazarus] Error 1
make[1]: *** [idepkg] Error 2
make: *** [idepkg] Error 2
/home/zamtmn/SharedEXT4/hdd/src/fpc/lazarus/ide/lazarus.pp(166,1) Error: (9013) Error while linking
/home/zamtmn/SharedEXT4/hdd/src/fpc/lazarus/ide/lazarus.pp(166,1) Fatal: (10026) There were 1 errors compiling module, stopping
Fatal: (1018) Compilation aborted
Makefile:4144: recipe for target 'lazarus' failed
make[2]: Leaving directory '/home/zamtmn/SharedEXT4/hdd/src/fpc/lazarus/ide'
Makefile:4574: recipe for target 'idepkg' failed
make[1]: Leaving directory '/home/zamtmn/SharedEXT4/hdd/src/fpc/lazarus/ide'
Makefile:3277: recipe for target 'idepkg' failed
make: Leaving directory '/home/zamtmn/SharedEXT4/hdd/src/fpc/lazarus'

Terry Mitchell

2018-11-19 18:19

reporter   ~0112077

The fix now list all of the attached printers. However, when a networked printer is selected, it prints to the default printer instead of the selected network printer. The same behavior occurs using lazreports and the printer dialog sample project.

Andrey Zubarev

2018-11-19 20:04

reporter   ~0112080

I take back what I said. Today everything works

Issue History

Date Modified Username Field Change
2018-11-15 23:56 Terry Mitchell New Issue
2018-11-16 16:05 Terry Mitchell Note Added: 0112004
2018-11-16 20:29 Marco van de Voort Project FPC => Lazarus
2018-11-17 09:48 Zeljan Rikalo Assigned To => Zeljan Rikalo
2018-11-17 09:48 Zeljan Rikalo Status new => assigned
2018-11-17 09:49 Zeljan Rikalo LazTarget => -
2018-11-17 09:49 Zeljan Rikalo Note Added: 0112013
2018-11-17 09:49 Zeljan Rikalo Status assigned => feedback
2018-11-17 16:07 Terry Mitchell File Added:
2018-11-18 13:21 Zeljan Rikalo Fixed in Revision => 59593
2018-11-18 13:21 Zeljan Rikalo Widgetset => QT5
2018-11-18 13:21 Zeljan Rikalo Note Added: 0112043
2018-11-18 13:21 Zeljan Rikalo Status feedback => resolved
2018-11-18 13:21 Zeljan Rikalo Resolution open => fixed
2018-11-18 13:34 Zeljan Rikalo Fixed in Revision 59593 => 59593,59594
2018-11-18 13:34 Zeljan Rikalo Product Version 3.0.4 =>
2018-11-18 19:37 Andrey Zubarev Note Added: 0112051
2018-11-19 18:19 Terry Mitchell Note Added: 0112077
2018-11-19 20:04 Andrey Zubarev Note Added: 0112080