Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,Guys.
When I import a plugin, I need to click the button in the main window to switch to another window. However, I have completed displaying the main window , when I click the main window button, another window appears below the main window, rather than a separate window. Could anyone help me? Thanks very very much.
Below is the code I wrote:
from PySide2 import QtCore, QtGui, QtWidgets
import uiTools
form2, base2 = uiTools.loadUiType('Ui2.ui')
class Window_2(form2, base2):
def __init__(self, parent=None):
super(Window_2, self).__init__(parent)
parent.layout().addWidget(self)
self.parent = parent
self.setupUi(self)
self.setupUserInterface()
def setupUserInterface(self):
"""Setup and connect the plugins user interface"""
form, base = uiTools.loadUiType('UI1.ui')
class Main_window(form, base):
def __init__(self, parent=None):
super(Main_window, self).__init__(parent)
parent.layout().addWidget(self)
self.parent = parent
self.setupUi(self)
self.setupUserInterface()
def setupUserInterface(self):
"""Setup and connect the plugins user interface"""
self.switch_button.clicked.connect(self.creat_window_2)
def creat_window_2(self):
window_2 = Window_2(VREDPluginWidget)
main_window = Main_window(VREDPluginWidget)
Solved! Go to Solution.