<div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div><div><div><div><div>Hi all,<br><br></div>This is my first post here, I hope my input is considered helpfull.<br><br></div>Anyhow, I am busy converting a Delphi MDI application (which I develop as a daytime job) to Lazarus using Qt/Qt5.<br></div>Compared to Win32 Widgeset indeed Qt has much more stuff in place.<br><br></div>A
problem I encountered is a mouse offset between mouseposition in the
MDI child window 'onscreen' and the position as handled internally in
LCL when a button in pressed.<br><br></div>The effect is that for
instance if I have a button onscreen, and I hover over it, the color
correctly changes hinting me that I can press that button. When I do
however, the button is not activated unless I hover my mouse 'titlebar
height' above the button.<br><br></div>There is a simple fix possible for this my modifying the file 'qtwidgets.pas' in both Qt and Qt5 LCL/interfaces folders.<br><br></div><div>When
I modify routine 'TQtMainWindow.OffsetMousePos' in the below way MDI
works fully correctly concerning the mouse positions here (windows7
tested):<br><br><br>procedure TQtMainWindow.OffsetMousePos(APoint: PQtPoint);<br>var<br> MyWidget : QWidgetH;<br> MyStyle : QStyleH;<br> MyTitleBarHeight : Integer;<br>begin<br> inherited OffsetMousePos(APoint);<br><br> if IsMdiChild and not IsMaximized then<br> begin<br> //correct windowed Y-pos<br> //dec(APoint^.Y, GetSystemMetrics(SM_CYCAPTION)); //windows only<br> MyWidget := GetWidget;<br> MyStyle := QWidget_style(MyWidget);<br> MyTitleBarHeight := QStyle_pixelMetric(MyStyle ,QStylePM_TitleBarHeight, nil, MyWidget);<br> dec(APoint^.Y, MyTitleBarHeight);<br><br> //correct windowed X-pos<br> dec(APoint^.X, (self.getFrameSize.Width - self.getClientBounds.Size.Width) div 2);<br> end;<br>end;<br><br><br></div><div>Can someone validate I am not doing something stupid here and update the sources if not?<br></div><div>That would save me some work manually modifying these routines over here..<br><br></div><div>Thanks for taking the time to look at this..<br><br></div><div>Kind regards,<br><br></div>Rudolf.</div></div>