2019-02-15 在TabWidget不同的Tab对应不同大

2019-02-26  本文已影响0人  gongdiwudu

先让本tabWidget对象的currentChanged对象和指向一个程序self.tab_changed,在程序self.tab_changed中改变窗口大小

self.yourTabWidget.currentChanged.connect( self.tab_changed )

def tab_changed(self): 

     if self.yourTabWidget.currentIndex == 0: 

             self.setGeometry(x, x, x, x)    # size for first tab 

     elif self.yourTabWidget.currentIndex == 1: 

             self.setGeometry(x, x, x, x)    # size for second tab

上一篇 下一篇

猜你喜欢

热点阅读