Skip to content

Commit

Permalink
Fix for layout of the GDS/Q3D export window in the gui (#938)
Browse files Browse the repository at this point in the history
* Fix for layout of the GDS/Q3D export window in the gui

Issue #549
#549

The scaling for the GDS/Q3D/HFSS dialogs should be fixed now.

* Fix for QComponents Widget Sort & Filter

Wrapped the The components table in a QSortFilterProxyModel for sorting, filtering, plus

Added a textChanged event to the filter box to display only specific items.

#45

* Revert "Fix for QComponents Widget Sort & Filter"

This reverts commit 71e5657.

* Lint tests updates (yapf)

run yapf -i <file> on UI python files.

---------

Co-authored-by: Priti Ashvin Shah <74020801+priti-ashvin-shah-ibm@users.noreply.github.com>
  • Loading branch information
Shark-y and priti-ashvin-shah-ibm authored May 8, 2023
1 parent bbaaf01 commit 9342453
Show file tree
Hide file tree
Showing 6 changed files with 439 additions and 655 deletions.
174 changes: 74 additions & 100 deletions qiskit_metal/_gui/renderer_gds_ui.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file './renderer_gds_ui.ui',
# licensing of './renderer_gds_ui.ui' applies.
# Form implementation generated from reading ui file 'c:\Temp\GitHub\qiskit-metal\qiskit_metal\_gui\renderer_gds_ui.ui'
#
# Created: Sat Jun 19 22:02:30 2021
# by: pyside2-uic running on PySide2 5.13.2
# Created by: PyQt5 UI code generator 5.15.9
#
# WARNING! All changes made in this file will be lost!
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.

from PySide2 import QtCore, QtGui, QtWidgets

Expand All @@ -18,14 +17,48 @@ def setupUi(self, MainWindow):
MainWindow.resize(651, 581)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.horizontalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(10, 500, 631, 38))
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
self.horizontalLayout = QtWidgets.QHBoxLayout(
self.horizontalLayoutWidget)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.instructionsLabel = QtWidgets.QLabel(self.centralwidget)
self.instructionsLabel.setObjectName("instructionsLabel")
self.gridLayout.addWidget(self.instructionsLabel, 0, 0, 1, 1)
self.instructionsLabel_2 = QtWidgets.QLabel(self.centralwidget)
self.instructionsLabel_2.setAlignment(QtCore.Qt.AlignCenter)
self.instructionsLabel_2.setObjectName("instructionsLabel_2")
self.gridLayout.addWidget(self.instructionsLabel_2, 0, 1, 1, 1)
self.listView = QtWidgets.QListView(self.centralwidget)
self.listView.setObjectName("listView")
self.gridLayout.addWidget(self.listView, 1, 0, 2, 1)
self.treeView = QTreeView_Base(self.centralwidget)
self.treeView.setRootIsDecorated(False)
self.treeView.setObjectName("treeView")
self.gridLayout.addWidget(self.treeView, 1, 1, 1, 1)
self.label = QtWidgets.QLabel(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(
self.label.sizePolicy().hasHeightForWidth())
self.label.setSizePolicy(sizePolicy)
self.label.setWordWrap(True)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 2, 1, 2, 1)
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.refreshButton = QtWidgets.QPushButton(self.centralwidget)
self.refreshButton.setObjectName("refreshButton")
self.horizontalLayout_4.addWidget(self.refreshButton)
self.selectAllButton = QtWidgets.QPushButton(self.centralwidget)
self.selectAllButton.setObjectName("selectAllButton")
self.horizontalLayout_4.addWidget(self.selectAllButton)
self.deselectAllButton = QtWidgets.QPushButton(self.centralwidget)
self.deselectAllButton.setObjectName("deselectAllButton")
self.horizontalLayout_4.addWidget(self.deselectAllButton)
self.gridLayout.addLayout(self.horizontalLayout_4, 3, 0, 1, 1)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.lineEdit = QtWidgets.QLineEdit(self.horizontalLayoutWidget)
self.lineEdit = QtWidgets.QLineEdit(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
Expand All @@ -35,7 +68,7 @@ def setupUi(self, MainWindow):
self.lineEdit.setSizePolicy(sizePolicy)
self.lineEdit.setObjectName("lineEdit")
self.horizontalLayout.addWidget(self.lineEdit)
self.browseButton = QtWidgets.QToolButton(self.horizontalLayoutWidget)
self.browseButton = QtWidgets.QToolButton(self.centralwidget)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/_imgs/search.png"), QtGui.QIcon.Normal,
QtGui.QIcon.Off)
Expand All @@ -44,110 +77,51 @@ def setupUi(self, MainWindow):
self.browseButton.setAutoRaise(False)
self.browseButton.setObjectName("browseButton")
self.horizontalLayout.addWidget(self.browseButton)
self.exportButton = QtWidgets.QPushButton(self.horizontalLayoutWidget)
self.exportButton = QtWidgets.QPushButton(self.centralwidget)
self.exportButton.setObjectName("exportButton")
self.horizontalLayout.addWidget(self.exportButton)
self.instructionsLabel = QtWidgets.QLabel(self.centralwidget)
self.instructionsLabel.setGeometry(QtCore.QRect(20, 10, 201, 16))
self.instructionsLabel.setObjectName("instructionsLabel")
self.horizontalLayoutWidget_2 = QtWidgets.QWidget(self.centralwidget)
self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(
10, 470, 301, 32))
self.horizontalLayoutWidget_2.setObjectName("horizontalLayoutWidget_2")
self.horizontalLayout_4 = QtWidgets.QHBoxLayout(
self.horizontalLayoutWidget_2)
self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.refreshButton = QtWidgets.QPushButton(
self.horizontalLayoutWidget_2)
self.refreshButton.setObjectName("refreshButton")
self.horizontalLayout_4.addWidget(self.refreshButton)
self.selectAllButton = QtWidgets.QPushButton(
self.horizontalLayoutWidget_2)
self.selectAllButton.setObjectName("selectAllButton")
self.horizontalLayout_4.addWidget(self.selectAllButton)
self.deselectAllButton = QtWidgets.QPushButton(
self.horizontalLayoutWidget_2)
self.deselectAllButton.setObjectName("deselectAllButton")
self.horizontalLayout_4.addWidget(self.deselectAllButton)
self.listView = QtWidgets.QListView(self.centralwidget)
self.listView.setGeometry(QtCore.QRect(10, 31, 301, 431))
self.listView.setObjectName("listView")
self.treeView = QTreeView_Base(self.centralwidget)
self.treeView.setGeometry(QtCore.QRect(325, 30, 311, 361))
self.treeView.setRootIsDecorated(False)
self.treeView.setObjectName("treeView")
self.instructionsLabel_2 = QtWidgets.QLabel(self.centralwidget)
self.instructionsLabel_2.setGeometry(QtCore.QRect(380, 10, 201, 16))
self.instructionsLabel_2.setAlignment(QtCore.Qt.AlignCenter)
self.instructionsLabel_2.setObjectName("instructionsLabel_2")
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setGeometry(QtCore.QRect(330, 400, 301, 91))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(
self.label.sizePolicy().hasHeightForWidth())
self.label.setSizePolicy(sizePolicy)
self.label.setWordWrap(True)
self.label.setObjectName("label")
self.gridLayout.addLayout(self.horizontalLayout, 4, 0, 1, 2)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar()
self.menubar.setGeometry(QtCore.QRect(0, 0, 651, 22))
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 651, 18))
self.menubar.setObjectName("menubar")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)

self.retranslateUi(MainWindow)
QtCore.QObject.connect(self.browseButton, QtCore.SIGNAL("clicked()"),
MainWindow.browse_folders)
QtCore.QObject.connect(self.exportButton, QtCore.SIGNAL("clicked()"),
MainWindow.export_file)
QtCore.QObject.connect(self.selectAllButton, QtCore.SIGNAL("clicked()"),
MainWindow.select_all)
QtCore.QObject.connect(self.deselectAllButton,
QtCore.SIGNAL("clicked()"),
MainWindow.deselect_all)
QtCore.QObject.connect(self.refreshButton, QtCore.SIGNAL("clicked()"),
MainWindow.refresh)
self.browseButton.clicked.connect(
MainWindow.browse_folders) # type: ignore
self.exportButton.clicked.connect(
MainWindow.export_file) # type: ignore
self.selectAllButton.clicked.connect(
MainWindow.select_all) # type: ignore
self.deselectAllButton.clicked.connect(
MainWindow.deselect_all) # type: ignore
self.refreshButton.clicked.connect(MainWindow.refresh) # type: ignore
QtCore.QMetaObject.connectSlotsByName(MainWindow)

def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(
QtWidgets.QApplication.translate("MainWindow", "GDS Renderer", None,
-1))
self.lineEdit.setPlaceholderText(
QtWidgets.QApplication.translate(
"MainWindow", "Export GDS to the following location... ", None,
-1))
self.browseButton.setText(
QtWidgets.QApplication.translate("MainWindow", "Browse", None, -1))
self.exportButton.setText(
QtWidgets.QApplication.translate("MainWindow", "Export", None, -1))
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "GDS Renderer"))
self.instructionsLabel.setText(
QtWidgets.QApplication.translate("MainWindow",
"Check off components to export:",
None, -1))
self.refreshButton.setText(
QtWidgets.QApplication.translate("MainWindow", "Refresh List", None,
-1))
self.selectAllButton.setText(
QtWidgets.QApplication.translate("MainWindow", "Select All", None,
-1))
self.deselectAllButton.setText(
QtWidgets.QApplication.translate("MainWindow", "Deselect All", None,
-1))
_translate("MainWindow", "Check off components to export:"))
self.instructionsLabel_2.setText(
QtWidgets.QApplication.translate("MainWindow", "Renderer options",
None, -1))
_translate("MainWindow", "Renderer options"))
self.label.setText(
QtWidgets.QApplication.translate(
_translate(
"MainWindow",
"Note: The user-defined bounding box scales above are only relevant when not all components are being exported. Otherwise, the bounding box for the subtraction layer is obtained from the DesignPlanar class.",
None, -1))
"Note: The user-defined bounding box scales above are only relevant when not all components are being exported. Otherwise, the bounding box for the subtraction layer is obtained from the DesignPlanar class."
))
self.refreshButton.setText(_translate("MainWindow", "Refresh List"))
self.selectAllButton.setText(_translate("MainWindow", "Select All"))
self.deselectAllButton.setText(_translate("MainWindow", "Deselect All"))
self.lineEdit.setPlaceholderText(
_translate("MainWindow",
"Export GDS to the following location... "))
self.browseButton.setText(_translate("MainWindow", "Browse"))
self.exportButton.setText(_translate("MainWindow", "Export"))


from .tree_view_base import QTreeView_Base
Expand Down
Loading

0 comments on commit 9342453

Please sign in to comment.