Make item delegate in QTableView not transparent - qt

I issued in problem with custom item delegate for QTableView.
That problem is completely illustrated by that screenshoot:
We can see item content behind item delegate editor. What is the best way to hide that content or make item delegate not transparent? (how I can get background color/brush for edited row?)

You need to let your editor to paint its own background by enabling the autofill background property:
editor->setAutoFillBackground(true);

widget->setStyleSheet("background-color: #eee;");

Related

Issue with displaying the text colors of the items inside QCombobox

I have a QCombobox, consists of 3 or 4 items.
Whenever,I try to select an item from my QCombobox, the color of the item changes to black(is not at all visible clearly).When I move my cursor away from the Dialog UI, then the color of the item changes to white (and is now clearly visible).
I think the problem lies with my QCombobox focus, but still not sure if I need to take care of it while adding the items inside my QCombobox.
Can someone explain the method, so that text of the items inside my QCombobox are clearly visible always?
Look for any stylesheets added for the combobox.
Also you can look for "setItemdata" function and anything is done with respect colors (backgroundrole).
Or if it is tough to figure out and wasting time, after adding your combobox items, change the background color of items to your convenience (Red in below code is just an example).
ui->comboBox->addItems({"text1","text2","text3","text4"});
ui->comboBox->setStyleSheet("QAbstractItemView { selection-background-color: red; }");

Qlabel with image as the background overlaps other Qlabels

I have a Qlabel with image as rich text and some other Qlabels on top of that as in the picture:
although I sent the Qlabel with image to back but when I run they appear as follows:
is there anyway to fix this?
Make the text labels children of the label containing the fade. Also I can not see any layouts. Did you use layouts? You could also put the fade on the widget by implementing its paintEvent(). All other widgets will be displayed on top of that.
Try right clicking the image label and clicking the send-to-back option. That might work. That should send the QLabel behind the other elements even though they appear as though they are already in front.

Change BorderColor of clicked item (itemrenderer) in List

Hello I want to set the BorderColor of certain Item Renderers (textInput) of a List. By default all have a common border color, but I want for example when clicking in an item to have a red border.
I tried this on a click event in my itemRenderer,
mytextInput.setStyle("color", 0xDDDDDD);
But it does not seem to work.
Any help.
Thx
As far as you're extending Spark TextInput control all the problems of that kind should be solved using skins. Create custom skin with the border you like.

Flex: Adding selectable image on canvas

I am new to flex, and do not know how to add an image (or other ui component) to canvas, so user can select it (and see that it's selected), also I want to add a possibility for example to click backspace and remove selected image from scene. How to do that?
Maybe you can point me to a doc to read?
I am not sure what you exactly need.
Do you need to add one image to the canvas, or possibly multiple?
And how do you need to lay out these images? Horizontal? Vertical? Tiled?
One way of doing it could be to add a TileList to your canvas, and as dataprovider an ArrayCollection that holds the sources of the images you need.
Create an itemrenderer for the List or TileList and you will be able to display the images.
The images will then be selectable. When you add an eventListener to the keyDown event you can catch the backscpace button being clicked and remove the selected item from the tilelist.
<mx:TileList id="myTileList" dataProvider="{myImages}" itemRenderer="your.domain.MyItemRenderer" keyDown="{keyDownHandler(event)}" />
Adobe LiveDocs and a few of the words I used in this answer might help you further.
Hope this helps.

Flex combobox custom icon

Trying to set the up and down state icons of a Flex Combobox to images. I see the property for changing the color of the icon, but no property to skin it. How can I do this?
The "properties" are actually styles on ComboBase: upSkin, downSkin, overSkin, disabledSkin.
The default is ComboBoxArrowSkin--take a look at the source code to get more details about overriding or customizing it.

Resources