Виталий АнтиповOct. 5, 2017, 12:08 a.m.
Добавление строки в Combobox
Здравствуйте! Подскажите, как добавить пустую строку в Combobox?
ComboBox { id: combo_ceh property string id: "" currentIndex: -1 anchors.top: tf_kks.bottom anchors.topMargin: 5 anchors.left: text_ceh.right anchors.leftMargin: 5 Material.accent: Material.LightBlue model: model_ceh textRole: 'Cehname' onCurrentTextChanged: { if(currentIndex==-1){ combo_ceh.id = "" } else { combo_ceh.id = model_ceh.getId(currentIndex) } } }
We recommend hosting TIMEWEB
Stable hosting, on which the social network EVILEG is located. For projects on Django we recommend VDS hosting.Do you like it? Share on social networks!
d
- dsfs
- April 26, 2024, 2:56 p.m.
C ++ - Test 004. Pointers, Arrays and Loops
- Result:80points,
- Rating points4
d
- dsfs
- April 26, 2024, 2:35 p.m.
C++ - Test 001. The first program and data types
- Result:73points,
- Rating points1
Last comments
Qt Linux - Lesson 001. Autorun Qt application under Linux как сделать автозапуск для флэтпака, который не даёт создавать файлы в ~/.config - вот это вопрос ))
АК
Qt WinAPI - Lesson 007. Working with ICMP Ping in Qt Без строки #include <QRegularExpressionValidator> в заголовочном файле не работает валидатор.
Анатолий КононенкоFeb. 5, 2024, 12:50 p.m.
EVADec. 25, 2023, 9:30 p.m.
Boost - static linking in CMake project under Windows Сделал всё по-как у вас, но выдаёт ошибку [build] LINK : fatal error LNK1104: не удается открыть файл "libboost_locale-vc142-mt-gd-x64-1_74.lib" Хоть убей, не могу понять в чём дел…
Qt/C++ - Lesson 056. Connecting the Boost library in Qt for MinGW and MSVC compilers Для решения твой проблемы добавь в файл .pro строчку "LIBS += -lws2_32" она решит проблему , лично мне помогло.
Now discuss on the forum
добавить qlineseries в функции Всем доброго времени суток! Товарищи, помогите, юному падавану обуздать QChart, уже неделю пытаюсь сам решить проблему, в интернете подходящих статей не нашел:) Проблема в следующем:…
Best Indian Food Restaurant In Cincinnati OH Ready to embark on a gastronomic journey like no other? Join us at App india restaurant and discover why we're renowned as the Best Indian Food Restaurant In Cincinnati OH . Whether y…
Evgenii LegotckoiMay 3, 2024, 12:07 a.m.
IscanderCheApril 30, 2024, 2:22 p.m.
Содержимое ComboBox зависит от модели данных, поэтому наиболее простым вариантом мне кажется наличие пустого поля в самой модели данных.
То есть добавлять нужно в саму модель. Я не знаю, что из себя у вас представляет модель данных, но в самом простом варианте это может выглядеть так.