Home > Mobile >  How to get in code QSS set color
How to get in code QSS set color

Time:11-21

by QSS set a border color, such as:

 border: 2 px solid red; 


how in CPP code for this color? , I tried some, color and background color these color can be obtained through QPalette, but only border didn't see the corresponding access on the palette, don't know the color of the border and width is which interface to get through?



Is a demo I wrote above, you can place the edit box on the dialog QSS, will refresh qpalette color below, but haven't found that border the corresponding color, I want to border in other interface corresponding color?

CodePudding user response:

A stupid method, obtain the QSS string content, and then the interception border - color corresponds to the content,

CodePudding user response:

Hello, the building Lord, I have a question about ChartCtrl fast display waveform figure, want to consult with you, I use ChartCtrl once every 50 ms drawing curve, timing is the SetTImer function, the OnTimer function with rand generate 1000 random Numbers, and use ClearSeries to clear the original graphics, reoccupy AddPoints to display an array into a curve,
But the program running, too, may have to 1 second to refresh a curve, I don't know where is the problem,

CodePudding user response:

A strange, ask the landlord to have solved, want to consult the original poster
Is considered by the administrator is to infuse water, I am speechless, administrators see from which I am water

CodePudding user response:

Is then solved? How to solve, knot a stick bosses

CodePudding user response:

Can't get so far, QStyleSheetStyle is doing this, but this class is private to the Qt libraries

CodePudding user response:

Qt application custom controls QSS (setStyleSheet) set by the Q_PROPERTY set of properties/
https://blog.csdn.net/senkkes/article/details/50890172

CodePudding user response:

How to solve how to solve

CodePudding user response:

QString s=UI - & gt; Label_23 - & gt; StyleSheet ();
QDebug () & lt;

Print the results
"Border - color: RGB (170, 255, 0);"
  •  Tags:  
  • Qt
  • Related