Mercurial > octave
annotate libgui/graphics/ListBoxControl.h @ 33620:96e9dcdc4003 default tip @
avoid crash when computing tree_index_expression end_pos (bug #65768)
* pt-idx.cc (tree_index_expression::end_pos): Fix handling of struct
field names.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 23 May 2024 15:22:47 -0400 |
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:
31808
diff
changeset
|
3 // Copyright (C) 2011-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 //////////////////////////////////////////////////////////////////////// |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 |
21203
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
20003
diff
changeset
|
26 #if ! defined (octave_ListBoxControl_h) |
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
20003
diff
changeset
|
27 #define octave_ListBoxControl_h 1 |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 #include "BaseControl.h" |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 class QListWidget; |
22726
dd2f547c21a0
QtHandles: firie listbox callback on click of selected item (Bug #44748)
John Donoghue
parents:
22413
diff
changeset
|
32 class QListWidgetItem; |
dd2f547c21a0
QtHandles: firie listbox callback on click of selected item (Bug #44748)
John Donoghue
parents:
22413
diff
changeset
|
33 class QModelIndex; |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 |
31646
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
31644
diff
changeset
|
35 OCTAVE_BEGIN_NAMESPACE(octave) |
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
31644
diff
changeset
|
36 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
37 class interpreter; |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
39 class ListBoxControl : public BaseControl |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
40 { |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
41 Q_OBJECT |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
42 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
43 public: |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
44 ListBoxControl (octave::interpreter& interp, const graphics_object& go, |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
45 QListWidget *list); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
46 ~ListBoxControl (); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
48 static ListBoxControl * |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
49 create (octave::interpreter& interp, |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
50 const graphics_object& go); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
51 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
52 protected: |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
53 void update (int pId); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
54 bool eventFilter (QObject *watched, QEvent *e); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
55 void sendSelectionChange (); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
56 |
33599
7f18c537e101
maint: Update Qt macros to avoid name collisions
Arun Giridhar <arungiridhar@gmail.com>
parents:
32632
diff
changeset
|
57 private Q_SLOTS: |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
58 void itemSelectionChanged (); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
59 void itemActivated (const QModelIndex&); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
60 void itemPressed (QListWidgetItem *); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
61 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
62 private: |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
63 bool m_blockCallback; |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
64 bool m_selectionChanged; |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
65 }; |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
66 |
31646
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
31644
diff
changeset
|
67 OCTAVE_END_NAMESPACE(octave) |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
68 |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
69 #endif |