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. using a Qstring from previous widget
QtWS25 Last Chance

using a Qstring from previous widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 384 Views
  • 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.
  • R Offline
    R Offline
    rexter
    wrote on last edited by
    #1

    Hi
    i made a widget that takes names

    QString N1 = ui->Player1name->toPlainText();
    

    and i want to display the name on a label on the new window :
    i put include the previous window then

    ui->Name1->setText(N1);
    

    but i get "use of undeclared identifier"

    pls help thanks

    K Pl45m4P 2 Replies Last reply
    0
    • R rexter

      Hi
      i made a widget that takes names

      QString N1 = ui->Player1name->toPlainText();
      

      and i want to display the name on a label on the new window :
      i put include the previous window then

      ui->Name1->setText(N1);
      

      but i get "use of undeclared identifier"

      pls help thanks

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @rexter

      You need to post some code snippets and the proper error message referring the actual vaiables. Otherwise nobody can help you.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      3
      • C Offline
        C Offline
        CroCo
        wrote on last edited by
        #3

        When you create a new windows, pass your string via the constructor of the new window.

        1 Reply Last reply
        2
        • R rexter

          Hi
          i made a widget that takes names

          QString N1 = ui->Player1name->toPlainText();
          

          and i want to display the name on a label on the new window :
          i put include the previous window then

          ui->Name1->setText(N1);
          

          but i get "use of undeclared identifier"

          pls help thanks

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by
          #4

          @rexter

          Pass it with constructor or use Signals & Slots (you can send out a signal which has a QString with your name as argument)


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          1 Reply Last reply
          2

          • Login

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