n this project, we will be using various features from the Qt framework to build a graphical user interface (UI) that contains a canvas (for drawing images) and buttons. You will receive different text files as input - each containing the elevation data for different mountains. Based on the dimensions and number of values in a file, you will create a canvas with similar dimensions.
n this project, we will be using various features from the Qt framework to build a graphical user interface (UI) that contains a canvas (for drawing images) and buttons. You will receive different text files as input - each containing the elevation data for different mountains. Based on the dimensions and number of values in a file, you will create a canvas with similar dimensions.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
have to complete all the septs in green
In this project, we will be using various features from the Qt framework to build a graphical user interface (UI) that contains a canvas (for drawing images) and buttons.
You will receive different text files as input - each containing the elevation data for different mountains.
Based on the dimensions and number of values in a file, you will create a canvas with similar dimensions.
For example, a file that contains data for 256 rows and 256 columns, should have a canvas with dimensions of 256 x 256 data points (refer to the canvas on the right).
heres the code
import sys
from PyQt5 import QtWidgets as qtw
from PyQt5 import QtGui as qtg
from PyQt5 import QtCore as qtc
class mainWindow(qtw.QWidget):
# Sprint-1 Step-1: Initializer function
def __init__(self):
super().__init__()
# Sprint-1 Step-2: Variables
self.n_rows = 0
self.n_columns = 0
self.grid_data = []
# Sprint-1 Step-3: Read input file
file = open('../Data/medium.txt','r')
# Sprint-1 Step-4: Extract the values of line-1 into
# self.n_rows and self.n_columns
# Sprint-1 Step-5:
# Extract the values of line-2 into a two-dimensional list
# called self.grid_data
# Important! Make sure each value is stored as a valid
# float with two decimals
# Sprint-1 Step-6:
# Set window title and icon
# Create self.label1 to be used to display the canvas
# Create self.canvas based on the size of self.n_columns and self.n_rows
# Set self.canvas as the image for label1
# Create the layout and display the UI
# Sprint-1 Step-7:
# Link a painter to label1's image and plot the data_points in
# self.grid_data (the items in the sub-lists) on the canvas.
# Use "#c2c2a3" as color
# *****************************************
# This is the Main Code section of the app.
# *****************************************
if __name__ == '__main__':
app = qtw.QApplication(sys.argv)
# Create a mainWindow object
mw = mainWindow()
sys.exit(app.exec())
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education