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. QCombobox read varialble like int

QCombobox read varialble like int

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 205 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.
  • C Offline
    C Offline
    Creatorczyk
    wrote on last edited by
    #1

    Hi

    I want to read data from my QComboBox to int variable but it's problem because QComboBox return QString. Is there any easy way to get this data as int?

    JonBJ 1 Reply Last reply
    0
    • C Creatorczyk

      Hi

      I want to read data from my QComboBox to int variable but it's problem because QComboBox return QString. Is there any easy way to get this data as int?

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by JonB
      #2

      @Creatorczyk
      https://doc.qt.io/qt-5/qstring.html#toInt

      Or, if you put ints in originally, you might consider https://doc.qt.io/qt-5/qcombobox.html#setItemData to store the integer value in the data.

      1 Reply Last reply
      1

      • Login

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