本文整理汇总了C++中Task::depth方法的典型用法代码示例。如果您正苦于以下问题:C++ Task::depth方法的具体用法?C++ Task::depth怎么用?C++ Task::depth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task::depth方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: INHERITED
Task::Task(const Task& parent)
: INHERITED(parent)
, fReporter(parent.fReporter)
, fTaskRunner(parent.fTaskRunner)
, fDepth(parent.depth()+1) {
fReporter->start();
}
示例2: SkString
inline static SkString find_base_name(const Task& parent, SkTArray<SkString>* suffixList) {
const int suffixes = parent.depth() + 1;
const SkString& name = parent.name();
const int totalSuffixLength = split_suffixes(suffixes, name.c_str(), suffixList);
return SkString(name.c_str(), name.size() - totalSuffixLength);
}
示例3: fReporter
Task::Task(const Task& parent)
: fReporter(parent.fReporter)
, fTaskRunner(parent.fTaskRunner)
, fDepth(parent.depth() + 1) {
fReporter->taskCreated();
}
示例4: exportcsvFile
//----------------------------------------------------------------------------
// Routines that handle Comma-Separated Values export file format.
//
QString timetrackerstorage::exportcsvFile(TaskView *taskview, const ReportCriteria &rc)
{
kDebug(5970) << "Entering function";
QString delim = rc.delimiter;
QString dquote = rc.quote;
QString double_dquote = dquote + dquote;
bool to_quote = true;
QString err;
Task* task;
int maxdepth=0;
QString title = i18n("Export Progress");
KProgressDialog dialog( taskview, 0, title );
dialog.setAutoClose( true );
dialog.setAllowCancel( true );
dialog.progressBar()->setMaximum( 2 * taskview->count() );
// The default dialog was not displaying all the text in the title bar.
int width = taskview->fontMetrics().width(title) * 3;
QSize dialogsize;
dialogsize.setWidth(width);
dialog.setInitialSize( dialogsize );
if ( taskview->count() > 1 ) dialog.show();
QString retval;
// Find max task depth
int tasknr = 0;
while ( tasknr < taskview->count() && !dialog.wasCancelled() )
{
dialog.progressBar()->setValue( dialog.progressBar()->value() + 1 );
if ( tasknr % 15 == 0 ) kapp->processEvents(); // repainting is slow
if ( taskview->itemAt(tasknr)->depth() > maxdepth )
maxdepth = taskview->itemAt(tasknr)->depth();
tasknr++;
}
// Export to file
tasknr = 0;
while ( tasknr < taskview->count() && !dialog.wasCancelled() )
{
task = taskview->itemAt( tasknr );
dialog.progressBar()->setValue( dialog.progressBar()->value() + 1 );
if ( tasknr % 15 == 0 ) kapp->processEvents();
// indent the task in the csv-file:
for ( int i=0; i < task->depth(); ++i ) retval += delim;
/*
// CSV compliance
// Surround the field with quotes if the field contains
// a comma (delim) or a double quote
if (task->name().contains(delim) || task->name().contains(dquote))
to_quote = true;
else
to_quote = false;
*/
to_quote = true;
if (to_quote)
retval += dquote;
// Double quotes replaced by a pair of consecutive double quotes
retval += task->name().replace( dquote, double_dquote );
if (to_quote)
retval += dquote;
// maybe other tasks are more indented, so to align the columns:
for ( int i = 0; i < maxdepth - task->depth(); ++i ) retval += delim;
retval += delim + formatTime( task->sessionTime(),
rc.decimalMinutes )
+ delim + formatTime( task->time(),
rc.decimalMinutes )
+ delim + formatTime( task->totalSessionTime(),
rc.decimalMinutes )
+ delim + formatTime( task->totalTime(),
rc.decimalMinutes )
+ '\n';
tasknr++;
}
// save, either locally or remote
if ((rc.url.isLocalFile()) || (!rc.url.url().contains("/")))
{
QString filename=rc.url.toLocalFile();
if (filename.isEmpty()) filename=rc.url.url();
QFile f( filename );
if( !f.open( QIODevice::WriteOnly ) )
{
err = i18n( "Could not open \"%1\".", filename );
}
if (err.length()==0)
{
QTextStream stream(&f);
// Export to file
stream << retval;
//.........这里部分代码省略.........
示例5: CpuTask
WriteTask::WriteTask(const Task& parent, SkBitmap bitmap) : CpuTask(parent), fBitmap(bitmap) {
const int suffixes = parent.depth() + 1;
const SkString& name = parent.name();
const int totalSuffixLength = split_suffixes(suffixes, name.c_str(), &fSuffixes);
fGmName.set(name.c_str(), name.size()-totalSuffixLength);
}