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. How to get Comment Value of a QComboBox Item?
QtWS25 Last Chance

How to get Comment Value of a QComboBox Item?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 2.2k 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.
  • S Offline
    S Offline
    sayezz
    wrote on last edited by
    #1

    How can I access the comment value of a ComboBox Item in my code:
    !http://luna-arts.de/others/misc/qcombobox.png(qcombobox)!

    Thanks
    Regards
    Denis

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Hi,

      the "comment" field is intended to provide help to translators.
      I think ther's no way to access it by code.

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        True. It is a field that you'll find with all (translatable) QString values. It is used as an argument in the call to the translator, but it cannot be retreived by any API. Instead, it is extracted by the code that goes over your sources to look for translatable strings.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sayezz
          wrote on last edited by
          #4

          hmm. ok, thats a pitty. But yeah, ok, thanks for the quick reply.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mcosta
            wrote on last edited by
            #5

            Hi,

            to set some extra data for QComboBox items you can use setItemData() but this can be done only coding (not via Designer)

            Once your problem is solved don't forget to:

            • Mark the thread as SOLVED using the Topic Tool menu
            • Vote up the answer(s) that helped you to solve the issue

            You can embed images using (http://imgur.com/) or (http://postimage.org/)

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sayezz
              wrote on last edited by
              #6

              cool, thanks! That helps a lot!

              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