Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. qcombobox
    Log in to post

    • UNSOLVED Filtering and sorting on QCompleter
      General and Desktop • qcombobox qcompleter • • Zee_07  

      1
      0
      Votes
      1
      Posts
      40
      Views

      No one has replied

    • UNSOLVED QComboBox and QAbstractSpinBox custom stylesheet affects arrow buttons
      General and Desktop • stylesheet qcombobox gradient qabstractspinbo • • sadeq  

      1
      0
      Votes
      1
      Posts
      69
      Views

      No one has replied

    • UNSOLVED QComboBox with QCompleter: multiple FocusIn event Issue
      General and Desktop • qwidget qcombobox focus issue • • Zee_07  

      1
      0
      Votes
      1
      Posts
      110
      Views

      No one has replied

    • UNSOLVED Settings widget into focus programmatically.
      General and Desktop • qwidget qtreeview qcombobox • • Dariusz  

      9
      0
      Votes
      9
      Posts
      436
      Views

      That article answers quite a few questions I had about that scenario, woah nice thanks! But... I kinda like the idea of more "control"... somehow, creating the widget this way allow the user to resize it which won't be possible using a popup, so I would like to get the focus to work properly... TIA
    • SOLVED QComboBox & QAbstractItemModel - editable/filtering
      General and Desktop • qcombobox qabstractitemmo • • Dariusz  

      3
      0
      Votes
      3
      Posts
      243
      Views

      @SGaist Awesome thanks! I think I can get it to do my bad biding now :- )
    • UNSOLVED Dynamically fit QComboBox popup height to the (dynamically changing) count of items
      General and Desktop • resize qcombobox qlistview item view • • AloyseTech  

      9
      0
      Votes
      9
      Posts
      824
      Views

      @AloyseTech IIRC hidePop() will reset the Popupwidget, so maybe hijack the add/remove process. Call hidePopup before adding are removing item and call showPopup afterwards?
    • UNSOLVED How to make QTableView with QComboBox in one column.
      General and Desktop • c++ qt5 qtableview qcombobox • • arkadiusz97  

      2
      0
      Votes
      2
      Posts
      587
      Views

      What's the problem replacing the QSpinBox with a QComboBox in the example? Did you even try?
    • SOLVED StyleSheet & QComboBox, height trouble
      General and Desktop • qcombobox qstylesheet qabstractitemvi min-height • • J.Hilk  

      10
      0
      Votes
      10
      Posts
      2526
      Views

      @J.Hilk ok then you can follow the suggestion from @mrjj (in case you would have set a custom model you would have need to handle the Qt::SizeHintRole in your data() method) or try to set a QStyledItemDelegate to the view and use your stylesheet.
    • SOLVED Update combobox data from model
      General and Desktop • qcombobox qsqltablemodel • • rudag  

      8
      0
      Votes
      8
      Posts
      1983
      Views

      I did this: ui->comboBox->clear(); ((QSqlTableModel*)ui->comboBox->model())->select(); And it's working!
    • SOLVED QComboBox lineEdit value not inserted in selection list
      General and Desktop • qcombobox extend selectio selection list • • koahnig  

      2
      0
      Votes
      2
      Posts
      588
      Views

      @koahnig Not directly. You have to fake it: bool eventFilter(QObject* watched, QEvent* event) { if( watched == comboBox ) // or watched->inherits("QComboBox") ?? { // you may want to do additional checks here for a generic solution (like the combobox is really editable, it has a insert policy set, etc) switch( event->type() ) { case QEvent::FocusOut: { QKeyEvent keyEvent( QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier ); QCoreApplication::instance()->sendEvent( watched, &keyEvent ); } break; } } return BaseClass::eventFilter(watched,event); }
    • UNSOLVED Signal Not Found for QComboBox
      General and Desktop • qcombobox signal • • SolaVitae  

      3
      0
      Votes
      3
      Posts
      1385
      Views

      Hi @SolaVitae , as suggested by @jsulm you have to delete param name in connect signal, you can keep const & Your connect will be then: connect(charactersBox, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(characterSelectedChange(const QString &)));
    • SOLVED QTabBar with QComboBox
      General and Desktop • qcombobox qtabbar • • tgru  

      6
      0
      Votes
      6
      Posts
      1359
      Views

      Right, that's the best solution if you are using a QTabWidget.
    • SOLVED QCombobox with key and value
      QML and Qt Quick • qml qt quick model qcombobox key and value • • tamlong0205  

      4
      0
      Votes
      4
      Posts
      1350
      Views

      I had create a model with key and value and pass it to qml, it worked!!! Sorry for late reply. Thank you @raven-worx
    • UNSOLVED How to add QComboBox and TextField inside TreeView with delegate QML?
      QML and Qt Quick • qml qcombobox delegate treeview qabstractitemmo • • tamlong0205  

      4
      0
      Votes
      4
      Posts
      2518
      Views

      @tamlong0205 I think most of this can be done from C++ side. You can add a function in the model which can return what type is the data for current index. This function will be called from QML and depending upon its value use a Loader to load the specific delegate. Perhaps setting currentIndex in Component.onCompleted handler ? Create a C++ function which will store in info in the model itself i.e When you change the index in ComboBox call this function and update the value there and may be maintain a role to store this update.
    • UNSOLVED Position of a Qt Combobox dropdown
      General and Desktop • qcombobox qlistview • • sunil.nair  

      10
      0
      Votes
      10
      Posts
      5137
      Views

      I apologise for the delay in response. The question was to make sure that the combobox always pops up in a given direction or position.
    • SOLVED how to add item QComboBox with QVideoFrame::PixelFormat?
      General and Desktop • qcombobox text strange additem pixelformat • • pauledd  

      7
      0
      Votes
      7
      Posts
      1917
      Views

      Ok, thanks a lot! Marked as solved!
    • UNSOLVED QComboBox align text stylesheet?
      General and Desktop • stylesheet qcombobox text align alignment • • pauledd  

      8
      0
      Votes
      8
      Posts
      5658
      Views

      QComboBox {background-color:rgb(190,190,190);color:black;padding-left: 10px;padding-right: 30px;border-style: solid;border-width: 0px;} "padding-left: 10px;" the padding will shift the combo-box displayed content form the left edge QComboBox::drop-down {subcontrol-origin: padding; subcontrol-position: top right;width: 40px;border: 0px ;} "subcontrol-position: top right;" and the above will position wot text to the right. Hopefully this helps.
    • UNSOLVED QComboBox with transparent dropdown
      General and Desktop • qt5 stylesheet qcombobox css drop-down • • Sebbo  

      5
      0
      Votes
      5
      Posts
      2945
      Views

      @VRonin With the provided code the whole dropdown list will be invisible. Do you know how to keep the items unaffected?
    • UNSOLVED Program crashes when calling QComboBox::clear() on a non-empty Combo Box
      General and Desktop • qcombobox crash qcombobox crash • • PurityLake  

      9
      0
      Votes
      9
      Posts
      3096
      Views

      @mrjj said: this->ui->personComboBox then pointer must be corrupt?
    • SOLVED QComboxBox different sizes for button and popup
      General and Desktop • qcombobox • • pablolito  

      12
      0
      Votes
      12
      Posts
      3758
      Views

      @raven-worx Thanks a lot ! This does exactly what I want !
    • Custom QWidgetAction To Differ on Vertical QToolBar and/or Different QToolButton Styles
      General and Desktop • qcombobox qtoolbar style qtoolbutton qwidgetaction • • Erika  

      3
      0
      Votes
      3
      Posts
      1055
      Views

      @SGaist Thanks. That's definitely another option. I suppose these approaches are as good as it gets for having a toolbar item auto-adjust to horizontal vs. vertical. Thanks again.
    • UNSOLVED QComboBox long item text breaks layout
      General and Desktop • qcombobox qscrollarea qformlayout • • the_  

      4
      0
      Votes
      4
      Posts
      2286
      Views

      @Rondog I was already thinking of setting the maximum width for each combobox but when creating the comboboxes I dont know the width of the scrollareas viewport. @SGaist Will try that, seems to be the more nice solution :) Thanks
    • UNSOLVED Qt5.6: How to disable the QComboBox's Up/Down arrows and show all items?
      General and Desktop • qcombobox • • cgripeos  

      2
      0
      Votes
      2
      Posts
      2052
      Views

      Solution that works for me is to call unpolish and polish on combo box: auto cb = new QComboBox(this); cb->setItemDelegate( new QStyledItemDelegate); style()->unpolish(cb); style()->polish(cb);
    • UNSOLVED How to sub stylesheet ?
      General and Desktop • stylesheet qcombobox qlistview qstyle qcheckbox • • _compiler  

      5
      0
      Votes
      5
      Posts
      1903
      Views

      @_compiler said: thanks.
    • SOLVED QCombobox with clearEditText ()
      General and Desktop • qcombobox clearedittext • • gabor53  

      3
      0
      Votes
      3
      Posts
      818
      Views

      @elveatles Thank you. You were right.
    • UNSOLVED Exiting QComboBox and reading content
      General and Desktop • qcombobox • • gabor53  

      4
      0
      Votes
      4
      Posts
      1044
      Views

      Hi, Isn't QComboBox::activated what you are looking for ?
    • UNSOLVED Differend ID-column and display-column in QCombobox
      General and Desktop • qcombobox • • Mr. Kibu  

      8
      0
      Votes
      8
      Posts
      2160
      Views

      It shouldn't belong to the Purchase table. That table should only contain items whether they come from a store or somewhere else is not something that that table should handle.
    • [Solved] Check if value is part of the list in qcombobox
      General and Desktop • qcombobox • • Mr. Kibu  

      5
      0
      Votes
      5
      Posts
      6939
      Views

      Thank you to the_ and SGaist! I realised it like the_ explained. In my case it is the easiest way and it works (in a combobox with a list of values from a related table, I want to know if the entered string is part of the list and if not (index = -1) I open a dialog to add a new value in the related table). But I admit, QCompleter is also a smart solution. Maybe in the future...
    • QCombobox scrolling in touchscreen device
      General and Desktop • qcombobox scroll touch screen • • marlenet15  

      5
      0
      Votes
      5
      Posts
      3346
      Views

      I solve it I use the same thing ui->comboBox->view()->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); if there is a better solution please post it Thanks
    • SOLVED QComboBox with icons but no text - how?
      General and Desktop • qcombobox qicon align • • wavelike  

      6
      0
      Votes
      6
      Posts
      4117
      Views

      @wavelike said: don't they use QComboBox-like widgets to offer different colors, brush thickness etc? Hm, I guess that's true, but I'd say it has more to do with QMenus and QToolButtons than QComboBox. But then again they are indeed similar in some ways. Oh well, the important thing is it's doable and quite easy ;)
    • UNSOLVED How can I pass data of QComboBox between classes?
      General and Desktop • qcombobox qt 4.8.5 • • roseicollis  

      6
      0
      Votes
      6
      Posts
      1787
      Views

      Yes, it's clearer. In that case I'd create a subclass of QComboBox with a property that would return content of data.
    • SOLVED Populating a QcomboBox using lines from a file
      General and Desktop • qcombobox • • gabor53  

      6
      0
      Votes
      6
      Posts
      3547
      Views

      Thank you it worked.
    • QComboBox with QAbstractItemModel, default text problem
      General and Desktop • qcombobox qabstractitemmo • • applefier  

      4
      0
      Votes
      4
      Posts
      1944
      Views

      @SGaist I have found out that I can use setEditText(const QString &) to specify the default display text, like "-- Choose --". But, this works only with editable QComboBox widgets, which I wouldn't want to do. Besides, why is my non-editable QComboBox displaying a seemingly arbitrary string that has nothing to do with the provided index? Again, it is only the display text I am talking about, while the selectable items - the contents of the ComboBox - are perfectly fine. How does this work to begin with? I have read the documentation on QComboBox numerous times and found nothing.
    • Get the row-Index in a model
      General and Desktop • model qcombobox • • Mr. Kibu  

      2
      0
      Votes
      2
      Posts
      2018
      Views

      I have solved my problem in this way: First I have changed the modelColumn to the Column with the key-value in the second combobox: ui->cbCostCenterGr->setModelColumn(0); Then I fetch the key-value for the second combobox from the first combobox... QModelIndex id = ui->cbCostCenter->model()->index(index, 2); QString _CcGr = id.data().toString(); ...and search the value in the second combobox: ui->cbCostCenterGr->setCurrentIndex(ui->cbCostCenterGr->findText(_CcGr)); At least I change the modelColumn of the second combobox to the column with the text (to display the text and not the key-value): ui->cbCostCenterGr->setModelColumn(1); Here is the hole function: void VoucherPosForm::on_cbCostCenter_activated(int index) { ui->cbCostCenterGr->setModelColumn(0); QModelIndex id = ui->cbCostCenter->model()->index(index, 2);//"2" is the key-column QString _CcGr = id.data().toString(); ui->cbCostCenterGr->setCurrentIndex(ui->cbCostCenterGr->findText(_CcGr)); ui->cbCostCenterGr->setModelColumn(1); } It works fine, but is there a straighter way??
    • Using QComboBox with QSqlQueryModel
      General and Desktop • c++ qt4 qcombobox model-view item qsqlquerymodel data • • Aleksey_K  

      2
      0
      Votes
      2
      Posts
      1696
      Views

      Yeah, according to QComboBox code should work: QVariant QComboBox::itemData(int index, int role) const { Q_D(const QComboBox); QModelIndex mi = d->model->index(index, d->modelColumn, d->root); return d->model->data(mi, role); } Will implement this.
    • Non-editable QComboBox text alignment
      General and Desktop • qcombobox align • • FrankE  

      2
      0
      Votes
      2
      Posts
      1769
      Views

      HI and welcome to devnet, I think you should try to write your own QStyle
    • QComboBox in QTableView Problem
      General and Desktop • qt5.5 qcombobox column table qrelationaltabl • • Maxim DC  

      2
      0
      Votes
      2
      Posts
      926
      Views

      Hi, Something like show in the relational table model example ?
    • Historic QComboBox with QStringListModel
      General and Desktop • qcombobox model-view subclassing • • ssenegas  

      1
      0
      Votes
      1
      Posts
      1051
      Views

      No one has replied

    • [SOLVED] Multiple QCombobox signal/slot connection
      General and Desktop • signal & slot qcombobox • • navap  

      3
      0
      Votes
      3
      Posts
      1642
      Views

      Thanks a lot mrjj!!!! This really worked for me!!!