Results 1 to 4 of 4

Thread: Convert an int to QString

  1. #1
    Join Date
    Apr 2009
    Posts
    87

    Convert an int to QString

    I'd like to insert an integer into a string QString, I tried
    Code:
     QMessageBox:: information (this,
                               "about"
                               "version" + Mn
                               );
    but it does not work, ideas? thank you

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: Convert an int to QString

    Code:
    QVariant tmpAe( listSE->getNode(i)->getData().getAge());
     QString age( tmpAe.toString() );

  3. #3
    Join Date
    Jan 2009
    Posts
    199

    Re: Convert an int to QString

    First you must convert your whole year or char string "x" after you made the addition of former String with x, I do not know if it works on QT but I read on what works on traditional C + +. Check this example :
    Code:
    QString sr;
    int j;
    
    sr.append(QString("%1").arg(j));

  4. #4
    Join Date
    Dec 2008
    Posts
    177

    Re: Convert an int to QString

    Code:
    #include <qlineedit.h>
    #include <qcombobox.h>
    
    ae::ae(QWidget* parent, const char* nm, WFlags fd)
        : Form1(parent,nm,fd)
    {}
    
    ae::~ae()
    {}
    void ae::ae()
    {
    	QString TString;
           	QVariant SLength;
    	QString CString;
    	
    	TString = nameBox->text();
    	SLength = TString.length();
    	CString = SLength.toString();
    	
    	
    	
    }

Similar Threads

  1. How do I convert .DMG to .ISO?
    By xxsniper1522 in forum Windows Software
    Replies: 2
    Last Post: 13-10-2010, 06:47 AM
  2. How to convert ASF to MP4 Mac
    By Computer_Freak in forum Tips & Tweaks
    Replies: 5
    Last Post: 04-03-2010, 03:17 PM
  3. Convert CDR to PSD
    By neonxgenesis in forum Windows Software
    Replies: 3
    Last Post: 30-10-2009, 01:42 PM
  4. Convert rtf to pdf
    By Ebenezer in forum Windows Software
    Replies: 3
    Last Post: 14-05-2009, 12:10 PM
  5. Replies: 1
    Last Post: 26-07-2008, 02:30 AM

Tags for this Thread

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
  •  
Page generated in 1,714,257,432.32342 seconds with 17 queries