mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-05 17:55:25 +08:00
update
This commit is contained in:
@ -20,6 +20,26 @@ public:
|
||||
Q_INVOKABLE int depth(){return _depth;};
|
||||
Q_INVOKABLE bool isExpanded(){return _isExpanded;};
|
||||
Q_INVOKABLE bool hasChildren(){ return !_children.isEmpty();};
|
||||
Q_INVOKABLE bool isHeaderNode(){
|
||||
if(hasChildren() && _isExpanded){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Q_INVOKABLE bool isFooterNode(){
|
||||
return this->_parent->_children.indexOf(this) == this->_parent->_children.count()-1;
|
||||
}
|
||||
|
||||
Q_INVOKABLE bool hasNextNodeByIndex(int index){
|
||||
Node* p = this;
|
||||
for(int i=0;i<(_depth - index -1);i++){
|
||||
p = p->_parent;
|
||||
}
|
||||
if(p->_parent->_children.indexOf(p) == p->_parent->_children.count()-1){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
Q_INVOKABLE bool hideLineFooter(){
|
||||
if(_parent){
|
||||
auto childIndex = _parent->_children.indexOf(this);
|
||||
@ -72,6 +92,8 @@ public:
|
||||
Q_INVOKABLE void collapse(int row);
|
||||
Q_INVOKABLE void expand(int row);
|
||||
Q_INVOKABLE void dragAnddrop(int dragIndex,int dropIndex);
|
||||
Q_INVOKABLE Node* getNode(int row);
|
||||
Q_INVOKABLE void refreshNode(int row);
|
||||
private:
|
||||
QList<Node*> _rows;
|
||||
QList<Node*> _dataSource;
|
||||
|
Reference in New Issue
Block a user