Qt: Added Qt-4.5 bindings - 1.69. Default for win32 is qt-4.5.

git-svn-id: trunk@19501 -
This commit is contained in:
zeljko 2009-04-19 09:33:34 +00:00
parent 60df337261
commit 99c2e458af
10 changed files with 13515 additions and 30 deletions

1
.gitattributes vendored
View File

@ -3942,6 +3942,7 @@ lcl/interfaces/qt/interfaces.pp svneol=native#text/pascal
lcl/interfaces/qt/qt4.pas svneol=native#text/plain
lcl/interfaces/qt/qt43.pas svneol=native#text/plain
lcl/interfaces/qt/qt44.pas svneol=native#text/plain
lcl/interfaces/qt/qt45.pas svneol=native#text/plain
lcl/interfaces/qt/qtcaret.pas svneol=native#text/pascal
lcl/interfaces/qt/qtdefines.inc svneol=native#text/pascal
lcl/interfaces/qt/qtint.pp svneol=native#text/pascal

View File

@ -1,7 +1,10 @@
{$I qtdefines.inc}
{$IFDEF USE_QT_45}
{$i qt45.pas}
{$ELSE}
{$IFDEF USE_QT_44}
{$i qt44.pas}
{$ELSE}
{$i qt43.pas}
{$ENDIF}
{$ENDIF}

13476
lcl/interfaces/qt/qt45.pas Normal file

File diff suppressed because it is too large Load Diff

View File

@ -3,5 +3,5 @@
******************************************************************************}
{$IFDEF MSWindows}
{$define USE_QT_44}
{$define USE_QT_45}
{$ENDIF}

View File

@ -395,7 +395,7 @@ const
{ QImageFormat_ARGB32 } 32,
{ QImageFormat_ARGB32_Premultiplied } 32,
{ QImageFormat_RGB16 } 16,
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
{ QImageFormat_ARGB8565_Premultiplied } 24,
{ QImageFormat_RGB666 } 24,
{ QImageFormat_ARGB6666_Premultiplied } 24,

View File

@ -180,7 +180,7 @@ end;
------------------------------------------------------------------------------}
procedure TQtWidgetSet.AppProcessMessages;
begin
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
{$note we must use QEventLoopDefferedDeletion because of SlotClose.
Normal forms are NOT closed without this ...}
QCoreApplication_processEvents(QEventLoopAllEvents);

View File

@ -47,7 +47,7 @@ type
FInEventCount: Integer;
FReleaseInEvent: Boolean;
public
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
FDeleteLater: Boolean;
{$ENDIF}
FEventHook: QObject_hookH;
@ -710,7 +710,7 @@ end;
constructor TQtObject.Create;
begin
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
FDeleteLater := False;
{$ENDIF}
FEventHook := nil;
@ -723,7 +723,7 @@ destructor TQtObject.Destroy;
begin
if TheObject <> nil then
begin
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
DetachEvents;
if FDeleteLater then
QObject_deleteLater(TheObject)
@ -743,7 +743,7 @@ procedure TQtObject.Release;
begin
if InEvent then
begin
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
FDeleteLater := True;
{$ENDIF}
FReleaseInEvent := True;
@ -3364,7 +3364,7 @@ constructor TQtTimer.CreateTimer(Interval: integer;
const TimerFunc: TFNTimerProc; App: QObjectH);
begin
inherited Create;
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
FDeleteLater := True;
{$ENDIF}
FAppObject := App;
@ -3413,7 +3413,7 @@ end;
procedure TQtTimer.DetachEvents;
begin
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
QTimer_stop(QTimerH(TheObject));
{$ENDIF}
if FTimerHook <> nil then

View File

@ -411,7 +411,7 @@ type
protected
function CreateWidget(const AParams: TCreateParams): QWidgetH; override;
public
{$IFNDEF USE_QT_44}
{$IF NOT DEFINED(USE_QT_44) or NOT DEFINED(USE_QT_45)}
destructor Destroy; override;
{$ENDIF}
procedure preferredSize(var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean); override;
@ -486,7 +486,7 @@ type
protected
function CreateWidget(const AParams: TCreateParams):QWidgetH; override;
public
{$IFNDEF USE_QT_44}
{$IF NOT DEFINED(USE_QT_44) or NOT DEFINED(USE_QT_45)}
destructor Destroy; override;
{$ENDIF}
function CheckState: QtCheckState;
@ -506,7 +506,7 @@ type
protected
function CreateWidget(const AParams: TCreateParams):QWidgetH; override;
public
{$IFNDEF USE_QT_44}
{$IF NOT DEFINED(USE_QT_44) or NOT DEFINED(USE_QT_45)}
destructor Destroy; override;
{$ENDIF}
public
@ -522,7 +522,7 @@ type
protected
function CreateWidget(const AParams: TCreateParams):QWidgetH; override;
public
{$IFNDEF USE_QT_44}
{$IF NOT DEFINED(USE_QT_44) or NOT DEFINED(USE_QT_45)}
destructor Destroy; override;
{$ENDIF}
function EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl; override;
@ -1739,7 +1739,7 @@ begin
QEventKeyRelease:
begin
{non-spontaneous key events are garbage in Qt >= 4.4}
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
Result := QEvent_spontaneous(Event);
if Result then
{$ENDIF}
@ -3624,7 +3624,7 @@ procedure TQtWidget.DestroyWidget;
begin
if (Widget <> nil) and FOwnWidget then
begin
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
if not FDeleteLater then
QWidget_destroy(Widget)
else
@ -3839,7 +3839,7 @@ end;
Params: None
Returns: Nothing
------------------------------------------------------------------------------}
{$IFNDEF USE_QT_44}
{$IF NOT DEFINED(USE_QT_44) or NOT DEFINED(USE_QT_45)}
destructor TQtPushButton.Destroy;
begin
{$ifdef VerboseQt}
@ -4039,7 +4039,7 @@ begin
QLayout_addWidget(LayoutWidget, FCentralWidget);
QWidget_setLayout(Result, QLayoutH(LayoutWidget));
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
QWidget_setAttribute(Result, QtWA_DeleteOnClose);
{$ENDIF}
end;
@ -4438,7 +4438,7 @@ end;
Params: None
Returns: Nothing
------------------------------------------------------------------------------}
{$IFNDEF USE_QT_44}
{$IF NOT DEFINED(USE_QT_44) or NOT DEFINED(USE_QT_45)}
destructor TQtCheckBox.Destroy;
begin
{$ifdef VerboseQt}
@ -4525,7 +4525,7 @@ end;
Params: None
Returns: Nothing
------------------------------------------------------------------------------}
{$IFNDEF USE_QT_44}
{$IF NOT DEFINED(USE_QT_44) or NOT DEFINED(USE_QT_45)}
destructor TQtRadioButton.Destroy;
begin
{$ifdef VerboseQt}
@ -4645,7 +4645,7 @@ end;
Params: None
Returns: Nothing
------------------------------------------------------------------------------}
{$IFNDEF USE_QT_44}
{$IF NOT DEFINED(USE_QT_44) or NOT DEFINED(USE_QT_45)}
destructor TQtGroupBox.Destroy;
begin
{$ifdef VerboseQt}
@ -7578,7 +7578,7 @@ end;
procedure TQtTreeWidget.setHeaderVisible(AVisible: Boolean);
begin
if (csDesigning in LCLObject.ComponentState) then
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
QTreeView_setHeaderHidden(QTreeViewH(Widget), not AVisible)
{$ELSE}
QWidget_setVisible(QTreeView_header(QTreeViewH(Widget)), AVisible)
@ -8032,7 +8032,7 @@ function TQtMenu.CreateWidget(const APrams: TCreateParams): QWidgetH;
begin
FIcon := nil;
Result := QMenu_create();
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
FDeleteLater := True;
{$ENDIF}
FActionHandle := nil;;
@ -8113,7 +8113,7 @@ end;
procedure TQtMenu.SlotAboutToHide; cdecl;
begin
if FMenuItem.Menu is TPopupMenu then
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
DoPopupClose;
{$ELSE}
QCoreApplication_postEvent(Widget, QEvent_create(LCLQt_PopupMenuClose));
@ -9640,7 +9640,7 @@ end;
procedure TQtFileDialog.setFilter(const AFilter: WideString);
begin
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
QFileDialog_setNameFilter(QFileDialogH(Widget), @AFilter);
{$ELSE}
QFileDialog_setFilter(QFileDialogH(Widget), @AFilter);
@ -9659,7 +9659,7 @@ end;
procedure TQtFileDialog.setSelectedFilter(const ASelFilter: WideString);
begin
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
QFileDialog_selectNameFilter(QFileDialogH(Widget), @ASelFilter);
{$ELSE}
QFileDialog_selectFilter(QFileDialogH(Widget), @ASelFilter);
@ -9704,7 +9704,7 @@ end;
procedure TQtFileDialog.getFilters(const retval: QStringListH);
begin
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
QFileDialog_nameFilters(QFileDialogH(Widget), retval);
{$ELSE}
QFileDialog_filters(QFileDialogH(Widget), retval);

View File

@ -2849,7 +2849,7 @@ begin
if FCachedColors[nIndex] = nil then
begin
case nIndex of
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
COLOR_SCROLLBAR : Result:=GetColor(QPaletteActive, QPaletteButton);
{$ELSE}
COLOR_SCROLLBAR : Result:=GetColor(QPaletteActive, QPaletteMid);
@ -2870,7 +2870,7 @@ begin
COLOR_BTNHIGHLIGHT : Result:=GetColor(QPaletteActive, QPaletteLight);
COLOR_3DDKSHADOW : Result:=GetColor(QPaletteActive, QPaletteShadow);
COLOR_3DLIGHT : Result:=GetColor(QPaletteActive, QPaletteMidlight);
{$IFDEF USE_QT_44}
{$IF DEFINED(USE_QT_44) or DEFINED(USE_QT_45)}
COLOR_INFOTEXT : Result:=GetColor(QPaletteInActive, QPaletteToolTipText);
COLOR_INFOBK : Result:=GetColor(QPaletteInActive, QPaletteToolTipBase);
{$ELSE}

View File

@ -363,7 +363,12 @@ begin
AVisible := AWidget.getVisible;
Flags := GetQtBorderStyle(ABorderStyle) or GetQtFormStyle(AFormStyle);
if (Flags and QtFramelessWindowHint) = 0 then
Flags := Flags or GetQtBorderIcons(ABorderIcons) or QtWindowTitleHint;
Flags := Flags or GetQtBorderIcons(ABorderIcons) or
QtWindowTitleHint or QtCustomizeWindowHint
{$IFDEF USE_QT_45}
or QtWindowCloseButtonHint
{$ENDIF}
;
if not (csDesigning in AWidget.LCLObject.ComponentState) then
AWidget.setWindowFlags(Flags);
AWidget.setVisible(AVisible);