Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法获取 QTabWidget 中标题栏的高度?
尝试以下操作:
QTabWidget *myTabWidget = new QTabWidget(); int titleBarHeight = myTabWidget->tabBar->height();
您需要在 QTabBar 的子类中重新实现 tabSizeHint() 方法。然后,如果您愿意,您也可以获取大小,并将 QTabWidget 的选项卡调整为您想要的任何大小。希望这可以帮助。干杯。