I have 3 .UI files that i’m trying to link together. The first is a main menu that only has 2 buttons on it. Each button should 1.) close the MainMenu.UI window and 2.)display the .UI file associated with that button.
My problem is I cant find any functions that either hide or display the currently used .UI file. I also can’t find a way to reference the other .UI files from the button1_onClick() function in the MainMenu.UI file.
hope I didn’t make this more confusing than it needed to be, just trying to link together .UI files with buttons
EDIT:
I have been to the QWindow Class docs to try and find a function that does what I’m looking for but I can’t seem find anything useful.
I finally figured out how access the show() and hide() methods so all i need now is to figure out how to reference other .UI files so I can show() or hide() those also. I tried using the SetWindowFilePath() function passing it the file path of another .ui file but this didn’t work either
this->hide();
this->setWindowFilePath("C:/Users/Scott/Desktop/...blah blah... /mainui.ui");
this->show();
You don’t hide or show .ui files, the C++ code generated from those files are wrapped into C++ classes which are derived directly or indirectly from QWidget and the instances of those classes can use show() or hide()
To use two Qt “forms” read this faq and ask specific questions (and maybe show some code) if you still can’t get it to work.