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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:27:13+00:00 2026-05-25T02:27:13+00:00

I use Qt Designer to build my UI layout. On the layout, I have

  • 0

I use Qt Designer to build my UI layout. On the layout, I have a combobox named cb_fac_cd. In my code I have a function that will automatically build a combobox based on the list I’m attempting to build. I have a lot of these lists defined in the database and this function spits out a QComboBox.

Unfortunately, until now I’ve only used this function to add cellWidgets to QTableWidgets. It works perfectly there. Now I want to populate this preexisting combobox.

It seems that a simple
self.ui.cb_fac_cd = makeComboBox('FACILITIES') doesn’t work. I can see that the function returns the QComboBox as usual, but the cb_fac_cd combobox remains unpopulated.

How can I copy or assign the returned combobox to the one build in Qt Designer?

I am using PyQt, but that shouldn’t make any difference.

  • 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-25T02:27:14+00:00Added an answer on May 25, 2026 at 2:27 am

    As far as I know, you cannot replace objects which are part of the .h files generated by Qt’s UIC mechanism (though I cannot confirm that 100% right now).

    What I usually do in such cases is to have an empty layout in the ui file and then do the following:
    (Note that I’m using Qt/C++ syntax as I don’t know the pyqt syntax but I think you will get the idea)

    QComboBox* pNewComboBox = makeComboBox( "FACILITIES" );
    ui.pComboBoxLayout->addWidget( pComboBox );
    

    Additionally, if possible for your program, consider using an enumeration rather than a string for your makeComboBox function. This is usually faster and safer.

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

Sidebar

Related Questions

I have an app that my users use to build objects. For example, they
I use Qt designer to make an interface and I have an QWebView in
Does anybody use the Class Designer much in Visual Studio? I have downloaded the
Is there a XAML designer I can use to build my Silverlight GUI? thanks
I am developing UI for a Wpf application. I have designs build by designer
I've got a control that crashes on the form designer when I build the
We have an online designer that uses Raphael to manipulate SVGs. We're preparing a
can I force the DBML designer to use my custom types instead of the
I'm attempting to use the DataSet designer to create a datatable from a query.
I am a novice designer who could just use HTML to design my own

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.