15,905,325 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by XamBEE (Top 54 by date)
XamBEE
4-Aug-16 3:25am
View
This is the method of writing text into CSV file.
XamBEE
4-Aug-16 3:22am
View
<html>
<script type="text/javascript">
function createCSV() {
csvRows = [["label first","details of label 1"],["label sec","details of label 2"],["label 3","details of label 3"],["label 4","details of label 4 and 3"],["label 5","details of label 5"],["label 6","details of label 6"],["label 7","details of label 7"],["label 8","details of label 8"],["label 9","details of label 9"]];
var csvString = csvRows.join("%0A");
var a = document.createElement('a');
a.href = 'data:attachment/csv,' + csvString;
a.target = '_blank';
a.download = 'myFile.csv';
document.body.appendChild(a);
a.click();
}
</script>
<body>
<form action="" method="post">
<input type="button" value="Create" >
</form>
</body>
</html>
XamBEE
4-Aug-16 3:21am
View
Deleted
<html>
<script type="text/javascript">
function createCSV() {
csvRows = [["label first","details of label 1"],["label sec","details of label 2"],["label 3","details of label 3"],["label 4","details of label 4 and 3"],["label 5","details of label 5"],["label 6","details of label 6"],["label 7","details of label 7"],["label 8","details of label 8"],["label 9","details of label 9"]];
var csvString = csvRows.join("%0A");
var a = document.createElement('a');
a.href = 'data:attachment/csv,' + csvString;
a.target = '_blank';
a.download = 'myFile.csv';
document.body.appendChild(a);
a.click();
}
</script>
<body>
<form action="" method="post">
<input type="button" value="Create" >
</form>
</body>
</html>
XamBEE
4-Aug-16 3:20am
View
Deleted
<html>
<script type="text/javascript">
function createCSV() {
csvRows = [["label first","details of label 1"],["label sec","details of label 2"],["label 3","details of label 3"],["label 4","details of label 4 and 3"],["label 5","details of label 5"],["label 6","details of label 6"],["label 7","details of label 7"],["label 8","details of label 8"],["label 9","details of label 9"]];
var csvString = csvRows.join("%0A");
var a = document.createElement('a');
a.href = 'data:attachment/csv,' + csvString;
a.target = '_blank';
a.download = 'myFile.csv';
document.body.appendChild(a);
a.click();
}
</script>
<body>
<form action="" method="post">
<input type="button" value="Create" >
</form>
</body>
</html>
XamBEE
29-Jul-16 5:04am
View
I did not get you solution unfortunately because I dont know much about batch file. Would be nice if you elaborate it bit more.
I also rephrased my question..
XamBEE
24-Jun-16 12:39pm
View
thanks
XamBEE
21-Jun-16 10:03am
View
I just added the sample function of reading file. would be nice if you can tell me how to add line pointer.
XamBEE
21-Jun-16 8:23am
View
Can you explain first options a bit. I dont know exactly how?
XamBEE
21-Jun-16 7:39am
View
BUT i want to avoid to read lines (n-1) to goto line n
XamBEE
9-Mar-16 7:04am
View
No matching function for call to 'QString::toLocal8Bit(const QString&)'
Error Line :: file = fopen(QString::toLocal8Bit(fileName).data(), "w+");
XamBEE
9-Mar-16 6:44am
View
would be nice if you add comments what you are doing each line. I didnt get it fully
Thanks for help, I appreciate it.
XamBEE
9-Mar-16 4:44am
View
If i have 2 classes(Class A, Class B). I want to access Class A variable into class B.
--------
ClassA.h
--------
Public:
int TestVariable= 21;
ClassB.cpp
---------
classB::function(){
cout<<ObjClassB.TestVariable<<endl; //want to display/update public variable of classA here.
}
I know this is wrong but dont know how to do this??
XamBEE
8-Mar-16 10:06am
View
I am trying to execute your example class. it gives me following errors.
1: Invalid use of destructor '~TempFile' as type
XamBEE
8-Mar-16 9:39am
View
error:: Expected class name before ´{´ token
in following line -> class TempFile : public {
XamBEE
8-Mar-16 8:01am
View
This is how i am trying to read from MainWindow thread T1?
//Thread T1 open the file read 100 Bytes and close the file. Than Thread-2 open and write new data.
//buffer of 100 bytes
char readBuffer[100];
bool fileopned= Tempfile::open(file);
if(fileopned==true){
//read as many as 100 Bytes from Temp file
Tempfile::Read(readBuffer, 100);
}
Tempfile::close();
XamBEE
8-Mar-16 7:08am
View
What would be the parameters of read(). While calling from MainWindow?
SEEK_SET would be the the last position to write?
XamBEE
8-Mar-16 4:49am
View
OK, and file name would be auto generated??
file = tmpfile();
while reading this file from second thread T2. how one can get the file name(in Thread T2)??
Writing Tempfile(f1)from Thread T1
Reading Tempfile(f1)from Thread T2
XamBEE
8-Mar-16 3:56am
View
is this the correct way to write into the tamp file??
//from Thread-1 class i want to write into the Temp file.
const char* Cardata[] = {"Blue car", "brown", "1996"};
bool fileopned= Tempfile::open(file);
if(fileopned==true){
Tempfile::write(Cardata,size);
}
Tempfile::close();
XamBEE
3-Mar-16 7:59am
View
would be nice if you can guide that how to read data from Temporary file using QTemporaryFile. How one can get the address/access of the Temporary file??
If data is e.g
aa, bbb, 123, d,
bb, ddd, 456, e,
i want to read data Qoma(,) separately
XamBEE
3-Mar-16 6:09am
View
Thanks for your help. I have one question that what about QTemporaryFile class?? Do you think it would difficult with QTemporaryFile class?
XamBEE
19-Feb-16 7:51am
View
i am already replacing characters separately. But i am asking to replace all at once??
XamBEE
12-Feb-16 11:51am
View
getting error ":: may not appear in macro parameter list"
# define DISPLAY_GRAPH_EV (QEvent::User + 1)
XamBEE
12-Feb-16 11:03am
View
Thanks . would be nice if you elaborate first line.
"(QEvent::User + 1)".
XamBEE
21-Jan-16 5:03am
View
how one can initialize all members of struct? if i want to initialize all integer members with zero.
XamBEE
21-Jan-16 3:45am
View
AS usual Thanks!!
XamBEE
20-Jan-16 12:48pm
View
just trying to check the value
std::cout << WorkerThreadClass::WorkerThreadStr.SyncTimeMilliSec << "\n";
XamBEE
19-Jan-16 10:31am
View
Sorry I know my question is very stupid but i dont know so i am asking..
I am Using QT Creator. When i run program I get only the default argument argv[0] because I am not running the program from command line
XamBEE
19-Jan-16 10:13am
View
How i can pass the file name as argument to main function?
XamBEE
18-Jan-16 12:24pm
View
Thanks
XamBEE
18-Jan-16 10:57am
View
you means initial path would be something like below..
QDir dir("C:\Users\userXAM\MyProjects\ProjectB\LogFiles");
and the rest would be.....
LFName= dir.relativeFilePath("Logfile_P_1.txt");
QFile logfile(sdir);
QFile logfile(LFName);
if (!logfile.open(QIODevice::ReadOnly | QIODevice::Text))
{
qDebug()<<"File not found";
return false;
}
qDebug()<<"File Found";
XamBEE
18-Jan-16 10:39am
View
Deleted
why you are using full file path??
LFName= dir.relativeFilePath("C:/MyDevelopment/MyProjects/ProjectB/LogFiles/Logfile_P_1.txt");
I mainly want to avoid this.
XamBEE
18-Dec-15 16:31pm
View
Deleted
qDebug()<<TimeInMilliSeconds;
Print Result is=1.77195e+07
XamBEE
18-Dec-15 16:29pm
View
qDebug()<<TimeInMilliSeconds;
Result is:=1.77195e+07
XamBEE
18-Dec-15 12:11pm
View
while i am reading from .txt file this value(123789456.785) is in QStringList. I want to convert it to Double.
XamBEE
17-Dec-15 10:08am
View
Still issue is there
when first byte is in range between 00-7F its correct but when its > 7F than output is FFFFFF80 ....
XamBEE
17-Dec-15 10:05am
View
Deleted
Nothings changed
still FFFFFF80 00 00 00 00 00 00 00
XamBEE
17-Dec-15 9:52am
View
when QByteArray qba = 8000000000000000
output in .txt file is as following.
FFFFFF80 00 00 00 00 00 00 00 //first byte with three extra bytes.
XamBEE
17-Dec-15 9:19am
View
I get your point but i am not writing a file the method you mentioned.
here is my sample code......
void writefile(QString Filename)
{
QFile mFile(Filename);
if(!mFile.open(QFile::WriteOnly | QFile::Text))
{ qDebug() << "Not open file";
return;}
QTextStream mylog(&mFile);
mylog <<" "<< currtTimeStump ","<<"MsgDLC << ","<< frameID << ","<< Data << '\n';
mFile.close();
}
//Data contain QBYTEArray. which i want to make easily readable
XamBEE
17-Dec-15 7:53am
View
I am not reading it from the file. Actually i want to write into the file with spaces. so before writing into the file QByteArray qba = AABBCCDDEEFF9988.
here is one line of my txt file.
13:33:44:095, 10826196, 1, 0x701, 7faabbccddeeff66
I want to write something like
13:33:44:095, 10826196, 1, 0x701, 7f aa bb cc dd ee ff 66
XamBEE
17-Dec-15 7:43am
View
how to add space ?
yes i want to add spaces
To make is easy to read as programmer
XamBEE
15-Dec-15 6:45am
View
YES its totally wrong.
I am reading String myStr1 = "7f00000000000000"; from txt file. and after removing all trailing zeros. Quint64 strdata= 7f.
your proposed solution is the smartest solution i think and working as well giving me output EXACTLY what i am looking for BUT didnt get fully how its working. would be nice if you explain it bit.
XamBEE
15-Dec-15 6:13am
View
quint64 val = 0x7b00000000440088;
for (int i = 0; i < 8; i++)
{
qbaa[i] = static_cast<char>(val & 0xFF);
if(qbaa.toHex()[i]!=0)
{
fieldArr.append(qbaa.toHex()[i]);
}
val >>= 8;
}
XamBEE
15-Dec-15 5:25am
View
I just want to remove all trailling zero.
Hexadecimal 4 Byte = 0x7f000000.
i want 0x7f for my application
XamBEE
14-Dec-15 9:53am
View
To access the byte at a particular index position of 8 byte data [00 ff 22 ff 55 00 11 88]
qDebug()<<qba.toHex()[0];
return 8 not 88
how i can get full byte data?
XamBEE
11-Dec-15 10:43am
View
QByteArray qba((const char *)msg.DATA, sizeof(msg.DATA));
qDebug()<<qba.data();
output is in Unicode characters something like....
C
D
E
F
G
XamBEE
11-Dec-15 10:37am
View
Thanks,
would be nice if you can elaborate it for clarification.
XamBEE
11-Dec-15 10:28am
View
What does this error message mean?
Call of overloaded function 'QByteArray(BYTE[8], unsigned int)' is ambguous
XamBEE
11-Dec-15 10:04am
View
DATA is not string its 8 Byte
typedef struct
{
DWORD ID;
canMSGTYPE MSGTYPE;
BYTE LEN;
BYTE DATA[8];
} CANMsg;
XamBEE
11-Dec-15 10:01am
View
Input is not string its 8 Byte data
typedef struct
{
DWORD ID;
canMSGTYPE MSGTYPE;
BYTE LEN;
BYTE DATA[8];
} CANMsg;
DeviceMsg.DATA is 8 Byte not QString
XamBEE
3-Dec-15 10:48am
View
but how i can pass the filename string when my signal is started()
connect(workerThread, SIGNAL(started()), worker, SLOT(processCounter()));
i need the filename in the beginning of the thread.
XamBEE
1-Dec-15 11:32am
View
I get the idea now. Thanks for your valuable comment.
XamBEE
25-Nov-15 5:30am
View
I am reading the file which has 4 columns. i am trying to split them with , and use them further....
what would be the better way to improve this type of situation?
XamBEE
23-Nov-15 4:15am
View
Thanks
XamBEE
18-Nov-15 6:53am
View
its
class Mainwindow:public QMainWindow
{
public:
void mytesfunctioncall();
}
in mainwindow.h file
Show More