@@ -204,7 +204,7 @@ def tabLayoutChange(self):
204
204
if total_height > self .parent ().height ():
205
205
# Don't paint over the top of the scroll buttons:
206
206
scroll_buttons_area_height = 2 * max (self .style ().pixelMetric (QtWidgets .QStyle .PM_TabBarScrollButtonWidth ),
207
- qapplication . globalStrut ().width ( ))
207
+ self . style ().pixelMetric ( QtWidgets . QStyle . PM_LayoutHorizontalSpacing ))
208
208
self .paint_clip = self .width (), self .parent ().height () - scroll_buttons_area_height
209
209
else :
210
210
self .paint_clip = None
@@ -240,8 +240,9 @@ def paintEvent(self, event):
240
240
241
241
def tabSizeHint (self , index ):
242
242
fontmetrics = QtGui .QFontMetrics (self .font ())
243
- text_width = fontmetrics .width (self .tabText (index ))
244
- text_height = fontmetrics .height ()
243
+ text_size = fontmetrics .size (QtCore .Qt .TextSingleLine , self .tabText (index ))
244
+ text_width = text_size .width ()
245
+ text_height = text_size .height ()
245
246
height = text_height + 15
246
247
height = max (self .minheight , height )
247
248
width = text_width + 15
@@ -366,7 +367,7 @@ def __init__(self, *args):
366
367
p .setColor (
367
368
group ,
368
369
QtGui .QPalette .HighlightedText ,
369
- p .color (QtGui .QPalette .Active , QtGui .QPalette .Foreground )
370
+ p .color (QtGui .QPalette .Active , QtGui .QPalette .WindowText )
370
371
)
371
372
self .setPalette (p )
372
373
@@ -976,7 +977,7 @@ def on_tableView_globals_context_menu_requested(self, point):
976
977
menu .addAction (self .action_globals_set_selected_true )
977
978
menu .addAction (self .action_globals_set_selected_false )
978
979
menu .addAction (self .action_globals_delete_selected )
979
- menu .exec_ (QtGui .QCursor .pos ())
980
+ menu .exec (QtGui .QCursor .pos ())
980
981
981
982
def on_globals_delete_selected_triggered (self ):
982
983
selected_indexes = self .ui .tableView_globals .selectedIndexes ()
@@ -1648,12 +1649,12 @@ def connect_signals(self):
1648
1649
self .groups_model .itemChanged , self .on_groups_model_item_changed )
1649
1650
1650
1651
# Keyboard shortcuts:
1651
- engage_shortcut = QtWidgets .QShortcut ('F5' , self .ui ,
1652
+ engage_shortcut = QtGui .QShortcut ('F5' , self .ui ,
1652
1653
lambda : self .ui .pushButton_engage .clicked .emit (False ))
1653
1654
engage_shortcut .setAutoRepeat (False )
1654
- QtWidgets .QShortcut ('ctrl+W' , self .ui , self .close_current_tab )
1655
- QtWidgets .QShortcut ('ctrl+Tab' , self .ui , lambda : self .switch_tabs (+ 1 ))
1656
- QtWidgets .QShortcut ('ctrl+shift+Tab' , self .ui , lambda : self .switch_tabs (- 1 ))
1655
+ QtGui .QShortcut ('ctrl+W' , self .ui , self .close_current_tab )
1656
+ QtGui .QShortcut ('ctrl+Tab' , self .ui , lambda : self .switch_tabs (+ 1 ))
1657
+ QtGui .QShortcut ('ctrl+shift+Tab' , self .ui , lambda : self .switch_tabs (- 1 ))
1657
1658
1658
1659
def on_close_event (self ):
1659
1660
save_data = self .get_save_data ()
@@ -1875,7 +1876,7 @@ def on_treeView_axes_context_menu_requested(self, point):
1875
1876
# menu = QtWidgets.QMenu(self.ui)
1876
1877
# menu.addAction(self.action_axes_check_selected)
1877
1878
# menu.addAction(self.action_axes_uncheck_selected)
1878
- # menu.exec_ (QtGui.QCursor.pos())
1879
+ # menu.exec (QtGui.QCursor.pos())
1879
1880
pass
1880
1881
1881
1882
def on_axes_check_selected_triggered (self , * args ):
@@ -2047,7 +2048,7 @@ def on_treeView_groups_context_menu_requested(self, point):
2047
2048
copy_menu .addAction (filename , lambda filepath = filepath : self .on_groups_copy_selected_groups_triggered (filepath , False ))
2048
2049
move_menu .addAction (filename , lambda filepath = filepath : self .on_groups_copy_selected_groups_triggered (filepath , True ))
2049
2050
2050
- menu .exec_ (QtGui .QCursor .pos ())
2051
+ menu .exec (QtGui .QCursor .pos ())
2051
2052
2052
2053
def on_groups_copy_selected_groups_triggered (self , dest_globals_file = None , delete_source_group = False ):
2053
2054
selected_indexes = self .ui .treeView_groups .selectedIndexes ()
@@ -3715,5 +3716,5 @@ def handler(self, request_data):
3715
3716
# Upon seeing a ctrl-c interrupt, quit the event loop
3716
3717
signal .signal (signal .SIGINT , lambda * args : qapplication .exit ())
3717
3718
3718
- qapplication .exec_ ()
3719
+ qapplication .exec ()
3719
3720
remote_server .shutdown ()
0 commit comments