Solved

setPlainText argument

Posted on 2010-09-13
1
734 Views
Last Modified: 2013-11-23
I have this method witch print that  numbers from loop like that 1,2,3,4,5....etc
I want it to print that AE1,AE2,AE3......etc
how can alter that method i.e in this line text->setPlainText(QString::number(i)); how can I add text I tryed to do that text->setPlainText("AE",QString::number(i)); but i got error
void QtRenderer::electrodes_label(int count_of_electrodes)
{
    for(int i=0 ; i<count_of_electrodes ;i++)
    {
        text = new QGraphicsTextItem(0,scene);
        int x= labelPos_X;
        int y= i*labelPos_Y;
        text->setPos(x,y);
        int num=1;

        text->setPlainText(QString::number(i));
    }

Open in new window

0
Comment
Question by:obad62
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 33668550
Not that I am absolutely sure about what you want to do, but are you thinking along these lines?
QString lbl = "AE";

QString num = QString::number(i);

QString txt = lbl + num;



text->setPlainText(txt);

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now