def __init__(self): super().__init__() self.data = None self.progress = None self.infoa = gui.widgetLabel(self.controlArea, "No data loaded.") self.projectionTable = QTableView() self.controlArea.layout().addWidget(self.projectionTable) self.projectionTable.setSelectionBehavior(QTableView.SelectRows) self.projectionTable.setSelectionMode(QTableView.SingleSelection) self.projectionTable.setSortingEnabled(True) self.projectionTableModel = QStandardItemModel(self) self.projectionTableModel.setHorizontalHeaderLabels( ["P-Index", "", ""]) self.projectionTable.setModel(self.projectionTableModel) self.projectionTable.setColumnWidth(0, 90) self.projectionTable.sortByColumn(0, Qt.DescendingOrder) self.projectionTable.selectionModel().selectionChanged.connect( self.on_selection_changed) gui.button(self.controlArea, self, "Rank Projections", callback=self.rank, default=True) self.resize(370, 600)
def __init__(self): super().__init__() self.corpus = None self.nyt_api = None self.output_info = '' self.num_retrieved = 0 self.num_all = 0 # API key self.api_dlg = self.APICredentialsDialog(self) self.api_dlg.accept(silent=True) gui.button(self.controlArea, self, 'Article API Key', callback=self.api_dlg.exec_, focusPolicy=Qt.NoFocus) # Query query_box = gui.widgetBox(self.controlArea, 'Query', addSpace=True) self.query_box = QueryBox(query_box, self, self.recent_queries, callback=self.new_query_input) # Year box date_box = gui.hBox(query_box) DatePickerInterval(date_box, self, 'date_from', 'date_to', min_date=MIN_DATE, max_date=date.today(), margin=(0, 3, 0, 0)) # Text includes features self.controlArea.layout().addWidget( CheckListLayout('Text includes', self, 'text_includes', self.attributes, cols=2, callback=self.set_text_features)) # Output info_box = gui.hBox(self.controlArea, 'Output') gui.label(info_box, self, 'Articles: %(output_info)s') # Buttons self.button_box = gui.hBox(self.controlArea) self.button_box.layout().addWidget(self.report_button) self.search_button = gui.button(self.button_box, self, 'Search', self.start_stop, focusPolicy=Qt.NoFocus)
def __init__(self, parent): super().__init__() self.parent = parent self.api = None form = QFormLayout() form.setContentsMargins(5, 5, 5, 5) self.key_edit = gui.lineEdit(self, self, 'key_input', controlWidth=400) form.addRow('Key:', self.key_edit) self.controlArea.layout().addLayout(form) self.submit_button = gui.button(self.controlArea, self, "OK", self.accept) self.load_credentials()
def __init__(self): super().__init__() self.data = None self.progress = None self.infoa = gui.widgetLabel(self.controlArea, "No data loaded.") self.projectionTable = QTableView() self.controlArea.layout().addWidget(self.projectionTable) self.projectionTable.setSelectionBehavior(QTableView.SelectRows) self.projectionTable.setSelectionMode(QTableView.SingleSelection) self.projectionTable.setSortingEnabled(True) self.projectionTableModel = QStandardItemModel(self) self.projectionTableModel.setHorizontalHeaderLabels(["P-Index", "", ""]) self.projectionTable.setModel(self.projectionTableModel) self.projectionTable.setColumnWidth(0, 90) self.projectionTable.sortByColumn(0, Qt.DescendingOrder) self.projectionTable.selectionModel().selectionChanged.connect(self.on_selection_changed) gui.button(self.controlArea, self, "Rank Projections", callback=self.rank, default=True) self.resize(370, 600)