Beispiel #1
0
    def __init__(self):
        Component.__init__(self)
        #loader = QUiLoader() 
        uism = r.getUiSceneManager() #self.canvas = r.createCanvas(EXTERNAL)

        #group = QGroupBox()
        #box = QVBoxLayout(group)
        #button = QPushButton(group)
        #box.addWidget(button)
        #group.show()
        #self.canvas.AddWidget(group)

        lineedit = QLineEdit()
        self.widget = lineedit
        #lineedit.show()
        #uiprops = UiWidgetProperties("PythonQt Test")
        #uism.AddWidgetToScene(lineedit) #uiprops) #self.canvas.AddWidget(lineedit)

        uism = r.getUiSceneManager()
        uiprops = r.createUiWidgetProperty()
        uiprops.widget_name_ = "Test Widget"
        #uiprops.my_size_ = QSize(width, height)
        #self.proxywidget = uism.AddWidgetToScene(ui, uiprops)
        self.proxywidget = r.createUiProxyWidget(self.widget, uiprops)
        ##print widget, dir(widget)
        if not uism.AddProxyWidget(self.proxywidget):
            print "Adding the ProxyWidget to the bar failed."

        #self.canvas.Show()

        #QInputDialog.getText(None, "Mesh asset UUID", "Please give mesh asset UUID", QLineEdit.Normal, "")

        lineedit.connect('textChanged(QString)', self.changed)

        r.logInfo("TestGui inited.")
Beispiel #2
0
    def __init__(self):
        Component.__init__(self)
        #loader = QUiLoader() 
        uism = r.getUiSceneManager() #self.canvas = r.createCanvas(EXTERNAL)

        #group = QGroupBox()
        #box = QVBoxLayout(group)
        #button = QPushButton(group)
        #box.addWidget(button)
        #group.show()
        #self.canvas.AddWidget(group)

        lineedit = QLineEdit()
        self.widget = lineedit
        #lineedit.show()
        #uiprops = UiWidgetProperties("PythonQt Test")
        #uism.AddWidgetToScene(lineedit) #uiprops) #self.canvas.AddWidget(lineedit)

        uism = r.getUiSceneManager()
        uiprops = r.createUiWidgetProperty()
        uiprops.widget_name_ = "Test Widget"
        #uiprops.my_size_ = QSize(width, height)
        #self.proxywidget = uism.AddWidgetToScene(ui, uiprops)
        self.proxywidget = r.createUiProxyWidget(self.widget, uiprops)
        ##print widget, dir(widget)
        if not uism.AddProxyWidget(self.proxywidget):
            print "Adding the ProxyWidget to the bar failed."

        #self.canvas.Show()

        #QInputDialog.getText(None, "Mesh asset UUID", "Please give mesh asset UUID", QLineEdit.Normal, "")

        lineedit.connect('textChanged(QString)', self.changed)

        r.logInfo("TestGui inited.")
Beispiel #3
0
 def __init__(self, mainedit, *args):
     self.mainedit = mainedit #to be able to query the selected entity at drop
     QLineEdit.__init__(self, *args)
     self.old_text = ""
     
     self.combobox = None #throw into another class...
     self.buttons = []
     self.index = None 
Beispiel #4
0
    def __init__(self, mainedit, *args):
        self.mainedit = mainedit  #to be able to query the selected entity at drop
        QLineEdit.__init__(self, *args)
        self.old_text = ""

        self.combobox = None  #throw into another class...
        self.buttons = []
        self.index = None
Beispiel #5
0
    def __init__(self, title, label1, label2, parent=None):
        super().__init__(parent)
        self.setWindowTitle(title)
        self.lay = QVBoxLayout(self)

        self.lay1 = QHBoxLayout()
        self.label1 = QLabel(label1, self)
        self.lay1.addWidget(self.label1)
        self.input1 = QLineEdit(self)
        self.lay1.addWidget(self.input1)
        self.lay.addLayout(self.lay1)

        self.lay2 = QHBoxLayout()
        self.label2 = QLabel(label2, self)
        self.lay2.addWidget(self.label2)
        self.input2 = QLineEdit(self)
        self.lay2.addWidget(self.input2)
        self.lay.addLayout(self.lay2)

        bbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel,
                                self)
        bbox.connect("accepted()", self.accept)
        bbox.connect("rejected()", self.reject)
        self.lay.addWidget(bbox)
Beispiel #6
0
    def initWidget(self):
        # Main layout
        mainBox = QVBoxLayout(self)

        # Add text edit to write regex by hand
        box = QVBoxLayout()
        mainBox.addLayout(box)
        self.textEdit = QLineEdit(self)
        box.addWidget(QLabel("You can write your regexp here", self))
        box.addWidget(self.textEdit)
        button = QPushButton("Find", self)
        button.connect("clicked()", self.applyRegex)
        box.addWidget(button)

        # Add grippers list
        self.grippersList = QListWidget(self)
        mainBox.addWidget(self.grippersList)

        # Sub layout for the action type
        box = QHBoxLayout()
        mainBox.addLayout(box)
        self.graspCheck = QCheckBox("Grasp", self)
        box.addWidget(self.graspCheck)
        self.pregraspCheck = QCheckBox("Pregrasp", self)
        box.addWidget(self.pregraspCheck)

        # Add handle list
        self.handlesList = QListWidget(self)
        mainBox.addWidget(self.handlesList)

        # Add a table to display results
        self.resultList = QListWidget(self)
        mainBox.addWidget(self.resultList)

        # Add button to refresh
        button = QPushButton(self)
        button.setText("Refresh")
        button.connect("clicked()", self.refresh)
        mainBox.addWidget(button)

        # Get the grippers and handles names
        # Connect the widget to functions
        self.addConnection()
Beispiel #7
0
    #print r.c, dir(r.c)
    print r.manager
    print dir(r.manager)
    
    channels = r.manager.channels
    #print channels
    for item in channels:
        for handler in r.manager._getHandlers(item):
            print handler.channels#dir(handler)
            
if 0:
    import PythonQt
    from PythonQt.QtGui import QTreeWidgetItem, QInputDialog, QLineEdit
    box = r.c.widget.findChild("QVBoxLayout")
    print box, dir(box), box.name
    line = QLineEdit()
    box.addWidget(line)

if 0: #a c++ side test func for api dev
    ret = r.randomTest()
    print ret
    print ret.map, ret.about(), ret.uuid, ret.list()
    l = ret.list()
    print dir(l)
    print l.count(2)
    for i in l:
        print i
    #print qm, dir(qm)
    #~ print r.c.widget, r.c.proxywidget
    #~ pe = r.getPropertyEditor()
    #~ #print pe, pe.setObject, pe.show
Beispiel #8
0
    def __init__(self, cfg, parent):
        super().__init__(parent)
        self.setAttribute(Qt.WA_DeleteOnClose)
        self.setWindowTitle("Eventlog")

        self.cfg = cfg

        self.pauseButton = QPushButton("Pause", self)
        self.pauseButton.setCheckable(True)
        self.pauseButton.connect("toggled(bool)", self.onPauseButtonToggled)
        self.spacer = QSpacerItem(40, 20, QSizePolicy.Expanding,
                                  QSizePolicy.Minimum)
        self.maxLabel = QLabel("Maximum Events:", self)
        self.maxSpin = QSpinBox(self)
        self.maxSpin.setMaximum(10000)
        self.maxSpin.setToolTip("Set to 0 to not shrink events at all")
        self.maxSpin.setValue(cfg.getint("maximumEvents"))
        self.maxSpin.connect("valueChanged(int)", self.onMaxSpinChanged)

        self.sublay1 = QHBoxLayout()
        self.sublay1.addWidget(self.pauseButton)
        self.sublay1.addItem(self.spacer)
        self.sublay1.addWidget(self.maxLabel)
        self.sublay1.addWidget(self.maxSpin)

        self.filterLabel = QLabel("Filter:", self)
        self.filterEdit = QLineEdit(self)
        self.filterEdit.connect("textChanged(QString)",
                                self.onFilterEditChanged)
        self.filterButton = QToolButton(self)
        self.filterButton.connect("clicked()", self.filterEdit.clear)
        try:
            ico = ts3client.IconPack.current()
            ico.open()
            self.filterButton.setIcon(QIcon(ico.icon("ERROR")))
            ico.close()
        except Exception as e:
            self.filterButton.setText("X")

        self.sublay2 = QHBoxLayout()
        self.sublay2.addWidget(self.filterLabel)
        self.sublay2.addWidget(self.filterEdit)
        self.sublay2.addWidget(self.filterButton)

        self.model = EventlogModel(self)
        self.model.maximumEvents = cfg.getint("maximumEvents")
        self.proxy = QSortFilterProxyModel(self)
        self.proxy.setFilterRole(Qt.UserRole)
        self.proxy.setSourceModel(self.model)

        self.tree = QTreeView(self)
        self.tree.header().hide()
        self.tree.setModel(self.proxy)

        self.lay = QVBoxLayout(self)
        self.lay.addLayout(self.sublay1)
        self.lay.addLayout(self.sublay2)
        self.lay.addWidget(self.tree)

        self.resize(cfg.getint("width"), cfg.getint("height"))

        self.connect("finished(int)", self.onFinished)
Beispiel #9
0
    #print r.c, dir(r.c)
    print r.manager
    print dir(r.manager)

    channels = r.manager.channels
    #print channels
    for item in channels:
        for handler in r.manager._getHandlers(item):
            print handler.channels  #dir(handler)

if 0:
    import PythonQt
    from PythonQt.QtGui import QTreeWidgetItem, QInputDialog, QLineEdit
    box = r.c.widget.findChild("QVBoxLayout")
    print box, dir(box), box.name
    line = QLineEdit()
    box.addWidget(line)

if 0:  #a c++ side test func for api dev
    ret = r.randomTest()
    print ret
    print ret.map, ret.about(), ret.uuid, ret.list()
    l = ret.list()
    print dir(l)
    print l.count(2)
    for i in l:
        print i
    #print qm, dir(qm)
    #~ print r.c.widget, r.c.proxywidget
    #~ pe = r.getPropertyEditor()
    #~ #print pe, pe.setObject, pe.show