Created with your hands, until the flow



  • I have a button.

    QComboBox cb_codChastotDiap1 
    

    Clicked with a mouse in the editor of shapes. But I have changed the conditions for this button, and I need to add one element , with only one (4 elements) in the case of two (3 elements). And that's why my question is, is it possible to finish my hands in code , cb_codChastotDiap1 another index?

    I'd like to finish the code and convert it to Qt Creator-e.

    P.S. Rewrite the code to me is uncomfortable because the whole program is assembled in the form editor. And I'm also being asked to make one amendment, and I don't want to change the whole program. Well, it's just a scientific interest, and it's possible, in general, in QComboBox, there's a slot setCurrentIndex, so it's possible to try to be implemented.



  • What did you ask? The essence of the question is unclear.

    I need to add one element, with only one (4 elements) of two (3 elements)

    If you want to add another element to QComboBox, use it.

    void addItem(const QString & text, const QVariant & userData = QVariant())
    

    In your case

    cb_codChastotDiap1.addItem("Новый элемент");
    

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2