Qt: added QtX11WaitForWindowManager() to all QWidget_showXX calls.Such call avoid unexpected behaviour under some X11 window managers.

Fixed AV with QLCLItemDelegate_destroy() which raises AV under linux in some circumstances.Added TODO for this case.

git-svn-id: trunk@16645 -
This commit is contained in:
zeljko 2008-09-19 11:18:43 +00:00
parent 35e4c88db4
commit eda775b4f0

View File

@ -2650,21 +2650,37 @@ end;
procedure TQtWidget.Show;
begin
QWidget_show(Widget);
{$IFDEF LINUX}
if QWidget_isWindow(Widget) then
QtX11WaitForWindowManager(Widget);
{$ENDIF}
end;
procedure TQtWidget.ShowNormal;
begin
QWidget_showNormal(Widget);
{$IFDEF LINUX}
if QWidget_isWindow(Widget) then
QtX11WaitForWindowManager(Widget);
{$ENDIF}
end;
procedure TQtWidget.ShowMinimized;
begin
QWidget_showMinimized(Widget);
{$IFDEF LINUX}
if QWidget_isWindow(Widget) then
QtX11WaitForWindowManager(Widget);
{$ENDIF}
end;
procedure TQtWidget.ShowMaximized;
begin
QWidget_showMaximized(Widget);
{$IFDEF LINUX}
if QWidget_isWindow(Widget) then
QtX11WaitForWindowManager(Widget);
{$ENDIF}
end;
function TQtWidget.getActionByIndex(AIndex: Integer): QActionH;
@ -2916,6 +2932,10 @@ end;
procedure TQtWidget.setVisible(visible: Boolean);
begin
QWidget_setVisible(Widget, visible);
{$IFDEF LINUX}
if Visible and QWidget_isWindow(Widget) then
QtX11WaitForWindowManager(Widget);
{$ENDIF}
end;
function TQtWidget.windowModality: QtWindowModality;
@ -8700,8 +8720,12 @@ begin
else
if ((not AValue) and (FNewDelegate <> nil)) then
begin
{$note this call avoid sporadic AVs with QLCLItemDelegate_destroy(FNewDelegate).}
{TODO : check this statement for Mac and Win32}
{$IFDEF LINUX}
FNewDelegate := QLCLItemDelegateH(QAbstractItemView_itemDelegate(QAbstractItemViewH(Widget)));
{$ENDIF}
QAbstractItemView_setItemDelegate(QAbstractItemViewH(Widget), FOldDelegate);
{$note some times raises av here, deep check of qt source for this destroy}
QLCLItemDelegate_destroy(FNewDelegate);
FNewDelegate := nil;
end;