Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Current text in Qcombobox

    General and Desktop
    2
    3
    1329
    Loading More Posts
    • 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
      Vidhya last edited by

      How can i get the current text of Qcombobox in QtableWidget

      Regards,
      Vidhya

      1 Reply Last reply Reply Quote 0
      • R
        raaghuu last edited by

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

        1 Reply Last reply Reply Quote 0
        • V
          Vidhya last edited by

          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 Reply Quote 0
          • First post
            Last post