Results 1 to 2 of 2

Thread: tabWidget in Designer

  1. #1
    Join Date
    Oct 2009
    Location
    South Africa
    Posts
    94
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default tabWidget in Designer

    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

    Qt Code:
    1. MainWindow::MainWindow(QWidget *parent) :
    2. QMainWindow(parent),
    3. ui(new Ui::MainWindow)
    4. {
    5. ui->setupUi(this);
    6. ui->tabWidget1->setTabPosition(QTabWidget::South);
    7. ...
    To copy to clipboard, switch view to plain text mode 

    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?

    Regards,
    Shaun
    Last edited by ShamusVW; 10th August 2010 at 08:23. Reason: Want to receive emails if any replies

  2. #2
    Join Date
    Oct 2009
    Location
    South Africa
    Posts
    94
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: tabWidget in Designer

    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.

Similar Threads

  1. Add tab to tabwidget thru Designer.
    By phillip_Qt in forum Qt Programming
    Replies: 2
    Last Post: 13th January 2010, 11:00
  2. TabWidget's Tab's parent
    By alisami in forum Qt Programming
    Replies: 12
    Last Post: 31st March 2009, 13:30
  3. Replies: 0
    Last Post: 23rd July 2008, 00:02
  4. TabWidget
    By Salazaar in forum Newbie
    Replies: 5
    Last Post: 17th May 2007, 21:07
  5. tabWidget Question
    By phlash in forum Qt Tools
    Replies: 1
    Last Post: 28th March 2007, 10:54

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.