Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to set QPlainTextEdit 's text to mapper->currentIndex?
Forum Updated to NodeBB v4.3 + New Features

How to set QPlainTextEdit 's text to mapper->currentIndex?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 639 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Panoss
    wrote on last edited by Panoss
    #1

    I want to convert mapper->currentIndex() to string, in order to put it in a QPlainTextEdit.
    I tried:

    int i = mapper->currentIndex();
    ui.currentIndex_txt->setPlainText(i.toString());
    

    Also:

    QString *i = QString(mapper->currentIndex());
    

    But both fail.
    How should I do it?

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @Panoss Check QString::number

      157

      1 Reply Last reply
      2
      • P Offline
        P Offline
        Panoss
        wrote on last edited by
        #3

        Thanks it works!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved