本文整理汇总了C++中setContent函数的典型用法代码示例。如果您正苦于以下问题:C++ setContent函数的具体用法?C++ setContent怎么用?C++ setContent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setContent函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)));
}
}
开发者ID:subhash1-0,项目名称:thirstyCrow,代码行数:8,代码来源:AnycastMessage.cpp
示例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 );
}
开发者ID:Chonger8888,项目名称:project,代码行数:10,代码来源:GameSystem.cpp
示例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);
}
开发者ID:seanhodges,项目名称:Medes,代码行数:57,代码来源:AppWindow.cpp
示例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:
;
}
}
开发者ID:Afreeca,项目名称:qt,代码行数:32,代码来源:ftpreply.cpp
示例5: setContent
void compiler::doLex()
{
setContent("The result of lex:\n", "inputSyn.txt");
lex->setDisabled(true);
synSem->setDisabled(false);
return;
}
开发者ID:yinizhizhu,项目名称:Compiler,代码行数:7,代码来源:gui.cpp
示例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);
}
}
开发者ID:zhangsoledad,项目名称:tdesktop,代码行数:28,代码来源:peer_list_box.cpp
示例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()); });
}
开发者ID:ghj1040110333,项目名称:dde-control-center,代码行数:30,代码来源:modifyfullnamepage.cpp
示例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");
}
开发者ID:rishidabre,项目名称:ICN-video-chunking,代码行数:27,代码来源:server.cpp
示例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());
}
}
}
}
开发者ID:jaakristioja,项目名称:qt-creator,代码行数:27,代码来源:extracompiler.cpp
示例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;
}
开发者ID:DHaylock,项目名称:fritzing-app,代码行数:34,代码来源:htmlinfoview.cpp
示例11: setContent
void SE_PropertySet::setChar(const char* name, char c)
{
_Property p;
p.type = CHAR;
p.prop.c = c;
setContent(name, p);
}
开发者ID:26597925,项目名称:3DHome,代码行数:7,代码来源:SE_PropertySet.cpp
示例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);
}
开发者ID:KeithMyHand,项目名称:diy_client,代码行数:7,代码来源:UITool.cpp
示例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);
}
开发者ID:MoLAoS,项目名称:Mandate,代码行数:28,代码来源:lua_console.cpp
示例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;
}
开发者ID:SRI-CSL,项目名称:ENCODERS,代码行数:33,代码来源:XMLMetadata.cpp
示例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();
}
}
开发者ID:aaronhesse,项目名称:Spellchecker,代码行数:30,代码来源:Trie.cpp
示例16: setError
void QPlaceContentReplyImpl::replyFinished()
{
if (m_reply->isOpen()) {
QJsonDocument document = QJsonDocument::fromJson(m_reply->readAll());
if (!document.isObject()) {
setError(ParseError, QCoreApplication::translate(NOKIA_PLUGIN_CONTEXT_NAME, PARSE_ERROR));
return;
}
QJsonObject object = document.object();
QPlaceContent::Collection collection;
int totalCount;
QPlaceContentRequest previous;
QPlaceContentRequest next;
parseCollection(request().contentType(), object, &collection, &totalCount,
&previous, &next, m_engine);
setTotalCount(totalCount);
setContent(collection);
setPreviousPageRequest(previous);
setNextPageRequest(next);
}
m_reply->deleteLater();
m_reply = 0;
setFinished(true);
emit finished();
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:31,代码来源:qplacecontentreplyimpl.cpp
示例17: ContentWidget
DetailPage::DetailPage(const Adapter *adapter, const Device *device) :
ContentWidget(),
m_adapter(adapter),
m_device(device),
m_ignoreButton(new QPushButton(tr("Ignore"))),
m_disconnectButton(new QPushButton(tr("Disconnect")))
{
setTitle(device->name());
dcc::widgets::TranslucentFrame *frame = new dcc::widgets::TranslucentFrame;
QVBoxLayout *layout = new QVBoxLayout(frame);
layout->setSpacing(0);
layout->setMargin(0);
layout->addSpacing(10);
layout->addWidget(m_disconnectButton);
layout->addSpacing(10);
layout->addWidget(m_ignoreButton);
setContent(frame);
device->state() == Device::StateConnected ? m_disconnectButton->show() : m_disconnectButton->hide();
connect(m_ignoreButton, &QPushButton::clicked, [this] { emit requestIgnoreDevice(m_adapter, m_device); emit back(); });
connect(m_disconnectButton, &QPushButton::clicked, [this] { emit requestDisconnectDevice(m_device); emit back(); });
}
开发者ID:ghj1040110333,项目名称:dde-control-center,代码行数:25,代码来源:detailpage.cpp
示例18: getContent
ScrollArea::~ScrollArea()
{
if (gui)
gui->removeDragged(this);
// Garbage collection
delete getContent();
instances--;
if (instances == 0)
{
Theme::unloadRect(background);
Theme::unloadRect(vMarker);
Theme::unloadRect(vMarkerHi);
Theme::unloadRect(vBackground);
Theme::unloadRect(hBackground);
for (int i = 0; i < 2; i ++)
{
for (int f = UP; f < BUTTONS_DIR; f ++)
{
if (buttons[f][i])
buttons[f][i]->decRef();
}
}
}
delete2(mVertexes);
delete2(mVertexes2);
setContent(nullptr);
}
开发者ID:nashley,项目名称:ManaPlus,代码行数:31,代码来源:scrollarea.cpp
示例19: BOOST_ASSERT
void
Producer::populateSegments(std::ifstream& ifs)
{
BOOST_ASSERT(m_segments.size() == 0);
// calculate how many segments are needed
std::streampos begin, end;
begin = ifs.tellg();
ifs.seekg(0, std::ios::end);
end = ifs.tellg();
int num_segments = (end-begin) / m_maxSegmentSize;
if ((end-begin) % m_maxSegmentSize != 0)
num_segments++;
std::cout << "Size of the file: " << (end-begin) << " bytes." << std::endl;
std::cout << "Maximum size of a segment: " << m_maxSegmentSize << " bytes." << std::endl;
std::cout << "Number of segments: " << num_segments << std::endl;
std::vector<uint8_t> buffer(m_maxSegmentSize);
ifs.seekg(0, std::ios::beg);
for (int i = 0; i < (end-begin) / m_maxSegmentSize; ++i) {
ifs.read(reinterpret_cast<char*>(buffer.data()), m_maxSegmentSize);
std::string seg_str = "/segment" + std::to_string(i);
auto data = make_shared<Data>(Name(m_prefix.toUri()+seg_str).appendSegment(i));
data->setFreshnessPeriod(m_freshnessPeriod);
data->setContent(&buffer[0], m_maxSegmentSize);
//std::cout << *data << std::endl;
m_segments.push_back(data);
}
if ((end-begin) % m_maxSegmentSize != 0) {
ifs.read(reinterpret_cast<char*>(buffer.data()), (end-begin) % m_maxSegmentSize);
std::string seg_str = "/segment" + std::to_string(m_segments.size());
auto data = make_shared<Data>(Name(m_prefix.toUri()+seg_str).appendSegment(m_segments.size()));
data->setFreshnessPeriod(m_freshnessPeriod);
data->setContent(&buffer[0], (end-begin) % m_maxSegmentSize);
//std::cout << *data << std::endl;
m_segments.push_back(data);
}
auto finalBlockId = name::Component::fromSegment(m_segments.size() - 1);
for (const auto& data : m_segments) {
data->setFinalBlockId(finalBlockId);
m_keyChain.sign(*data, m_signingInfo);
}
}
开发者ID:imsure,项目名称:ndn_cc,代码行数:47,代码来源:producer.cpp
示例20: setContent
AppCover::AppCover(QObject* parent)
: bb::cascades::SceneCover(this)
{
bb::cascades::QmlDocument *qml = bb::cascades::QmlDocument::create("asset:///cover.qml").parent(this);
m_mainContainer = qml->createRootObject<bb::cascades::Container>();
setContent(m_mainContainer);
//setText("hhhhhh");
}
开发者ID:lovexiaov,项目名称:BlackberryApps,代码行数:8,代码来源:AppCover.cpp
注:本文中的setContent函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论