Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How to set comboBox first index to empty value
Forum Updated to NodeBB v4.3 + New Features

How to set comboBox first index to empty value

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 2 Posters 247 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.
  • L Offline
    L Offline
    LT-K101
    wrote on last edited by
    #1

    I want to set a comboBox to an empty value when the index is 0. I did below and it's does not work, any help?

    second_num = ' '
     if self.ui.Second_comboBox.currentIndex() == 0:
        s_text = second_num
    
    JonBJ 1 Reply Last reply
    0
    • L LT-K101

      I want to set a comboBox to an empty value when the index is 0. I did below and it's does not work, any help?

      second_num = ' '
       if self.ui.Second_comboBox.currentIndex() == 0:
          s_text = second_num
      
      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @LT-K101
      Because you don't set anything in the combobox, you just set some variable named s_text.

      1 Reply Last reply
      2

      • Login

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