You are not logged in.

Search results

Search results 1-20 of 186.

Wednesday, February 8th 2012, 10:09am

Author: crazycoder

Socket communication with TCP client/server sample code

Thank you xizhizhu that tutorial helped a lot.. I could do a TCP communication between 2 computers and send data.. Will add in all the error recovery for the program. I was breaking my head trying so many things but in vain my program had some small problem cud't send data .

Tuesday, April 19th 2011, 11:15am

Author: crazycoder

Sql query model doubt

Hi everyone i am having a small problem , how i can display data from two different tables in a single TableView the code below works fine when i try to display all the columns of data from a single SQL Table. But when i try to display one column from other sql Table into the same TableView it does't display the data. This is what i did to display data from a single Table into the TableView Source code 1 2 3 4 5 6 7 QTableView *tv; tv=new QTableView(); QSqlQueryModel *model = new QSqlQueryModel(...

Thursday, April 7th 2011, 3:22pm

Author: crazycoder

how to decrease Insersion time for sqlite data base

Hello friends i have a small problem, i am inserting some temperature data into data base which i receive from the rs232 interface. As the data base grows the insertion time increases which is a cause of concern in the program.. Cause i might have to save data for some 15 hours in a go some times. I wanted to know if there are any ways by which i can decrease the insertion time . I have around 500 columns in a table, there are two table like that so 1000 columns i am trying to insert. I use a ti...

Friday, February 11th 2011, 6:44am

Author: crazycoder

Make QListWidget Editable

Hello everyone.. i have a small problem, i am using QListWidget to display some data from a data base. I wanted to know how to set the QListWidget to Editable and capture the edited item, so that i can save the edited data back to the database i tried a few things but was not successfull, regards..

Friday, December 31st 2010, 5:34am

Author: crazycoder

set width of a column

Hello some one pls help me with my problem. I am stuck here at this part past 2 days.. Not able to get a solution for it. !! Breaking my head for it. i will be very Thankfull just give me a idea on how to do it.. save 2944 chars in every row of the db.

Thursday, December 30th 2010, 12:08pm

Author: crazycoder

set width of a column

The main reason i am trying to only save 2944 chars in each row of the data base is cause the data which i receive exaactly 2944 chars is one master frame so it would be easy for me to align the data when i am retrieving it back from the db again. .. I tried it this way but i have only one frame saved into the database.. from the second row it is empty. but the first row has exactly 2944 chars. Don know wats wrong here. I have continuous data which is being appended into atdata.. i am calling th...

Thursday, December 30th 2010, 10:34am

Author: crazycoder

set width of a column

Hello someone pls help me out with this problem, i tried every thing to limit the only like 2944 chars into the db table. but not able to do it properly. pls help me out with my problem. .

Thursday, December 30th 2010, 7:24am

Author: crazycoder

set width of a column

Hello i tried it like this but i have a error.. I even declared the column name as varchar(2944); but there is more then 2944 chars of data in each row. Is this the right way to set the column width of each row in the db,. Source code 1 2 3 4 QString sq("INSERT INTO fulldb values(%1, %2)"); sq("SET COLUMN ChannelData WIDTH 2944"); sq = sq.arg(rcount) .arg("'" + newstr + "'"); thank you

Thursday, December 30th 2010, 4:36am

Author: crazycoder

set width of a column

Hello, how can i set the width of a column for sqlite table in qt.. i wanted to set width of the second column to 2944 chars. I saw in the sqlite site on how to set the width but not able to figure out how to bind it to the column i wanted. this is the syntax but how can i use it in my program to set the column width of each row below.. i have never done any thing like this before pls help me out. Quoted sqlite> .width NUM NUM Source code 1 2 3 QString sq("INSERT INTO fulldb values(%1, %2)"); sq...

Wednesday, December 29th 2010, 7:51am

Author: crazycoder

QString resize() not working as anticipated..

Hey friends i tried resize() but it tells in the detailed description that the QString would resize when there is more data.. So it won't do what i am trying to do i guess, the data which i receive is continuous so i think it will resize the QString even if i use the resize() function .. I wanted only push 2944 chars for every row in the db. pls help me out friends,how can i over come this problem.?? Quoted void QString::resize ( int size ) Sets the size of the string to size characters. If size...

Tuesday, December 28th 2010, 5:51pm

Author: crazycoder

QString resize() not working as anticipated..

hello , i tried QString::left , but it does not push 2944 chars at one iteration to the data base,. every row there is diff number of chars in the db.. pls tell me what is the best way i could overcome my problem .. Source code 1 2 3 4 5 6 7 8 9 10 11 12 for(np = pos; np<oldat.size(); np++) { stfram.append(oldat.at(np)); pos++; } newstr.append(stfram.left(2944)); QString sq("INSERT INTO Bulkdb values(%1, %2)"); sq = sq.arg(rcount) .arg("'" + newstr + "'"); m_query.exec(sq); rcount++; newstr.clea...

Tuesday, December 28th 2010, 2:27pm

Author: crazycoder

QString resize() not working as anticipated..

Hello every one,, I am trying to save some data which i receive on rs 232 into the database i am able to do that right now but i was wondering how i could restrict exactly 2944 chars to be save in each row in a db.. Right now i am jus doing this i am receiving data on rs232 and searching for the start of the frame which is 03b702200000 and then i am appending data from there.. How can i only dump 2944 chars every row, cause every 2944 char's is one Master Frame, I tried stfram.resize(2944); but ...

Sunday, December 26th 2010, 5:11pm

Author: crazycoder

QString or any other container for Data manuplation.

hello friends can some one tell me, how to append every row of db to a String with out a break even when there is a row change.. cause the aligning is takes place with a count, when the data from the 1 st row is continued to the 2nd the count is missed.. how can i take all the "data retrieved from the data base as one string" so that there is no problem in aligning the data... , Help me out friends. This is how i am inserting the data into the db.. Source code 1 2 3 4 5 6 QString sq("INSERT INTO...

Sunday, December 26th 2010, 1:22pm

Author: crazycoder

QString or any other container for Data manuplation.

hello sir i think i figured out the problem.. i din clear the buffer before. i am doing that now. But i am having a aligning problem.. when the data is retrieved from from the db everything is fine until the first row ends.. by the time the 2 nd row aligning is taking place the data is getting disrupted.. How can i prevent that this is my sql retreiving query.,. Source code 1 2 3 4 5 6 7 8 9 10 QSqlQuery sq1("SELECT ChannelData FROM Bulkdb"); while(sq1.next()) { rowdata.push_back(sq1.value(0).to...

Sunday, December 26th 2010, 10:10am

Author: crazycoder

QString or any other container for Data manuplation.

Hello every one, I am retrieving continuous data which i am saving in hexadecimal format into the database. which i retrieve back before any manipulation the data has a frame id and 20 channels of data and frame id again and 20 channels of data and so on. I am not sure if i have used the right container. The data to the QString datstr; is push back from the db before to the aligndata() function here. Am i using the wrong container pls tell me what is wrong in my code.. ? Source code 1 2 3 4 5 6 ...

Thursday, December 23rd 2010, 8:37pm

Author: crazycoder

many Column selection from a Sqlite table

i tried many things but nothing seems to work right.. Pls help me out . thank you

Wednesday, December 22nd 2010, 5:39pm

Author: crazycoder

many Column selection from a Sqlite table

hello .. I have a problem with multiple column selection, This is what i am doing to access a single column.. How could i select only the column names i.e( Channels ) which i have selected i have appended the list of selected column names in a QVector.. How can i use the column names from this vector in the query to access only those channel data. " QSqlQuery sq1("select Thermo2 from thdata where rowid = (" + QString::number(rowcnt) + ")");" Instead of a single column Thermo2 i need to pass how ...

Tuesday, December 21st 2010, 10:43am

Author: crazycoder

Problem solved.. :)

Hello i solved the problem. this is what i did.. Source code 1 2 3 4 5 for(int i=0;i< temptagidnames.count(); i++) { QStandardItem *item = new QStandardItem(temptagidnames.at(i)); model->setItem(i, 0, item); } thank you

Tuesday, December 21st 2010, 10:10am

Author: crazycoder

Data duplication in QTableView.

hello friends this is what i did to add data into TableView.. all the data is in the QVector<QString> tempnames; , i am trying to populate the first column.. But the problem is i have only the data in the last position in the Vector is displayed all through out the rows in the QTableView.. example.. if i have the data like name1 , name2 , name3 , name4 ,name5 in the QVector tempnames; only the last name name5 is displayed in all the rows of the first column 5 times.. where am i going wrong pleas...

Tuesday, December 21st 2010, 8:47am

Author: crazycoder

updating QTableView with values

Hello this is what i am doing.. i retrieving the names which i have saved before.. and i intend to display it in real time.. the data continious so i must update the tableView every second or two.. i have the data appended into the two vectors i just need to update them in the first and the second column.. Source code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 QSqlQuery sqpre("select nel_Name,temId from tempchnames"); if(sqpre.exec()) { if (sqpre.first...