Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/157.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ QPushButton背景色与边框重叠_C++_Css_Qt_Background Color_Qpushbutton - Fatal编程技术网

C++ QPushButton背景色与边框重叠

C++ QPushButton背景色与边框重叠,c++,css,qt,background-color,qpushbutton,C++,Css,Qt,Background Color,Qpushbutton,我正在使用QPushButton类,并在设置样式表后将对象添加到QGraphicsProxyWidget。但是,当我设置边框半径时,背景色仍然与边框重叠。我怎样才能摆脱这个 示例:(其中levelOneEasyProxy是QGrpahicsProxyWidget) 当前结果: 我发现使用上述代码将设置边框半径,但需要通过使用QPushButton上的setAttribute将背景设置为半透明。这可以通过以下代码完成: qPushButtonObject->setAttribute(Qt::

我正在使用
QPushButton
类,并在设置样式表后将对象添加到
QGraphicsProxyWidget
。但是,当我设置
边框半径时,
背景色仍然与边框重叠。我怎样才能摆脱这个

示例:(其中levelOneEasyProxy是
QGrpahicsProxyWidget

当前结果:


我发现使用上述代码将设置
边框半径
,但需要通过使用
QPushButton
上的
setAttribute
将背景设置为
半透明。这可以通过以下代码完成:

qPushButtonObject->setAttribute(Qt::WA_TranslucentBackground);
这将消除重叠的
背景色

qPushButtonObject->setAttribute(Qt::WA_TranslucentBackground);