Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

setPlainText argument

Posted on 2010-09-13
1
Medium Priority
?
755 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

722 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