|
From: Tatsuro M. <tma...@ya...> - 2014-06-24 09:32:40
|
----- Original Message ----- > From: sfeam > To: gnuplot-beta Tatsuro MATSUOKA> > Date: 2014/6/24, Tue 13:12 > Subject: Re: How to get key information from qt terminal to gnuplot > > On Tuesday, 24 June 2014 12:15:07 PM Tatsuro MATSUOKA wrote: > >> > It partially work. Key input reflected in the plot window. >> > However, <del>, <bs> and <esc> work but <tab> > does not >> > work. > > The <tab> key is not normally available to Qt apps, with some exceptions > like text-entry widgets. It is trapped by the Qt top layer and normally > interpreted as a request to switch focus to the next Qt widget. > I suppose this made sense when Qt was mostly being > used as a phone O/S but it's really annoying on the desktop. > The closest I could find to a clue how to work around this was this > thread: > > http://stackoverflow.com/questions/18160051/intercepting-tab-key-press-to-manage-focus-switching-manually > > I did not try to add this to gnuplot, however, so I don't > know whether it would work for us or not. > > Ethan Thank you for the pointer. According to the first answer on the web page above, I added QWidget::setFocusPolicy( Qt::NoFocus); //trial to the top of void QtGnuplotScene::keyPressEvent(QKeyEvent* event) in QtGnuplotWidget.cpp. I have met the error: QtGnuplotScene.cpp:881:38: error: cannot call member function 'void QWidget::setFocusPolicy(Qt::FocusPolicy)' without object I do not have enough knowldege for C++ so that I cannot understand what the error message means. I should make a mistake but I cannot find out what am I wrong. Sorry for my ignorance for this matter. Tatsuro |