firstly I'm using MySQL..
I've a table (EmployeeTable ) with fields ( ID, Name,Salary)
what I mean by ( I've stored data in Arabic in my database )
that I've typed some text in Arabic in Name field .. using this code :
query.exec("insert into EmployeeTable(ID,Name,Salary) values (1,'employee_name',300)");
QSqlQuery query;
query.exec("insert into EmployeeTable(ID,Name,Salary) values (1,'employee_name',300)");
To copy to clipboard, switch view to plain text mode
but my employee_name in the above code is in Arabic Langauge like this:
query.exec("insert into EmployeeTable(ID,Name,Salary) values (1,'احمد',300)");
QSqlQuery query;
query.exec("insert into EmployeeTable(ID,Name,Salary) values (1,'احمد',300)");
To copy to clipboard, switch view to plain text mode
the problem is.. when I populate my model with data from database and view it with QTableView it appears in unknown language. see this Code:
model->setTable("EmployeeTable");
model->select();
view->setModel(model);
view->show();
QSqlTableModel* model=new QSqlTableModel;
model->setTable("EmployeeTable");
model->select();
QTableView* view=new QTableView;
view->setModel(model);
view->show();
To copy to clipboard, switch view to plain text mode
hope u got me..
Bookmarks