Merged revision(s) 48840 #990754d7c0, 48842 #aac691fd52 from trunk:

Qt: do not report stalled focus changes if widget is invisible. issue #27960
........
Qt: cleanup unused local variables, removed one warning. issue #27951
........

git-svn-id: branches/fixes_1_4@48861 -
This commit is contained in:
maxim 2015-04-25 18:39:03 +00:00
parent 3ee89bd2da
commit 9cf3760120
7 changed files with 21 additions and 9 deletions

View File

@ -392,7 +392,7 @@ begin
begin
if not (Obj is TQtWidget) then
raise Exception.Create('QtObjectFromWidgetH: QObject_property returned '
+ 'a variant which is not TQtWidget but ' + dbgsName(Obj));
+ 'a variant which is not TQtWidget ' + dbgHex(PtrUInt(Obj)));
QtWg := TQtWidget(Obj);
//Write('Converted successfully, Control=');
if QtWg<>nil then

View File

@ -1005,8 +1005,14 @@ begin
{$IF DEFINED(VerboseFocus) OR DEFINED(DebugQtFocus)}
WriteLn('> ** TQtWidgetSet.FocusChanged: old: ', dbgHex(PtrUInt(aold)), ' new: ', dbgHex(PtrUInt(anew)));
{$ENDIF}
OldWidget := GetFirstQtObjectFromWidgetH(aold);
NewWidget := GetFirstQtObjectFromWidgetH(anew);
if (AOld <> nil) and not QWidget_isVisible(AOld) then
OldWidget := nil
else
OldWidget := GetFirstQtObjectFromWidgetH(aold);
if (ANew <> nil) and not QWidget_isVisible(ANew) then
NewWidget := nil
else
NewWidget := GetFirstQtObjectFromWidgetH(anew);
if OldWidget = NewWidget then
begin

View File

@ -307,9 +307,8 @@ class procedure TQtWSCustomTabControl.MovePage(const ATabControl: TCustomTabCont
var
TabWidget: TQtTabWidget;
Index: Integer;
Page: TQtPage;
begin
Page := TQtPage(AChild.Handle);
AChild.HandleNeeded; {create handle if it does not exist yet}
TabWidget := TQtTabWidget(ATabControl.Handle);
Index := AChild.PageIndex;
if Index < 0 then

View File

@ -176,7 +176,9 @@ var
R: TRect;
P: TQtPoint;
AHint: WideString;
{$IFDEF HASX11}
PaintData: TSysTrayIconPaintData;
{$ENDIF}
begin
Result := False;
if Sender <> FSysTrayWidget then

View File

@ -3965,7 +3965,10 @@ end;
procedure TQtWidget.SlotMove(Event: QEventH); cdecl;
var
Msg: TLMMove;
APos, ACurrPos: TQtPoint;
APos: TQtPoint;
{$IFDEF HASX11}
ACurrPos: TQtPoint;
{$ENDIF}
FrameRect, WindowRect: TRect;
begin
{$ifdef VerboseQt}
@ -8711,6 +8714,7 @@ begin
{$endif}
if SliderPressed and not InUpdate then
begin
Msg.Msg := 0; // shutup compiler
FillChar(Msg, SizeOf(Msg), #0);
Msg.Msg := LM_CHANGED;
DeliverMessage(Msg);
@ -11593,7 +11597,6 @@ var
v: QVariantH;
WStr: WideString;
DataStr: WideString;
ASelected: Boolean;
ImgList: TCustomImageList;
AImageIndex: TImageIndex;
Bmp: TBitmap;
@ -13671,7 +13674,7 @@ var
R: TRect;
TopItem: Integer;
i: Integer;
j, x: Integer;
j: Integer;
ChildCount: Integer;
VHeight: Integer; // viewport height
RowHeight: Integer;

View File

@ -1437,7 +1437,7 @@ begin
F := DTFlagsToQtFlags(Flags);
end;
{$warning HARDCODED WORKAROUND for qt-4.7.1 QPainter bug.}
{Workaround for qt-4.7 QPainter bug.It's fixed in qt-4.7.4. DO NOT REMOVE}
{ Bug triggers when we try to paint multiline text which contains 1
space. eg "Save project\nCtrl+S". In this case QPainter draws
Save

View File

@ -395,8 +395,10 @@ const
var
Widget: TQtMainWindow;
R: TRect;
{$IFDEF HASX11}
ActiveWin: HWND;
W: QWidgetH;
{$ENDIF}
Flags: Cardinal;
function ShowNonModalOverModal: Boolean;