Qt焦点小部件

时间:2014-04-12 20:23:56

标签: qt

QWidget* Lin = new Lin();

QScrollArea* scrollArea = new QScrollArea();
scrollArea->setFrameStyle(0);
scrollArea->setWidget(Lin);

scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
QVBoxLayout * layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->addWidget(scrollArea);

Lin->setFocus();

但是,当我点击鼠标或滚动父窗口小部件时,林会离开焦点;

0 个答案:

没有答案