octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #57635] Editor often has focus but no cursor u


From: Hg200
Subject: [Octave-bug-tracker] [bug #57635] Editor often has focus but no cursor until clicking elsewhere and then clicking in editor
Date: Wed, 22 Apr 2020 03:56:09 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0

Follow-up Comment #31, bug #57635 (project octave):

First of all, to ensure that this is no GDB artifact (e.g. the BP does not
work) i have added assert () to set_focus (), rebuild the source and it never
stops running if i open & close tabs. But if i put assert into activate () it
stops running.

  void file_editor::activate (void){
    ...
    QWidget *fileEditorTab = m_tab_widget->currentWidget ();
    if (fileEditorTab)
      assert (false);


  void file_editor::set_focus (QWidget *fet) {
    assert (false);
    setFocus ();
    ...

My thoughts are:

1.) Can somebody confirm that the correct behaviour to set the focus is the
slot file_editor::set_focus?

2.) If so, next question is why it is not executed. i.) Reason could be a
broken Qt installation. ii.) Or there is a bug in octave lib gui that
manifests only in a specific Qt version.

3.) According to Qt docs addTab() or insertTab() is used to put the page
widgets into the tab widget. The signal / slot connection is setup in
file_editor::make_file_editor_tab (file-editor.c:2459) and it is transfered
into the tab widget when *.m files are opened. That is in
file_editor::request_open_file and file_editor::add_file_editor_tab.
Vice versa, when a tab is destroyed in file_editor::handle_tab_remove_request
the sender object is searched in the tabwidget and then deleted. In
file_editor::activate "QWidget *fileEditorTab = m_tab_widget->currentWidget"
is used to emit the fetab_set_focus signal to force the focus to the current
widget (my guess).

No doubt, i can be wrong. But the idea why the slot is not executed could be a
disconnected signal / slot pair in the returned widget. Or the wrong widget is
returned. The problem is that following modification does not have any effect
(i.e. the focus is still not there when closing a tab):

  void file_editor::activate (void) {
    octave_dock_widget::activate ();

    QWidget *fileEditorTab = m_tab_widget->currentWidget ();
    setFocus ();
    m_tab_widget->setCurrentWidget (fileEditorTab);
  }


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57635>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]