qtbuttonpropertybrowser.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the Qt Solutions component.
7 **
8 ** $QT_BEGIN_LICENSE:BSD$
9 ** You may use this file under the terms of the BSD license as follows:
10 **
11 ** "Redistribution and use in source and binary forms, with or without
12 ** modification, are permitted provided that the following conditions are
13 ** met:
14 ** * Redistributions of source code must retain the above copyright
15 ** notice, this list of conditions and the following disclaimer.
16 ** * Redistributions in binary form must reproduce the above copyright
17 ** notice, this list of conditions and the following disclaimer in
18 ** the documentation and/or other materials provided with the
19 ** distribution.
20 ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
21 ** of its contributors may be used to endorse or promote products derived
22 ** from this software without specific prior written permission.
23 **
24 **
25 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
36 **
37 ** $QT_END_LICENSE$
38 **
39 ****************************************************************************/
40 
41 
43 #include <QSet>
44 #include <QGridLayout>
45 #include <QLabel>
46 #include <QTimer>
47 #include <QMap>
48 #include <QToolButton>
49 #include <QStyle>
50 
51 QT_BEGIN_NAMESPACE
52 
54 {
56  Q_DECLARE_PUBLIC(QtButtonPropertyBrowser)
57 public:
58 
59  void init(QWidget* parent);
60 
64  QWidget* createEditor(QtProperty* property, QWidget* parent) const
65  {
66  return q_ptr->createEditor(property, parent);
67  }
68 
69  void slotEditorDestroyed();
70  void slotUpdate();
71  void slotToggled(bool checked);
72 
73  struct WidgetItem
74  {
75  WidgetItem() : widget(0), label(0), widgetLabel(0),
76  button(0), container(0), layout(0), /*line(0), */parent(0), expanded(false) { }
77  QWidget* widget; // can be null
78  QLabel* label; // main label with property name
79  QLabel* widgetLabel; // label substitute showing the current value if there is no widget
80  QToolButton* button; // expandable button for items with children
81  QWidget* container; // container which is expanded when the button is clicked
82  QGridLayout* layout; // layout in container
84  QList<WidgetItem*> children;
85  bool expanded;
86  };
87 private:
88  void updateLater();
89  void updateItem(WidgetItem* item);
90  void insertRow(QGridLayout* layout, int row) const;
91  void removeRow(QGridLayout* layout, int row) const;
92  int gridRow(WidgetItem* item) const;
93  int gridSpan(WidgetItem* item) const;
94  void setExpanded(WidgetItem* item, bool expanded);
95  QToolButton* createButton(QWidget* panret = 0) const;
96 
97  QMap<QtBrowserItem*, WidgetItem*> m_indexToItem;
98  QMap<WidgetItem*, QtBrowserItem*> m_itemToIndex;
99  QMap<QWidget*, WidgetItem*> m_widgetToItem;
100  QMap<QObject*, WidgetItem*> m_buttonToItem;
101  QGridLayout* m_mainLayout;
102  QList<WidgetItem*> m_children;
103  QList<WidgetItem*> m_recreateQueue;
104 };
105 
106 QToolButton* QtButtonPropertyBrowserPrivate::createButton(QWidget* parent) const
107 {
108  QToolButton* button = new QToolButton(parent);
109  button->setCheckable(true);
110  button->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed));
111  button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
112  button->setArrowType(Qt::DownArrow);
113  button->setIconSize(QSize(3, 16));
114  /*
115  QIcon icon;
116  icon.addPixmap(q_ptr->style()->standardPixmap(QStyle::SP_ArrowDown), QIcon::Normal, QIcon::Off);
117  icon.addPixmap(q_ptr->style()->standardPixmap(QStyle::SP_ArrowUp), QIcon::Normal, QIcon::On);
118  button->setIcon(icon);
119  */
120  return button;
121 }
122 
123 int QtButtonPropertyBrowserPrivate::gridRow(WidgetItem* item) const
124 {
125  QList<WidgetItem*> siblings;
126 
127  if (item->parent)
128  {
129  siblings = item->parent->children;
130  }
131  else
132  {
133  siblings = m_children;
134  }
135 
136  int row = 0;
137  QListIterator<WidgetItem*> it(siblings);
138 
139  while (it.hasNext())
140  {
141  WidgetItem* sibling = it.next();
142 
143  if (sibling == item)
144  {
145  return row;
146  }
147 
148  row += gridSpan(sibling);
149  }
150 
151  return -1;
152 }
153 
154 int QtButtonPropertyBrowserPrivate::gridSpan(WidgetItem* item) const
155 {
156  if (item->container && item->expanded)
157  {
158  return 2;
159  }
160 
161  return 1;
162 }
163 
165 {
166  m_mainLayout = new QGridLayout();
167  parent->setLayout(m_mainLayout);
168  QLayoutItem* item = new QSpacerItem(0, 0,
169  QSizePolicy::Fixed, QSizePolicy::Expanding);
170  m_mainLayout->addItem(item, 0, 0);
171 }
172 
174 {
175  QWidget* editor = qobject_cast<QWidget*>(q_ptr->sender());
176 
177  if (!editor)
178  {
179  return;
180  }
181 
182  if (!m_widgetToItem.contains(editor))
183  {
184  return;
185  }
186 
187  m_widgetToItem[editor]->widget = 0;
188  m_widgetToItem.remove(editor);
189 }
190 
192 {
193  QListIterator<WidgetItem*> itItem(m_recreateQueue);
194 
195  while (itItem.hasNext())
196  {
197  WidgetItem* item = itItem.next();
198 
199  WidgetItem* parent = item->parent;
200  QWidget* w = 0;
201  QGridLayout* l = 0;
202  const int oldRow = gridRow(item);
203 
204  if (parent)
205  {
206  w = parent->container;
207  l = parent->layout;
208  }
209  else
210  {
211  w = q_ptr;
212  l = m_mainLayout;
213  }
214 
215  int span = 1;
216 
217  if (!item->widget && !item->widgetLabel)
218  {
219  span = 2;
220  }
221 
222  item->label = new QLabel(w);
223  item->label->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
224  l->addWidget(item->label, oldRow, 0, 1, span);
225 
226  updateItem(item);
227  }
228 
229  m_recreateQueue.clear();
230 }
231 
232 void QtButtonPropertyBrowserPrivate::setExpanded(WidgetItem* item, bool expanded)
233 {
234  if (item->expanded == expanded)
235  {
236  return;
237  }
238 
239  if (!item->container)
240  {
241  return;
242  }
243 
244  item->expanded = expanded;
245  const int row = gridRow(item);
246  WidgetItem* parent = item->parent;
247  QGridLayout* l = 0;
248 
249  if (parent)
250  {
251  l = parent->layout;
252  }
253  else
254  {
255  l = m_mainLayout;
256  }
257 
258  if (expanded)
259  {
260  insertRow(l, row + 1);
261  l->addWidget(item->container, row + 1, 0, 1, 2);
262  item->container->show();
263  }
264  else
265  {
266  l->removeWidget(item->container);
267  item->container->hide();
268  removeRow(l, row + 1);
269  }
270 
271  item->button->setChecked(expanded);
272  item->button->setArrowType(expanded ? Qt::UpArrow : Qt::DownArrow);
273 }
274 
276 {
277  WidgetItem* item = m_buttonToItem.value(q_ptr->sender());
278 
279  if (!item)
280  {
281  return;
282  }
283 
284  setExpanded(item, checked);
285 
286  if (checked)
287  {
288  emit q_ptr->expanded(m_itemToIndex.value(item));
289  }
290  else
291  {
292  emit q_ptr->collapsed(m_itemToIndex.value(item));
293  }
294 }
295 
296 void QtButtonPropertyBrowserPrivate::updateLater()
297 {
298  QTimer::singleShot(0, q_ptr, SLOT(slotUpdate()));
299 }
300 
302 {
303  WidgetItem* afterItem = m_indexToItem.value(afterIndex);
304  WidgetItem* parentItem = m_indexToItem.value(index->parent());
305 
306  WidgetItem* newItem = new WidgetItem();
307  newItem->parent = parentItem;
308 
309  QGridLayout* layout = 0;
310  QWidget* parentWidget = 0;
311  int row = -1;
312 
313  if (!afterItem)
314  {
315  row = 0;
316 
317  if (parentItem)
318  {
319  parentItem->children.insert(0, newItem);
320  }
321  else
322  {
323  m_children.insert(0, newItem);
324  }
325  }
326  else
327  {
328  row = gridRow(afterItem) + gridSpan(afterItem);
329 
330  if (parentItem)
331  {
332  parentItem->children.insert(parentItem->children.indexOf(afterItem) + 1, newItem);
333  }
334  else
335  {
336  m_children.insert(m_children.indexOf(afterItem) + 1, newItem);
337  }
338  }
339 
340  if (!parentItem)
341  {
342  layout = m_mainLayout;
343  parentWidget = q_ptr;
344  }
345  else
346  {
347  if (!parentItem->container)
348  {
349  m_recreateQueue.removeAll(parentItem);
350  WidgetItem* grandParent = parentItem->parent;
351  QGridLayout* l = 0;
352  const int oldRow = gridRow(parentItem);
353 
354  if (grandParent)
355  {
356  l = grandParent->layout;
357  }
358  else
359  {
360  l = m_mainLayout;
361  }
362 
363  QFrame* container = new QFrame();
364  container->setFrameShape(QFrame::Panel);
365  container->setFrameShadow(QFrame::Raised);
366  parentItem->container = container;
367  parentItem->button = createButton();
368  m_buttonToItem[parentItem->button] = parentItem;
369  q_ptr->connect(parentItem->button, SIGNAL(toggled(bool)), q_ptr, SLOT(slotToggled(bool)));
370  parentItem->layout = new QGridLayout();
371  container->setLayout(parentItem->layout);
372 
373  if (parentItem->label)
374  {
375  l->removeWidget(parentItem->label);
376  delete parentItem->label;
377  parentItem->label = 0;
378  }
379 
380  int span = 1;
381 
382  if (!parentItem->widget && !parentItem->widgetLabel)
383  {
384  span = 2;
385  }
386 
387  l->addWidget(parentItem->button, oldRow, 0, 1, span);
388  updateItem(parentItem);
389  }
390 
391  layout = parentItem->layout;
392  parentWidget = parentItem->container;
393  }
394 
395  newItem->label = new QLabel(parentWidget);
396  newItem->label->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
397  newItem->widget = createEditor(index->property(), parentWidget);
398 
399  if (newItem->widget)
400  {
401  QObject::connect(newItem->widget, SIGNAL(destroyed()), q_ptr, SLOT(slotEditorDestroyed()));
402  m_widgetToItem[newItem->widget] = newItem;
403  }
404  else if (index->property()->hasValue())
405  {
406  newItem->widgetLabel = new QLabel(parentWidget);
407  newItem->widgetLabel->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed));
408  }
409 
410  insertRow(layout, row);
411  int span = 1;
412 
413  if (newItem->widget)
414  {
415  layout->addWidget(newItem->widget, row, 1);
416  }
417  else if (newItem->widgetLabel)
418  {
419  layout->addWidget(newItem->widgetLabel, row, 1);
420  }
421  else
422  {
423  span = 2;
424  }
425 
426  layout->addWidget(newItem->label, row, 0, span, 1);
427 
428  m_itemToIndex[newItem] = index;
429  m_indexToItem[index] = newItem;
430 
431  updateItem(newItem);
432 }
433 
435 {
436  WidgetItem* item = m_indexToItem.value(index);
437 
438  m_indexToItem.remove(index);
439  m_itemToIndex.remove(item);
440 
441  WidgetItem* parentItem = item->parent;
442 
443  const int row = gridRow(item);
444 
445  if (parentItem)
446  {
447  parentItem->children.removeAt(parentItem->children.indexOf(item));
448  }
449  else
450  {
451  m_children.removeAt(m_children.indexOf(item));
452  }
453 
454  const int colSpan = gridSpan(item);
455 
456  m_buttonToItem.remove(item->button);
457 
458  if (item->widget)
459  {
460  delete item->widget;
461  }
462 
463  if (item->label)
464  {
465  delete item->label;
466  }
467 
468  if (item->widgetLabel)
469  {
470  delete item->widgetLabel;
471  }
472 
473  if (item->button)
474  {
475  delete item->button;
476  }
477 
478  if (item->container)
479  {
480  delete item->container;
481  }
482 
483  if (!parentItem)
484  {
485  removeRow(m_mainLayout, row);
486 
487  if (colSpan > 1)
488  {
489  removeRow(m_mainLayout, row);
490  }
491  }
492  else if (parentItem->children.count() != 0)
493  {
494  removeRow(parentItem->layout, row);
495 
496  if (colSpan > 1)
497  {
498  removeRow(parentItem->layout, row);
499  }
500  }
501  else
502  {
503  const WidgetItem* grandParent = parentItem->parent;
504  QGridLayout* l = 0;
505 
506  if (grandParent)
507  {
508  l = grandParent->layout;
509  }
510  else
511  {
512  l = m_mainLayout;
513  }
514 
515  const int parentRow = gridRow(parentItem);
516  const int parentSpan = gridSpan(parentItem);
517 
518  l->removeWidget(parentItem->button);
519  l->removeWidget(parentItem->container);
520  delete parentItem->button;
521  delete parentItem->container;
522  parentItem->button = 0;
523  parentItem->container = 0;
524  parentItem->layout = 0;
525 
526  if (!m_recreateQueue.contains(parentItem))
527  {
528  m_recreateQueue.append(parentItem);
529  }
530 
531  if (parentSpan > 1)
532  {
533  removeRow(l, parentRow + 1);
534  }
535 
536  updateLater();
537  }
538 
539  m_recreateQueue.removeAll(item);
540 
541  delete item;
542 }
543 
544 void QtButtonPropertyBrowserPrivate::insertRow(QGridLayout* layout, int row) const
545 {
546  QMap<QLayoutItem*, QRect> itemToPos;
547  int idx = 0;
548 
549  while (idx < layout->count())
550  {
551  int r, c, rs, cs;
552  layout->getItemPosition(idx, &r, &c, &rs, &cs);
553 
554  if (r >= row)
555  {
556  itemToPos[layout->takeAt(idx)] = QRect(r + 1, c, rs, cs);
557  }
558  else
559  {
560  idx++;
561  }
562  }
563 
564  const QMap<QLayoutItem*, QRect>::ConstIterator icend = itemToPos.constEnd();
565 
566  for (QMap<QLayoutItem*, QRect>::ConstIterator it = itemToPos.constBegin(); it != icend; ++it)
567  {
568  const QRect r = it.value();
569  layout->addItem(it.key(), r.x(), r.y(), r.width(), r.height());
570  }
571 }
572 
573 void QtButtonPropertyBrowserPrivate::removeRow(QGridLayout* layout, int row) const
574 {
575  QMap<QLayoutItem*, QRect> itemToPos;
576  int idx = 0;
577 
578  while (idx < layout->count())
579  {
580  int r, c, rs, cs;
581  layout->getItemPosition(idx, &r, &c, &rs, &cs);
582 
583  if (r > row)
584  {
585  itemToPos[layout->takeAt(idx)] = QRect(r - 1, c, rs, cs);
586  }
587  else
588  {
589  idx++;
590  }
591  }
592 
593  const QMap<QLayoutItem*, QRect>::ConstIterator icend = itemToPos.constEnd();
594 
595  for (QMap<QLayoutItem*, QRect>::ConstIterator it = itemToPos.constBegin(); it != icend; ++it)
596  {
597  const QRect r = it.value();
598  layout->addItem(it.key(), r.x(), r.y(), r.width(), r.height());
599  }
600 }
601 
603 {
604  WidgetItem* item = m_indexToItem.value(index);
605 
606  updateItem(item);
607 }
608 
609 void QtButtonPropertyBrowserPrivate::updateItem(WidgetItem* item)
610 {
611  QtProperty* property = m_itemToIndex[item]->property();
612 
613  if (item->button)
614  {
615  QFont font = item->button->font();
616  font.setUnderline(property->isModified());
617  item->button->setFont(font);
618  item->button->setText(property->propertyName());
619  item->button->setToolTip(property->toolTip());
620  item->button->setStatusTip(property->statusTip());
621  item->button->setWhatsThis(property->whatsThis());
622  item->button->setEnabled(property->isEnabled());
623  }
624 
625  if (item->label)
626  {
627  QFont font = item->label->font();
628  font.setUnderline(property->isModified());
629  item->label->setFont(font);
630  item->label->setText(property->propertyName());
631  item->label->setToolTip(property->toolTip());
632  item->label->setStatusTip(property->statusTip());
633  item->label->setWhatsThis(property->whatsThis());
634  item->label->setEnabled(property->isEnabled());
635  }
636 
637  if (item->widgetLabel)
638  {
639  QFont font = item->widgetLabel->font();
640  font.setUnderline(false);
641  item->widgetLabel->setFont(font);
642  item->widgetLabel->setText(property->valueText());
643  item->widgetLabel->setToolTip(property->valueText());
644  item->widgetLabel->setEnabled(property->isEnabled());
645  }
646 
647  if (item->widget)
648  {
649  QFont font = item->widget->font();
650  font.setUnderline(false);
651  item->widget->setFont(font);
652  item->widget->setEnabled(property->isEnabled());
653  item->widget->setToolTip(property->valueText());
654  }
655 }
656 
657 
658 
659 /*!
660  \class QtButtonPropertyBrowser
661 
662  \brief The QtButtonPropertyBrowser class provides a drop down QToolButton
663  based property browser.
664 
665  A property browser is a widget that enables the user to edit a
666  given set of properties. Each property is represented by a label
667  specifying the property's name, and an editing widget (e.g. a line
668  edit or a combobox) holding its value. A property can have zero or
669  more subproperties.
670 
671  QtButtonPropertyBrowser provides drop down button for all nested
672  properties, i.e. subproperties are enclosed by a container associated with
673  the drop down button. The parent property's name is displayed as button text. For example:
674 
675  \image qtbuttonpropertybrowser.png
676 
677  Use the QtAbstractPropertyBrowser API to add, insert and remove
678  properties from an instance of the QtButtonPropertyBrowser
679  class. The properties themselves are created and managed by
680  implementations of the QtAbstractPropertyManager class.
681 
682  \sa QtTreePropertyBrowser, QtAbstractPropertyBrowser
683 */
684 
685 /*!
686  \fn void QtButtonPropertyBrowser::collapsed(QtBrowserItem *item)
687 
688  This signal is emitted when the \a item is collapsed.
689 
690  \sa expanded(), setExpanded()
691 */
692 
693 /*!
694  \fn void QtButtonPropertyBrowser::expanded(QtBrowserItem *item)
695 
696  This signal is emitted when the \a item is expanded.
697 
698  \sa collapsed(), setExpanded()
699 */
700 
701 /*!
702  Creates a property browser with the given \a parent.
703 */
705  : QtAbstractPropertyBrowser(parent)
706 {
707  d_ptr = new QtButtonPropertyBrowserPrivate;
708  d_ptr->q_ptr = this;
709 
710  d_ptr->init(this);
711 }
712 
713 /*!
714  Destroys this property browser.
715 
716  Note that the properties that were inserted into this browser are
717  \e not destroyed since they may still be used in other
718  browsers. The properties are owned by the manager that created
719  them.
720 
721  \sa QtProperty, QtAbstractPropertyManager
722 */
724 {
725  const QMap<QtButtonPropertyBrowserPrivate::WidgetItem*, QtBrowserItem*>::ConstIterator icend = d_ptr->m_itemToIndex.constEnd();
726 
727  for (QMap<QtButtonPropertyBrowserPrivate::WidgetItem*, QtBrowserItem*>::ConstIterator it = d_ptr->m_itemToIndex.constBegin(); it != icend; ++it)
728  {
729  delete it.key();
730  }
731 
732  delete d_ptr;
733 }
734 
735 /*!
736  \reimp
737 */
739 {
740  d_ptr->propertyInserted(item, afterItem);
741 }
742 
743 /*!
744  \reimp
745 */
747 {
748  d_ptr->propertyRemoved(item);
749 }
750 
751 /*!
752  \reimp
753 */
755 {
756  d_ptr->propertyChanged(item);
757 }
758 
759 /*!
760  Sets the \a item to either collapse or expanded, depending on the value of \a expanded.
761 
762  \sa isExpanded(), expanded(), collapsed()
763 */
764 
766 {
767  QtButtonPropertyBrowserPrivate::WidgetItem* itm = d_ptr->m_indexToItem.value(item);
768 
769  if (itm)
770  {
771  d_ptr->setExpanded(itm, expanded);
772  }
773 }
774 
775 /*!
776  Returns true if the \a item is expanded; otherwise returns false.
777 
778  \sa setExpanded()
779 */
780 
782 {
783  QtButtonPropertyBrowserPrivate::WidgetItem* itm = d_ptr->m_indexToItem.value(item);
784 
785  if (itm)
786  {
787  return itm->expanded;
788  }
789 
790  return false;
791 }
792 
793 QT_END_NAMESPACE
794 
795 #include "moc_qtbuttonpropertybrowser.cpp"
QtButtonPropertyBrowserPrivate::WidgetItem
Definition: qtbuttonpropertybrowser.cpp:111
QtButtonPropertyBrowserPrivate::propertyInserted
void propertyInserted(QtBrowserItem *index, QtBrowserItem *afterIndex)
Definition: qtbuttonpropertybrowser.cpp:301
QtButtonPropertyBrowserPrivate::slotEditorDestroyed
void slotEditorDestroyed()
Definition: qtbuttonpropertybrowser.cpp:173
index
uint8_t index
Definition: EtherCATFrame.h:59
QtButtonPropertyBrowserPrivate::WidgetItem::layout
QGridLayout * layout
Definition: qtbuttonpropertybrowser.cpp:120
QtButtonPropertyBrowserPrivate::WidgetItem::widget
QWidget * widget
Definition: qtbuttonpropertybrowser.cpp:115
QtButtonPropertyBrowserPrivate::createEditor
QWidget * createEditor(QtProperty *property, QWidget *parent) const
Definition: qtbuttonpropertybrowser.cpp:102
qtbuttonpropertybrowser.h
QtButtonPropertyBrowserPrivate::WidgetItem::label
QLabel * label
Definition: qtbuttonpropertybrowser.cpp:116
QtAbstractPropertyBrowser
QtAbstractPropertyBrowser provides a base class for implementing property browsers.
Definition: qtpropertybrowser.h:289
QtButtonPropertyBrowser::setExpanded
void setExpanded(QtBrowserItem *item, bool expanded)
Definition: qtbuttonpropertybrowser.cpp:765
QtButtonPropertyBrowserPrivate::WidgetItem::parent
WidgetItem * parent
Definition: qtbuttonpropertybrowser.cpp:121
QtButtonPropertyBrowserPrivate::init
void init(QWidget *parent)
Definition: qtbuttonpropertybrowser.cpp:164
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
QtBrowserItem
The QtBrowserItem class represents a property in a property browser instance.
Definition: qtpropertybrowser.h:273
QtButtonPropertyBrowser::itemInserted
void itemInserted(QtBrowserItem *item, QtBrowserItem *afterItem) override
Definition: qtbuttonpropertybrowser.cpp:738
QtProperty
The QtProperty class encapsulates an instance of a property.
Definition: qtpropertybrowser.h:71
QtButtonPropertyBrowserPrivate::WidgetItem::container
QWidget * container
Definition: qtbuttonpropertybrowser.cpp:119
QtButtonPropertyBrowser::QtButtonPropertyBrowser
QtButtonPropertyBrowser(QWidget *parent=0)
Definition: qtbuttonpropertybrowser.cpp:704
QtAbstractPropertyBrowser::createEditor
virtual QWidget * createEditor(QtProperty *property, QWidget *parent)
Definition: qtpropertybrowser.cpp:2096
QtButtonPropertyBrowserPrivate
Definition: qtbuttonpropertybrowser.cpp:53
QtButtonPropertyBrowser::~QtButtonPropertyBrowser
~QtButtonPropertyBrowser() override
Definition: qtbuttonpropertybrowser.cpp:723
QtButtonPropertyBrowserPrivate::slotUpdate
void slotUpdate()
Definition: qtbuttonpropertybrowser.cpp:191
QtButtonPropertyBrowser
The QtButtonPropertyBrowser class provides a drop down QToolButton based property browser.
Definition: qtbuttonpropertybrowser.h:50
QtButtonPropertyBrowserPrivate::WidgetItem::WidgetItem
WidgetItem()
Definition: qtbuttonpropertybrowser.cpp:113
QtButtonPropertyBrowserPrivate::WidgetItem::children
QList< WidgetItem * > children
Definition: qtbuttonpropertybrowser.cpp:122
QtButtonPropertyBrowserPrivate::propertyChanged
void propertyChanged(QtBrowserItem *index)
Definition: qtbuttonpropertybrowser.cpp:602
QtButtonPropertyBrowser::isExpanded
bool isExpanded(QtBrowserItem *item) const
Definition: qtbuttonpropertybrowser.cpp:781
QtButtonPropertyBrowserPrivate::WidgetItem::widgetLabel
QLabel * widgetLabel
Definition: qtbuttonpropertybrowser.cpp:117
QtButtonPropertyBrowser::itemRemoved
void itemRemoved(QtBrowserItem *item) override
Definition: qtbuttonpropertybrowser.cpp:746
QtButtonPropertyBrowser::expanded
void expanded(QtBrowserItem *item)
QtButtonPropertyBrowserPrivate::WidgetItem::button
QToolButton * button
Definition: qtbuttonpropertybrowser.cpp:118
QtButtonPropertyBrowserPrivate::WidgetItem::expanded
bool expanded
Definition: qtbuttonpropertybrowser.cpp:123
QtButtonPropertyBrowserPrivate::slotToggled
void slotToggled(bool checked)
Definition: qtbuttonpropertybrowser.cpp:275
QtButtonPropertyBrowserPrivate::propertyRemoved
void propertyRemoved(QtBrowserItem *index)
Definition: qtbuttonpropertybrowser.cpp:434
QtButtonPropertyBrowser::collapsed
void collapsed(QtBrowserItem *item)
QtButtonPropertyBrowser::itemChanged
void itemChanged(QtBrowserItem *item) override
Definition: qtbuttonpropertybrowser.cpp:754