mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-26 00:27:11 +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]);
|
RegisterComponents('Dialogs',[TPrinterSetupDialog,TPrintDialog,TPageSetupDialog]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
{$I printersdlgs.lrs}
|
{$I printersdlgs.lrs}
|
||||||
{$IFDEF LCLQt}
|
|
||||||
finalization
|
|
||||||
if QtPrnDlg<>nil then
|
|
||||||
QPrintDialog_destroy(QtPrnDlg);
|
|
||||||
{$ENDIF}
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
@ -4,14 +4,6 @@
|
|||||||
const
|
const
|
||||||
SExecute = 'Execute';
|
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 }
|
{ TPageSetupDialog }
|
||||||
|
|
||||||
function TPageSetupDialog.Execute: Boolean;
|
function TPageSetupDialog.Execute: Boolean;
|
||||||
@ -52,6 +44,7 @@ end;
|
|||||||
|
|
||||||
function TPrintDialog.Execute: Boolean;
|
function TPrintDialog.Execute: Boolean;
|
||||||
var
|
var
|
||||||
|
QtPrnDlg: QPrintDialogH;
|
||||||
PrnOptions: QAbstractPrintDialogPrintDialogOptions;
|
PrnOptions: QAbstractPrintDialogPrintDialogOptions;
|
||||||
Str: WideString;
|
Str: WideString;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
@ -61,8 +54,8 @@ begin
|
|||||||
if not Assigned(Printer) then Exit;
|
if not Assigned(Printer) then Exit;
|
||||||
if Printer.Printers.Count <= 0 then Exit;
|
if Printer.Printers.Count <= 0 then Exit;
|
||||||
|
|
||||||
if QtPrnDlg = nil then
|
|
||||||
QtPrnDlg := QPrintDialog_create(QtDefaultPrinter.Handle, nil);
|
QtPrnDlg := QPrintDialog_create(QtDefaultPrinter.Handle, nil);
|
||||||
|
try
|
||||||
|
|
||||||
if Title <> '' then
|
if Title <> '' then
|
||||||
Str := UTF8Decode(Title)
|
Str := UTF8Decode(Title)
|
||||||
@ -129,5 +122,8 @@ begin
|
|||||||
PrintRange := prCurrentPage;
|
PrintRange := prCurrentPage;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
finally
|
||||||
|
QPrintDialog_destroy(QtPrnDlg);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user