当前位置: 首页>>代码示例>>Python>>正文


Python QUiLoader.setLanguageChangeEnabled方法代码示例

本文整理汇总了Python中PythonQt.QtUiTools.QUiLoader.setLanguageChangeEnabled方法的典型用法代码示例。如果您正苦于以下问题:Python QUiLoader.setLanguageChangeEnabled方法的具体用法?Python QUiLoader.setLanguageChangeEnabled怎么用?Python QUiLoader.setLanguageChangeEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PythonQt.QtUiTools.QUiLoader的用法示例。


在下文中一共展示了QUiLoader.setLanguageChangeEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from PythonQt.QtUiTools import QUiLoader [as 别名]
# 或者: from PythonQt.QtUiTools.QUiLoader import setLanguageChangeEnabled [as 别名]
    def __init__(self, controller):
        self.controller = controller
        loader = QUiLoader()
        loader.setLanguageChangeEnabled(True)
        uifile = QFile(self.UIFILE)

        ui = loader.load(uifile)
        width = ui.size.width()
        height = ui.size.height()
        
        uism = naali.ui

        self.widget = ui

        # Material/Texture widgets
        self.materialTabFormWidget = ui.findChild("QWidget", "MaterialsTab").formLayoutWidget

        # Mesh line edit and buttons
        self.meshline = lines.MeshAssetidEditline(controller) 
        self.meshline.name = "meshLineEdit"

        button_ok = self.getButton("Apply", self.ICON_OK, self.meshline, self.meshline.applyAction)
        button_cancel = self.getButton("Cancel", self.ICON_CANCEL, self.meshline, self.meshline.cancelAction)
        button_browse = self.getButton("Browse", self.ICON_FOLDER, None, None)
        
        box = QHBoxLayout()
        box.setContentsMargins(0,0,0,0)
        box.addWidget(self.meshline)
        box.addWidget(button_browse)
        box.addWidget(button_ok)
        box.addWidget(button_cancel)
        self.mesh_widget = QWidget()
        self.mesh_widget.setLayout(box)
        
        # Sound line edit and buttons
        self.soundline = lines.SoundAssetidEditline(controller) 
        self.soundline.name = "soundLineEdit"
        soundbutton_ok = self.getButton("Apply", self.ICON_OK, self.soundline, self.soundline.applyAction)
        soundbutton_cancel = self.getButton("Cancel", self.ICON_CANCEL, self.soundline, self.soundline.cancelAction)
        soundbutton_browse = self.getButton("Browse", self.ICON_FOLDER, None, None)
        soundRadius = self.getDoubleSpinBox("soundRadius", "Set sound radius", self.soundline)
        soundVolume = self.getDoubleSpinBox("soundVolume", "Set sound volume", self.soundline)
        
        main_box = QVBoxLayout()
        main_box.setContentsMargins(0,0,0,0)
        box_buttons = QHBoxLayout()
        box_buttons.setContentsMargins(0,0,0,0)
        
        # TODO no need for self?
        # crashed always if didnt put self to second label :P you can try to remove them...
        # basically the qwidget ptr must stay somewhere in py otherwise will crash when gets to painting -Pforce
        self.label_radius = QLabel("Radius")
        self.label_radius.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)
        self.label_volume = QLabel("Volume")
        self.label_volume.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)

        box_buttons.addWidget(self.label_radius)
        box_buttons.addWidget(soundRadius)
        box_buttons.addWidget(self.label_volume)
        box_buttons.addWidget(soundVolume)
        box_buttons.addWidget(soundbutton_browse)        
        box_buttons.addWidget(soundbutton_ok)
        box_buttons.addWidget(soundbutton_cancel)

        main_box.addWidget(self.soundline)
        main_box.addLayout(box_buttons)
        self.sound_widget = QWidget()
        self.sound_widget.setLayout(main_box)

        # Animation line edit and buttons
        self.animation_title = QLabel("Skeleton Animation")
        self.animation_title.setStyleSheet("font-size:18px;font-weight:bold;padding-top:5px;")
        self.animation_title.setIndent(0)
        self.animationline = lines.AnimationAssetidEditline(controller)
        self.animationline.name = "animationLineEdit"
        animation_combobox = self.getCombobox("AnimationName", "Animation Name", self.animationline)
        animationbutton_ok = self.getButton("Apply", self.ICON_OK, self.animationline, self.animationline.applyAction)
        animationbutton_cancel = self.getButton("Cancel", self.ICON_CANCEL, self.animationline, self.animationline.cancelAction)
        animationbutton_browse = self.getButton("Browse", self.ICON_FOLDER, None, None)
        animationRate = self.getDoubleSpinBox("animationRate", "Set animation rate", self.animationline)

        animationbox = QVBoxLayout()
        animationbox.setContentsMargins(0,0,0,0)
        self.anim_box_buttons = QHBoxLayout()
        self.anim_box_buttons.name = "AnimBoxButtons"
        self.anim_box_buttons.setContentsMargins(0,0,0,0)

        label_rate = QLabel("Rate")
        label_rate.name = "Animation Rate"
        label_rate.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)

        self.anim_box_buttons.addWidget(animation_combobox)
        self.anim_box_buttons.addWidget(label_rate)
        self.anim_box_buttons.addWidget(animationRate)
        self.anim_box_buttons.addWidget(animationbutton_browse)
        self.anim_box_buttons.addWidget(animationbutton_ok)
        self.anim_box_buttons.addWidget(animationbutton_cancel)

        animationbox.addWidget(self.animation_title)
        animationbox.addWidget(self.animationline)
#.........这里部分代码省略.........
开发者ID:A-K,项目名称:naali,代码行数:103,代码来源:window.py

示例2: __init__

# 需要导入模块: from PythonQt.QtUiTools import QUiLoader [as 别名]
# 或者: from PythonQt.QtUiTools.QUiLoader import setLanguageChangeEnabled [as 别名]
    def __init__(self, controller, queue):
        loader = QUiLoader()
        loader.setLanguageChangeEnabled(True)
        # uifile = QFile("pymodules/estatemanagement/estatemanagement.ui")
        uifile = QFile(EstateManagementWindow.UIFILE)
        self.gui = loader.load(uifile)
        self.controller = controller
        IncomingMessagesHandler.__init__(self, queue, self.endMethod)

        uism = naali.ui
        #        uiprops = r.createUiWidgetProperty(1) # 1 = Qt::Dialog
        #        uiprops.SetMenuGroup("Server Tools")
        #        uiprops.name_ = "Estate Management"

        self.proxywidget = r.createUiProxyWidget(self.gui)
        self.proxywidget.setWindowTitle("Estate Management")

        if not uism.AddWidgetToScene(self.proxywidget):
            r.logInfo("Adding ProxyWidget failed.")

        # TODO: Due to core UI API refactor RemoveWidgetFromMenu doesn't exist anymore.
        # uism.AddWidgetToMenu(self.proxywidget, "Estate Management", "Server Tools", "./data/ui/images/menus/edbutton_ESMNG_normal.png")

        self.btnLoadEstate = self.gui.findChild("QPushButton", "btnLoadEstate")
        self.listWEI = self.gui.findChild("QListWidget", "listWidgetEstateInfo")
        self.listWRU = self.gui.findChild("QListWidget", "listWidgetRegionUsers")
        self.listWEB = self.gui.findChild("QListWidget", "listWidgetBanList")
        self.listWAL = self.gui.findChild("QListWidget", "listWidgetAccessList")
        self.listWEM = self.gui.findChild("QListWidget", "listWidgetEstateManagers")
        self.listWSU = self.gui.findChild("QListWidget", "listWidgetSavedUsers")

        self.labelEstateInfo = self.gui.findChild("QLabel", "labelEstateInfo")
        self.tableEstates = self.gui.findChild("QListWidget", "tableWidgetEstates")
        self.chkEstateAccess = self.gui.findChild("QCheckBox", "checkBoxEstateAccess")

        self.lineCurrentEstate = self.gui.findChild("QLineEdit", "lineEditCurrentEstate")
        self.listWidgetEstates = self.gui.findChild("QListWidget", "listWidgetEstates")
        self.btnSetEstate = self.gui.findChild("QPushButton", "pushButtonSetEstate")

        self.chkSunFixed = self.gui.findChild("QCheckBox", "checkBoxSunFixed")
        # PublicAllowed
        # ExternallyVisible);
        self.chkAllowVoice = self.gui.findChild("QCheckBox", "checkBoxAllowVoice")
        self.chkAllowDirectTeleport = self.gui.findChild("QCheckBox", "checkBoxAllowDirectTeleport")
        self.chkDenyAnonymous = self.gui.findChild("QCheckBox", "checkBoxDenyAnonymous")
        self.chkDenyIdentified = self.gui.findChild("QCheckBox", "checkBoxDenyIdentified")
        self.chkDenyTransacted = self.gui.findChild("QCheckBox", "checkBoxDenyTransacted")
        self.chkAbuseEmailToEstateOwner = self.gui.findChild("QCheckBox", "checkBoxAbuseEmailToEstateOwner")
        self.chkBlockDwell = self.gui.findChild("QCheckBox", "checkBoxBlockDwell")
        self.chkEstateSkipScripts = self.gui.findChild("QCheckBox", "checkBoxEstateSkipScripts")
        self.chkResetHomeOnTeleport = self.gui.findChild("QCheckBox", "checkBoxResetHomeOnTeleport")
        self.chkTaxFree = self.gui.findChild("QCheckBox", "checkBoxTaxFree")
        self.chkDenyAgeUnverified = self.gui.findChild("QCheckBox", "checkBoxDenyAgeUnverified")

        self.btnLoadEstate.connect("clicked(bool)", self.btnLoadEstateClicked)

        self.btnToBan = self.gui.findChild("QPushButton", "pushButtonToBan")
        self.btnToAccess = self.gui.findChild("QPushButton", "pushButtonToAccess")
        self.btnToManagers = self.gui.findChild("QPushButton", "pushButtonToManagers")
        self.btnSaveUserInfo = self.gui.findChild("QPushButton", "pushButtonSaveUserInfo")

        self.btnRemoveBan = self.gui.findChild("QPushButton", "pushButtonRemoveBan")
        self.btnRemoveAccess = self.gui.findChild("QPushButton", "pushButtonRemoveAccess")
        self.btnRemoveManagers = self.gui.findChild("QPushButton", "pushButtonRemoveManager")
        self.btnRemoveSaved = self.gui.findChild("QPushButton", "pushButtonRemoveSaved")

        self.btnSavedToAccess = self.gui.findChild("QPushButton", "pushButtonSavedToAccess")
        self.btnSavedToBan = self.gui.findChild("QPushButton", "pushButtonSavedToBan")
        self.btnSavedToManagers = self.gui.findChild("QPushButton", "pushButtonSavedToManagers")

        self.btnKick = self.gui.findChild("QPushButton", "pushButtonKick")
        self.btnRequestGodLikePowers = self.gui.findChild("QPushButton", "pushButtonRequestGodLikePowers")
        self.lineKickMessage = self.gui.findChild("QLineEdit", "lineEditKickMessage")

        self.btnToBan.connect("clicked(bool)", self.btnToBanClicked)
        self.btnToAccess.connect("clicked(bool)", self.btnToAccessClicked)
        self.btnToManagers.connect("clicked(bool)", self.btnToManagersClicked)
        self.btnSaveUserInfo.connect("clicked(bool)", self.btnSaveUserInfoClicked)

        self.btnRemoveBan.connect("clicked(bool)", self.btnRemoveBanClicked)
        self.btnRemoveAccess.connect("clicked(bool)", self.btnRemoveAccessClicked)
        self.btnRemoveManagers.connect("clicked(bool)", self.btnRemoveManagersClicked)

        self.btnRemoveSaved.connect("clicked(bool)", self.btnRemoveSavedClicked)

        self.btnSavedToAccess.connect("clicked(bool)", self.btnSavedToAccessClicked)
        self.btnSavedToBan.connect("clicked(bool)", self.btnSavedToBanClicked)
        self.btnSavedToManagers.connect("clicked(bool)", self.btnSavedToManagersClicked)

        self.btnRequestGodLikePowers.connect("clicked(bool)", self.btnRequestGodLikePowersClicked)
        self.btnKick.connect("clicked(bool)", self.btnKickClicked)
        self.btnSetEstate.connect("clicked(bool)", self.btnSetEstateClicked)

        self.chkEstateAccess.connect("toggled(bool)", self.chkEstateAccessToggled)

        # add incoming event handlers
        self.addHandler("EstateUpdate", self.setEstateInfo)
        self.addHandler("setEstateManagers", self.setEstateManagers)
        self.addHandler("setEstateBans", self.setEstateBans)
        self.addHandler("setEsteteAccessList", self.setEsteteAccessList)
#.........这里部分代码省略.........
开发者ID:AlphaStaxLLC,项目名称:TundraAddons,代码行数:103,代码来源:window.py


注:本文中的PythonQt.QtUiTools.QUiLoader.setLanguageChangeEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。