def test_mpushbutton_init(qtbot, dayu_type, dayu_size, icon, text): """Test MPushButton set_dayu_size and set_dayu_type.""" widget = MPushButton(icon=MIcon(icon) if icon else icon, text=text) widget.set_dayu_size(dayu_size) widget.set_dayu_type(dayu_type) qtbot.addWidget(widget) assert widget.property('dayu_type') == dayu_type assert widget.property('dayu_size') == dayu_size
def create_button(self, data_dict): button = MPushButton() button.set_dayu_size(data_dict.get('dayu_size', self._dayu_size)) button.set_dayu_type(data_dict.get('dayu_type', self._dayu_type)) return button