Questions tagged [qcombobox]

QComboBox is a Qt class that implements a standard combo-box, which is a list of elements that can contract to occupy less screen space, and expand to show all of the options.

In it's "closed" view, the QComboBox displays the current selection. It can also pop-up to show all of the choices, and can as well be user-editable.

QComboBox can be operated dynamically to insert (with insertItem() and insertItems() functions), remove (removeItem()), and clear (clear()) items.

One can also get the current item's index and text.

An example of creating a QComboBox and showing it will look like this:

//creating the combobox with no parent, so it appears in a new window.
QComboBox * b = new QComboBox();
//Inserting 3 elements into it. 
b->insertItems(0, QStringList() << "item1" << "item2" << "item3");
//Showing the ComboBox.
b->show();

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

727 questions
-1
votes
1 answer

PySide QComboBox in QTableWidget (Python)

I have table 5x3 :first cloumn just temp text ,in second column contain combo box and last column is result by choice in combo box. Now just set result into row 1 and i need set result to row for each combo box.(example:if change combo box in row…
Ash
  • 35
  • 8
-1
votes
2 answers

QComboBox::findData() always returns -1

I am trying to get the id of the record in the model from a QCombobox with findData(index), but when select a item, it retunrs -1. It has been working in another project, but this is the second one that doesn't work. Here's my code: modAnfi = new…
-2
votes
1 answer

Selecting a table row, coloring a combobox based on item selection

I have this table, and what I want is a few things: When I click on a cell, I want the entire row from that cell's location to be highlighted,something white-ish, and for some function to be able to get all the values from all the columns for that…
-2
votes
1 answer

How to write regexp which will validate the following strings?

I have tried following regexp in cpp ^((T[X-Z]|R[X-Z])+?)(?:,\\s*|$). It validates only TX. If empty string it should be invalid, it should not accept numbers as well User may enter: TX TX, TY TX, TY, TZ, RX, RY, RZ RX It should be valid in…
-2
votes
2 answers

How to filter text file content using QRegExp?

I have a text file containing these lines: a1 b00 2222 a1 b01 233 a1 b92 34444 a2 b00 2222 a2 b00 3333 a2 b01 3333 I want to read this file and filter the text using QRegExp and fill the result…
Waleed A
  • 95
  • 10
-2
votes
2 answers

QComboBox drop-down list adding unnecessary scroll bar

I'm creating a QComboBox in an app with just 2 items in it. This should appear without a scroll bar, but it seems to be creating the drop-down list very fractionally too small for the information in it, causing it to create a vertical scroll bar. It…
Hugh
  • 726
  • 1
  • 6
  • 25
-3
votes
2 answers

QCombobox enables selection of header (Qtableview)

I am previewing a file in Qtableview and want users to select the column they want to import into a dataframe. this selection is done by listing the column headers in a combobox for easy user selection. somehow I cannot get the list populated, my…
Zoner
  • 37
  • 9
1 2 3
48
49