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. A question about QComboBox::setCurrentIndex
Forum Updated to NodeBB v4.3 + New Features

A question about QComboBox::setCurrentIndex

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.9k 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.
  • H Offline
    H Offline
    HYSuperman
    wrote on last edited by
    #1

    I used the Designer to add a QComboBox widget to the window and then use the property editor to edit the text property.
    Then, I compiled the project.
    Strange thing is, there's an error:
    @/home/cecaadmin/Configure_xml/build-Configure_xml-Desktop-Debug/ui_topmodule_start.h:229: error: 'class QComboBox' has no member named 'setCurrentText'
    comboBox->setCurrentText(QApplication::translate("topModule_start", "1ns/1ps", 0, QApplication::UnicodeUTF8));
    ^
    @
    Means there's now method to set the combobox's current index??
    I don't know how to figure this. How to set the currentindex of the combobox in Qt designer?

    Some help please~~~thank you!

    1 Reply Last reply
    0
    • Chris KawaC Online
      Chris KawaC Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      There is no "text" property for the combo box. What did you set exactly?
      The proper way would be to set the "currentIndex" property.

      1 Reply Last reply
      0
      • H Offline
        H Offline
        HYSuperman
        wrote on last edited by
        #3

        Yeah, you are right.
        I've figured out the question by modify the xml file.

        thanks~~

        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