I have a QCalendarWidget and some days of month are colored (for example holidays are red). When I select a day which is colored, selection clears the color and I can't see it's original color. But when I deselect that day - color is back. Please see in pictures.
Is there a way to keep color even if a day is selected? I know that there is a way to do this for QTableView with delegates, but I can't find anything like this for QCalendarWidget. Any Ideas? Thank you for your time.
You can get access to the internal QTableView object of your calendar widget like this:
QCalendarWidget *c = new QCalendarWidget;
QTableView *view = c->findChild<QTableView*>("qt_calendar_calendarview");
if (view)
{
view->setItemDelegate(new MySuperCalendarDelegate);
}
Then you can use a custom delegate that will set proper background and foreground colors.
Also you can check my previous answer on QCalendarWidget styling.
I know it's more than a year, if I understood the question correctly, I think I found a better solution to this. In my case, every time a date is selected, I set the date to yellow color doing the following:
QTextCharFormat fmt;
fmt.setBackground(Qt::yellow);
m_ui->calender->setDateTextFormat(date, fmt);
and that very time I also set the stylesheet of the QCalenderWidget like this:
setStyleSheet("QTableView{selection-background-color: yellow}")
If I need to de-select, I set the date color to the original, which is white and also do the following:
setStyleSheet("QTableView{selection-background-color: yellow}")
This works great for me.
Related
I wanna highlight the background of a slicer when more then 10 items are selected.
My measure:
ColorBackground = IF(COUNTX(ALLSELECTED(Table), Table[Column])<=10, "Green", "Red")
So I use conditional formatting by field value.
When I use the conditional of an table column or as background for a textbox or shape it works as expected.
But when I use the same for the background of a slicer the background the background is always red.
Any ideas whats going wrong here?
Warm regards
Thank you.
As workaround I placed a shape under the slicer where conditional formatting works.
It doesn't work on a slicer. There are posts on powerbi.com asking for this functionality.
I am creating a bar chart using charts. The current work is below:
The colour represents continents. Notice that the default legend is blue showing undefined. I want to have the legends showing each colour and its represented continent. That is, to be able to display legends of the bar's background and customise their label.
How can I achieve that?
Really appreciate your help! Thanks
Instead of putting all your data in a single dataset you will need to make a different dataset for each continent and then set the label of that dataset to the continent
How can I outline the border of the slicer?
I want to change color of the border of the window where it says "All".
I do not need like this:
I need something like that"
Anyway to achieve that in Power bi?
I don't think this is currently possible with the built-in slicer.
To do this, you'll either have to create your own custom visual or else submit an idea and hope it gets implemented.
This image shows the different pieces you can currently adjust.
Notice that the border for the header and the items (purple) is the same thickness and color, the outside border (yellow) can't be changed in width, and the Items Outline doesn't display except on the drop-down section.
You could make a really thick border using the Background, but I don't think that's a good option.
I want to conditionally change the color of a font or text box background color or rectangles background color on a certain value. As far as i have researched its only possible in a matrix or a table. Is there any way i can do this? I want to change the color of the "condition" box on bases of a value, please see the attached screen shot. I would be very thankful if anyone can help me achieve it or any other work around to achieve this.
I would use the Custom Visual: Card with States. It's States properties let you dynamically control the colors of the font or background.
https://appsource.microsoft.com/en-us/product/power-bi-visuals/WA104380967?src=office&tab=Overview
i want draw a rectangle for showing time and users can select time intervals in it, something like below image, but i don't know how to do this in Qt, is there any widget that i can use it? or if i should implement myself how can i do this? i googled it and i found a QTimeSpan but it is not added to Qt yet. or is it possible to change QSlider to have two side slide for selecting time?
thank you in advance