def __init__(self,master): AbstractBeeDockWindow.__init__(self,master) self.setAttribute(qtcore.Qt.WA_DeleteOnClose,False) self.ui=Ui_BeePaletteDock() self.ui.setupUi(self) self.show() self.ui.FGSwatch=FGSwatch(master,replacingwidget=self.ui.FGSwatch) self.setFGColor(qtgui.QColor(0,0,0)) self.ui.BGSwatch=BGSwatch(master,replacingwidget=self.ui.BGSwatch) self.setBGColor(qtgui.QColor(255,255,255)) # read in pallette file palfilename=os.path.join("config","default.pal") palfile=qtcore.QFile(palfilename) if palfile.exists(): palfile.open(qtcore.QIODevice.ReadOnly) reader=PaletteParser(palfile) colors=reader.getColors() swatchsize=reader.swatchsize else: colors=[] self.setColors(colors,swatchsize)
def __init__(self,master): AbstractBeeDockWindow.__init__(self,master) self.master=master self.ui=Ui_ToolSelection() self.ui.setupUi(self) self.show()
def __init__(self,master): AbstractBeeDockWindow.__init__(self,master) self.master=master self.ui=Ui_ToolOptionsWindow() self.ui.setupUi(self) self.show() self.curwidget=self.ui.toolwidget self.toolwidgetparent=self.curwidget.parentWidget()
def __init__(self, master): AbstractBeeDockWindow.__init__(self, master) # don't have a maximize button self.setWindowFlags( qtcore.Qt.CustomizeWindowHint | qtcore.Qt.WindowMinimizeButtonHint | qtcore.Qt.WindowCloseButtonHint ) # setup ui self.ui = Ui_LayersWindow() self.ui.setupUi(self) self.show() layersListArea = qtgui.QScrollArea(self.ui.layersListArea.parentWidget()) layout = self.ui.layersListArea.parentWidget().layout() # setup new scroll area options layersListArea.setGeometry(self.ui.layersListArea.geometry()) layersListArea.setSizePolicy(self.ui.layersListArea.sizePolicy()) layersListArea.setObjectName(self.ui.layersListArea.objectName()) layersListArea.setVerticalScrollBarPolicy(qtcore.Qt.ScrollBarAlwaysOn) layersListArea.setHorizontalScrollBarPolicy(qtcore.Qt.ScrollBarAlwaysOff) scrollareawidth = LayerConfigWidget.getStandardGeometry().width() # layersListArea.setFixedWidth(scrollareawidth) layersListArea.setMinimumWidth(scrollareawidth + 15) layersListArea.setSizePolicy(qtgui.QSizePolicy.MinimumExpanding, qtgui.QSizePolicy.MinimumExpanding) # remove widget that I'm replacing in the layout index = layout.indexOf(self.ui.layersListArea) layout.removeWidget(self.ui.layersListArea) # replace widget with custom scroll area widget self.ui.layersListArea = layersListArea layout.insertWidget(index, layersListArea) # add frame to scrolled area frame = qtgui.QFrame(layersListArea) layersListArea.setWidget(frame) # frame.setSizePolicy(qtgui.QSizePolicy.MinimumExpanding,qtgui.QSizePolicy.MinimumExpanding) # add layout to frame inside the scroll area vbox = qtgui.QVBoxLayout() frame.setLayout(vbox) self.layersListArea = layersListArea