Results 1 to 3 of 3

Thread: NUll character output for combobox index

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default NUll character output for combobox index

    Whenever I run this bit of code it prints blank characters:

    Qt Code:
    1. void Photo::apertureChanged()
    2. {
    3.  
    4. x = aperture.itemText(0);
    5. QByteArray i = x.toLatin1();
    6. const char *c_str2 = i.data();
    7. printf(c_str2);
    8.  
    9. }
    To copy to clipboard, switch view to plain text mode 

    when really its supposed to print the aperture number of combobox index 0.
    it compiles fine.
    Thanks in Advance
    Last edited by jpn; 5th October 2008 at 13:25. Reason: missing [code] tags

Similar Threads

  1. convert QString to QByteArray
    By morgana in forum Qt Programming
    Replies: 5
    Last Post: 2nd March 2011, 13:33
  2. Read binary file and convert to QString
    By jaca in forum Qt Programming
    Replies: 12
    Last Post: 13th June 2008, 23:05
  3. convert QString to int
    By mattia in forum Newbie
    Replies: 2
    Last Post: 4th January 2008, 09:10
  4. how to convert int to QString?
    By phillip_Qt in forum Newbie
    Replies: 2
    Last Post: 5th October 2007, 08:07
  5. Convert from iso-8859-1 to... Something else :-)
    By Nyphel in forum Qt Programming
    Replies: 4
    Last Post: 7th March 2007, 17:59

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.