×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    12

    how to refer a dynamically added table widget inside a tab widget?

    Hi,
    I created a tab widget using designer,
    Then added table widget inside the tab widget…(one table in every tab)
    Now i want to access the values of a particular table, for example that table headers….
    How can i get that????

    And if there is multiple tabs,i want headers of presently activated tabs, tables header…
    Please guide me….

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2009
    Posts
    1,024

    Re: how to refer a dynamically added table widget inside a tab widget?

    Hi,
    Here is an example which prints out the text of the first item of a table.
    tableWidget is pointer to the tablewidget. It's child of a TabWidget, but it is still reachable from C++.

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    qDebug() << ui->tableWidget->itemAt(0,0)->text(); <--- this prints out in the console the text of the item in the table
    }

    If you want to get the data from the table inside of the active tabWidget you can:
    1. Get the tabwidget pointer with: http://doc.qt.nokia.com/latest/qtabw...currentChanged (signal) or http://doc.qt.nokia.com/latest/qtabw...#currentWidget
    2. search for the table widget in the list of tabwidget's children: http://doc.qt.nokia.com/latest/qobject.html#findChild

Similar Threads

  1. Homescreen widget: Error occured. Widget removed
    By _yarik_ in forum Symbian User Interface
    Replies: 2
    Last Post: 2011-02-12, 22:17
  2. how to check if running inside a widget or browser?
    By ashishgoyal_86 in forum Symbian
    Replies: 2
    Last Post: 2010-04-21, 07:35
  3. Scrolling inside a widget
    By idokd in forum Symbian
    Replies: 34
    Last Post: 2009-10-27, 13:55
  4. Flash inside HTML for a widget?????
    By rj12info in forum Symbian
    Replies: 7
    Last Post: 2009-07-09, 13:34

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •