本文整理汇总了C++中wt::WString::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ WString::empty方法的具体用法?C++ WString::empty怎么用?C++ WString::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wt::WString
的用法示例。
在下文中一共展示了WString::empty方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: set_query
void set_query() {
dbo::Transaction t(tApp->session());
ULP::Q q;
if (only_blocked_) {
q = tApp->session().query<UserPtr>(
"select U from thechess_message_filter F "
"left join thechess_user U on F.bad_id = U.id");
q.where("F.good_id = ?").bind(tApp->user());
} else {
q = tApp->session().find<User>();
}
if (not_removed_) {
q.where("rights != ?").bind(NONE);
q.where("vacation_until is null");
q.where("last_online > ?").bind(now() - 10 * WEEK);
}
if (only_online_) {
q.where("last_online >= ?");
q.bind(now() - Options::instance()->away_timeout());
}
if (!name_like_.empty()) {
q.where("(username like ? or id = ?)");
q.bind("%" + name_like_ + "%");
q.bind(Wt::Wc::str2int(name_like_.toUTF8()));
}
q.orderBy("games_stat_elo desc");
setQuery(q, /* keep_columns */ true);
}
示例2: setValid
void FormBaseModel::setValid(Field field, const Wt::WString& message)
{
setValidation(field,
WValidator::Result(WValidator::Valid,
message.empty() ?
WString::tr("Wt.Auth.valid") : message));
}
示例3: sayHi
void MainWindow::sayHi() {
Wt::WString name = _nameInput->valueText();
if (name.empty())
_nameOutput->setText("");
else
_nameOutput->setText("Hi there " + name);
}
示例4: setName
void PopupChatWidget::setName(const Wt::WString& name)
{
if (name.empty())
return;
if (online_) {
int tries = 1;
Wt::WString n = name;
while (!server().changeName(name_, n))
n = name + boost::lexical_cast<std::string>(++tries);
name_ = n;
} else
name_ = name;
}
示例5: goOnline
void PopupChatWidget::goOnline()
{
if (!online_) {
online_ = true;
int tries = 1;
Wt::WString name = name_;
if (name.empty())
name = server().suggestGuest();
while (!startChat(name)) {
if (name_.empty())
name = server().suggestGuest();
else
name = name_ + boost::lexical_cast<std::string>(++tries);
}
name_ = name;
}
missedMessages_ = 0;
bar_->removeStyleClass("alert");
}
示例6:
sb2->addItem("Green peppers");
sb2->addItem("Ham");
sb2->addItem("Pepperoni");
sb2->addItem("Red peppers");
sb2->addItem("Turkey");
sb2->setSelectionMode(Wt::ExtendedSelection);
std::set<int> selection; // By default select the items with index 1 and 4.
selection.insert(1); // Index 1 corresponds to the 2nd item.
selection.insert(4); // Index 4 corresponds to the 5th item.
sb2->setSelectedIndexes(selection);
sb2->setMargin(10, Wt::Right);
Wt::WText *out = new Wt::WText(container);
sb2->activated().connect(std::bind([=] () {
Wt::WString selected;
std::set<int> selection = sb2->selectedIndexes();
for (std::set<int>::iterator it = selection.begin();
it != selection.end(); ++it) {
if (!selected.empty())
selected += ", ";
selected += sb2->itemText(*it);
}
out->setText(Wt::WString::fromUTF8("You choose {1}.").arg(selected));
}));
SAMPLE_END(return container)
示例7: switch
Wt::WContainerWidget*
Application::instantiateMainTabs() {
Wt::WContainerWidget *mainTabContainer = new Wt::WContainerWidget;
Wt::WVBoxLayout *vbox = new Wt::WVBoxLayout;
mainTabContainer->setLayout(vbox);
wMainTabs_ = new Wt::WTabWidget;
wMainTabs_->currentChanged().connect(boost::bind(&Application::changeTab2, this, _1));
vbox->addWidget(wMainTabs_, 1 /*stretch*/);
for (size_t i=0; i<NMainTabs; ++i) {
Wt::WString tabName;
Wt::WContainerWidget *tabContent = NULL;
switch ((MainTab)i) {
case PartitionerTab: {
tabName = "Partitioner";
tabContent = wPartitioner_ = new WPartitioner(ctx_);
wPartitioner_->specimenParsed().connect(boost::bind(&Application::handleSpecimenParsed, this, _1));
wPartitioner_->specimenLoaded().connect(boost::bind(&Application::handleSpecimenLoaded, this, _1));
wPartitioner_->specimenPartitioned().connect(boost::bind(&Application::handleSpecimenPartitioned, this, _1));
break;
}
case MemoryMapTab: {
tabName = "Memory Map";
tabContent = wMemoryMap_ = new WMemoryMap;
wMemoryMap_->mapChanged().connect(boost::bind(&Application::memoryMapChanged, this));
wMemoryMap_->allowDownloads(ctx_.settings.allowDownloads);
break;
}
case FunctionListTab: {
tabName = "Functions";
tabContent = wFunctionList_ = new WFunctionList(ctx_);
wFunctionList_->functionChanged().connect(boost::bind(&Application::changeFunction, this, _1));
wFunctionList_->functionRowDoubleClicked()
.connect(boost::bind(&Application::changeFunctionDoubleClick, this, _1));
break;
}
case FunctionSummaryTab: {
tabName = "Summary";
tabContent = wFunctionSummary_ = new WFunctionSummary(ctx_);
break;
}
case FunctionCfgTab: {
tabName = "CFG";
tabContent = wFunctionCfg_ = new WFunctionCfg(ctx_);
wFunctionCfg_->functionChanged().connect(boost::bind(&Application::changeFunction, this, _1));
wFunctionCfg_->functionClicked().connect(boost::bind(&Application::changeFunction, this, _1));
wFunctionCfg_->addressClicked().connect(boost::bind(&Application::showHexDumpAtAddress, this, _1));
wFunctionCfg_->basicBlockClicked().connect(boost::bind(&Application::changeBasicBlock, this, _1));
break;
}
case AssemblyTab: {
tabName = "Assembly";
tabContent = wAssembly_ = new WAssemblyListing(ctx_);
break;
}
case HexDumpTab: {
tabName = "Hexdump";
tabContent = wHexDump_ = new WHexDump;
wHexDump_->byteClicked().connect(boost::bind(&Application::updateAddressCrossReferences, this, _1));
break;
}
case MagicTab: {
tabName = "Magic";
tabContent = wMagic_ = new WMagic;
break;
}
case StringsTab: {
tabName = "Strings";
tabContent = wStrings_ = new WStrings;
wStrings_->stringClicked().connect(boost::bind(&Application::updateStringCrossReferences, this, _1));
break;
}
case StatusTab: {
tabName = "Status";
tabContent = wStatus_ = new WStatus(ctx_);
break;
}
default:
ASSERT_not_reachable("invalid main tab");
}
ASSERT_not_null(tabContent);
ASSERT_forbid(tabName.empty());
wMainTabs_->addTab(tabContent, tabName);
}
return mainTabContainer;
}
示例8:
void
WHexValueEdit::setError(const Wt::WString &mesg) {
wError_->setText(mesg);
wError_->setHidden(mesg.empty());
wSave_->setEnabled(mesg.empty());
}