@@ -230,18 +230,18 @@ def build_tabs_layout(self):
230230 except Exception : pass
231231 while len (self .tabs ) > 0 :
232232 self .removeTab (0 , True )
233- #
233+ # tabs
234234 conf = config .get_maps (self .current_model ['id' ])
235235 maps_list = {'list' : [conf ], 'def' : 0 } if isinstance (conf , list ) else conf
236236 for maps in maps_list ['list' ]:
237237 self .addTab (maps , False )
238- self .tab_widget .setCurrentIndex (maps_list ['def' ])
239238 self .tab_widget .currentChanged .connect (self .changedTab )
240- self .changedTab (self .tab_widget .currentIndex ())
239+ # value
240+ self .changedTab (maps_list ['def' ])
241+ self .tab_widget .setCurrentIndex (maps_list ['def' ])
241242 # size
242- tab_frame_width = self .tabs [self .tab_widget .currentIndex ()].frameSize ().width ()
243243 self .resize (
244- tab_frame_width + self . frameSize (). width () - tab_frame_width ,
244+ WIDGET_SIZE . dialog_width ,
245245 min (max (3 , len (self .current_model ['flds' ])+ 1 ), 14 ) * WIDGET_SIZE .map_max_height + WIDGET_SIZE .dialog_height_margin
246246 )
247247 self .save ()
@@ -272,7 +272,7 @@ def changedTab(self, i):
272272 self .tab_widget .setTabIcon (k , self ._NULL_ICON )
273273 # add flag
274274 self .tab_widget .setTabIcon (i , self ._OK_ICON )
275- self .tabs [i ].build ()
275+ self .tabs [i ].build_layout ()
276276
277277 def show_models (self ):
278278 '''
@@ -318,16 +318,16 @@ def __init__(self, model, conf, services):
318318 self ._last_checkeds = None
319319 self ._options = list ()
320320 self ._was_built = False
321- # add dicts mapping
322- self .dicts_widget = QWidget ()
323- self .dicts_layout = QGridLayout ()
324- self .dicts_layout .setSizeConstraint (QLayout .SetMinAndMaxSize )
325- self .dicts_widget .setLayout (self .dicts_layout )
321+ # dicts mapping
322+ dicts = QWidget (self )
323+ dicts .setLayout (QGridLayout ())
326324 self .setFrameShape (QFrame .NoFrame )
327325 self .setWidgetResizable (True )
328- self .setWidget (self .dicts_widget )
326+ self .setWidget (dicts )
327+ self .dicts_layout = dicts .layout ()
328+ #self.dicts_layout.setSizeConstraint(QLayout.SetFixedSize)
329329
330- def build (self ):
330+ def build_layout (self ):
331331 '''
332332 build dictionary、fields etc
333333 '''
@@ -367,7 +367,7 @@ def build(self):
367367 self .skip_all_check_btn .setChecked (True )
368368 self .dicts_layout .addWidget (self .skip_all_check_btn , 0 , 4 )
369369 self .skip_all_check_btn .clicked .connect (self .skip_all_check_changed )
370-
370+
371371 # dict & fields
372372 self .radio_group = QButtonGroup ()
373373 for i , fld in enumerate (model ['flds' ]):
@@ -440,7 +440,7 @@ def add_dict_layout(self, i, **kwargs):
440440 )
441441 field_combo .setEnabled (not word_checked and not ignore )
442442 self .fill_field_combo_options (field_combo , dict_name , dict_unique , dict_fld_name , dict_fld_ord )
443-
443+
444444 # ignore
445445 ignore_check_btn = QCheckBox (_ ("NOT_DICT_FIELD" ))
446446 ignore_check_btn .setEnabled (not word_checked )
@@ -497,13 +497,13 @@ def dict_combo_changed(index):
497497 field_combo .itemData (field_combo .currentIndex ())
498498 )
499499 dict_combo .currentIndexChanged .connect (dict_combo_changed )
500-
500+
501501 self .dicts_layout .addWidget (word_check_btn , i + 1 , 0 )
502502 self .dicts_layout .addWidget (ignore_check_btn , i + 1 , 1 )
503503 self .dicts_layout .addWidget (dict_combo , i + 1 , 2 )
504504 self .dicts_layout .addWidget (field_combo , i + 1 , 3 )
505505 self .dicts_layout .addWidget (skip_check_btn , i + 1 , 4 )
506-
506+
507507 self ._options .append ({
508508 'model' : {'fld_name' : fld_name , 'fld_ord' : fld_ord },
509509 'word_check_btn' : word_check_btn ,
0 commit comments