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. Runtime error raised up from QComboBox

Runtime error raised up from QComboBox

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.5k 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.
  • M Offline
    M Offline
    moravas
    wrote on last edited by
    #1

    Hi Folks,

    I have a little issue tracking system. To get a new ticket, the user shall to press a QPushButton, that triggers the following method:
    @
    if(!_ui->_LETitle->text().isEmpty()) {
    _card->setValue(_currentState + "/" + _ui->_LETitle->text(), '(' + _ui->_TECardText->toPlainText() + ')');
    }
    _ui->_CBState->clear();
    _ui->_CBState->addItems(_session->getCardStates());
    _ui->_CBCards->clear();
    _card->beginGroup(_currentState);
    _ui->_CBCards->addItems(QStringList("") + _card->allKeys());
    _card->endGroup();
    _ui->_LETitle->clear();
    _ui->_TECardText->clear();
    _currentState = _ui->_CBState->currentText();
    }
    @

    when the execution reachs the
    @
    _ui->_CBState->clear();
    @

    line, Microsoft Visual C++ Runtime Library error raise up. On the command line of the application the following message appers:
    ASSERT failure in QSettings: "empty key", file io\qsettings.cpp, line 325
    Invalid parameter passed to C runtime function.
    Invalid parameter passed to C runtime function.

    Can anybody help me?

    Regards,
    Norbert

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      The error is not from QComboBox but from QSettings, are you sure _currentState contains something valid ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        moravas
        wrote on last edited by
        #3

        Hi,

        yes, the _currentState member contains a valid string. During this time, I have considered that the combobox doesn't display any string, because in one of the use cases, I fill up it by the following way:
        @
        _ui->_CBCards->addItems(QStringList("") + _card->allKeys());
        @
        as you can see, I add an empty QStringList and the keys from the ini file (the _card member is a QSettings object).
        Could it cause this kind of error or does it have any matter?

        Regards,
        Norbert

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Can you show what your QSettings should contain ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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