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

  • Home
  • SEARCH
  • 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 7928407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:43:19+00:00 2026-06-03T19:43:19+00:00

Somehow I feel really silly to ask this question, but I just spent 2

  • 0

Somehow I feel really silly to ask this question, but I just spent 2 hours reading this site and other sources of information, and I only find complicated solutions, while I strongly believe there must be a really simple one for my problem.

In TCL/TK for example, I can define a variable and bind it to a combobox in 2 lines of code. Similarly in Qt/C++, I have an int defined in one of my classes, and I want the QCombobox to set that int to the number (index) of the selected element.

Do I really have to delve in the depths of model/view and its classes to achieve this?

  • 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-03T19:43:20+00:00Added an answer on June 3, 2026 at 7:43 pm

    All you need is a slot somewhere that is connected to the combo box’s currentItemChanged(int) signal. The slot can update your int variable, or do whatever it likes with the selected index. (Look at QComboBox’s other signals, there are alternatives.)

    (That’s one line for the connect, and 1, 2 or 3 lines for the slot depending on how you count that.)

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

Sidebar

Related Questions

I've checked other threads about this subject, but nothing really answers my exact question.
somehow couldn't find this with a google search, but I feel like it has
I started developing ruby lately and I really like it, But I feel somehow
Is it possible to somehow change the look/feel of NetBeans? I know it uses
Somehow, I cannot get this piece of Smarty code to work as required: {assign
Somehow, due to folder renamings and various other source code changes, I'm having an
I am sure there is a good way of solving this, but it's something
I am currently converting a very old, but working classic ASP site to ASP.Net.
I've been trying to troubleshoot this, but can't find a good function that will
Alright, so this is something really basic, and I know that when someone tells

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.