Beispiel #1
0
    def processObject(self, obj):
        mw = QtGui.QMainWindow(obj)
        if not mw or not self.acosPerms_:
            return

        if not self.perm_.isEmpty():
            l = QtCore.QObjectList(mw.queryList("QAction"))
            ito = QtCore.QObjectListIt(l)
            a = QtCore.QAction

            while not ito.current() == 0:
                a = ito.current()
                ++ito
                if self.acosPerm_[a.name()]:
                    continue
                if self.perm_ == "-w" or self.perm_ == "--":
                    a.setVisible(False)

            del l

        it = QtCore.QDictIterator(self.acosPerms_)
        for i in range(len(it.current())):
            a = mw.child(it.currentKey(), "QAction")
            if a:
                perm = it
                if perm in ("-w", "--"):
                    a.setVisible(False)
Beispiel #2
0
 def processObject(self, obj):
     fm = FLForm(obj)
     if not fm or not self.acosPerms_:
         return
     
     if not self.perm_.isEmpty():
         l = QtCore.QObjectList(fm.queryList("QWidget"))
         ito = QtCore.QObjectListIt(l)
         w = None
         while not ito.current() == 0:
             w = ito.current()
             ++ito
             if self.acosPerms_[w.name()]:
                 continue
             if self.perm_ == "w" or self.perm_ == "--":
                 w.setPallete(pal)
                 w.setDisabled(True)
                 w.hide()
                 continue
             if self.perm_ == "r-":
                 w.setDisabled(True)
             
         del l
     
     it = self.acosPerms_
     
     for i in range(it.current()):
         w = QtWidgets.QWidget(fm.child(it.currentKey(), "QWidget"))
         if w:
             perm = QString(it)
             if perm == "-w" or perm == "--":
                 w.setPalette(pal)
                 w.setDisabled(True)
                 w.hide()
                 continue
             if perm == "r-":
                 w.setDisabled(True)