Mailinglist Archive: opensuse-programming (148 mails)
| < Previous | Next > |
Displaying an image in the QDataTable::paintField with QLabel. Is it possible?
- From: Prabu Subroto <prabu_subroto@xxxxxxxxx>
- Date: Fri, 24 Sep 2004 06:30:32 -0700 (PDT)
- Message-id: <20040924133032.79451.qmail@xxxxxxxxxxxxxxxxxxxxxxx>
Dear friends....
I am writing a database application with Qt 3.2 and
SuSE 9.1.
Each sales must write a report for the sales
supervisor after the sales call a customer. one of the
field in the report content a smiley (image file) to
represent(describe) the reaction of the customer.
The smiley field has content in the form of ascii art
such as : ":(", ":-)", ":X" etc.
The sales reports are displayed in QDataTable.
But I want the sales supervisor does not see the ascii
art but the corresponded image file which stored in a
subdirectory of my database application.
So my code should change for example ":)" into the
file "1.png".
I want to use this :
void QDataTable::paintField ( QPainter * p, const
QSqlField * field, const QRect & cr, bool selected )
[virtual protected]
I plotted the QDataTable in a UI Form with QtDesigner.
Is it possible to draw an image file into QDataTable
with QLabel instead of QPainter ?
If yes, how?
I have second question, if the form an sql query
(content ascii art like this : ":)" why this code
comes with error ?
QString noapp = noapplineEdit.text(); //nomor
appointment
QString sid = sidlineEdit.text(); //SalesID
QString cid = cidlineEdit.text(); //Customer ID
QString smiley = slineEdit.text(); //Smiley in ascii
art
QString report = rlineEdit.text(); //report dalam
kalimat biasa
QString reportsales = QString (insert into sales
report(nomerappointment, salesid, custid, smiley,
report) values('%1', '%1', '%1', '%1', '%1')
.arg(noapp)
.arg(sid)
.arg(cid)
.arg(smiley)
.arg(report);
In PHP I can use "\" so I make like this : $smiley =
"\:)" but should I do in C++ (Qt)?
Thank you very much in advance.
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
I am writing a database application with Qt 3.2 and
SuSE 9.1.
Each sales must write a report for the sales
supervisor after the sales call a customer. one of the
field in the report content a smiley (image file) to
represent(describe) the reaction of the customer.
The smiley field has content in the form of ascii art
such as : ":(", ":-)", ":X" etc.
The sales reports are displayed in QDataTable.
But I want the sales supervisor does not see the ascii
art but the corresponded image file which stored in a
subdirectory of my database application.
So my code should change for example ":)" into the
file "1.png".
I want to use this :
void QDataTable::paintField ( QPainter * p, const
QSqlField * field, const QRect & cr, bool selected )
[virtual protected]
I plotted the QDataTable in a UI Form with QtDesigner.
Is it possible to draw an image file into QDataTable
with QLabel instead of QPainter ?
If yes, how?
I have second question, if the form an sql query
(content ascii art like this : ":)" why this code
comes with error ?
QString noapp = noapplineEdit.text(); //nomor
appointment
QString sid = sidlineEdit.text(); //SalesID
QString cid = cidlineEdit.text(); //Customer ID
QString smiley = slineEdit.text(); //Smiley in ascii
art
QString report = rlineEdit.text(); //report dalam
kalimat biasa
QString reportsales = QString (insert into sales
report(nomerappointment, salesid, custid, smiley,
report) values('%1', '%1', '%1', '%1', '%1')
.arg(noapp)
.arg(sid)
.arg(cid)
.arg(smiley)
.arg(report);
In PHP I can use "\" so I make like this : $smiley =
"\:)" but should I do in C++ (Qt)?
Thank you very much in advance.
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
| < Previous | Next > |