Im making an app that has 2 menus, the first one is a "Welcome" menu, and the second one is for searching something. The problem is that i cant make the searching window show itself. It sticks in the welcome menu. When i started programming the tools for the searching window i kept them in the "Welcome" menu and worked fine until i tried to put those tools in an other menu(ergo different function); So i guess the problem is not that im not calling the self.show() because they worked fine before...

Here's the details of the app and what im doing. Gonna delete the non important parts.
Its kinda complex:

First i have this:

Qt Code:
  1. class Window(QtGui.QMainWindow):
  2. def __init__(self):
  3. super(Window, self).__init__()
  4.  
  5. self.buttons()
  6. self.toolButtons()
  7. self.searchMenu()
To copy to clipboard, switch view to plain text mode 

There there is the buttons() that creates all the interface of the "Welcome" menu, which was the first one.
toolButtons() explains itself. Im using one of the toolbuttons to switch between menues.
searchMenu() is the second Menu, which is supposed to show itself when you press one of the toolbuttons

A little bit later i have the important functions among others:

Qt Code:
  1. def buttons(self):
  2. # Welcome menu. Images and labels.
  3. self.show()
  4.  
  5. def toolButtons(self):
  6. # Toolbuttons. Here is the button that is supposed to load the search menu, and it does it with these lines:
  7. searchButton = QtGui.QAction(QtGui.QIcon('searchicon.png'), 'Search', self)
  8. searchButton.triggered.connect(self.loadingSearchWindow) #Appears down
  9. self.toolBar.addAction(searchButton)
  10.  
  11. def searchMenu(self):
  12. # lot of comboboxes, images, etc. Loads everything of the search menu.
  13. self.show()
To copy to clipboard, switch view to plain text mode 

____________________

Now here is the "loadingSearchWindow" that appears up in the searchButton:

Qt Code:
  1. def loadingSearchWindow(self):
  2. search = self.searchMenu()
  3. self.setCentralWidget(search)
To copy to clipboard, switch view to plain text mode 

So when you click the searchButton, it loads "loadingSearchWindow" which sets the searchMenu() as the CentralWidget.

And again, nothing happends when i click the toolButton that is supposed to load the search menu. And i dont know why, because im doing the same thing with the "buttons" function that loads the welcome menu without problems, but then it seems that if you want to add an other menu it doesn't work.

What am I doing wrong?