Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8297515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:26:38+00:00 2026-06-08T15:26:38+00:00

Im a student developer using Qt to build a GUI to help users plot

  • 0

Im a student developer using Qt to build a GUI to help users plot specific columns of data located in multiple files. The feature I’m setting up allows users to select a file using a button in each row. So the button originally would say browse and then user clicks it to open a dialog to select a file then the button text is replaced with the file name selected. Sorry for the story; my simple attempt to add some clarity.

The problem I’m having is I’m not sure how to set a policy up for the button clicked. I’d imagine that I’d have to extend the functionality of each of the QPushButtons but I don’t really know how to do that. So far I am using the following to set the cell widget.

//with row count set dimensions are set becasue column count is static
    //begin bulding custom widgets/QTableWidgetItems into cells
    for(int x = 0; x < ui->tableWidgetPlotLineList->rowCount(); x++)
    {
        for(int y = 0; y < ui->tableWidgetPlotLineList->columnCount(); y++)
        {
            if(y == 1)
            {
                //install button widget for file selection
                QPushButton *fileButton = new QPushButton();
                if(setDataStruct.plotLineListData.at(rowCount).lineFileName != "");
                {
                    fileButton->setText(setDataStruct.plotLineListData.at(rowCount).lineFileName);
                }
                else
                {
                    fileButton->setText("Browse...");
                }
                ui->tableWidgetPlotLineList->setCellWidget(x, y, fileButton);
            }

I was thinking that

connect(ui->tableWidgetPlotLineList->row(x), SIGNAL(fileButton->clicked()), this, SLOT(selectPlotLineFile(x));

might do the trick but I think I’m probably going in the wrong direction here. Honestly I’m not even too sure as to where it would go…

Thanks so much for reading my post. Please let me know if there is anything lacking from this post and I will update it immediately. I’d also like to thank any contributions to this post in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T15:26:40+00:00Added an answer on June 8, 2026 at 3:26 pm
    connect(ui->tableWidgetPlotLineList->row(x), SIGNAL(fileButton->clicked()), this, SLOT(selectPlotLineFile(x));
    

    Is not syntactically correct for a signal/slot connection. Something like this would be more appropriate:

    connect(fileButton, SIGNAL(clicked()), this, SLOT(selectPlotLineFile(x));
    

    …

    If you need access to the specific button that emited the clicked() signal than you could use the sender() function in your slot:

    void selectPlotLineFile() {
        QPushButton *button = dynamic_cast<QPushButton*>( sender() )
    }
    

    Now you may be wondering how you know which row to operate on. There are several different approaches, one of the easier ones being to maintain a QMap<QPushButton*, int> member variable that you can use to lookup which button belongs to which row.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a student programmer using Qt to develop a GUI application. I am
I am student programmer and I am using Qt to develop a GUI interface
Im a student programmer using Qt to develop a GUI for work and I
I am a student programmer using QT to develop and application for work. Currently
I'm a web developer and a college student majoring in telecommunications. This means I'm
I'm currently a student and I aspire to become a great web developer :)
I've spent my professional life as a C# developer. As a student I occasionally
I am starter game developer. And also i am 2nd year student of software
I am a student developer and I have built several installers for the company
I am a part time developer (full time student) and the company I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.