StupidBeauty
Read times:393Posted at:Wed Jul 6 18:54:06 2011
- no title specified

Wt3.1.9文档翻译:Wt::WCheckBox类参考,Wt::WCheckBox Class Reference

详细描述

这是一个代表复选框的用户控件。

默认情况下,复选框会有两个状态: Wt::CheckedWt::Unchecked ,可使用 isChecked() 来跟踪,使用 setChecked() 来设置

复选框还可以拥有第三种状态, Wt::PartiallyChecked ,可用来表示这个复选 框既不是选中状态也不是未选中状态。如果可以的话 (Safari和MS IE),我们会使用浏览器对这个HTML5 扩展提供的原生支持,否则将会使用一个图片来敷衍一下 。你可以使用 setTristate() 来启用对第三种状态的支持,使用 setCheckState() 来设置状态,使用 checkState() 来读取状态

会有一个标签作为邻居部件添加到该复选框的同一个亲代部件中。

使用示例:

Wt::WGroupBox *box = new Wt::WGroupBox("In-flight options");

Wt::WCheckBox *w1 = new Wt::WCheckBox("Vegetarian diet", box);

box->addWidget(new WBreak());

Wt::WCheckBox *w2 = new Wt::WCheckBox("WIFI access", box);

box->addWidget(new WBreak());

Wt::WCheckBox *w3 = new Wt::WCheckBox("AC plug", box);

w1->setChecked(false);

w2->setChecked(true);

w3->setChecked(true);

WCheckBox是一个内联部件

CSS

这个部件对应于HTML <input type="checkbox">标记。取决于其中是否包含咯一段文字,它可能会 被嵌套到一个 <span> 标记中,其中同时还包含一个 WLabel 。这个部件不支持样式设置 ,可使用内联或外部CSS 来设置样式

参考

WAbstractToggleButton

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4