qwidget

How to put QPushButton into Qt3DWindow which is in the widget?

て烟熏妆下的殇ゞ 提交于 2021-01-28 04:03:43
问题 I want to have one or more QPushButtons or other widgets on top of Qt3DWidget, but it is invisible. Don't know why. In my mainwindow.cpp I have such code: this->renderer = new Qt3DExtras::Qt3DWindow(); this->renderer->defaultFrameGraph()->setClearColor(QColor(QRgb(0x4d4d41)); this->rendererContainer = QWidget::createWindowContainer(this->renderer); ui->centralWidget->layout()->addWidget(this->rendererContainer); this->shotButton = new QPushButton("Make photo", this->rendererContainer); this-

How to put QPushButton into Qt3DWindow which is in the widget?

霸气de小男生 提交于 2021-01-28 02:41:05
问题 I want to have one or more QPushButtons or other widgets on top of Qt3DWidget, but it is invisible. Don't know why. In my mainwindow.cpp I have such code: this->renderer = new Qt3DExtras::Qt3DWindow(); this->renderer->defaultFrameGraph()->setClearColor(QColor(QRgb(0x4d4d41)); this->rendererContainer = QWidget::createWindowContainer(this->renderer); ui->centralWidget->layout()->addWidget(this->rendererContainer); this->shotButton = new QPushButton("Make photo", this->rendererContainer); this-

How to put QPushButton into Qt3DWindow which is in the widget?

南笙酒味 提交于 2021-01-27 22:43:00
问题 I want to have one or more QPushButtons or other widgets on top of Qt3DWidget, but it is invisible. Don't know why. In my mainwindow.cpp I have such code: this->renderer = new Qt3DExtras::Qt3DWindow(); this->renderer->defaultFrameGraph()->setClearColor(QColor(QRgb(0x4d4d41)); this->rendererContainer = QWidget::createWindowContainer(this->renderer); ui->centralWidget->layout()->addWidget(this->rendererContainer); this->shotButton = new QPushButton("Make photo", this->rendererContainer); this-

Can I create widgets on a non-GUI thread, then send to the GUI?

对着背影说爱祢 提交于 2020-12-12 02:56:29
问题 I have a complex function in my MainWindow class which periodically runs queries and changes attributes and data of the widgets. Since it can take a long time on the main thread, the GUI can appear to freeze. So I created a GUIUpdater class on another thread to do the periodic operation. I based it on the solution here, which shows how to update a QLabel from another thread: Qt - updating main window with second thread But that solution requires defining a connection. With a complex function

How to move the whole window when mouse is on the window's custom widget in Qt?

眉间皱痕 提交于 2020-08-26 10:02:30
问题 Let's say I have a custom widget and add it to the main window in qt. As you can see, the red area is the custom widget. What I want to do is when the mouse is pressed in the red area and moved, the whole window will move as well. I know how to simply implement mousePressEvent and mouseMoveEvent ; but when dealing with a window with the custom widget, I do not know how to move the whole window when mouse is pressed on the custom widget. Also I want to mention that I only want the window

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