Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, December 2007
QCryptographicHash to hex string ?


Message 1 in thread

I have a QCryptographicHash and I want to generate a
QString containing a hex representation of the
QByteArray returned by the result() method.

Can someone suggest how that can be done ? I can't
see a straightforward method at present.

-- 
 [ signature omitted ] 

Message 2 in thread

http://doc.trolltech.com/4.3/qbytearray.html#toHex

this should do what you want.

Rich.


On 12/16/07, Stephen Collyer <scollyer@xxxxxxxxxxxxxxxx> wrote:
> I have a QCryptographicHash and I want to generate a
> QString containing a hex representation of the
> QByteArray returned by the result() method.
>
> Can someone suggest how that can be done ? I can't
> see a straightforward method at present.
>
> --
> Regards
>
> Steve Collyer
> Netspinner Ltd
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>

--
 [ signature omitted ] 

Message 3 in thread

richmoore44@xxxxxxxxx wrote:
> http://doc.trolltech.com/4.3/qbytearray.html#toHex
> 
> this should do what you want.
> 
> Rich.

Thanks. I finally ended up with:

QString hex_result(digest.result().toHex().constData());

which seems a bit verbose. Can it be done more simply ?

-- 
 [ signature omitted ] 

Message 4 in thread

Hi,

> Thanks. I finally ended up with:
> 
> QString hex_result(digest.result().toHex().constData());
> 
> which seems a bit verbose. Can it be done more simply ?

Doesn't the following work for you?
QString hex_result(digest.result().toHex());

This uses the following QString constructor:
http://doc.trolltech.com/4.3/qstring.html#QString-8

-- 
 [ signature omitted ] 

Message 5 in thread

Dimitri wrote:

> Doesn't the following work for you?
> QString hex_result(digest.result().toHex());
> 
> This uses the following QString constructor:
> http://doc.trolltech.com/4.3/qstring.html#QString-8

Thanks. That works fine. I didn't notice that ctor.
There's too many of them.  ;-)

-- 
 [ signature omitted ] 

Message 6 in thread

Stephen Collyer wrote:
> Dimitri wrote:
> 
>> Doesn't the following work for you?
>> QString hex_result(digest.result().toHex());
>>
>> This uses the following QString constructor:
>> http://doc.trolltech.com/4.3/qstring.html#QString-8
> 
> Thanks. That works fine. I didn't notice that ctor.
> There's too many of them.  ;-)

You could also do:

    QString hex_result = digest.result().toHex();

Which looks cleaner.

-- 
 [ signature omitted ] 

Message 7 in thread

Hi All
1.I saw this sample program
http://doc.trolltech.com/3.3/showimg-example.html

I need help how to use this code in eclipse-QT integration. What project do
I open? How do I use it?

Thanks!

 



--
 [ signature omitted ] 

Message 8 in thread

You're looking at the wrong examples, you're working on Qt 4.x (since you use the eclipse integration) but you're looking at Qt 3.3 examples (Qt 3 is no longer supported, it's here for legacy reasons)

Look here instead: http://doc.trolltech.com/4.3/widgets-imageviewer.html

Cheers,
Peter

> -----Ursprüngliche Nachricht-----
> Von: Taly Galor [mailto:taly.galor@xxxxxxxxx] 
> Gesendet: Dienstag, 18. Dezember 2007 10:13
> An: qt-interest@xxxxxxxxxxxxx
> Betreff: Newby question about project
> 
> Hi All
> 1.I saw this sample program
> http://doc.trolltech.com/3.3/showimg-example.html
> 
> I need help how to use this code in eclipse-QT integration. 
> What project do
> I open? How do I use it?
> 
> Thanks!
> 
>  
> 
> 
> 
> --
> To unsubscribe - send a mail to 
> qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the 
> subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
> 
> 

--
 [ signature omitted ] 

Message 9 in thread

Thanks Peter
Do you have any idea how do I take those file and build them in the Eclipse?
I tried to open the files but I am not sure how to build hem under QT

Also there is exe file in the folder. I can open it, but when I try to open
image file, I get message "cannot load........."(file path)

Thanks


-----Original Message-----
From: Peter Prade [mailto:prade@xxxxxxxxxxx] 
Sent: Tuesday, December 18, 2007 3:35 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: AW: Newby question about project

You're looking at the wrong examples, you're working on Qt 4.x (since you
use the eclipse integration) but you're looking at Qt 3.3 examples (Qt 3 is
no longer supported, it's here for legacy reasons)

Look here instead: http://doc.trolltech.com/4.3/widgets-imageviewer.html

Cheers,
Peter

> -----Ursprüngliche Nachricht-----
> Von: Taly Galor [mailto:taly.galor@xxxxxxxxx] 
> Gesendet: Dienstag, 18. Dezember 2007 10:13
> An: qt-interest@xxxxxxxxxxxxx
> Betreff: Newby question about project
> 
> Hi All
> 1.I saw this sample program
> http://doc.trolltech.com/3.3/showimg-example.html
> 
> I need help how to use this code in eclipse-QT integration. 
> What project do
> I open? How do I use it?
> 
> Thanks!
> 
>  
> 
> 
> 
> --
> To unsubscribe - send a mail to 
> qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the 
> subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
> 
> 

--
 [ signature omitted ]