Editor Design Consideration- Should loss of focus be required to save a setting?

Started by topdown, May 26, 2015, 12:35:06 AM

Previous topic - Next topic
If I change the title bar property in 1.4.2, the editor does not know it unless I tab out, losing the focus, triggering the SIGNAL.  I confess I am not an expert in Qt, C++, or the overall design, though I am getting up to speed. 

I saw this on Github:

settings_dialog.cpp


  connect(&model, SIGNAL(title_bar_changed(QString)),
          this, SLOT(update_title_bar_field()));
  connect(ui.title_bar_field, SIGNAL(editingFinished()),
          this, SLOT(change_title_bar_requested()));



and in plain_text_edit.h,



class PlainTextEdit : public QPlainTextEdit ....

  inline PlainTextEdit(QWidget* parent = nullptr) :
    QPlainTextEdit(parent),
    changed(false),
    show_margin(false) {

    setTabChangesFocus(true);
    setLineWrapMode(LineWrapMode::NoWrap);

    QTextCharFormat char_format = currentCharFormat();
    char_format.setFontFixedPitch(true);
    setCurrentCharFormat(char_format);

    connect(this, SIGNAL(textChanged()), this, SLOT(handle_text_changed()));
  }


Do you think this should be on changing any text in the field or that you have to tab out.  I found that I would change the title bar and run the program.  I saw no change, so I hit save.  I saw no change, and that is when I figured out I had to lose focus.

Interested in feedback.  Thanks.

Yes this is a very annoying problem. We fixed the issue in the development version 1.4.3. Thanks for reporting it!

Would I look at the same point in the code I have above to see the solution?  I like to learn :).