Skip to content
Snippets Groups Projects
Commit 715d5e2b authored by Kien Le's avatar Kien Le
Browse files

Create layout for GPS dialog

parent a888a1ea
No related branches found
No related tags found
No related merge requests found
import sys
from view.plotting.plotting_widget.plotting_widget import PlottingWidget
from PySide2 import QtWidgets, QtCore
class GPSWidget(PlottingWidget):
def __init__(self, parent, tracking_box):
super().__init__(parent, tracking_box)
class GPSDialog(QtWidgets.QWidget):
def __init__(self, parent, gps_points):
super().__init__()
self.parent = parent
self.gps_points = gps_points
self.info_text_browser = QtWidgets.QTextBrowser(self)
self.setGeometry(300, 300, 400, 500)
self.setWindowTitle("GPS Plot")
main_layout = QtWidgets.QVBoxLayout()
self.setLayout(main_layout)
main_layout.setContentsMargins(5, 5, 5, 5)
main_layout.setSpacing(0)
self.plotting_widget = GPSWidget(
self, self.info_text_browser)
main_layout.addWidget(self.plotting_widget, 2)
button_layout = QtWidgets.QHBoxLayout()
button_layout.setContentsMargins(100, 0, 100, 0)
button_layout.setStretch(1, 3)
button_layout.setSpacing(10)
self.read_button = QtWidgets.QPushButton('Read/Plot', self)
button_layout.addWidget(self.read_button)
self.export_button = QtWidgets.QPushButton('Export', self)
button_layout.addWidget(self.export_button)
self.close_button = QtWidgets.QPushButton('Close', self)
self.close_button.setStyleSheet('QPushButton {color: red;}')
button_layout.addWidget(self.close_button)
bottom_layout = QtWidgets.QVBoxLayout()
bottom_layout.addLayout(button_layout)
self.info_text_browser.setFixedHeight(42)
self.info_text_browser.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.info_text_browser.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.info_text_browser.verticalScrollBar().setDisabled(True)
self.info_text_browser.horizontalScrollBar().setDisabled(True)
bottom_layout.addWidget(self.info_text_browser)
main_layout.addLayout(bottom_layout)
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
wnd = GPSDialog(None, [])
wnd.show()
sys.exit(app.exec_())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment