Qt: removed qt-4.3 workaround

git-svn-id: trunk@22869 -
This commit is contained in:
zeljko 2009-11-30 09:21:42 +00:00
parent 45f8f39a9e
commit 3a5dfa739f
2 changed files with 58 additions and 69 deletions

View File

@ -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.

View File

@ -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;