Mercurial > octave
annotate libgui/src/variable-editor-model.h @ 33636:3ec6fcce7715 default tip @
gui: Avoid using HAVE_QSCINTILLA in more header files.
* gui-settings.h, settings-dialog.h: Don't include QScintilla header.
Forward-declare QSciLexer class instead if necessary. Declare all member
functions unconditionally.
* gui-settings.cc (gui_settings::get_valid_lexer_styles,
gui_settings::read_lexer_settings),
settings-dialog.cc (settings_dialog::update_lexer,
settings_dialog::get_lexer_settings, settings_dialog::write_lexer_settings):
Define functions unconditionally.
* gui-preferences-ed.h: Don't include QScintilla header. Remove definition of
local variable os_eol_mode from header.
* gui-preferences-ed.cc (os_eol_mode): Move definition of local variable here.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Tue, 28 May 2024 14:54:58 +0200 |
parents | 7f18c537e101 |
children |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
32632
2e484f9f1f18
maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
31838
diff
changeset
|
3 // Copyright (C) 2013-2024 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
25 |
27413
b67e5dc2e34a
use consistent naming pattern for include file guards in libgui sources
John W. Eaton <jwe@octave.org>
parents:
27302
diff
changeset
|
26 #if ! defined (octave_variable_editor_model_h) |
b67e5dc2e34a
use consistent naming pattern for include file guards in libgui sources
John W. Eaton <jwe@octave.org>
parents:
27302
diff
changeset
|
27 #define octave_variable_editor_model_h 1 |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
28 |
31837
febd82d1a8de
use new macros to consistently delete copy and move member functions
John W. Eaton <jwe@octave.org>
parents:
31771
diff
changeset
|
29 #include "octave-config.h" |
febd82d1a8de
use new macros to consistently delete copy and move member functions
John W. Eaton <jwe@octave.org>
parents:
31771
diff
changeset
|
30 |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
31 #include <QAbstractTableModel> |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
32 #include <QMap> |
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
33 #include <QString> |
23978
665507c3c29d
Use Octave coding conventions for Variable Editor code.
Rik <rik@octave.org>
parents:
23927
diff
changeset
|
34 |
27302
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27247
diff
changeset
|
35 #include "qt-interpreter-events.h" |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27247
diff
changeset
|
36 |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
37 #include "ov.h" |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
38 #include "pr-flt-fmt.h" |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
39 |
31646
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
40 OCTAVE_BEGIN_NAMESPACE(octave) |
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
41 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
42 class interpreter; |
27302
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27247
diff
changeset
|
43 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
44 class base_ve_model |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
45 { |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
46 public: |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
47 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
48 base_ve_model (const QString& expr, const octave_value& val); |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
49 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
50 virtual ~base_ve_model () = default; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
51 |
31837
febd82d1a8de
use new macros to consistently delete copy and move member functions
John W. Eaton <jwe@octave.org>
parents:
31771
diff
changeset
|
52 OCTAVE_DISABLE_COPY_MOVE (base_ve_model) |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
53 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
54 virtual void maybe_resize_rows (int) { } |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
55 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
56 virtual void maybe_resize_columns (int) { } |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
57 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
58 std::string name () const; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
59 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
60 bool index_ok (const QModelIndex& idx, int& row, int& col) const; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
61 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
62 virtual bool is_editable () const { return true; } |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
63 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
64 virtual octave_value value_at (const QModelIndex& idx) const; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
65 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
66 int column_width () const; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
67 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
68 int rowCount (const QModelIndex& = QModelIndex ()) const; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
69 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
70 int columnCount (const QModelIndex& = QModelIndex ()) const; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
71 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
72 QString edit_display_sub (const octave_value& elt, int role) const; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
73 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
74 virtual QVariant edit_display (const QModelIndex& idx, int role) const; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
75 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
76 QVariant data (const QModelIndex& idx, int role = Qt::DisplayRole) const; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
77 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
78 virtual bool requires_sub_editor (const QModelIndex& idx) const; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
79 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
80 void set_update_pending (const QModelIndex& idx, const QString& str); |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
81 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
82 bool update_pending (const QModelIndex& idx) const; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
83 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
84 QString update_pending_data (const QModelIndex& idx) const; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
85 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
86 void clear_update_pending (); |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
87 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
88 virtual char quote_char (const QModelIndex& idx) const; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
89 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
90 virtual QVariant |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
91 header_data (int section, Qt::Orientation orientation, int role) const; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
92 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
93 // Return a subscript expression as a string that can be used to |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
94 // access a sub-element of a data structure. For example "{1,3}" |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
95 // for cell array element {1,3} or "(2,4)" for array element (2,4). |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
96 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
97 virtual QString subscript_expression (const QModelIndex& idx) const; |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
98 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
99 bool is_valid () const { return m_valid; } |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
100 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
101 octave_idx_type data_rows () const { return m_data_rows; } |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
102 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
103 octave_idx_type data_columns () const { return m_data_cols; } |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
104 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
105 int display_rows () const { return m_display_rows; } |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
106 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
107 int display_columns () const { return m_display_cols; } |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
108 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
109 virtual QString make_description_text () const; |
24621
2bb3f3de0b4e
more style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24585
diff
changeset
|
110 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
111 void reset (const octave_value& val); |
24621
2bb3f3de0b4e
more style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24585
diff
changeset
|
112 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
113 protected: |
24621
2bb3f3de0b4e
more style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24585
diff
changeset
|
114 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
115 std::string m_name; |
24642
d58543eb53e9
improve efficiency of variable editor
John W. Eaton <jwe@octave.org>
parents:
24641
diff
changeset
|
116 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
117 octave_value m_value; |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
118 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
119 octave_idx_type m_data_rows; |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
120 octave_idx_type m_data_cols; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
121 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
122 // Qt table widget limits the size to int. |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
123 int m_display_rows; |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
124 int m_display_cols; |
24669
15fe766fbaf5
set initial size of variable editor columns based on data
John W. Eaton <jwe@octave.org>
parents:
24660
diff
changeset
|
125 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
126 QMap<QModelIndex, QString> m_update_pending; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
127 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
128 bool m_valid; |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
129 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
130 float_display_format m_display_fmt; |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
131 }; |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
132 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
133 class variable_editor_model : public QAbstractTableModel |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
134 { |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
135 Q_OBJECT |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
136 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
137 private: |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
138 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
139 static base_ve_model * create (const QString& expr, const octave_value& val); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
140 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
141 public: |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
142 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
143 variable_editor_model (const QString& expr, const octave_value& val, |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
144 QObject *parent = nullptr); |
24681
ea058ec5ef30
track display and data rows/columns separately in variable editor (bug #53033)
John W. Eaton <jwe@octave.org>
parents:
24670
diff
changeset
|
145 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
146 ~variable_editor_model () |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
147 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
148 delete m_rep; |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
149 } |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
150 |
31837
febd82d1a8de
use new macros to consistently delete copy and move member functions
John W. Eaton <jwe@octave.org>
parents:
31771
diff
changeset
|
151 OCTAVE_DISABLE_COPY_MOVE (variable_editor_model) |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
152 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
153 std::string name () const |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
154 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
155 return m_rep->name (); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
156 } |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
157 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
158 bool is_editable () const |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
159 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
160 return m_rep->is_editable (); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
161 } |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
162 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
163 octave_value value_at (const QModelIndex& idx) const |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
164 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
165 return m_rep->value_at (idx); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
166 } |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
167 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
168 int column_width () const |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
169 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
170 return m_rep->column_width (); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
171 } |
24585
8a4aedbb3e5a
style fixes for variable editor
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
172 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
173 int rowCount (const QModelIndex& idx = QModelIndex ()) const |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
174 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
175 return m_rep->rowCount (idx); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
176 } |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
177 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
178 int columnCount (const QModelIndex& idx = QModelIndex ()) const |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
179 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
180 return m_rep->columnCount (idx); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
181 } |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
182 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
183 QVariant data (const QModelIndex& idx = QModelIndex (), |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
184 int role = Qt::DisplayRole) const |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
185 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
186 return m_rep->data (idx, role); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
187 } |
24670
62a05d23cd00
don't cache text data in variable editor model (bug #53005)
John W. Eaton <jwe@octave.org>
parents:
24669
diff
changeset
|
188 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
189 bool setData (const QModelIndex& idx, const QVariant& v, |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
190 int role = Qt::EditRole); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
191 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
192 bool clear_content (const QModelIndex& idx); |
24670
62a05d23cd00
don't cache text data in variable editor model (bug #53005)
John W. Eaton <jwe@octave.org>
parents:
24669
diff
changeset
|
193 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
194 Qt::ItemFlags flags (const QModelIndex& idx) const; |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
195 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
196 bool insertRows (int row, int count, |
33359
689d4d069bbf
maint: Use Octave coding convention of space between function name and parentheses in libgui/.
Rik <rik@octave.org>
parents:
32632
diff
changeset
|
197 const QModelIndex& parent = QModelIndex ()); |
24670
62a05d23cd00
don't cache text data in variable editor model (bug #53005)
John W. Eaton <jwe@octave.org>
parents:
24669
diff
changeset
|
198 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
199 bool removeRows (int row, int count, |
33359
689d4d069bbf
maint: Use Octave coding convention of space between function name and parentheses in libgui/.
Rik <rik@octave.org>
parents:
32632
diff
changeset
|
200 const QModelIndex& parent = QModelIndex ()); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
201 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
202 bool insertColumns (int column, int count, |
33359
689d4d069bbf
maint: Use Octave coding convention of space between function name and parentheses in libgui/.
Rik <rik@octave.org>
parents:
32632
diff
changeset
|
203 const QModelIndex& parent = QModelIndex ()); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
204 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
205 bool removeColumns (int column, int count, |
33359
689d4d069bbf
maint: Use Octave coding convention of space between function name and parentheses in libgui/.
Rik <rik@octave.org>
parents:
32632
diff
changeset
|
206 const QModelIndex& parent = QModelIndex ()); |
24655
3ceee1910e1a
allow single character strings to be edited (bug #51848)
John W. Eaton <jwe@octave.org>
parents:
24649
diff
changeset
|
207 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
208 // Is cell at idx complex enough to require a sub editor? |
24660
a4ea36915e38
handle structure arrays in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24655
diff
changeset
|
209 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
210 bool requires_sub_editor (const QModelIndex& idx) const |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
211 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
212 return m_rep->requires_sub_editor (idx); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
213 } |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
214 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
215 void set_update_pending (const QModelIndex& idx, const QString& str) |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
216 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
217 m_rep->set_update_pending (idx, str); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
218 } |
24655
3ceee1910e1a
allow single character strings to be edited (bug #51848)
John W. Eaton <jwe@octave.org>
parents:
24649
diff
changeset
|
219 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
220 bool update_pending (const QModelIndex& idx) const |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
221 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
222 return m_rep->update_pending (idx); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
223 } |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
224 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
225 QString update_pending_data (const QModelIndex& idx) const |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
226 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
227 return m_rep->update_pending_data (idx); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
228 } |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
229 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
230 void clear_update_pending () |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
231 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
232 m_rep->clear_update_pending (); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
233 } |
24758
09364b41ddb6
allow dynamic resizing of display rows and columns in variable editor
John W. Eaton <jwe@octave.org>
parents:
24755
diff
changeset
|
234 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
235 char quote_char (const QModelIndex& idx) const |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
236 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
237 return m_rep->quote_char (idx); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
238 } |
24758
09364b41ddb6
allow dynamic resizing of display rows and columns in variable editor
John W. Eaton <jwe@octave.org>
parents:
24755
diff
changeset
|
239 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
240 QVariant |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
241 headerData (int section, Qt::Orientation orientation, int role) const |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
242 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
243 return m_rep->header_data (section, orientation, role); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
244 } |
24758
09364b41ddb6
allow dynamic resizing of display rows and columns in variable editor
John W. Eaton <jwe@octave.org>
parents:
24755
diff
changeset
|
245 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
246 // Return a subscript expression as a string that can be used to |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
247 // access a sub-element of a data structure. For example "{1,3}" |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
248 // for cell array element {1,3} or "(2,4)" for array element (2,4). |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
249 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
250 QString subscript_expression (const QModelIndex& idx) const |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
251 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
252 return m_rep->subscript_expression (idx); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
253 } |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
254 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
255 int display_rows () const |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
256 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
257 return m_rep->display_rows (); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
258 } |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
259 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
260 octave_idx_type data_rows () const |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
261 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
262 return m_rep->data_rows (); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
263 } |
28397
37c5532e558c
check object size before plotting from variiable editor (bug #56685)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27923
diff
changeset
|
264 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
265 int display_columns () const |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
266 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
267 return m_rep->display_columns (); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
268 } |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24758
diff
changeset
|
269 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
270 octave_idx_type data_columns () const |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
271 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
272 return m_rep->data_columns (); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
273 } |
28397
37c5532e558c
check object size before plotting from variiable editor (bug #56685)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27923
diff
changeset
|
274 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
275 void maybe_resize_rows (int rows); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
276 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
277 void maybe_resize_columns (int cols); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24758
diff
changeset
|
278 |
33599
7f18c537e101
maint: Update Qt macros to avoid name collisions
Arun Giridhar <arungiridhar@gmail.com>
parents:
33359
diff
changeset
|
279 Q_SIGNALS: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24758
diff
changeset
|
280 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
281 void update_data_signal (const octave_value& val); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24758
diff
changeset
|
282 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
283 void data_error_signal (const QString& name) const; |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
284 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
285 void user_error_signal (const QString& title, const QString& msg) const; |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24758
diff
changeset
|
286 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
287 void set_editable_signal (bool); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
288 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
289 void description_changed (const QString& description); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
290 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
291 void edit_variable_signal (const QString& name, const octave_value& val); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
292 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
293 void interpreter_event (const fcn_callback& fcn); |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
294 void interpreter_event (const meth_callback& meth); |
27302
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27247
diff
changeset
|
295 |
33599
7f18c537e101
maint: Update Qt macros to avoid name collisions
Arun Giridhar <arungiridhar@gmail.com>
parents:
33359
diff
changeset
|
296 public Q_SLOTS: |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
297 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
298 void update_data (const octave_value& val); |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23978
diff
changeset
|
299 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
300 void update_data_cache (); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
301 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
302 void double_click (const QModelIndex& idx); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
303 |
33599
7f18c537e101
maint: Update Qt macros to avoid name collisions
Arun Giridhar <arungiridhar@gmail.com>
parents:
33359
diff
changeset
|
304 private Q_SLOTS: |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
305 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
306 void data_error (const QString& msg); |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
307 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
308 void user_error (const QString& title, const QString& msg); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
309 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
310 private: |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
311 |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
312 base_ve_model *m_rep; |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
313 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
314 void init_from_oct (interpreter& interp); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
315 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
316 void eval_expr_event (const QString& expr); |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
317 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
318 octave_value retrieve_variable (interpreter&, const std::string& name); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
319 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
320 bool is_valid () const |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
321 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
322 return m_rep->is_valid (); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
323 } |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
324 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
325 void change_display_size (int old_rows, int old_cols, |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
326 int new_rows, int new_cols); |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
327 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
328 QString make_description_text () const |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
329 { |
31838
45f8b601c992
maint: Use "m_" prefix on all private member variables in classes.
Rik <rik@octave.org>
parents:
31837
diff
changeset
|
330 return m_rep->make_description_text (); |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
331 } |
24697
21d6d80ed427
refactor variable editor model internal representation (bug #53054)
John W. Eaton <jwe@octave.org>
parents:
24681
diff
changeset
|
332 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
333 void reset (const octave_value& val); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
334 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
335 void invalidate (); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
336 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
337 void update_description (const QString& description = QString ()); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
338 |
31648
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
339 void evaluation_error (const std::string& expr) const; |
29d734430e5f
maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents:
31646
diff
changeset
|
340 }; |
31646
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
341 |
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
342 OCTAVE_END_NAMESPACE(octave) |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
343 |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
diff
changeset
|
344 #endif |