Home > other >  Qt in the window frame?
Qt in the window frame?

Time:12-02

Each prawn, ask two questions: 1. The QWidget class created by the window, can set the border attribute? , for example, set the border into bold 2. In the constructor call QWidget: : setBackgroundMode () sets the background color mode, no matter what, is set to background is grey, there is no difference, I tried PaletteBase, PaletteDark, PaletteText, PaletteMidlight many properties, such as are grey, I read the document, should be different? There is no way, I have to use FixedColor attributes, and then call QWidget: : setPaletteForegroundColor () to join the background color to succeed, but I just want to set the background color to white, with PaletteBase why not?

CodePudding user response:

Setting with a palette, you can have a look at the palette that class, I think this qt is misleading, has set the background color of function but doesn't work, must use the palette to set,

CodePudding user response:

Border issues, can be set to no borders of the different style such as form, you can see WFlags this setup code a different set of values is as follows: QColorGroup activColorGroup=lisboxPalette. Active (); QColorGroup disableColorGroup=lisboxPalette. Disabled (); QColorGroup inactivColorGroup=lisboxPalette. Inactive (); ActivColorGroup. SetColor (QColorGroup: : Background, Qt: : black); ActivColorGroup. SetColor (QColorGroup: : Foreground, Qt: : red). ActivColorGroup. SetColor (QColorGroup: : Base, Qt: : black); ActivColorGroup. SetColor (QColorGroup: : Text, Qt: : blue); DisableColorGroup. SetColor (QColorGroup: : Background, Qt: : black); DisableColorGroup. SetColor (QColorGroup: : Foreground, Qt: : red). InactivColorGroup. SetColor (QColorGroup: : Background, Qt: : black); InactivColorGroup. SetColor (QColorGroup: : Foreground, Qt: : red). QPalette newPalette (activColorGroup disableColorGroup, inactivColorGroup); This - & gt; SetPalette (newPalette); Of course you can change the color of the other

CodePudding user response:

Thank roy_skyx, background color problem solved, border issues and one more thing: in QT: : WidgetFlags forms can be set to bring a frame model, but did not set the border into bold options, continue to depressed...

CodePudding user response:

Which come of fixcolor!!!!!!
  • Related