View Full Version : tabWidget in Designer

10th August 2010, 08:22
Please can someone help me with the following:
I have placed a tabWidget on the form, not taking up the full form though.
This tabWidget I have renamed tabWidget1, and it has 2 tabs.
On the first tab I have placed another tabWidget called tabWidget2, and it has a further 4 tabs.

In my editor (Qt Creator) I have the following

MainWindow::MainWindow(QWidget *parent) :
ui(new Ui::MainWindow)

However I get the error message

class Ui::MainWindow has no member named tabWidget1

If I allow Qt Creator to suggest values for me by typing "ui-> tab" then it shows me 2 available tabs, tabWidget and tabWidget_2. However, these were the original names, I have subsequently renamed them to tabWidget1 & tabWidget2.
If I switch over to edit, and do a search for tabWidget & tabWidget_2, it isn't even found!

I have saved, exited and restarted Qt Creator. Still nothing. Am I doing this right in order to make use of these tabWidgets?


10th August 2010, 09:21
I managed to get it to work.
For some reason, it is creating a -build-desktop folder, and saving my modified ui_mainwindow.h file in there. I had to copy it back into the root directory of the project for it to update/work.
How can I switch off this functionality of it creating this desktop build folder? I want it to stay in the same folder whee all my other source files are.
This seems to be a new function of Qt Creator, I don't recall it having this folder before.