[Qt] QTabWidget problem

Den.Jean at telenet.be Den.Jean at telenet.be
Fri Jan 30 10:57:41 CET 2009


>yes, that's ugly patch, I'll fix it in another way ... inside qt. 
>TQtWinApi.getFocus() is quilty for that, I mean FTabBar is pure QWidget and 
>QApplication_focusWidget() returns that one, but FTabBar isn't TQtWidget ... 

Well this one liner is pretty. 
As Tabbar is private subwidget, the solution
to return public TabWidget is acceptable.


Index: lcl/interfaces/qt/qtwidgets.pas
===================================================================
--- lcl/interfaces/qt/qtwidgets.pas	(revision 18503)
+++ lcl/interfaces/qt/qtwidgets.pas	(working copy)
@@ -5590,6 +5590,7 @@
      objectName is qt_tabwidget_tabbar.}
     FTabBar := QLCLTabWidget_tabBarHandle(QTabWidgetH(Widget));
     QWidget_setFocusPolicy(FTabBar, QtNoFocus);
+    setProperty(FTabBar, 'lclwidget', Int64(PtrUInt(Self)));
   end;
   Result := FTabBar;
 end;






More information about the Qt mailing list