Solved

setPlainText argument

Posted on 2010-09-13
1
732 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

772 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

12 Experts available now in Live!

Get 1:1 Help Now