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. QWebElement and ComboBox
Qt 6.11 is out! See what's new in the release blog

QWebElement and ComboBox

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 337 Views
  • 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.
  • B Offline
    B Offline
    BOBOS
    wrote on last edited by
    #1

    So im using QWebElement to fill up a online form and im having some trouble with the country combobox.
    My code is somehitng like this:

    QWebElement document = frame->documentElement();
    QWebElement country_element = document.findFirst("select[id=countryCombobox]");
    QWebElementCollection country_option = country_element.findAll("option");
    for(QWebElementCollection::iterator it = country_option.begin(); it != country_option.end(); it++) {
        if((*it).attribute("value") == "DE") {
            (*it).setAttribute("selected", "true");
        }
    }
    

    So for instance if i want to select Germany it dosent do what i really want. It selects Germany in the list but it dosent put it as the selected value.(instead of --)

    Picture Here

    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