location.py 文件源码

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

项目:lilii 作者: LimeLinux 项目源码 文件源码
def __init__(self, parent=None):
        super().__init__()
        self.parent = parent
        self.setWindowTitle(self.tr("System Location"))
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignCenter)

        layout = QHBoxLayout()
        self.layout().addLayout(layout)

        worldMap = QLabel()
        worldMap.setFixedSize(480, 283)
        worldMap.setScaledContents(True)
        worldMap.setPixmap(QPixmap(":/images/world.svg"))
        layout.addWidget(worldMap)

        hlayout = QHBoxLayout()
        self.layout().addLayout(hlayout)

        cLabel = QLabel()
        cLabel.setText(self.tr("Region:"))
        hlayout.addWidget(cLabel)

        self.cBox = QComboBox()
        self.cBox.setFixedWidth(300)
        hlayout.addWidget(self.cBox)

        hlayout.addSpacerItem(QSpacerItem(40, 20, QSizePolicy.Preferred, QSizePolicy.Expanding))

        iLabel = QLabel()
        iLabel.setText(self.tr("City:"))
        hlayout.addWidget(iLabel)

        self.iBox = QComboBox()
        self.iBox.setFixedWidth(300)
        hlayout.addWidget(self.iBox)

        self.cBox.addItems(zone)

        info = zone_info[self.cBox.currentText()]
        info.sort()
        self.iBox.addItems(info)

        self.parent.lilii_settings["timezone"] = "{}/{}".format(self.cBox.currentText() , self.iBox.currentText())

        self.cBox.currentTextChanged.connect(self.zoneChanged)
        self.iBox.currentTextChanged.connect(self.cityChanged)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号