27 #include <QListWidget>
40 int lc = list->count ();
42 list->clearSelection ();
46 int idx =
xround (value(i));
48 if (1 <= idx && idx <= lc)
50 list->item (idx-1)->setSelected (
true);
52 && list->selectionMode () == QAbstractItemView::SingleSelection)
58 list->clearSelection ();
87 list->setSelectionMode (QAbstractItemView::ExtendedSelection);
89 list->setSelectionMode (QAbstractItemView::SingleSelection);
91 if (value.
numel () > 0)
94 int lc = list->count ();
98 int idx =
xround (value(i));
100 if (1 <= idx && idx <= lc)
102 list->item (idx-1)->setSelected (
true);
103 if (i == 0 && (list->selectionMode ()
104 == QAbstractItemView::SingleSelection))
110 list->removeEventFilter (
this);
111 list->viewport ()->installEventFilter (
this);
125 QListWidget* list = qWidget<QListWidget> ();
141 list->setSelectionMode (QAbstractItemView::ExtendedSelection);
143 list->setSelectionMode (QAbstractItemView::SingleSelection);
147 m_blockCallback =
true;
149 m_blockCallback =
false;
163 QListWidget* list = qWidget<QListWidget> ();
165 QModelIndexList l = list->selectionModel ()->selectedIndexes ();
169 foreach (
const QModelIndex& idx, l)
170 value(i++) = (idx.row () + 1);
static void post_callback(const graphics_handle &h, const std::string &name, const octave_value &data=Matrix())
octave_idx_type numel(void) const
Number of elements in the array.
void itemSelectionChanged(void)
string_vector get_string_vector(void) const
static Object * parentObject(const graphics_object &go)
ListBoxControl(const graphics_object &go, QListWidget *list)
QStringList fromStringVector(const string_vector &v)
virtual Container * innerContainer(void)=0
Matrix matrix_value(bool frc_str_conv=false) const
double get_min(void) const
static ListBoxControl * create(const graphics_object &go)
octave_value get_value(void) const
double get_max(void) const
static void updateSelection(QListWidget *list, const Matrix &value)
static void post_set(const graphics_handle &h, const std::string &name, const octave_value &value, bool notify_toolkit=true)