def __init__(self): QMainWindow.__init__(self) self.setWindowTitle("Lab-Data-Converter") self.create_actions() self.setup_menu() self.settings = QSettings("UCB", "Lab-Data-Converter") self.data_sets = {} self.output_widget = OutputWidget(self) self.data_table = DataTabel(self) self.splitter1 = QSplitter() self.splitter1.setOrientation(Qt.Vertical) self.splitter1.addWidget(self.data_table) self.splitter1.addWidget(self.output_widget) self.splitter1.setSizes([200, 100]) #self.splitter1.setStretchFactor(0, 8) #self.splitter1.setStretchFactor(1, 4) self.setCentralWidget(self.splitter1) QDir.setCurrent(QStandardPaths.standardLocations( QStandardPaths.DocumentsLocation)[-1]) if (self.settings.value("work_dir")): try: QDir.setCurrent(self.settings.value("work_dir")) except: pass
def abrir_archivo(self): location = QStandardPaths.standardLocations( QStandardPaths.HomeLocation) ubicacion = QFileDialog.getOpenFileName(self, 'Abrir archivo', location[0], 'CSV Files(*.csv)') self.data = pd.read_csv(ubicacion[0])
def get_app_config_path(): return QStandardPaths.standardLocations( QStandardPaths.AppConfigLocation)[0] # type: ignore