set line between qtreewidget items - c++

I have a QTreeWidget that items append to it dynamically, I want to set lines between them, I have first pictures and I want it to be like the second one, but I don't know how doing it?
thank you in advance!

Well you can experiment with stylesheets:
treeWidget->setStyleSheet("QTreeWidget::item { border-bottom: 1px solid black;}");
But I am not sure if can get exactly the look you want. You can also subclass QStyledItemDelegate and provide your own sizeHint() and paint() implementations.

If You need to select items, following works a little better I think:
QString style = "QTreeWidget::item:!selected "
"{ "
"border: 1px solid gainsboro; "
"border-left: none; "
"border-top: none; "
"}"
"QTreeWidget::item:selected {}";
allergiesListView->setStyleSheet(style);

Related

How to remove css-grid gutter from outer edge of a row

I am currently working to replicate a design and I am using css grid for the layout.
I applied the css gap attribute and gutters were created between the rows and columns. However, a gutter was created outside the last row and I have been battling to fix it. from what I know about grid gap and also from css Tricks,the gutters are only created between the columns/rows, not on the outer edges.
Following is a screenshot of how it looks like after my implementation current look You can notice the gutter at the bottom of the last row on the right. I do not want the gutter there, I just want the row to take up the space at the bottom. This is the code for the grid container.
.App {
display: grid;
grid-template-rows: repeat(2, 1fr);
grid-template-columns: repeat(4, 1fr);
gap: 25px;
width: 70%;
height: 55%;
background-color: var(--pry-blue);
}

Oracle Apex column value conditional display

I used the query below in interactive report and turned escape special characters off. This is just coloring text whereas requirement is to highlight entire row.
Any suggestions?
Ex:
SELECT "P_IT_ISSUES"."ISSUE_SUMMARY" as "ISSUE_SUMMARY",
decode("P_IT_PEOPLE_1"."PERSON_NAME",NULL,'Unassigned',
"P_IT_PEOPLE_1"."PERSON_NAME")
as "ASSIGNED_TO",
case when "P_IT_ISSUES"."STATUS" ='Open'
then '<aaab style= " color: green; " >'
||"P_IT_ISSUES"."STATUS"||'</aaab>'
when "P_IT_ISSUES"."STATUS" ='On-Hold'
then '<aaab style= " color: red; " >'
||"P_IT_ISSUES"."STATUS"||'</aaab>'
else '<aaab style= " color: red; " >'
||"P_IT_ISSUES"."STATUS"||'</aaab>'
end "Status"
FROM "P_IT_PEOPLE" "P_IT_PEOPLE_1",
"P_IT_DEPARTMENTS" "P_IT_DEPARTMENTS",
"P_IT_PEOPLE" "P_IT_PEOPLE",
"P_IT_ISSUES" "P_IT_ISSUES"
WHERE "P_IT_ISSUES"."IDENTIFIED_BY_PERSON_ID"="P_IT_PEOPLE"."PERSON_ID"
AND "P_IT_ISSUES"."ASSIGNED_TO_PERSON_ID"="P_IT_PEOPLE_1"."PERSON_ID"(+)
AND "P_IT_ISSUES"."RELATED_DEPT_ID"="P_IT_DEPARTMENTS"."DEPT_ID"
I need to do a revised version of this post
http://www.grassroots-oracle.com/2013/06/highlight-cell-background-in-apex-report.html
To highlight the entire cell/row, you need to apply a conditional class to your column, similar to how you're doing now - but could be a simple value.
First, add a hidden column to your query.
case when status = 'X' then 'foo' else 'bar' end my_class
which you would add as HTML expression of a visible column, eg: the status column.
<span class="#MY_CLASS#">#STATUS#</span>
Then have an after-refresh dynamic action with JS, ensuring 'fire in initialisation' is checked.
This JS looks for any elements with that class, then climbs the DOM to find the relevant cell/row, and applies a colour to the row.
$("#my_report_static_id .foo").each(function(){
$(this).closest('tr').css({"background-color":"red"});
});
You could parameterise that colour, if necessary, using similar techniques.

how to combine 2 different stylesheet in QT

In my application im having a table widget , by using stylesheet i tried to change header border and cells background colors.refer my code below,
//to set cell background color as white
tableWidget->setStyleSheet(" QTableWidget::item { border: 1px solid white; }" );
//to set header background as white
tableWidget->setStyleSheet("QHeaderView::section{background-color: black;color:white;border: 1px solid white;}");
now i want to combine both in style sheet. Guide me how to combine above two stylesheets into 1 stylesheet.
//to set cell background color as white
QString styleSheet = " QTableWidget::item { border: 1px solid white; }";
//to set header background as white
styleSheet += "QHeaderView::section{background-color: black;color:white;border: 1px solid white;}";
tableWidget->setStyleSheet(stylesheet);
However, you can just put everything in a single line, there is no need to split your stylesheet into two parts like this.

QComboBox text color doesn't change as expected [duplicate]

This question already has answers here:
QComboBox text colour won't change with style sheet
(3 answers)
Closed 8 years ago.
I have a simple QComboBox but I cannot figure out how to change the text color of the selected item. It stays black but it should be white. I used the color:white; properties but it seems to affect only the color of the popup item list.
this is my current stylesheet:
background: rgb(61,61,61);
color: rgb(255,255,255);
selection-color: rgb(255, 255, 255);
the QComboBox keeps having this behaviour:
as you can see the selected item still has an unspecified black color.
I have solved this by including the padding property:
QComboBox { combobox-popup: 0;
color: white;
padding: 0px 0px 0px 0px; }
It seems setting the padding property (with any value) on the combobox in the style sheet makes it properly obey the colour styling.
See for reference:
https://stackoverflow.com/a/24824810/4022402

CSS3 Border Images

I'm trying to achieve a 5px gradient around all edges. I've found multiple ways to do this in all browsers except for IE (-mos-border-colors and apply 5 separate colors, border-image, etc...).
I've tried CSS3 Pie, but can't seem to get it to function at all in IE (any version). There are multiple sizes for this column, so images would be a hassle.
Any one have any solutions for this?
.col {
border: 5px solid;
-moz-border-image: url(../images/bg-border.png) 5 5 5 5 stretch;
-webkit-border-image: url(../images/bg-border.png) 5 5 5 5 stretch;
border-image: url(../images/bg-border.png) 5 5 5 5 stretch;
behavior: url(/htc/Support/assets/css/PIE.htc);
}
Maybe box-shadow is an option for you, enabling monochrome gradients/shades…
header {
box-shadow: 0 1em 2em #fff;
-webkit-box-shadow: 0 1em 2em #fff;
-moz-box-shadow: 0 1em 2em #fff; }
Does it really need to look identical in every browser?
Some cross browser solutions: http://webdesignerwall.com/tutorials/cross-browser-css-gradient
Please note not all browsers support CSS gradient. To be safe, you shouldn't rely on CSS gradient when coding the layout. It should only be used for enhancing the layout.
I've tried CSS3 Pie, but can't seem to get it to function at all in IE
(any version).
CSS3-Pie is a bit tricky. Try adding position:relative; to the element you want to apply border image to.
csspie cannot resolve relative paths from your stylesheet to your images. If you do not specify absolute paths from document root to your images, css pie cannot find them.
See this issue here:
http://css3pie.com/documentation/known-issues/#relative-paths