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.
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?
Qt Code:
void Widget::setBrowserEditable(bool editable) { QList<QWidget *> widgets = m_browser->findChildren<QWidget *>(); { if ( wgt->inherits("QScrollBar") || wgt->inherits("QtPropertyEditorView") ) { continue; } wgt->setEnabled(editable); } }To copy to clipboard, switch view to plain text mode
Unfortunately some of displayed properties are read only so I would have to remember which properties were not editable.
west (8th October 2014)
another way to make
Qt Code:
void MainWindow::setPropTreeElemReadOnly(bool mode) { foreach(QtProperty *property, propertyTree->properties()) { property->setEnabled(mode); qDebug()<<property->propertyName(); if (property->propertyName() == "StateEnable") { property->setEnabled(true); } } }To copy to clipboard, switch view to plain text mode
Bookmarks