QKeyEvents과 같은 소리입니다. 구현의
class MyClass : public QWidget
{
//whatever you want
protected:
//here, override the virtual function keyPressEvent (from QWidget)
void QWidget::keyPressEvent(QKeyEvent* ev)
{
//check for the key(s) you care about and handle the event if needed
//by iterating through lineEditList, asking each QLineEdit* if
//the 'enabled' property is true. When you find the appropriate one,
//set the cursor to that widget.
}
QList<QLineEdit*> lineEditList;
int currentLineEditIndex;
};
구체적인 내용은 물론, 당신에게 달려있을 것이다 :
가장 단순한 구현은 다음과 같이 될 것이다.
매우 명확하지 않습니다. 탭을 사용하여 QLineEdits를 탐색 할 때를 의미합니까? 탭 순서에 따라 처리해야합니다. – Correa
탭이 아닙니다. 화살표 키로 탐색. –
나는 이것을 반대합니다. 운영 체제는 대부분이 기능을 Tab 키와 함께 제공합니다. 이 정보를 추가하면 불필요하게 혼동을 일으킬 수 있습니다. –