How to adjust QComboBox?
-
Hi, I want to adjust my QCombobox and its items to have a look that is identical to buttons on the left. In short, this combobox should have a circular shape and a size of QSize(50,50), but I am not sure how to do it. The picture attached is to provide greater details on what I want to achieve. Any help will be very welcome.
-
Thank you. I figure out that I mis-spell QComboBox in the stylesheet and that is main cause of the problem. Eventually, I get the result that I want and this is the code that provides it.
ui -> comboBox -> setStyleSheet( "QComboBox{" "background-color: rgb(238,238,238);" "border: 1px solid black;" "border-radius: 25px;" "width: 40;" "height: 50;" "}" "QComboBox::drop-down{" "border-width: 0px;" "margin-left: 0px;" "}" "QComboBox::down-arrow{" "image:url(://Button_Icons/down-arrow.png);" "width: 10px;" "height: 50px;" "}");
-
Hi, I've read through the document and write this stylesheet up. But nothing has changed. The combobox still looks exactly the same.
ui -> comboBox -> setStyleSheet( "QComboBox::drop-down{" "subcontrol-position: top right;" "width: 0px;" "border-left-width: 0px;" "border-left-color: none;" "border-left-style: transparent;" "border-top-right-radius: 0px;" "border-bottom-right-radius: 0px;" "}" "QCombobox{" "border: 1px solid black;" "border-radius:3px;" "border-color:black;" "border-width: 25 25;" "}");
-
Thank you. I figure out that I mis-spell QComboBox in the stylesheet and that is main cause of the problem. Eventually, I get the result that I want and this is the code that provides it.
ui -> comboBox -> setStyleSheet( "QComboBox{" "background-color: rgb(238,238,238);" "border: 1px solid black;" "border-radius: 25px;" "width: 40;" "height: 50;" "}" "QComboBox::drop-down{" "border-width: 0px;" "margin-left: 0px;" "}" "QComboBox::down-arrow{" "image:url(://Button_Icons/down-arrow.png);" "width: 10px;" "height: 50px;" "}");