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 pass the data from dialog box to mainwindow
Forum Updated to NodeBB v4.3 + New Features

How pass the data from dialog box to mainwindow

Scheduled Pinned Locked Moved General and Desktop
14 Posts 3 Posters 7.0k 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
    Pawan Pal
    wrote on last edited by
    #5

    I know Single Slot function. already i used this mechanism ok but its not work

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Pawan Pal
      wrote on last edited by
      #6

      Hi
      This is my code, how to used 'strlen' command. I want display the number of character.

      string str = "Amazon";

      if(!strlen(str.c_str))
      {
      ui->textEdit->setText(str);

      }

      1 Reply Last reply
      0
      • IamSumitI Offline
        IamSumitI Offline
        IamSumit
        wrote on last edited by
        #7

        You should use QString .

        QString str ="Example"

        int len = str.length();

        hope it helps

        Be Cute

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Pawan Pal
          wrote on last edited by
          #8

          Hi Everybody
          how used and compare two string. This is my code.

          void MainWindow::start_cummunication()

          {

          if (!strcmp("!PKS",start_cumm) !=0);

          else
          
              ui->textEdit->setText("Error : Communication
              NotEstabilished");
          

          }

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Pawan Pal
            wrote on last edited by
            #9

            Hi Sumit

            Thanks, for code but its not working, comeing errror.
            I written this code.

             QString str = "loni";
             int length = str.length();
             ui->lineEdit->setText(length);
            

            Error : invalid conversion from 'int' to 'const char*' [-fpermissive]

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andreyc
              wrote on last edited by
              #10

              Try this one
              @
              QString str = “loni”;
              int length = str.length();
              ui->lineEdit->setText(QString("%1").arg(length));
              @

              1 Reply Last reply
              0
              • IamSumitI Offline
                IamSumitI Offline
                IamSumit
                wrote on last edited by
                #11

                Hi Pawam.
                [quote author="Pawan Pal" date="1396583482"]Hi Sumit

                Thanks, for code but its not working, comeing errror.
                I written this code.

                 QString str = "loni";
                 int length = str.length();
                 ui->lineEdit->setText(length);
                

                Error : invalid conversion from 'int' to 'const char*' [-fpermissive]

                [/quote]

                edit your code in one line
                ui->lineEdit->setText(QString::number(length));
                Hope it helps

                Be Cute

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  Pawan Pal
                  wrote on last edited by
                  #12

                  Thanks Sumit

                  Its working

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    Pawan Pal
                    wrote on last edited by
                    #13

                    Thanks andreyc

                    your code is working

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      Pawan Pal
                      wrote on last edited by
                      #14

                      Plz Help me

                      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