QPushButton* button = new QPushButton("My Button", 0);
button->setFocusPolicy(QWidget::NoFocus);
ps. widget들을 스택에 생성하면 위험합니다.
// Don't do this
void f(QApplication& app)
{
QPushButton button("My Button", 0);
app.setMainWidget(&button);
button.show();
}
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
f(app);
// now the main widget does not exist
return app.exec();
}
그 점선은 현재 포커스를 갖는 버튼임을 나타냅니다. 숨기고 싶다면[c
그 점선은 현재 포커스를 갖는 버튼임을 나타냅니다. 숨기고 싶다면
ps. widget들을 스택에 생성하면 위험합니다.
나중에 부모 개체가 소멸될 때 알아서 해제해 주니 delete는 안해도 됩니다.
댓글 달기