high_flyer
i posted a request to the parapin mailinglist during the last discussion:
quote: wallyqt:
Would be nice if somebody more experienced than me
may help to clear some missunderstandings on parapin.
discussion on QT-Centre:
http://www.qtcentre.org/forum/f-qt-p...rface-594.html
quote:parapin-users@lists.sourceforge.net :Al Houston:
**Wally,
********I just read through your thread on Qt-Centre, it looks like you guys
have it figured out correctly by the end of the thread. *The fact this
is working as a console app, but not a Qt app, is important.
********I'm not a Qt programmer, but I have one question: Does Qt mess around
with loading/unloading kernel modules under the hood at all? *If for
some reason it forced an unload of kparapin or parport, you might get
the crash you're seeing on close(). *Seems very unlikely to me, but I
thought I'd mention it.
********I've just gone through the code again -- I can't see any reason why a
gui layer like Qt would have any idea what's going on in a driver, or
have any effect on it.
********This is a strange one... *I probably won't have time to look at this
anymore for the next several days, at least. *Hopefully you guys will
get it figured out by then.
-Al
high_flyer
i did the same stuff with qt4 and at least achieved an readable error:
qtparapinwidgets.cpp:68: error: no matching function for call to ‘QtParapinWidgets::close(int&)’
/usr/include/QtGui/qwidget.h:444: note: candidates are: bool QWidget::close()
cheers wally
when i use the ::close for the general namespace i get the
same crash as with Qt3 :(
any ideas ?
#include <fcntl.h> /* open, fcntl */
#include <sys/ioctl.h> /* ioctl */
#include <stdio.h> /* printf, getchar */
#include <stdlib.h> /* exit */
#include <parapindriver.h> /* parapindriver */
#include <unistd.h> /* close, read, usleep */
#include <iostream>
void QtParapinWidgets::on_pushButtonClose_clicked()
{
qWarning("TODO: %s %d",__FILE__,__LINE__);
if ( m_parapinloaded == true)
{
::close(parapindevice);
m_parapinloaded = false;
// label->setText( "Device Closed" );
}
}
wally
}
Last edited by wallyqt; 19th November 2007 at 13:53. Reason: disabled smilies
Now it works fine! :)
when i also use ::open to open the device
i can ::close and all works as wanted.
parapindevice = ::open("/dev/ppdrv_device", 0);
cheers wally
Last edited by wallyqt; 19th November 2007 at 13:51. Reason: disabled smilies
Bookmarks