本文整理汇总了C++中SymbolDialog::selectedFile方法的典型用法代码示例。如果您正苦于以下问题:C++ SymbolDialog::selectedFile方法的具体用法?C++ SymbolDialog::selectedFile怎么用?C++ SymbolDialog::selectedFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymbolDialog
的用法示例。
在下文中一共展示了SymbolDialog::selectedFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: openRule
void FormulaEdit::openRule ()
{
QString s("*");
QString s2;
config.getData(Config::IndicatorPath, s2);
SymbolDialog *dialog = new SymbolDialog(this,
s2,
s2,
s,
QFileDialog::ExistingFiles);
dialog->setCaption(tr("Select rule to open."));
int rc = dialog->exec();
if (rc != QDialog::Accepted)
{
delete dialog;
return;
}
QStringList selection = dialog->selectedFile();
delete dialog;
if (! selection.count())
return;
QFile f(selection[0]);
if (! f.open(IO_ReadOnly))
{
qDebug("FormulaEdit::openRule:can't read file %s", selection[0].latin1());
return;
}
QTextStream stream(&f);
QString script;
while(stream.atEnd() == 0)
{
s = stream.readLine();
s = s.stripWhiteSpace();
if (s.contains("script="))
script = s;
}
f.close();
setLine(script);
}
示例2: deleteTest
void TestPage::deleteTest()
{
QString s("*");
QString s2;
config.getData(Config::TestPath, s2);
SymbolDialog *dialog = new SymbolDialog(this,
s2,
s2,
s,
QFileDialog::DirectoryOnly);
dialog->setCaption(tr("Select Backtest rule To Delete"));
int rc = dialog->exec();
if (rc == QDialog::Accepted)
{
rc = QMessageBox::warning(this,
tr("Qtstalker: Warning"),
tr("Are you sure you want to delete backtest rule?"),
QMessageBox::Yes,
QMessageBox::No,
QMessageBox::NoButton);
if (rc == QMessageBox::No)
{
delete dialog;
return;
}
s = "rm -r " + dialog->selectedFile();
if (system(s.latin1()) == -1)
qDebug("TestPage::deleteTest:command failed");
updateList();
testNoSelection();
}
delete dialog;
}