def setup_window(self): self.setWindowTitle("API Data GUI") display_list = QListWidget(self) self.list_control = display_list self.put_data_in_list(self.data) display_list.resize(400, 350) self.setGeometry(300, 100, 400, 500) quit_button = QPushButton("Quit Now", self) quit_button.clicked.connect(QApplication.instance().quit) quit_button.resize(quit_button.sizeHint()) quit_button.move(300, 400) api_db_demo_button = QPushButton("Push me for Data Visual", self) api_db_demo_button.move(100, 400) api_db_demo_button.clicked.connect(self.do_something_to_test) self.show()
def setup_window(self): self.setWindowTitle("GUI Demo for Capstone") display_list = QListWidget(self) self.list_control = display_list self.put_data_in_list(self.data) display_list.resize(400, 350) self.setGeometry(300, 100, 400, 500) quit_button = QPushButton("Quit Now", self) quit_button.clicked.connect(QApplication.instance().quit) quit_button.resize(quit_button.sizeHint()) quit_button.move(300, 400) comp490_demo_button = QPushButton("Push me for Demo", self) comp490_demo_button.move(100, 400) comp490_demo_button.clicked.connect(self.do_something_to_demo) # comp490_demo_button.resize(123, 35) self.show()
def __init__(self, db_name_from_visualize): super().__init__() self.db_name_from_visual_btn = db_name_from_visualize self.type_of_display = QLabel( "Please choose how you'd like to display the data", self) self.type_of_display.move(20, 20) self.type_of_display.setStyleSheet("border: 1px solid black;") self.type_of_display.setFont(QFont("Calibre", 12)) self.which_data = QLabel( "Please select which data you'd like to display", self) self.which_data.move(430, 20) self.which_data.setStyleSheet("border: 1px solid black") self.which_data.setFont(QFont("Calibre", 12)) # LIST BOXES display_list = QListWidget(self) self.list_control = display_list display_list.resize(770, 440) display_list.move(10, 200) # CHECK BOXES self.color_coded_checkbox = QCheckBox("Color coded text in a list", self) self.color_coded_checkbox.move(100, 60) self.color_coded_checkbox.clicked.connect( self.swap_color_coded_checkbox) self.render_map_checkbox = QCheckBox("Render a Map", self) self.render_map_checkbox.move(100, 90) self.render_map_checkbox.toggle() self.render_map_checkbox.clicked.connect(self.swap_render_map_checkbox) self.analysis_type1_checkbox = QCheckBox( "Compare the number of college graduates in a state \n(for the most recent " "year) with number of jobs in that \nstate that likely expect a college " "education.", self) self.analysis_type1_checkbox.setGeometry(430, 20, 300, 100) self.analysis_type1_checkbox.clicked.connect( self.swap_num_grads_checkbox) self.analysis_type2_checkbox = QCheckBox( "Compare the 3 year graduate cohort declining balance \npercentage to " "the 25% salary in the state.", self) self.analysis_type2_checkbox.setGeometry(430, 70, 400, 100) self.analysis_type2_checkbox.toggle() self.analysis_type2_checkbox.clicked.connect( self.swap_3_yr_cohort_checkbox) # PUSH BUTTONS self.render_data_button = QPushButton("VISUALIZE", self) self.render_data_button.setGeometry(10, 150, 770, 40) self.render_data_button.clicked.connect(self.display_visualization) self.sort_ascending_button = QPushButton("Sort Ascending", self) self.sort_ascending_button.setGeometry(10, 650, 120, 30) self.sort_ascending_button.clicked.connect(self.sort_ascending) self.sort_descending_button = QPushButton("Sort Descending", self) self.sort_descending_button.setGeometry(130, 650, 120, 30) self.sort_descending_button.clicked.connect(self.sort_descending) self.close_visual_window_button = QPushButton("CLOSE", self) self.close_visual_window_button.setGeometry(660, 650, 120, 30) self.close_visual_window_button.clicked.connect(lambda: self.close()) self.setWindowTitle( "Data Visualization for Project 1 - Sprint 4 - Ryan O'Connor - COMP490 - T/R" ) self.setGeometry(100, 100, 800, 700) self.setFixedSize(800, 700) self.center()
def setup_window(self): self.setWindowTitle("Jobs Window") display_list = QListWidget(self) self.list_control = display_list display_list.resize(500, 350) self.setGeometry(50, 50, 500, 500) self.quit_button.clicked.connect(QApplication.instance().quit) self.quit_button.resize(self.quit_button.sizeHint()) self.quit_button.move(415, 450) self.update_button.clicked.connect(self.update_data) self.update_button.move(200, 200) self.data_button.clicked.connect(self.run_data_visualization) self.data_button.move(175, 250) self.back_button.clicked.connect(self.go_back) self.back_button.move(25, 450) self.data_visualization_label.move(20, 400) self.text_visualization_button.move(400 - self.text_visualization_button.width(), 600) self.order_selector_text.move(self.text_visualization_button.x(), self.text_visualization_button.y()+self.text_visualization_button.height()+10) self.text_visualization_button.clicked.connect(self.text_visualization) self.map_visualization.move(self.text_visualization_button.x() + self.text_visualization_button.width(), self.text_visualization_button.y()) self.data_selector_map.move(self.map_visualization.x(), self.map_visualization.y()+self.map_visualization.height()+10) self.map_visualization.clicked.connect(self.run_map_visualization) self.welcome_label.move(150, 150) self.update_box_01.move(150, 30) self.update_box_02.move(150, 60) self.update_box_03.move(150, 90) self.update_box_04.move(150, 120) self.update_box_05.move(150, 150) self.update_box_06.move(150, 180) self.update_box_07.move(150, 210) self.update_box_08.move(150, 240) self.excel_label.move(340, 70) self.update_excel_selection.move(340, 90) self.update_information.move(25, 325) self.update_label_01.setGeometry(5, 30, 145, 20) self.update_label_02.setGeometry(5, 60, 145, 20) self.update_label_03.setGeometry(5, 90, 145, 20) self.update_label_04.setGeometry(5, 120, 145, 20) self.update_label_05.setGeometry(5, 150, 145, 20) self.update_label_06.setGeometry(5, 180, 145, 20) self.update_label_07.setGeometry(5, 210, 145, 20) self.update_label_08.setGeometry(5, 240, 145, 20) self.table_selection.setGeometry(10, 10, 145, 20) self.enter_data.move(10, 260) self.enter_data.clicked.connect(self.import_data) self.table_selection.addItem("---") self.table_selection.addItem("Schools") self.table_selection.addItem("Jobs") self.order_selector_text.addItem("---") self.order_selector_text.addItem("ASC") self.order_selector_text.addItem("DESC") self.data_selector_map.addItem("---") self.data_selector_map.addItem("Employment to Graduates") self.data_selector_map.addItem("Average Salary to Average Declining Balance Percent") self.table_selection.currentIndexChanged.connect(self.update_selection) self.hidden_at_start() self.show()