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. Fetch text on array of buttons and set it on textbrwoser when clicked on a button.
Forum Updated to NodeBB v4.3 + New Features

Fetch text on array of buttons and set it on textbrwoser when clicked on a button.

Scheduled Pinned Locked Moved General and Desktop
10 Posts 4 Posters 3.9k 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.
  • I Offline
    I Offline
    imrrk
    wrote on last edited by
    #1

    Hello friends,I have created an array of buttons ,can u tell me how shall i interact with each button,i mean when i click any of the buttons,i shouls be able to open a new window,(the same window)..below is my code how created an array of buttons
    @for(i=0;i<6;i++)
    {
    for(j=1;j<=7;j++)
    {
    cellBut[i][j]=new QPushButton;

    controlsLayout->addWidget(cellBut[i][j], i, j);
    }@

    regards
    imrrk

    1 Reply Last reply
    0
    • C Offline
      C Offline
      CMGeorge
      wrote on last edited by
      #2

      Hi,

      You can use Signal Mapper.
      Take a look at this demo, it can help you: http://doc.qt.nokia.com/qq/qq10-signalmapper.html

      iOS & Qt Developer
      Happy Qt-ing

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vinb
        wrote on last edited by
        #3

        why not just make a loop with a connect in it?

        1 Reply Last reply
        0
        • C Offline
          C Offline
          CMGeorge
          wrote on last edited by
          #4

          Because, i guess, he also want to know which button was pressed, and why to create n SLOT when you can create one, that can handle all buttons?

          iOS & Qt Developer
          Happy Qt-ing

          1 Reply Last reply
          0
          • I Offline
            I Offline
            imrrk
            wrote on last edited by
            #5

            ok thanks i will go through it

            1 Reply Last reply
            0
            • I Offline
              I Offline
              imrrk
              wrote on last edited by
              #6

              hello friends i have done it..

              1 Reply Last reply
              0
              • I Offline
                I Offline
                imrrk
                wrote on last edited by
                #7

                hello friends,how to fecth the text on array of buttons and set it into a textbrowser..

                reagards
                imrrk

                1 Reply Last reply
                0
                • I Offline
                  I Offline
                  imrrk
                  wrote on last edited by
                  #8

                  hello friends,how to fecth the text on array of buttons,suppose i have a grid of buttons with text 1-10 on it,so when i click on a button with 1 as the text,it should be shown on a textbrowser..

                  regards
                  imrrk

                  [merged this here, Tobias]

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    giesbert
                    wrote on last edited by
                    #9

                    connect the signal of the button to a slot of yours and use QPushButton::text()

                    Nokia Certified Qt Specialist.
                    Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                    1 Reply Last reply
                    0
                    • I Offline
                      I Offline
                      imrrk
                      wrote on last edited by
                      #10

                      ok thanks gerolf..

                      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