Results 1 to 2 of 2

Thread: Obtaining the currentTabText property

  1. #1
    Join Date
    Nov 2009
    Posts
    20
    Thanks
    6
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Obtaining the currentTabText property

    I have a QMap defined as

    Qt Code:
    1. QMap<QString, QString> design;
    To copy to clipboard, switch view to plain text mode 

    and that (in part) am populating with the following:

    Qt Code:
    1. foreach (QTabWidget *tab, ui->MainWidget->findChildren<QTabWidget*>()) {
    2. design.insert(tab->objectName() + ".index", QString::number(tab->currentIndex()));
    3. // design.insert(tab->objectName() + ".string", tab->currentWidget()->objectName());
    4. }
    To copy to clipboard, switch view to plain text mode 

    The first line in the foreach loop saves the currentIndex of the corresponding tab as a QString value using a key formed by the tab's objectName + ".index". The purpose of the second line is to save the currentTabText property of the currently selected tab but I can't seem to find the appropriate property, i.e., tab->currentTabText() does not exist. The above is an attempt in lieu of this missing property.

    Is there another route that I can use to access the currentTabText via the above?

    Thanks!

  2. #2
    Join Date
    Sep 2009
    Location
    Finland
    Posts
    63
    Thanks
    1
    Thanked 22 Times in 19 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Obtaining the currentTabText property

    Is this what you are looking for?
    Qt Code:
    1. QString tabText = tab->tabText(tab->currentIndex());
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to tsp for this useful post:

    wconstan (7th December 2009)

Similar Threads

  1. Qt Property Browser Framework - Redo/Undo
    By monadic_kid in forum Qt Programming
    Replies: 2
    Last Post: 3rd December 2009, 10:46
  2. Replies: 2
    Last Post: 2nd November 2009, 13:24
  3. Replies: 2
    Last Post: 1st April 2009, 23:52
  4. FrameShape property for Q3GroupBox
    By user_mail07 in forum Qt Tools
    Replies: 3
    Last Post: 16th February 2007, 14:41
  5. QPushbutton Flat property and icon appearance.
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 4th November 2006, 08:30

Tags for this Thread

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.