本文整理汇总了C++中XbelWriter类的典型用法代码示例。如果您正苦于以下问题:C++ XbelWriter类的具体用法?C++ XbelWriter怎么用?C++ XbelWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XbelWriter类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: save
void BookmarksManager::save() const
{
if (!m_loaded)
return;
XbelWriter writer;
QString dir = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
QString bookmarkFile = dir + QLatin1String("/bookmarks.xbel");
if (!writer.write(bookmarkFile, m_bookmarkRootNode))
qWarning() << "BookmarkManager: error saving to" << bookmarkFile;
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:11,代码来源:bookmarks.cpp
示例2: save
void BookmarksManager::save() const
{
if (!m_loaded)
return;
XbelWriter writer;
QString dir = BrowserApplication::dataLocation();
QString bookmarkFile = dir + QLatin1String("/bookmarks.xbel");
if (!writer.write(bookmarkFile, m_bookmarkRootNode))
qWarning() << "BookmarkManager: error saving to" << bookmarkFile;
}
开发者ID:OS2World,项目名称:APP-INTERNET-QtWeb,代码行数:11,代码来源:bookmarks.cpp
示例3: tr
void BookmarksManager::exportBookmarks()
{
QString fileName = QFileDialog::getSaveFileName(0, tr("Save File"),
tr("%1 Bookmarks.xbel").arg(QCoreApplication::applicationName()),
tr("XBEL (*.xbel *.xml)"));
if (fileName.isEmpty())
return;
XbelWriter writer;
if (!writer.write(fileName, m_bookmarkRootNode))
QMessageBox::critical(0, tr("Export error"), tr("error saving bookmarks"));
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:12,代码来源:bookmarks.cpp
示例4: save
void BookmarksManager::save() const
{
if (!m_loaded)
return;
XbelWriter writer;
QString dir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
QString bookmarkFile = dir + QLatin1String("/bookmarks.xbel");
// Save root folder titles in English (i.e. not localized)
m_menu->title = QLatin1String(BOOKMARKMENU);
m_toolbar->title = QLatin1String(BOOKMARKBAR);
if (!writer.write(bookmarkFile, m_bookmarkRootNode))
qWarning() << "BookmarkManager: error saving to" << bookmarkFile;
// Restore localized titles
retranslate();
}
开发者ID:porphyr,项目名称:arora,代码行数:16,代码来源:bookmarks.cpp
示例5: QMimeData
QMimeData *BookmarksModel::mimeData(const QModelIndexList &indexes) const
{
QMimeData *mimeData = new QMimeData();
QByteArray data;
QDataStream stream(&data, QIODevice::WriteOnly);
foreach (QModelIndex index, indexes) {
if (index.column() != 0 || !index.isValid())
continue;
QByteArray encodedData;
QBuffer buffer(&encodedData);
buffer.open(QBuffer::ReadWrite);
XbelWriter writer;
const BookmarkNode *parentNode = node(index);
writer.write(&buffer, parentNode);
stream << encodedData;
}
mimeData->setData(MIMETYPE, data);
return mimeData;
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:19,代码来源:bookmarks.cpp
注:本文中的XbelWriter类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论