Sponsored Content
Top Forums Programming Proximity-card reader: no data when app window out of focus Post 302344999 by Dp0H on Tuesday 18th of August 2009 07:39:51 AM
Old 08-18-2009
With the following modification my windowing code gets all the counted signals:
Code:
bool MarinReader::read_port(QFile* file)
{
	static int i = 0;
	emit Message("debug message #" + QString::number(i++));
	char first_char = '\0';
	file->getChar(&first_char);
	if (first_char == ':')
	{
		QByteArray bres = file->readAll();
		QString s(bres);
		s.resize(10);
		emit CardProcessed(s);
	}
	tcflush(file->handle(), TCIOFLUSH);
	return true;
}

Signals CardProcessed and Message are identical, and the destination slots are in the same thread of main window (I can process these signals with the same slot).
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

MSR magnetic stripe card reader

Hi all I am working on MSR110 ...Can anyone plz tell me how to use the configuration commands with magnetic reader???. Please help me out as i have to develop API in C on linux platform.MSR110 is not responding to the configuration commands. Please help... Regards Mahima (0 Replies)
Discussion started by: mahima_er
0 Replies

2. Programming

Hiding app window

I am facing a problem while creating/executing a process in C. I am using old fork/exec mechanism. The problem is: I want to hide the console window of the app i am instantiating. Remember i am instantiating a console application from a GUI application. Is this possible? How? Comments are... (1 Reply)
Discussion started by: amessbee
1 Replies

3. Solaris

Secure Card Reader

I see on some of the recent Sun workstations that there is a secure card reader installed. I have a Sunblade 100 and 150 and would like to know, how do you access this device or turn it on to use it? Thanks, (2 Replies)
Discussion started by: stocksj
2 Replies

4. Shell Programming and Scripting

Bash: Exiting while true loop when terminal is not the focus window

I am running an Ubuntu Gutsy laptop with Advanced Compiz fusion options enabled. I am using xdotool to simulate keyboard input in order to rotate through multiple desktops. I am looking for a way to kill a while true loop when the Enter key (or Control+C if it is easier) is pushed when the... (2 Replies)
Discussion started by: acclaypool
2 Replies

5. Programming

Multithread app - Read-Only Data

Hello, I'm coding an application using pthreads.At some point the threads will read some read-only variables.Is it safe NOT to use mutexes, in order to make the program lighter since mutex operations are resource-demanding... Thanks (1 Reply)
Discussion started by: jonas.gabriel
1 Replies

6. UNIX for Dummies Questions & Answers

grab the data from the unix window

Hi, How could i grab a set of data (eg:file execution start & stop time stamp f) from unix? (1 Reply)
Discussion started by: siriv
1 Replies

7. What is on Your Mind?

CNET News Reader App for the Forums

We are thinking of building a CNET style reader app for reading threads in the forums. One developer suggested we look at a CNN vBulletin app, which I am not familiar with (he said he will post the link tomorrow, Monday). Anyway, I asked the (potential) developer for this app to work with us in... (1 Reply)
Discussion started by: Neo
1 Replies

8. Programming

Building app. to send data to website

Hi. I plan to build an application which takes text data from a user. It then sends this to a website, login required. The business case being this site contains many text fields, mostly redundant to user. My application would only prompt user for necessary text. What language, methods... (4 Replies)
Discussion started by: cic
4 Replies

9. UNIX for Dummies Questions & Answers

How to regain the focus back to the launch window?

Consider this code snippet below:- char=`which afplay` if then xterm -e 'while true; do clear; echo "Press Ctrl-C to Quit..."; afplay /tmp/pulse.wav; done' & > /dev/null 2>&1 fi This launches a second terminal window that generates a specific waveform for the next calibration of... (4 Replies)
Discussion started by: wisecracker
4 Replies
QNetworkOperation(3qt)													    QNetworkOperation(3qt)

NAME
QNetworkOperation - Common operations for network protocols SYNOPSIS
#include <qnetworkprotocol.h> Inherits QObject. Public Members QNetworkOperation ( QNetworkProtocol::Operation operation, const QString & arg0, const QString & arg1, const QString & arg2 ) QNetworkOperation ( QNetworkProtocol::Operation operation, const QByteArray & arg0, const QByteArray & arg1, const QByteArray & arg2 ) ~QNetworkOperation () void setState ( QNetworkProtocol::State state ) void setProtocolDetail ( const QString & detail ) void setErrorCode ( int ec ) void setArg ( int num, const QString & arg ) void setRawArg ( int num, const QByteArray & arg ) QNetworkProtocol::Operation operation () const QNetworkProtocol::State state () const QString arg ( int num ) const QByteArray rawArg ( int num ) const QString protocolDetail () const int errorCode () const void free () DESCRIPTION
The QNetworkOperation class provides common operations for network protocols. An object is created to describe the operation and the current state for each operation that a network protocol should process. For a detailed description of the Qt Network Architecture and how to implement and use network protocols in Qt, see the Qt Network Documentation. See also QNetworkProtocol and Input/Output and Networking. MEMBER FUNCTION DOCUMENTATION
QNetworkOperation::QNetworkOperation ( QNetworkProtocol::Operation operation, const QString & arg0, const QString & arg1, const QString & arg2 ) Constructs a network operation object. operation is the type of the operation, and arg0, arg1 and arg2 are the first three arguments of the operation. The state is initialized to QNetworkProtocol::StWaiting. See also QNetworkProtocol::Operation and QNetworkProtocol::State. QNetworkOperation::QNetworkOperation ( QNetworkProtocol::Operation operation, const QByteArray & arg0, const QByteArray & arg1, const QByteArray & arg2 ) Constructs a network operation object. operation is the type of the operation, and arg0, arg1 and arg2 are the first three raw data arguments of the operation. The state is initialized to QNetworkProtocol::StWaiting. See also QNetworkProtocol::Operation and QNetworkProtocol::State. QNetworkOperation::~QNetworkOperation () Destructor. QString QNetworkOperation::arg ( int num ) const Returns the operation's num-th argument. If this argument was not already set, an empty string is returned. Example: network/networkprotocol/nntp.cpp. int QNetworkOperation::errorCode () const Returns the error code for the last error that occurred. void QNetworkOperation::free () Sets this object to delete itself when it hasn't been used for one second. Because QNetworkOperation pointers are passed around a lot the QNetworkProtocol generally does not have enough knowledge to delete these at the correct time. If a QNetworkProtocol doesn't need an operation any more it will call this function instead. Note: you should never need to call the method yourself. QNetworkProtocol::Operation QNetworkOperation::operation () const Returns the type of the operation. QString QNetworkOperation::protocolDetail () const Returns a detailed error message for the last error. This must have been set using setProtocolDetail(). QByteArray QNetworkOperation::rawArg ( int num ) const Returns the operation's num-th raw data argument. If this argument was not already set, an empty bytearray is returned. void QNetworkOperation::setArg ( int num, const QString & arg ) Sets the network operation's num-th argument to arg. void QNetworkOperation::setErrorCode ( int ec ) Sets the error code to ec. If the operation failed, the protocol should set an error code to describe the error in more detail. If possible, one of the error codes defined in QNetworkProtocol should be used. See also setProtocolDetail() and QNetworkProtocol::Error. void QNetworkOperation::setProtocolDetail ( const QString & detail ) If the operation failed, the error message can be specified as detail. void QNetworkOperation::setRawArg ( int num, const QByteArray & arg ) Sets the network operation's num-th raw data argument to arg. void QNetworkOperation::setState ( QNetworkProtocol::State state ) Sets the state of the operation object. This should be done by the network protocol during processing; at the end it should be set to QNetworkProtocol::StDone or QNetworkProtocol::StFailed, depending on success or failure. See also QNetworkProtocol::State. QNetworkProtocol::State QNetworkOperation::state () const Returns the state of the operation. You can determine whether an operation is still waiting to be processed, is being processed, has been processed successfully, or failed. SEE ALSO
http://doc.trolltech.com/qnetworkoperation.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qnetworkoperation.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QNetworkOperation(3qt)
All times are GMT -4. The time now is 06:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy