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 6132835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:09:08+00:00 2026-05-23T17:09:08+00:00

I have a strange problem when trying to add buttons to a QWidget during

  • 0

I have a strange problem when trying to add buttons to a QWidget during run-time. I have a window with a QTabWidget, and it has 2 tabs. When I press a button on the window it generates an array of check boxes on the first tab.

The problem is, when I have the first tab open, nothing happens when I press the button, but if I open the second tab, press the button, then return to the first tab, the check boxes appear properly. This is a sample from the code that creates the check boxes:

for(int i = 0; i < x_dim; ++i){
    for(int j = 0; j < y_dim; ++j){
        checkBoxVector.append(new QCheckBox( ui->dim1 ));
        checkBoxVector.last()->setGeometry(i * 20, j * 20, 20, 20);
    }
}

Is there some sort of property I have to enable in the QTabWidget for this to work as it should?

  • 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-05-23T17:09:09+00:00Added an answer on May 23, 2026 at 5:09 pm

    You probably need to show() the newly created widget and let the layout update:

    checkBoxVector.last()->show();
    ui->dim1->updateGeometry();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange problem, I am trying to order the output of a
I have a bit of a strange problem. I am trying to send in-app
I have a strange problem with VS2008. My solution has 8 projects (all c#)
i have a strange problem with IE8 installed in xp. i was trying to
Trying this I have found a strange problem: Delete an old file. Create a
I have been trying to solve this strange problem with a website I am
I have a strange problem with my query trying to join 3 tables. The
I'm having a strange problem when trying to run a maven build that uses
I have an extremely strange Problem, while trying to develop for android on eclipse
I have a strange problem. I am trying to update some fields using linq

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.