Css 如何在QLineEdit和QPushButton中仅为边框的一侧设置样式表?

Css 如何在QLineEdit和QPushButton中仅为边框的一侧设置样式表?,css,stylesheet,qpushbutton,qlineedit,Css,Stylesheet,Qpushbutton,Qlineedit,我试图手动创建一个组合框。因此,行编辑应该与(下拉)按钮相结合。因此,我想隐藏行编辑的右边框和按钮的左边框 我试过这个: myLineEdit->setStyleSheet("QLineEdit{border-right: none;}"); myPushButton->setStyleSheet("QPushButton{border-left:none;}"); 我还尝试了: myLineEdit->setStyleSheet("QLineEdit{border: 1px

我试图手动创建一个组合框。因此,行编辑应该与(下拉)按钮相结合。因此,我想隐藏行编辑的右边框和按钮的左边框

我试过这个:

myLineEdit->setStyleSheet("QLineEdit{border-right: none;}");
myPushButton->setStyleSheet("QPushButton{border-left:none;}");
我还尝试了:

myLineEdit->setStyleSheet("QLineEdit{border: 1px 1px 0px 1px;}");

但两者都不起作用。我错在哪里?

我认为只有一个
myLineEdit->setStyleSheet(“QLineEdit{border right:none;}”)不起作用。我们需要设置边框样式、边框宽度和边框颜色。这个代码对我有用:

myLineEdit->setStyleSheet( "QLineEdit{ border-width: 1px; border-style: solid; border-color: black white black black; }" );
myPushButton->setStyleSheet( "QAbstractButton{ border-width: 1px; border-style: solid; border-color: black black black white; }" );

您可以在这里看到边框样式部分

我认为只有一个
myLineEdit->setStyleSheet(“QLineEdit{border right:none;}”)不起作用。我们需要设置边框样式、边框宽度和边框颜色。这个代码对我有用:

myLineEdit->setStyleSheet( "QLineEdit{ border-width: 1px; border-style: solid; border-color: black white black black; }" );
myPushButton->setStyleSheet( "QAbstractButton{ border-width: 1px; border-style: solid; border-color: black black black white; }" );
您可以在这里看到边框样式部分

您将看到结果。
也可以看到:边框底部颜色边框底部样式边框底部宽度
我使用qt5.15

您将看到结果。
也可以看到:边框底部颜色边框底部样式边框底部宽度
我使用qt5.15