Exemplo n.º 1
0
class ApplicationWindow(QtWidgets.QWidget):
    def __init__(self):
        super(ApplicationWindow,self).__init__()

        self.m_DragPosition=self.pos()
        self.avasize=QtWidgets.QDesktopWidget().availableGeometry()#screenGeometry()
        self.setGeometry(self.avasize)
        self.setWindowFlags(QtCore.Qt.FramelessWindowHint )
        self.setFocus()
        #self.setCentralWidget(self)
        self.widgets_set()
        '''
        tb=QtWidgets.QPushButton('test',self)
        tb.resize(100,50)
        tb.move(0,400)
        tb.clicked.connect(self.test)'''
    def test(self):
        self.fm.addFigLabel('ajfeh',random.randint(1,100))
        #self.lb.resize(100,40)


    def widgets_set(self):
        # add close button
        self.closeB=ModCloseButton(self,40,40)
        self.closeB.move( self.width()-40, 0 )

        # label region
        self.fm=FigMana(self)
        self.flm=FigLabelMana(self,self.fm)
        '''
        self.lb=FigLabelWidget(self)
        self.lb.move(100,100)
        self.lb.resize(200,100)
        print(self.lb.geometry())'''

        self.addB=ModCrossButton(self)
        self.addB.setGeometry(self.width()/2,self.height()/2,100,100)
        self.addB.clicked.connect(self.addFigure)

        # figure type 
        self.ftm=FigTpeMana(self,self.fm)


    def addFigure(self):
        filepath=QtWidgets.QFileDialog.getOpenFileName(self,"Data Load")[0]
        if not filepath.strip() :
            return
        filename=os.path.basename(filepath)
        fid=random.randint(1,100)
        # fig add
        self.fm.addFig( fid, data_format(filepath) )
        # label add 
        self.flm.addFigLabel(filename,fid)
        # addbutton move resize
        self.addB.resize( self.flm.height(), self.flm.height() )
        self.addB.move( self.flm.x()+self.flm.endpoint+5 , self.flm.y() )
Exemplo n.º 2
0
    def widgets_set(self):
        # add close button
        self.closeB=ModCloseButton(self,40,40)
        self.closeB.move( self.width()-40, 0 )

        # label region
        self.fm=FigMana(self)
        self.flm=FigLabelMana(self,self.fm)
        '''
        self.lb=FigLabelWidget(self)
        self.lb.move(100,100)
        self.lb.resize(200,100)
        print(self.lb.geometry())'''

        self.addB=ModCrossButton(self)
        self.addB.setGeometry(self.width()/2,self.height()/2,100,100)
        self.addB.clicked.connect(self.addFigure)

        # figure type 
        self.ftm=FigTpeMana(self,self.fm)