本文整理汇总了C++中qstringlist::Iterator::toStdString方法的典型用法代码示例。如果您正苦于以下问题:C++ Iterator::toStdString方法的具体用法?C++ Iterator::toStdString怎么用?C++ Iterator::toStdString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qstringlist::Iterator
的用法示例。
在下文中一共展示了Iterator::toStdString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tr
void Qt5Files::buttonClicked() {
QString filter;
if (!m_extensions.size()) {
filter = tr("All Files (*.*)");
} else {
filter = tr("Valid Files (");
for (unsigned int i=0; i<m_extensions.size(); ++i) {
if (i) filter += " ";
filter += "*."+QString::fromStdString(m_extensions[i]);
}
filter += tr(")");
}
QStringList files = QFileDialog::getOpenFileNames(nullptr, "Open Files...", filter, tr("All Files (*.*)"), nullptr, 0);
QStringList::Iterator it = files.begin();
m_value.clear();
QString text;
while (it != files.end()) {
m_value.push_back(fs::path(it->toStdString()));
if (it != files.begin()) text += ", ";
text += *it;
++it;
}
m_lineEdit->setText(text);
notify(m_value);
}
示例2: LoadImages
void MainWindow::LoadImages() {
images_.clear();
QStringList files = QFileDialog::getOpenFileNames(
this, tr("Load Images"), "~/Pictures",
tr("Images (*.png, *.jpeg, *.jpg, *.tiff, *.bmp, *"));
QStringList files_copy = files;
for (QStringList::Iterator i = files_copy.begin(); i != files_copy.end(); ++i) {
// Load files and add to ThumbnailView.
QImage* img = new QImage(*i);
std::cout << i->toStdString() << " " << img->width() << " " << img->height() << "\n";
images_.push_back(shared_ptr<QImage>(img));
thumb_->addImage(img, *i);
}
}
示例3: getImage
/**
* Funtion returns image pointer to Image located
* in cache folder where shoul be downloaded cover
* with name from parameter.
* @param name
* @return
*/
QImage* CoverDownloader::getImage(QString name) {
QDir d = QDir::current();
std::cout << "Current dir cover.. " << d.absolutePath().toStdString() << std::endl;
if (d.cd("cache")) {
QImage * img = new QImage();
QStringList filters;
filters << name + ".*";
QStringList files = d.entryList(filters, QDir::Readable | QDir::Files | QDir::NoSymLinks);
for (QStringList::Iterator it = files.begin(); it != files.end(); ++it) {
std::cout << it->toStdString() << std::endl;
if (img->load("cache/" + *it)) {
break;
}
}
if (!img->isNull()) {
return img;
}
SAFE_DELETE(img);
}
return NULL;
}
示例4: open
void ReduxWidget::open() {
QStringList files = QFileDialog::getOpenFileNames( this, tr( "Open File" ), "", tr( "Log Files (*_lg*)" ) );
int sz = PATH_MAX + 1; // N.B. It is possible to construct a path longer than PATH_MAX on most systems,
// so this is really not fool-proof...
char* buf = new char[sz];
QStringList::Iterator it = files.begin();
while( it != files.end() ) {
memset( buf, 0, sz * sizeof( char ) );
if( ( ! it->isEmpty() ) && realpath( it->toStdString().c_str(), buf ) ) {
dumpMsg( QString( "Opening LogFile : " ) + *it );
/*LogFile* tmpLog = new LogFile ( buf );
bool skip = false;
for ( unsigned int i=0; i<myLogs.size(); ++i)
if ( !(*(myLogs[i]) != *tmpLog) )
skip = true;
cout << *tmpLog << endl;
if ( ! skip ) myLogs.push_back( tmpLog );
else delete tmpLog;
//myLog.load();
*/
}
++it;
}
delete[] buf;
//emit setsChanged();
//logTree->reset();
//emit jobsChanged();
//jobTree->reset();
//for (int i=0; i<myJobs.size(); ++i) cout << *myJobs[i];
//cout << myNet;
//cout << dumpXML(true) << endl;
}
示例5: handleIPCMessage
void QmitkCommonExtPlugin::handleIPCMessage(const QByteArray& msg)
{
QDataStream ds(msg);
QString msgType;
ds >> msgType;
// we only handle messages containing command line arguments
if (msgType != "$cmdLineArgs") return;
// activate the current workbench window
berry::IWorkbenchWindow::Pointer window =
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow();
QMainWindow* mainWindow =
static_cast<QMainWindow*> (window->GetShell()->GetControl());
mainWindow->setWindowState(mainWindow->windowState() & ~Qt::WindowMinimized);
mainWindow->raise();
mainWindow->activateWindow();
// Get the preferences for the instantiation behavior
berry::IPreferencesService* prefService = berry::Platform::GetPreferencesService();
berry::IPreferences::Pointer prefs = prefService->GetSystemPreferences()->Node("/General");
bool newInstanceAlways = prefs->GetBool("newInstance.always", false);
bool newInstanceScene = prefs->GetBool("newInstance.scene", true);
QStringList args;
ds >> args;
QStringList fileArgs;
QStringList sceneArgs;
Poco::Util::OptionSet os;
berry::Platform::GetOptionSet(os);
Poco::Util::OptionProcessor processor(os);
#if !defined(POCO_OS_FAMILY_UNIX)
processor.setUnixStyle(false);
#endif
args.pop_front();
QStringList::Iterator it = args.begin();
while (it != args.end())
{
std::string name;
std::string value;
if (processor.process(it->toStdString(), name, value))
{
++it;
}
else
{
if (it->endsWith(".mitk"))
{
sceneArgs << *it;
}
else
{
fileArgs << *it;
}
it = args.erase(it);
}
}
if (newInstanceAlways)
{
if (newInstanceScene)
{
startNewInstance(args, fileArgs);
foreach(QString sceneFile, sceneArgs)
{
startNewInstance(args, QStringList(sceneFile));
}
}
else
{