可编辑的ComboBox,怎么得到输入的字符串? QT

hazellove 2011-09-06 02:57:30
可编辑的ComboBox,怎么得到输入的字符串? QT
...全文
547 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
donwmufromdying 2011-09-08
  • 打赏
  • 举报
回复
QComboBox *cb = new QComboBox(NULL);
cb->setEditable(true);
cb->lineEdit()->text();

前提是:一定是可编辑。否则,lineEdit()返回是NULL
pp0354030 2011-09-08
  • 打赏
  • 举报
回复
getCurrentText()
blueness883 2011-09-07
  • 打赏
  • 举报
回复
关联这个信号就ok了.

void QComboBox::editTextChanged ( const QString & text ) [signal]
This signal is emitted when the text in the combobox's line edit widget is changed. The new text is specified by text.
念茜 2011-09-06
  • 打赏
  • 举报
回复
int QComboBox::findText ( const QString & text, Qt::MatchFlags flags = Qt::MatchExactly | Qt::MatchCaseSensitive ) const
hazellove 2011-09-06
  • 打赏
  • 举报
回复
->text() 不能得到,系统编译报错的!不信你试下!
ryanzz 2011-09-06
  • 打赏
  • 举报
回复
->text()

16,216

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧