mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-24 04:39:29 +01:00
Qt: removed qt-4.3 workaround
git-svn-id: trunk@22869 -
This commit is contained in:
parent
45f8f39a9e
commit
3a5dfa739f
@ -132,13 +132,6 @@ begin
|
||||
RegisterComponents('Dialogs',[TPrinterSetupDialog,TPrintDialog,TPageSetupDialog]);
|
||||
end;
|
||||
|
||||
|
||||
initialization
|
||||
{$I printersdlgs.lrs}
|
||||
{$IFDEF LCLQt}
|
||||
finalization
|
||||
if QtPrnDlg<>nil then
|
||||
QPrintDialog_destroy(QtPrnDlg);
|
||||
{$ENDIF}
|
||||
|
||||
end.
|
||||
|
||||
@ -4,14 +4,6 @@
|
||||
const
|
||||
SExecute = 'Execute';
|
||||
|
||||
{TODO: WE HAVE PROBLEM WITH QPrintDialog size (second call resizes it
|
||||
to screen width) if QPrintDialog is
|
||||
destroyed each time, so that's the reason why we have
|
||||
QtPrnDlg variable and finalization in PrintersDlgs
|
||||
This is probably qt 4.3 bug.}
|
||||
var
|
||||
QtPrnDlg: QPrintDialogH = nil;
|
||||
|
||||
{ TPageSetupDialog }
|
||||
|
||||
function TPageSetupDialog.Execute: Boolean;
|
||||
@ -52,6 +44,7 @@ end;
|
||||
|
||||
function TPrintDialog.Execute: Boolean;
|
||||
var
|
||||
QtPrnDlg: QPrintDialogH;
|
||||
PrnOptions: QAbstractPrintDialogPrintDialogOptions;
|
||||
Str: WideString;
|
||||
i: Integer;
|
||||
@ -61,8 +54,8 @@ begin
|
||||
if not Assigned(Printer) then Exit;
|
||||
if Printer.Printers.Count <= 0 then Exit;
|
||||
|
||||
if QtPrnDlg = nil then
|
||||
QtPrnDlg := QPrintDialog_create(QtDefaultPrinter.Handle, nil);
|
||||
try
|
||||
|
||||
if Title <> '' then
|
||||
Str := UTF8Decode(Title)
|
||||
@ -129,5 +122,8 @@ begin
|
||||
PrintRange := prCurrentPage;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
QPrintDialog_destroy(QtPrnDlg);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user