Home > Mobile >  Using CSS beautification QTreeView
Using CSS beautification QTreeView

Time:10-13

this is made of QTreeView organization the tree, how to use CSS to achieve to the left of the blue effect

QTreeView {
Color: RGB (255255255);
Background - color: # 15171 a;
The show - decoration - selected: 1;
}

QTreeView: : item {
height: 30px;
Background - color: # 15171 a;

}

QTreeView: : item: selected: active {
Color: RGB (255255255);
Background - color: # 282 c32;

}

QTreeView: : branch: selected: active {
Background - color: # 282 c32;
}

QTreeView: : item: hover, QTreeView: : branch: hover {
Background - color: # 282 c32;
}

Item: selected: QTreeView...! The active {
Color: RGB (255255255);
Background - color: # 282 c32;
}

QTreeView: : branch {
Background - color: # 15171 a;
}

QTreeView: : branch: from - children:! From the - siblings: closed,
QTreeView: : branch: closed: from - children: from siblings {
-Border - image: none;
Image: url (:/images/branch_closed PNG);
}

QTreeView: : branch: open: from - children:! From the siblings,
QTreeView: : branch: open: from - children: from siblings {
-Border - image: none;
Image: url (:/images/branch_open PNG);
}

CodePudding user response:

You said the style sheet? It is ok to copy the past

CodePudding user response:

What I want is blue vertical bar on the left

CodePudding user response:

QSS write very clear:

QTreeView: : branch: from - children:! From the - siblings: closed,
QTreeView: : branch: closed: from - children: from siblings {
-Border - image: none;
Image: url (:/images/branch_closed PNG);
}

QTreeView: : branch: open: from - children:! From the siblings,
QTreeView: : branch: open: from - children: from siblings {
-Border - image: none;
Image: url (:/images/branch_open PNG);
}

But there is no need to use pictures, you can directly use border:
QTreeView: : branch: from - children:! From the - siblings: closed,
QTreeView: : branch: closed: from - children: from siblings {
-Border - image: none;
Border - left: none;
}

//the son unfold and selected option when they show that vertical bar on the left side of the blue, can according to your requirements adjustment condition
QTreeView: : branch: open: from - children:! From the - siblings: selected,
QTreeView: : branch: open: from - children: from - siblings: selected {
Border - image: none;
Border - left: 5 px solid blue;
}

CodePudding user response:

The
this is a nice nickname reference 3 floor response:
QSS write very clear:

QTreeView: : branch: from - children:! From the - siblings: closed,
QTreeView: : branch: closed: from - children: from siblings {
-Border - image: none;
Image: url (:/images/branch_closed PNG);
}

QTreeView: : branch: open: from - children:! From the siblings,
QTreeView: : branch: open: from - children: from siblings {
-Border - image: none;
Image: url (:/images/branch_open PNG);
}

But there is no need to use pictures, you can directly use border:
QTreeView: : branch: from - children:! From the - siblings: closed,
QTreeView: : branch: closed: from - children: from siblings {
-Border - image: none;
Border - left: none;
}

//the son unfold and selected option when they show that vertical bar on the left side of the blue, can according to your requirements adjustment condition
QTreeView: : branch: open: from - children:! From the - siblings: selected,
QTreeView: : branch: open: from - children: from - siblings: selected {
Border - image: none;
Border - left: 5 px solid blue;
}

Because before contact is not much, so more difficult to use; Can I tried, the first level, second level to the second branch on the left, is it possible that no matter which level in the left branch on the left

CodePudding user response:

The
reference 4 floor wash inkstone reply:
Quote: this is a nice nickname reference 3 floor response:

QSS write very clear:

QTreeView: : branch: from - children:! From the - siblings: closed,
QTreeView: : branch: closed: from - children: from siblings {
-Border - image: none;
Image: url (:/images/branch_closed PNG);
}

QTreeView: : branch: open: from - children:! From the siblings,
QTreeView: : branch: open: from - children: from siblings {
-Border - image: none;
Image: url (:/images/branch_open PNG);
}

But there is no need to use pictures, you can directly use border:
QTreeView: : branch: from - children:! From the - siblings: closed,
QTreeView: : branch: closed: from - children: from siblings {
-Border - image: none;
Border - left: none;
}

//the son unfold and selected option when they show that vertical bar on the left side of the blue, can according to your requirements adjustment condition
QTreeView: : branch: open: from - children:! From the - siblings: selected,
QTreeView: : branch: open: from - children: from - siblings: selected {
Border - image: none;
Border - left: 5 px solid blue;
}

Because before contact is not much, so more difficult to use; Can I tried, the first level, second level to the second branch on the left, is it possible that no matter which level in the left branch on the left side of the



This I also tried it on, secondary branch of the left is a primary branch, temporarily didn't find out how to make the level of state and secondary unchanged,
If you have to realize that the effect can change the way of thinking: do one on the left side of the border is blue, the background is black QWidget, let QTreeView when selected a line item and branch are the background transparent, and then move the QWidget to the corresponding position, the next layer in QTreeView, show (),

If it is we would like to change QWidget to QLabel with pictures, in picture moved into position

CodePudding user response:

this is a nice nickname reference 5 floor response:
Quote: refer to 4th floor wash inkstone reply:

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • Qt
  • Related