I have the QtTreePropertyBrowser whose items mustn't be editable but user wants to be able to scroll and expand root items. Is it possible to reach this? Method setEnabled isn't the solution because it freezes the whole widget.
Printable View
I have the QtTreePropertyBrowser whose items mustn't be editable but user wants to be able to scroll and expand root items. Is it possible to reach this? Method setEnabled isn't the solution because it freezes the whole widget.
Hi guys, what do you think about my solution? :)
Code:
void Widget::setBrowserEditable(bool editable) { QList<QWidget *> widgets = m_browser->findChildren<QWidget *>(); { if ( wgt->inherits("QScrollBar") || wgt->inherits("QtPropertyEditorView") ) { continue; } wgt->setEnabled(editable); } }
Can't you simply make the properties not editable?
Unfortunately some of displayed properties are read only so I would have to remember which properties were not editable.
So do that.
another way to make
Code:
void MainWindow::setPropTreeElemReadOnly(bool mode) { foreach(QtProperty *property, propertyTree->properties()) { property->setEnabled(mode); qDebug()<<property->propertyName(); if (property->propertyName() == "StateEnable") { property->setEnabled(true); } } }