Remove NumberBox border?

Is there a way to remove the border of the Qt NumberBox or change its alpha values?

You can set the canFocus flag to false to remove the outline of the button. I thought you could use focusColor = … to set the focus color if canFocus is set to true, but it is not working.

Using QPalette seems to work with Color.clear:

p = QPalette();
p.setColor(Color.clear, \window, \active);
p.setColor(Color.clear, \highlight, \active);
q = QPalette();
q.setColor(, \window, \active);
q.setColor(, \highlight, \active);

w = Window("NumberBox Example", Rect(100, 500, 400, 120));
b = NumberBox(w, Rect(150, 10, 100, 20));
c = NumberBox(w, Rect(150, 40, 100, 20));
d = NumberBox(w, Rect(150, 70, 100, 20));

b.palette = p;
c.palette = q;

That works! thanks for bringing QPalette to my attention, that is a hidden little gem :slight_smile: