qframe

Border color of Qt components

£可爱£侵袭症+ 提交于 2021-02-18 12:11:29
问题 I want to change border color of QFrame component. Also tried with style sheet but no effect at run time. In my project there are various Dialog UI are there which are basically QFrame and i want to change the border color of selected dialog i.e. QFrame border color. Is there any workaround for that in QT. As shown below there are two dialog when any one of selected it's respective frame border color should get changed 回答1: Try this: frame->setObjectName("myObject"); frame->setStyleSheet("

Border color of Qt components

霸气de小男生 提交于 2021-02-18 12:09:30
问题 I want to change border color of QFrame component. Also tried with style sheet but no effect at run time. In my project there are various Dialog UI are there which are basically QFrame and i want to change the border color of selected dialog i.e. QFrame border color. Is there any workaround for that in QT. As shown below there are two dialog when any one of selected it's respective frame border color should get changed 回答1: Try this: frame->setObjectName("myObject"); frame->setStyleSheet("

QFrame round border transparent background

帅比萌擦擦* 提交于 2020-07-19 06:47:04
问题 I'm creating a round context menu using QFrame. To make round corner, I used Qt style sheet. Here is my CSS this->setStyleSheet("QFrame#ShareContextMenu{background-color:rgb(255,255,255); border-width:1px; border-color :rgb(0,0,0); border-radius:10px; border-style:solid;} QPushButton{background-color:rgba(255,255,255,0);} QPushButton::hover{background-color:rgba(125,125,125,50); border-radius:5px;}"); How can I remove the white background marked with red circles in this picture?. Edit: Here

Enable own widget for stylesheet

霸气de小男生 提交于 2019-12-25 01:15:36
问题 I want to enable my own widget class for stylesheets, whereat I am not talking about setStyleSheet(qss) , but selectors in a qss stylesheet. It is understood that I have to replace the "::" with "--" in namespaces. Here ( Qt Stylesheet for custom widget ) I have found a similar question, but it is > 4 years old. Based on the answer I have some detailed questions: a) Is the published approach with an overridden paintEvent still valid (Qt5.6/5.7), from https://stackoverflow.com/a/8817908/356726

Qt - render QFrame with image as background without using WA_TranslucentBackground

依然范特西╮ 提交于 2019-12-24 16:19:15
问题 I need to set a QFrame with a background image: http://imgur.com/RnSghvV. This is what I tried: setAutoFillBackground(true); setWindowFlags(Qt::FramelessWindowHint); setStyleSheet("background: transparent;"); QPalette p = this->palette(); p.setBrush(QPalette::Base, QPixmap("ipad.png")); this->setPalette(p); This is what I am getting: As you can see, there is an annoying black frame along the edges, which I want to remove, and view just the image. How do I do that? P.S, it is possible to make

QFrame with background image and otherwise transparent background

旧时模样 提交于 2019-12-24 03:52:52
问题 I am making a desktop carousel app. There I need to show image widgets, which might contain other sub-widgets as well. For that I am using a QFrame with the required image as background. Here is the image I am trying to use: image link. What I want is that only the image shows up, no background image or anything shows up as well, so to the user it looks like just the image. Here is my code: setGeometry(QRect(100, 20, 325,400)); setFrameStyle(QFrame::StyledPanel); setStyleSheet("QFrame

pyqt: how to put a border frame around a widget

做~自己de王妃 提交于 2019-12-06 16:58:35
问题 I'm making some changes to an existing PyQt project. The UI was created with Qt Designer. The relevant part is a QWidget that displays text. I'm trying to put margins around the text. I'd think the simplest way to do this would be to put a border around the QWidget whose background color is the same as the QWidget's background (white). The QWidget is on a QFrame. I'd like to put a white border inside the QFrame and around the edge of the QWidget. The closest I've come is to put short vertical

QScrollArea not working as expected with QWidget and QVBoxLayout

帅比萌擦擦* 提交于 2019-12-05 11:26:31
So I have this QFrame which is the parent widget (represented by this in the code). In this widget, I want to place a QWidget at 10 px from top (and 10 px from bottom, as a result of which it will have a height of 140px, whereas parent is 160px). The QWidget will have a number of custom buttons inside it in a vertical layout, in a scroll area, so that when the height of the buttons combined exceeds the QWidget's height (140px), scroll sets in automatically. Because the scroll is not for the entire parent widget, but only for a child widget, the scroll should apply only to the child widget here

pyqt: how to put a border frame around a widget

那年仲夏 提交于 2019-12-04 20:58:32
I'm making some changes to an existing PyQt project. The UI was created with Qt Designer. The relevant part is a QWidget that displays text. I'm trying to put margins around the text. I'd think the simplest way to do this would be to put a border around the QWidget whose background color is the same as the QWidget's background (white). The QWidget is on a QFrame. I'd like to put a white border inside the QFrame and around the edge of the QWidget. The closest I've come is to put short vertical and horizontal spacers around the QWidget, but that displays the underlying grey QFrame. I can't