Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    How I Can change text on the button

    General and Desktop
    2
    11
    1462
    Loading More Posts
    • 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.
    • N
      Nexicoll last edited by

      I have function
      @void RepeatQuestion@
      and when i want to change the text on the button, that don't work. I tried
      @Ui_MainWindow.pushButton->SetText("")@ @Ui_MainWindow->pushButton->SetText("")@ @Ui::MainWindow.pushButton->SetText("")@
      and
      @Ui::MAinWindow->pushButton->SetText("")@

      1 Reply Last reply Reply Quote 0
      • A
        andreyc last edited by

        Could you post MainWindow declaration.

        If you use MainWindow that was created by QtCreator wizard then
        @
        ui->pushButton->setText("Hello");
        @

        1 Reply Last reply Reply Quote 0
        • N
          Nexicoll last edited by

          When i write @ ui->@ i see "ui is not declarate"

          1 Reply Last reply Reply Quote 0
          • A
            andreyc last edited by

            Could you post MainWindow declaration.

            1 Reply Last reply Reply Quote 0
            • N
              Nexicoll last edited by

              http://wklej.to/S7qvO

              1 Reply Last reply Reply Quote 0
              • A
                andreyc last edited by

                There is no MainWindoww include in the source file.
                @
                #include "MainWindoww.h"
                @

                1 Reply Last reply Reply Quote 0
                • N
                  Nexicoll last edited by

                  http://wklej.to/qyZm6

                  1 Reply Last reply Reply Quote 0
                  • A
                    andreyc last edited by

                    void ReWriteQuestion(string files) is not a part of MainWindoww.
                    That is why you are getting "ui is not declared".

                    Add it to the MainWindoww declaration and change the definition accordingly.

                    1 Reply Last reply Reply Quote 0
                    • N
                      Nexicoll last edited by

                      How :( ?

                      1 Reply Last reply Reply Quote 0
                      • A
                        andreyc last edited by

                        @
                        class MainWindoww : public ......
                        {
                        .....
                        void ReWriteQuestion(string files)
                        .....
                        };
                        @

                        @
                        void MainWindoww::ReWriteQuestion(string files)
                        {
                        ......
                        ui->pushButton->setText("C++ rocks");
                        ......
                        }
                        @

                        1 Reply Last reply Reply Quote 0
                        • N
                          Nexicoll last edited by

                          Thank You, mean :)

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post