本文整理汇总了C++中QTC_CHECK函数的典型用法代码示例。如果您正苦于以下问题:C++ QTC_CHECK函数的具体用法?C++ QTC_CHECK怎么用?C++ QTC_CHECK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了QTC_CHECK函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: updateCacheAndEmitEnvironmentChanged
bool BuildConfiguration::fromMap(const QVariantMap &map)
{
m_clearSystemEnvironment = map.value(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY)).toBool();
m_userEnvironmentChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList());
m_buildDirectory = Utils::FileName::fromString(map.value(QLatin1String(BUILDDIRECTORY_KEY)).toString());
updateCacheAndEmitEnvironmentChanged();
qDeleteAll(m_stepLists);
m_stepLists.clear();
int maxI = map.value(QLatin1String(BUILD_STEP_LIST_COUNT), 0).toInt();
for (int i = 0; i < maxI; ++i) {
QVariantMap data = map.value(QLatin1String(BUILD_STEP_LIST_PREFIX) + QString::number(i)).toMap();
if (data.isEmpty()) {
qWarning() << "No data for build step list" << i << "found!";
continue;
}
auto list = new BuildStepList(this, idFromMap(data));
if (!list->fromMap(data)) {
qWarning() << "Failed to restore build step list" << i;
delete list;
return false;
}
m_stepLists.append(list);
}
// We currently assume there to be at least a clean and build list!
QTC_CHECK(knownStepLists().contains(Core::Id(Constants::BUILDSTEPS_BUILD)));
QTC_CHECK(knownStepLists().contains(Core::Id(Constants::BUILDSTEPS_CLEAN)));
return ProjectConfiguration::fromMap(map);
}
开发者ID:kai66673,项目名称:qt-creator,代码行数:33,代码来源:buildconfiguration.cpp
示例2: QTC_CHECK
void IosDeployStep::run(QFutureInterface<bool> &fi)
{
m_futureInterface = fi;
QTC_CHECK(m_transferStatus == NoTransfer);
if (iosdevice().isNull()) {
if (iossimulator().isNull())
TaskHub::addTask(Task::Error, tr("Deployment failed. No iOS device found."),
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
m_futureInterface.reportResult(!iossimulator().isNull());
cleanup();
emit finished();
return;
}
m_transferStatus = TransferInProgress;
QTC_CHECK(m_toolHandler == 0);
m_toolHandler = new IosToolHandler(IosDeviceType::IosDevice, this);
m_futureInterface.setProgressRange(0, 200);
m_futureInterface.setProgressValueAndText(0, QLatin1String("Transferring application"));
m_futureInterface.reportStarted();
connect(m_toolHandler, SIGNAL(isTransferringApp(Ios::IosToolHandler*,QString,QString,int,int,QString)),
SLOT(handleIsTransferringApp(Ios::IosToolHandler*,QString,QString,int,int,QString)));
connect(m_toolHandler, SIGNAL(didTransferApp(Ios::IosToolHandler*,QString,QString,Ios::IosToolHandler::OpStatus)),
SLOT(handleDidTransferApp(Ios::IosToolHandler*,QString,QString,Ios::IosToolHandler::OpStatus)));
connect(m_toolHandler, SIGNAL(finished(Ios::IosToolHandler*)),
SLOT(handleFinished(Ios::IosToolHandler*)));
connect(m_toolHandler, SIGNAL(errorMsg(Ios::IosToolHandler*,QString)),
SLOT(handleErrorMsg(Ios::IosToolHandler*,QString)));
m_toolHandler->requestTransferApp(appBundle(), deviceId());
}
开发者ID:ZerpHmm,项目名称:qt-creator,代码行数:29,代码来源:iosdeploystep.cpp
示例3: selectedIndex
void BranchDialog::rename()
{
QModelIndex selected = selectedIndex();
QTC_CHECK(selected != m_model->currentBranch()); // otherwise the button would not be enabled!
const bool isTag = m_model->isTag(selected);
QTC_CHECK(m_model->isLocal(selected) || isTag);
QString oldName = m_model->fullName(selected);
QStringList localNames;
if (!isTag)
localNames = m_model->localBranchNames();
BranchAddDialog branchAddDialog(localNames, false, this);
if (isTag)
branchAddDialog.setWindowTitle(tr("Rename Tag"));
branchAddDialog.setBranchName(oldName);
branchAddDialog.setTrackedBranchName(QString(), false);
branchAddDialog.exec();
if (branchAddDialog.result() == QDialog::Accepted) {
if (branchAddDialog.branchName() == oldName)
return;
if (isTag)
m_model->renameTag(oldName, branchAddDialog.branchName());
else
m_model->renameBranch(oldName, branchAddDialog.branchName());
refresh();
}
enableButtons();
}
开发者ID:FlavioFalcao,项目名称:qt-creator,代码行数:31,代码来源:branchdialog.cpp
示例4: selectedIndex
bool BranchUtils::rename()
{
const QModelIndex selected = selectedIndex();
QTC_CHECK(selected != m_model->currentBranch());
const bool isTag = m_model->isTag(selected);
QTC_CHECK(m_model->isLocal(selected) || isTag);
QString oldName = m_model->fullName(selected);
QStringList localNames;
if (!isTag)
localNames = m_model->localBranchNames();
BranchAddDialog branchAddDialog(localNames, false, m_widget);
if (isTag)
branchAddDialog.setWindowTitle(tr("Rename Tag"));
branchAddDialog.setBranchName(oldName);
branchAddDialog.setTrackedBranchName(QString(), false);
branchAddDialog.exec();
if (branchAddDialog.result() == QDialog::Accepted) {
if (branchAddDialog.branchName() == oldName)
return false;
if (isTag)
m_model->renameTag(oldName, branchAddDialog.branchName());
else
m_model->renameBranch(oldName, branchAddDialog.branchName());
return true;
}
if (QTC_GUARD(m_branchView))
m_branchView->selectionModel()->clear();
return false;
}
开发者ID:choenig,项目名称:qt-creator,代码行数:34,代码来源:branchutils.cpp
示例5: QTC_CHECK
void TreeModel::checkIndex(const QModelIndex &index) const
{
if (index.isValid()) {
QTC_CHECK(index.model() == this);
} else {
QTC_CHECK(index.model() == 0);
}
}
开发者ID:OnlineCop,项目名称:qt-creator,代码行数:8,代码来源:treemodel.cpp
示例6: removeAnnotationDate
static QString removeAnnotationDate(const QString &b)
{
if (b.isEmpty())
return b;
const QChar space(QLatin1Char(' '));
const int parenPos = b.indexOf(QLatin1Char(')'));
if (parenPos == -1)
return b;
int datePos = parenPos;
int i = parenPos;
while (i >= 0 && b.at(i) != space)
--i;
while (i >= 0 && b.at(i) == space)
--i;
int spaceCount = 0;
// i is now on timezone. Go back 3 spaces: That is where the date starts.
while (i >= 0) {
if (b.at(i) == space)
++spaceCount;
if (spaceCount == 3) {
datePos = i;
break;
}
--i;
}
if (datePos == 0)
return b;
// Copy over the parts that have not changed into a new byte array
QString result;
QTC_ASSERT(b.size() >= parenPos, return result);
int prevPos = 0;
int pos = b.indexOf(QLatin1Char('\n'), 0) + 1;
forever {
QTC_CHECK(prevPos < pos);
int afterParen = prevPos + parenPos;
result.append(b.mid(prevPos, datePos));
result.append(b.mid(afterParen, pos - afterParen));
prevPos = pos;
QTC_CHECK(prevPos != 0);
if (pos == b.size())
break;
pos = b.indexOf(QLatin1Char('\n'), pos) + 1;
if (pos == 0) // indexOf returned -1
pos = b.size();
}
return result;
}
开发者ID:ProDataLab,项目名称:qt-creator,代码行数:51,代码来源:giteditor.cpp
示例7: QObject
QmlProfilerEventRelativesModelProxy::QmlProfilerEventRelativesModelProxy(QmlProfilerModelManager *modelManager,
QmlProfilerEventsModelProxy *eventsModel,
QObject *parent)
: QObject(parent)
{
QTC_CHECK(modelManager);
m_modelManager = modelManager;
connect(modelManager->simpleModel(), SIGNAL(changed()), this, SLOT(dataChanged()));
QTC_CHECK(eventsModel);
m_eventsModel = eventsModel;
m_acceptedTypes << QmlDebug::Compiling << QmlDebug::Creating << QmlDebug::Binding << QmlDebug::HandlingSignal;
}
开发者ID:ryzh945,项目名称:qt-creator,代码行数:14,代码来源:qmlprofilereventsmodelproxy.cpp
示例8: m_fatalErrorCount
XcodebuildParser::XcodebuildParser() :
m_fatalErrorCount(0),
m_xcodeBuildParserState(OutsideXcodebuild)
{
setObjectName(QLatin1String("XcodeParser"));
m_failureRe.setPattern(QLatin1String(failureRe));
QTC_CHECK(m_failureRe.isValid());
m_successRe.setPattern(QLatin1String(successRe));
QTC_CHECK(m_successRe.isValid());
m_buildRe.setPattern(QLatin1String(buildRe));
QTC_CHECK(m_buildRe.isValid());
m_replacingSignatureRe.setPattern(QLatin1String(signatureChangeRe));
QTC_CHECK(m_replacingSignatureRe.isValid());
}
开发者ID:AltarBeastiful,项目名称:qt-creator,代码行数:14,代码来源:xcodebuildparser.cpp
示例9: QObject
QmlProfilerStatisticsRelativesModel::QmlProfilerStatisticsRelativesModel(
QmlProfilerModelManager *modelManager, QmlProfilerStatisticsModel *statisticsModel,
QObject *parent) : QObject(parent)
{
QTC_CHECK(modelManager);
m_modelManager = modelManager;
QTC_CHECK(statisticsModel);
m_statisticsModel = statisticsModel;
// Load the child models whenever the parent model is done to get the filtering for JS/QML
// right.
connect(m_statisticsModel, &QmlProfilerStatisticsModel::dataAvailable,
this, &QmlProfilerStatisticsRelativesModel::dataChanged);
}
开发者ID:KeeganRen,项目名称:qt-creator,代码行数:15,代码来源:qmlprofilerstatisticsmodel.cpp
示例10: QObject
QmlProfilerEventRelativesModelProxy::QmlProfilerEventRelativesModelProxy(QmlProfilerModelManager *modelManager,
QmlProfilerEventsModelProxy *eventsModel,
QObject *parent)
: QObject(parent)
{
QTC_CHECK(modelManager);
m_modelManager = modelManager;
QTC_CHECK(eventsModel);
m_eventsModel = eventsModel;
// Load the child models whenever the parent model is done to get the filtering for JS/QML
// right.
connect(m_eventsModel, SIGNAL(dataAvailable()), this, SLOT(dataChanged()));
}
开发者ID:Gardenya,项目名称:qtcreator,代码行数:15,代码来源:qmlprofilereventsmodelproxy.cpp
示例11: d
IDevice::IDevice(const QString &type, Origin origin, Core::Id id) : d(new Internal::IDevicePrivate)
{
d->type = type;
d->origin = origin;
QTC_CHECK(origin == ManuallyAdded || id.isValid());
d->id = id.isValid() ? id : newId();
}
开发者ID:gaoxiaojun,项目名称:qtcreator,代码行数:7,代码来源:idevice.cpp
示例12: QTC_CHECK
void GdbMi::parseTuple(const char *&from, const char *to)
{
//qDebug() << "parseTuple: " << QByteArray(from, to - from);
QTC_CHECK(*from == '{');
++from;
parseTuple_helper(from, to);
}
开发者ID:anchowee,项目名称:QtCreator,代码行数:7,代码来源:gdbmi.cpp
示例13: submitEditorWidget
void PerforceSubmitEditor::updateFields()
{
PerforceSubmitEditorWidget *widget = submitEditorWidget();
widget->setData(m_entries.value(QLatin1String("Change")).trimmed(),
m_entries.value(QLatin1String("Client")).trimmed(),
m_entries.value(QLatin1String("User")).trimmed());
const QChar newLine = QLatin1Char('\n');
QStringList lines = m_entries.value(QLatin1String("Description")).split(newLine);
lines.removeFirst(); // that is the line break after 'Description:'
lines.removeLast(); // that is the empty line at the end
const QRegExp leadingTabPattern = QRegExp(QLatin1String("^\\t"));
QTC_CHECK(leadingTabPattern.isValid());
lines.replaceInStrings(leadingTabPattern, QString());
widget->setDescriptionText(lines.join(newLine));
lines = m_entries.value(QLatin1String("Files")).split(newLine);
// split up "file#add" and store complete spec line as user data
foreach (const QString &specLine, lines) {
const QStringList list = specLine.split(QLatin1Char('#'));
if (list.size() == 2) {
const QString file = list.at(0).trimmed();
const QString state = list.at(1).trimmed();
m_fileModel->addFile(file, state).at(0)->setData(specLine, FileSpecRole);
}
}
}
开发者ID:Gardenya,项目名称:qtcreator,代码行数:29,代码来源:perforcesubmiteditor.cpp
示例14: spaceMatcher
QString ClassNameValidatingLineEdit::createClassName(const QString &name)
{
// Remove spaces and convert the adjacent characters to uppercase
QString className = name;
QRegExp spaceMatcher(QLatin1String(" +(\\w)"), Qt::CaseSensitive, QRegExp::RegExp2);
QTC_CHECK(spaceMatcher.isValid());
int pos;
while ((pos = spaceMatcher.indexIn(className)) != -1) {
className.replace(pos, spaceMatcher.matchedLength(),
spaceMatcher.cap(1).toUpper());
}
// Filter out any remaining invalid characters
className.remove(QRegExp(QLatin1String("[^a-zA-Z0-9_]")));
// If the first character is numeric, prefix the name with a "_"
if (className.at(0).isNumber()) {
className.prepend(QLatin1Char('_'));
} else {
// Convert the first character to uppercase
className.replace(0, 1, className.left(1).toUpper());
}
return className;
}
开发者ID:55171514,项目名称:qtcreator,代码行数:25,代码来源:classnamevalidatinglineedit.cpp
示例15: QTC_CHECK
void IosDeployStep::run(QFutureInterface<bool> &fi)
{
m_futureInterface = fi;
QTC_CHECK(m_transferStatus == NoTransfer);
if (iosdevice().isNull()) {
m_futureInterface.reportResult(!iossimulator().isNull());
cleanup();
m_futureInterface.reportFinished();
return;
}
m_transferStatus = TransferInProgress;
IosToolHandler *toolHandler = new IosToolHandler(IosToolHandler::IosDeviceType, this);
m_futureInterface.setProgressRange(0, 200);
m_futureInterface.setProgressValueAndText(0, QLatin1String("Transferring application"));
m_futureInterface.reportStarted();
connect(toolHandler, SIGNAL(isTransferringApp(Ios::IosToolHandler*,QString,QString,int,int,QString)),
SLOT(handleIsTransferringApp(Ios::IosToolHandler*,QString,QString,int,int,QString)));
connect(toolHandler, SIGNAL(didTransferApp(Ios::IosToolHandler*,QString,QString,Ios::IosToolHandler::OpStatus)),
SLOT(handleDidTransferApp(Ios::IosToolHandler*,QString,QString,Ios::IosToolHandler::OpStatus)));
connect(toolHandler, SIGNAL(finished(Ios::IosToolHandler*)),
SLOT(handleFinished(Ios::IosToolHandler*)));
connect(toolHandler, SIGNAL(errorMsg(Ios::IosToolHandler*,QString)),
SLOT(handleErrorMsg(Ios::IosToolHandler*,QString)));
toolHandler->requestTransferApp(appBundle(), deviceId());
}
开发者ID:ProDataLab,项目名称:qt-creator,代码行数:25,代码来源:iosdeploystep.cpp
示例16: QTC_CHECK
void WorkingDirectoryAspect::addToMainConfigurationWidget(QWidget *parent, QFormLayout *layout)
{
QTC_CHECK(!m_chooser);
m_resetButton = new QToolButton(parent);
m_resetButton->setToolTip(tr("Reset to Default"));
m_resetButton->setIcon(Core::Icons::RESET.icon());
connect(m_resetButton.data(), &QAbstractButton::clicked, this, &WorkingDirectoryAspect::resetPath);
m_chooser = new PathChooser(parent);
m_chooser->setHistoryCompleter(m_key);
m_chooser->setExpectedKind(Utils::PathChooser::Directory);
m_chooser->setPromptDialogTitle(tr("Select Working Directory"));
m_chooser->setBaseFileName(m_defaultWorkingDirectory);
m_chooser->setFileName(m_workingDirectory.isEmpty() ? m_defaultWorkingDirectory : m_workingDirectory);
connect(m_chooser.data(), &PathChooser::pathChanged, this,
[this]() {
m_workingDirectory = m_chooser->rawFileName();
m_resetButton->setEnabled(m_workingDirectory != m_defaultWorkingDirectory);
});
m_resetButton->setEnabled(m_workingDirectory != m_defaultWorkingDirectory);
if (auto envAspect = runConfiguration()->extraAspect<EnvironmentAspect>()) {
connect(envAspect, &EnvironmentAspect::environmentChanged, m_chooser.data(), [this, envAspect] {
m_chooser->setEnvironment(envAspect->environment());
});
m_chooser->setEnvironment(envAspect->environment());
}
auto hbox = new QHBoxLayout;
hbox->addWidget(m_chooser);
hbox->addWidget(m_resetButton);
layout->addRow(tr("Working directory:"), hbox);
}
开发者ID:C-sjia,项目名称:qt-creator,代码行数:34,代码来源:runconfigurationaspects.cpp
示例17: AssistInterface
// --------------------------
// CppQuickFixAssistInterface
// --------------------------
CppQuickFixInterface::CppQuickFixInterface(CppEditorWidget *editor,
AssistReason reason)
: AssistInterface(editor->document(), editor->position(),
editor->textDocument()->filePath().toString(), reason)
, m_editor(editor)
, m_semanticInfo(editor->semanticInfo())
, m_snapshot(CppModelManager::instance()->snapshot())
, m_currentFile(CppRefactoringChanges::file(editor, m_semanticInfo.doc))
, m_context(m_semanticInfo.doc, m_snapshot)
{
QTC_CHECK(m_semanticInfo.doc);
QTC_CHECK(m_semanticInfo.doc->translationUnit());
QTC_CHECK(m_semanticInfo.doc->translationUnit()->ast());
ASTPath astPath(m_semanticInfo.doc);
m_path = astPath(editor->textCursor());
}
开发者ID:AgnosticPope,项目名称:qt-creator,代码行数:19,代码来源:cppquickfixassistant.cpp
示例18: selectedIndex
void BranchDialog::checkout()
{
QModelIndex idx = selectedIndex();
QTC_CHECK(m_model->isLocal(idx));
m_model->checkoutBranch(idx);
enableButtons();
}
开发者ID:CNOT,项目名称:julia-studio,代码行数:8,代码来源:branchdialog.cpp
示例19: QSyntaxHighlighter
GitSubmitHighlighter::GitSubmitHighlighter(QTextEdit * parent) :
QSyntaxHighlighter(parent),
m_commentFormat(commentFormat()),
m_keywordPattern(QLatin1String("^\\w+:")),
m_hashChar(QLatin1Char('#'))
{
QTC_CHECK(m_keywordPattern.isValid());
}
开发者ID:CNOT,项目名称:julia-studio,代码行数:8,代码来源:gitsubmiteditorwidget.cpp
示例20: possibleBaseEnvironments
int EnvironmentAspect::baseEnvironmentBase() const
{
if (m_base == -1) {
QList<int> bases = possibleBaseEnvironments();
QTC_ASSERT(!bases.isEmpty(), return -1);
foreach (int i, bases)
QTC_CHECK(i >= 0);
m_base = bases.at(0);
}
开发者ID:UIKit0,项目名称:qt-creator,代码行数:9,代码来源:environmentaspect.cpp
注:本文中的QTC_CHECK函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论