

SetAttribute(Qt::WA_TranslucentBackground) //Set background transparency To set the window to fillet, you must set the background transparent and borderless ToolTipForm::ToolTipForm(QWidget *parent) : Void setToolTipInfo(QString &strTip) //Set window prompt **********Class function description: prompt box***********/Įxplicit ToolTipForm(QWidget *parent = nullptr) The desired rounded window can be realized without adding. The author's other two parameters are set for the project. SetWindowFlags(Qt::WindowTransparentForInput | Qt::ToolTip | Qt::FramelessWindowHint) //The window is for output only and does not receive any input eventsĪbove, you only need setAttribute(Qt::WA_TranslucentBackground) And QT:: frameleswindowhint. setAttribute(Qt::WA_TranslucentBackground) //Set background transparency The most critical step: you need to add the settings of window untitled bar and background transparency to the constructor of the window class of the prompt tool. The window has black square corners under the fillet.
#QT DIALOG BACKGROUND COLOR UI FULL#
This has not yet reached the full fillet window.

It is written in the previous introduction to qss, and readers can consult it by themselves. The loading of qss files is not mentioned here. It needs to be written in the main function, so that no matter how large the project is, the style of the whole project can be loaded through a qss file. The last step is to load the contents of the qss file into the code. You also need to add a prefix when creating the resource file, and then add the qss file and save it. In this way, more symbols will not be recorded here.Īfter the qss file is written, add it to the resource folder of the project. Of course, you can omit the control type and write #objectname directly. "#" means that the following field is the name of the previous control type. The symbol ">" represents the immediate child part, indicating that there is a parent-child relationship between the two controls. Here is one thing to pay attention to: pay attention to the parent-child relationship between controls. Three controls, QWidget, qframe and qlabel, are set in the style sheet. The object classes of the ui file are as follows: In this example, only one QLabel control is placed because of the prompt. After creating a new file, open the ui file, drag the QFrame control into it, set the QFrame and QWidget to the same size, and then drag the required control into the QFrame. Load the qss file in the project, usually in the main function. Set the transparent and borderless background of the form in the class constructor corresponding to the ui file Ĥ. Create a project, open the ui file, and "platoon Department array" in the ui file (place the QFrame on the QWidget window, place the controls you need on the QFrame, set the QWidget to transparent, set the QFrame to fillet, and set its background color to realize the fillet window) ģ. Without good clipping, just look at the green window. It simply records how the style sheet implements the fillet window.

The following is a window that prompts the tool. You need to drag the control QFrame into the window QWidget, set the QFrame to be the same size as the window QWidget, and drag the control required in the window QWidget into the QFrame.

The window widget cannot be set to fillet directly through the style sheet.
