Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Current text in Qcombobox
Qt 6.11 is out! See what's new in the release blog

Current text in Qcombobox

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vidhya
    wrote on last edited by
    #1

    How can i get the current text of Qcombobox in QtableWidget

    Regards,
    Vidhya

    1 Reply Last reply
    0
    • R Offline
      R Offline
      raaghuu
      wrote on last edited by
      #2

      see the "docs":http://qt-project.org/doc/qt-4.8/qcombobox.html#currentText-prop
      @text = myComboBox.currentText()@

      1 Reply Last reply
      0
      • V Offline
        V Offline
        Vidhya
        wrote on last edited by
        #3

        no i achive this in another way
        @int row = 1;
        int col = 8;
        QStringList dislist;
        QComboBox* com = new QComboBox(this);
        com->addItems(dislist);
        ui->widget->setCellWidget(row, col, com);

        //another function
        QComboBox* cell_com = dynamic_cast<QComboBox*>(ui->widget->cellWidget(1, 8));
        QString text;
        if(cell_com != 0)
        {
        text = cell_com->currentText();
        }@

        Thank U for ur reply

        Regards,
        Vidhya

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved