本文整理汇总了C++中setContent函数的典型用法代码示例。如果您正苦于以下问题:C++ setContent函数的具体用法?C++ setContent怎么用?C++ setContent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setContent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setContent
void rice::p2p::scribe::messaging::AnycastMessage::setContent(::rice::p2p::scribe::ScribeContent* content)
{
if(dynamic_cast< ::rice::p2p::scribe::rawserialization::RawScribeContent* >(content) != nullptr) {
setContent(content);
} else {
setContent(static_cast< ::rice::p2p::scribe::rawserialization::RawScribeContent* >(new ::rice::p2p::scribe::rawserialization::JavaSerializedScribeContent(content)));
}
}
示例2: if
void GameBuySystem::showBuyTips( BuyType type )
{
auto widget = CommonWidget::create();
if ( BuyType_Gem == type )
widget->setContent( "宝石不足" );
else if ( BuyType_Gold == type )
widget->setContent( "金币不足" );
Director::getInstance()->getRunningScene()->addChild( widget );
}
示例3: gtk_set_locale
/**
* Create the application window
*
* @param argc - number of arguments passed into main()
* @param argv[] - the arguments passed into main()
* @param config - the application configuration settings
*/
AppWindow::AppWindow(int argc, char *argv[], ConfigContainer config) {
menuBar = NULL;
statusBar = NULL;
gtk_set_locale();
std::cout << "locale set" << std::endl;
gtk_init(&argc, &argv);
std::cout << "gtk init() called" << std::endl;
window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
windowContainer = gtk_vbox_new(false, 0);
// Set up the global keyboard accelerator interface
accelGroup = gtk_accel_group_new();
// Set up the window
setConfig(config);
Geometry geom = config.getWindowGeom();
gtk_window_move(window, geom.getLeft(), geom.getTop());
posEventFirstPass = true;
gtk_window_set_default_size(window, geom.getWidth(), geom.getHeight());
setTitle(config.getAppTitle());
string iconPath = config.getAppIcon();
if (fs::is_regular(fs::path(iconPath))) {
// Set the icon, if it exists
setIcon(iconPath);
}
else {
cout << "could not load icon, file does not exist: " << iconPath << endl;
}
// Attach the menu bar
if (config.hasMenuBar() == true) {
menuBar = new MenuBar(config.getMenuBar(), &gecko, accelGroup);
setContent(menuBar->getMenuWidget(), false);
}
// Attach the Gecko engine
gecko.init(config);
setContent(gecko.getFrame(), true);
// Attach the status bar
if (config.hasStatusBar() == true) {
statusBar = new StatusBar();
setContent(statusBar->getWidget(), false);
gecko.attachStatusBar(statusBar);
}
// Set up window callback events
setupCallbacks();
gtk_window_add_accel_group(window, accelGroup);
}
示例4: setError
//! [process command]
void FtpReply::processCommand(int, bool err)
{
if (err) {
setError(ContentNotFoundError, tr("Unknown command"));
emit error(ContentNotFoundError);
return;
}
switch (ftp->currentCommand()) {
case QFtp::ConnectToHost:
ftp->login();
break;
case QFtp::Login:
ftp->list(url().path());
break;
case QFtp::List:
if (items.size() == 1)
ftp->get(url().path());
else
setListContent();
break;
case QFtp::Get:
setContent();
default:
;
}
}
示例5: setContent
void compiler::doLex()
{
setContent("The result of lex:\n", "inputSyn.txt");
lex->setDisabled(true);
synSem->setDisabled(false);
return;
}
示例6: setContent
void PeerListBox::prepare() {
setContent(setInnerWidget(
object_ptr<PeerListContent>(
this,
_controller.get(),
st::peerListBox),
st::boxLayerScroll));
content()->resizeToWidth(st::boxWideWidth);
_controller->setDelegate(this);
setDimensions(st::boxWideWidth, st::boxMaxListHeight);
if (_select) {
_select->finishAnimating();
Ui::SendPendingMoveResizeEvents(_select);
_scrollBottomFixed = true;
onScrollToY(0);
}
content()->scrollToRequests(
) | rpl::start_with_next([this](Ui::ScrollToRequest request) {
onScrollToY(request.ymin, request.ymax);
}, lifetime());
if (_init) {
_init(this);
}
}
示例7: ContentWidget
ModifyFullNamePage::ModifyFullNamePage(User *u, QWidget *parent)
: ContentWidget(parent),
m_user(u)
{
m_fullnameWidget = new LineEditWidget;
m_fullnameWidget->setTitle(tr("Fullname:"));
m_fullnameWidget->textEdit()->setText(m_user->fullname());
QPushButton *confirmBtn = new QPushButton;
confirmBtn->setText(tr("OK"));
SettingsGroup *grp = new SettingsGroup;
grp->appendItem(m_fullnameWidget);
QVBoxLayout *centralLayout = new QVBoxLayout;
centralLayout->addWidget(grp);
centralLayout->addWidget(confirmBtn);
centralLayout->setSpacing(10);
centralLayout->setContentsMargins(0, 10, 0, 0);
QWidget *centralWidget = new TranslucentFrame;
centralWidget->setLayout(centralLayout);
setContent(centralWidget);
setTitle(tr("Fullname Settings"));
connect(m_user, &User::fullnameChanged, this, &ModifyFullNamePage::onFullnameChanged);
connect(confirmBtn, &QPushButton::clicked, this, [=] { emit requestSetFullname(m_user, m_fullnameWidget->textEdit()->text()); });
}
示例8:
void
icnVideoChunkingServer::OnInterest(std::shared_ptr<const ndn::Interest> interest)
{
// ndn::App::OnInterest(interest); // forward call to perform app-level tracing
// // do nothing else (hijack interest)
// NS_LOG_DEBUG("Do nothing for incoming interest for" << interest->getName());
ndn::App::OnInterest(interest);
// std::cout << "Producer received interest " << interest->getName() << std::endl;
// Note that Interests send out by the app will not be sent back to the app !
auto data = std::make_shared<ndn::Data>(interest->getName());
data->setFreshnessPeriod(ndn::time::seconds(1000));
this->total_bytes_served += 1000;
data->setContent(std::make_shared< ::ndn::Buffer>(this->chunk_size));
ndn::StackHelper::getKeyChain().sign(*data);
// Call trace (for logging purposes)
m_transmittedDatas(data, this, m_face);
m_face->onReceiveData(*data);
// Call trace (for logging purposes)
// printf("OnInterest\n");
}
示例9: foreach
void ExtraCompiler::onTargetsBuilt(Project *project)
{
if (project != d->project || BuildManager::isBuilding(project))
return;
// This is mostly a fall back for the cases when the generator couldn't be run.
// It pays special attention to the case where a source file was newly created
const QDateTime sourceTime = d->source.toFileInfo().lastModified();
if (d->compileTime.isValid() && d->compileTime >= sourceTime)
return;
foreach (const Utils::FileName &target, d->targets) {
QFileInfo fi(target.toFileInfo());
QDateTime generateTime = fi.exists() ? fi.lastModified() : QDateTime();
if (generateTime.isValid() && (generateTime > sourceTime)) {
if (d->compileTime >= generateTime)
continue;
QFile file(target.toString());
if (file.open(QFile::ReadOnly | QFile::Text)) {
QTextStream stream(&file);
d->compileTime = generateTime;
setContent(target, stream.readAll());
}
}
}
}
示例10: QScrollArea
HtmlInfoView::HtmlInfoView(QWidget * parent) : QScrollArea(parent)
{
this->setWidgetResizable(true);
this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_lastTitleItemBase = NULL;
m_lastTagsModelPart = NULL;
m_lastConnectorItem = NULL;
m_lastIconItemBase = NULL;
m_lastPropsModelPart = NULL;
m_lastPropsItemBase = NULL;
m_tinyMode = false;
m_partTitle = NULL;
m_partUrl = NULL;
m_partVersion = NULL;
m_lockCheckbox = NULL;
m_stickyCheckbox = NULL;
m_connDescr = NULL;
m_tagsTextLabel = NULL;
m_lastSwappingEnabled = false;
m_lastItemBase = NULL;
m_setContentTimer.setSingleShot(true);
m_setContentTimer.setInterval(10);
connect(&m_setContentTimer, SIGNAL(timeout()), this, SLOT(setContent()));
m_currentItem = NULL;
m_currentSwappingEnabled = false;
m_layerWidget = NULL;
}
示例11: setContent
void SE_PropertySet::setChar(const char* name, char c)
{
_Property p;
p.type = CHAR;
p.prop.c = c;
setContent(name, p);
}
示例12: showMessageBox
void UITool::showMessageBox(const char* title, const char* content)
{
auto gui = GUIMessageBox::createGUI();
gui->setTitle(title);
gui->setContent(content);
SceneMan::getInstance()->getCrrentScene()->addChild(gui);
}
示例13: BasicDialog
LuaConsole::LuaConsole(UserInterface *ui, Container* parent)
: BasicDialog(parent, ButtonFlags::ROLL_UPDOWN | ButtonFlags::CLOSE)
, m_ui(ui) {
setTitleText("Lua-Console");
setButtonText("");
CellStrip *panel = new CellStrip(this, Orientation::VERTICAL, 2);
setContent(panel);
Anchors inputAnchors(Anchor(AnchorType::RIGID, 2));
m_inputBox = new LuaInputBox(this, panel);
m_inputBox->setCell(0);
m_inputBox->setAnchors(inputAnchors);
m_inputBox->setText("");
m_inputBox->setAlignment(Alignment::FLUSH_LEFT);
m_inputBox->setTextPos(Vec2i(3, 3));
m_inputBox->InputEntered.connect(this, &LuaConsole::onLineEntered);
int h = int(m_inputBox->getFont()->getMetrics()->getHeight()) * 2;
panel->setSizeHint(0, SizeHint(-1, h));
Anchors outputAnchors(Anchor(AnchorType::RIGID, 0));
m_outputBox = new CodeBox(panel);
m_outputBox->setCell(1);
m_outputBox->setAnchors(outputAnchors);
m_outputBox->setText("");
m_outputBox->setAlignment(Alignment::NONE);
}
示例14: initDoc
bool XMLMetadata::initFromRaw(const unsigned char *raw, size_t len)
{
char *_name = initDoc((const char *)raw, len);
if (!_name) {
fprintf(stderr, "Could not create document\n");
if (doc)
xmlFreeDoc(doc);
doc = NULL;
return false;
}
if (!parseXML(xmlDocGetRootElement(doc))) {
fprintf(stderr, "Parse XML failed\n");
xmlFreeDoc(doc);
doc = NULL;
return false;
}
name = _name;
xmlChar *content = xmlNodeGetContent(xmlDocGetRootElement(doc));
if (content) {
setContent((char *)content);
xmlFree(content);
}
xmlFreeDoc(doc);
doc = NULL;
return true;
}
示例15: Node
void Trie::addWord(string& word)
{
std::transform(word.begin(), word.end(), word.begin(), ::tolower);
auto current = m_root;
if ( word.length() == 0 )
{
current->setWordMarker(); // an empty word
return;
}
for ( size_t i = 0; i < word.length(); i++ )
{
auto child = current->findChild(word[i]);
if (child)
{
current = child;
}
else
{
auto tmp = new Node();
tmp->setContent(word[i]);
current->appendChild(tmp);
current = tmp;
}
if ( i == word.length() - 1 )
current->setWordMarker();
}
}