0

I am new to PyQt4 and i try to make a QMainWindow in which I can change the views. I use the QtDesigner plugin for eclipse. I make a QMainWindow with some space for a view. The view is a QWidget made in QtDesigner, too.

So how can i show my QWidget in my QMainWindow?

Thanks in advance.

Chris
  • 159
  • 3
  • 14
  • A `QWidget` is just a blank, frameless rectangle that is usually used as a container for other widgets - so it won't really "show" anything. What were you expecting to see? And what do you mean by "change the views"? – ekhumoro Nov 22 '11 at 14:54
  • I want to show datas. my idea is that i have different QWidgets with different methods to show (QTable, QListview, etc.) and the user can chose how he wants to see the datas. That i dont had to change the hole QMainWindow i want QWidgets which i can add and drop from my QMainWindow. – Chris Nov 22 '11 at 14:58

1 Answers1

1

It sounds like you need to put your different "views" in either a Tab Widget or a Stacked Widget.

The Config Dialog Example gives a relatively simple example of how to use a stacked widget, and a python version of it is included in the PyQt demo and examples.

(If you don't have the demos and examples available on your system, they can be obtained from the PyQt sources).

ekhumoro
  • 115,249
  • 20
  • 229
  • 336