configwindow.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:dxf2gcode 作者: cnc-club 项目源码 文件源码
def __init__(self, text, items_list = None, default_item = None, parent = None):
        """
        Initialization of the CfgComboBox class (drop-down menu).
        @param text: text string associated with the combobox
        @param items_list: string list containing all the available options
        @param default_item: string containing the default selected item
        """
        QWidget.__init__(self, parent)

        self.combobox = QComboBox(parent)

        if isinstance(items_list, (list, tuple)):
            self.setSpec({'string_list': items_list, 'comment': ''})
        if default_item is not None:
            self.setValue(default_item)

        self.label = QLabel(text, parent)
        self.layout = QHBoxLayout(parent);

        self.combobox.setMinimumWidth(200) #Provide better alignment with other items
        self.layout.addWidget(self.label)
        self.layout.addStretch()
        self.layout.addWidget(self.combobox)
        self.setLayout(self.layout)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号