Solved

setPlainText argument

Posted on 2010-09-13
1
737 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hide carret in RichEdit 4 63
Copying WordPress Pages 5 83
Create a path if not exists 7 77
c++, dynamic object by json 1 42
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

778 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