当前位置: 首页>>代码示例>>C++>>正文


C++ QChar::isUpper方法代码示例

本文整理汇总了C++中QChar::isUpper方法的典型用法代码示例。如果您正苦于以下问题:C++ QChar::isUpper方法的具体用法?C++ QChar::isUpper怎么用?C++ QChar::isUpper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QChar的用法示例。


在下文中一共展示了QChar::isUpper方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: extractKeywords

static void extractKeywords(const QByteArray &input, QStringList *destination)
{
    if (!destination)
        return;

    QString keyword;
    int ignoreZone = 0;
    for (int i = 0; i < input.count(); ++i) {
        const QChar chr = QLatin1Char(input.at(i));
        if (chr == QLatin1Char('{'))
            ++ignoreZone;
        if (chr == QLatin1Char('}'))
            --ignoreZone;
        if (ignoreZone == 0) {
            if ((chr.isLetterOrNumber() && chr.isUpper())
                || chr == QLatin1Char('_')) {
                keyword += chr;
            } else {
                if (!keyword.isEmpty()) {
                    if (keyword.size() > 1)
                        *destination << keyword;
                    keyword.clear();
                }
            }
        }
    }
    if (keyword.size() > 1)
        *destination << keyword;
}
开发者ID:csuft,项目名称:qt-creator,代码行数:29,代码来源:cmakevalidator.cpp

示例2: fixTwoUppercaseChars

void Autocorrect::fixTwoUppercaseChars()
{
    if (! m_fixTwoUppercaseChars) return;
    if (m_word.length() <= 2) return;

    if (m_twoUpperLetterExceptions.contains(m_word.trimmed()))
        return;

    QChar firstChar = m_word.at(0);
    QChar secondChar = m_word.at(1);

    if (secondChar.isUpper()) {
        QChar thirdChar = m_word.at(2);

        if (firstChar.isUpper() && thirdChar.isLower())
            m_word.replace(1, 1, secondChar.toLower());
    }
}
开发者ID:KDE,项目名称:calligra-history,代码行数:18,代码来源:Autocorrect.cpp

示例3: fixupQString

const QString ctkLDAPExpr::fixupQString( const QString &s )
{
  QString sb;
  int len = s.length();
  for(int i=0; i<len; i++) {
    QChar c = s.at(i);
    if (!c.isSpace()) {
      if (c.isUpper())
        c = c.toLower();
      sb.append(c);
    }
  }
  return sb;
}
开发者ID:sixthfore,项目名称:CTK,代码行数:14,代码来源:ctkLDAPExpr.cpp

示例4: nextTokenKind


//.........这里部分代码省略.........
            m_curpos++;
        }
        // if the string is never terminated, make sure we don't overflow the boundaries
        if ( m_curpos == m_contentSize ) {
            --m_curpos;
        }
    }
    else if (it->unicode() == '=')
    {
        if ((it + 1)->unicode() == '=')
        {
            m_curpos++;
            token = Parser::Token_IS_EQUAL;
        }
        else if ((it + 1)->unicode() == '<') {
            m_curpos++;
            token = Parser::Token_IS_SMALLER_OR_EQUAL;
        }
        else if ((it + 1)->unicode() == ':' && (it + 2)->unicode() == '=')
        {
            m_curpos += 2;
            token = Parser::Token_EXACT_EQUATIONAL;
        }
        else if ((it + 1)->unicode() == '/' && (it + 2)->unicode() == '=')
        {
            m_curpos += 2;
            token = Parser::Token_EXACT_NOT_EQUATIONAL;
        }
        else
        {
            token = Parser::Token_ASSIGN;
        }
    }
    else if (it->isLetter() && it->isUpper())
    {
        QString name;
        while (m_curpos < m_contentSize && (isValidVariableIdentifier(it))) {
            name.append(*it);
            it++;
            m_curpos++;
        }
        m_curpos--;
        token = Parser::Token_VARIABLE;
    }
    else if (it->isLetter() && it->isLower())
    {
        QString name;
        while (m_curpos < m_contentSize && (isValidVariableIdentifier(it))) {
            name.append(*it);
            it++;
            m_curpos++;
        }

        m_curpos--;

        if (name == "after") {
            token = Parser::Token_AFTER;
        } else if (name == "begin") {
            token = Parser::Token_BEGIN;
        } else if (name == "case") {
            token = Parser::Token_CASE;
        } else if (name == "if") {
            token = Parser::Token_IF;
        } else if (name == "catch") {
            token = Parser::Token_CATCH;
        } else if (name == "cond") {
开发者ID:scooterman,项目名称:kdevelop-erlang,代码行数:67,代码来源:erlanglexer.cpp

示例5: fromScriptValue


//.........这里部分代码省略.........
            } else if (event.text.toUpper() == "F3") {
                event.key = Qt::Key_F3;
            } else if (event.text.toUpper() == "F4") {
                event.key = Qt::Key_F4;
            } else if (event.text.toUpper() == "F5") {
                event.key = Qt::Key_F5;
            } else if (event.text.toUpper() == "F6") {
                event.key = Qt::Key_F6;
            } else if (event.text.toUpper() == "F7") {
                event.key = Qt::Key_F7;
            } else if (event.text.toUpper() == "F8") {
                event.key = Qt::Key_F8;
            } else if (event.text.toUpper() == "F9") {
                event.key = Qt::Key_F9;
            } else if (event.text.toUpper() == "F10") {
                event.key = Qt::Key_F10;
            } else if (event.text.toUpper() == "F11") {
                event.key = Qt::Key_F11;
            } else if (event.text.toUpper() == "F12") {
                event.key = Qt::Key_F12;
            } else if (event.text.toUpper() == "UP") {
                event.key = Qt::Key_Up;
                event.isKeypad = true;
            } else if (event.text.toUpper() == "DOWN") {
                event.key = Qt::Key_Down;
                event.isKeypad = true;
            } else if (event.text.toUpper() == "LEFT") {
                event.key = Qt::Key_Left;
                event.isKeypad = true;
            } else if (event.text.toUpper() == "RIGHT") {
                event.key = Qt::Key_Right;
                event.isKeypad = true;
            } else if (event.text.toUpper() == "SPACE") {
                event.key = Qt::Key_Space;
            } else if (event.text.toUpper() == "ESC") {
                event.key = Qt::Key_Escape;
            } else if (event.text.toUpper() == "TAB") {
                event.key = Qt::Key_Tab;
            } else if (event.text.toUpper() == "DELETE") {
                event.key = Qt::Key_Delete;
            } else if (event.text.toUpper() == "BACKSPACE") {
                event.key = Qt::Key_Backspace;
            } else if (event.text.toUpper() == "SHIFT") {
                event.key = Qt::Key_Shift;
            } else if (event.text.toUpper() == "ALT") {
                event.key = Qt::Key_Alt;
            } else if (event.text.toUpper() == "CONTROL") {
                event.key = Qt::Key_Control;
            } else if (event.text.toUpper() == "META") {
                event.key = Qt::Key_Meta;
            } else if (event.text.toUpper() == "PAGE DOWN") {
                event.key = Qt::Key_PageDown;
            } else if (event.text.toUpper() == "PAGE UP") {
                event.key = Qt::Key_PageUp;
            } else if (event.text.toUpper() == "HOME") {
                event.key = Qt::Key_Home;
            } else if (event.text.toUpper() == "END") {
                event.key = Qt::Key_End;
            } else if (event.text.toUpper() == "HELP") {
                event.key = Qt::Key_Help;
            } else if (event.text.toUpper() == "CAPS LOCK") {
                event.key = Qt::Key_CapsLock;
            } else {
                // Key values do not distinguish between uppercase and lowercase
                // and use the uppercase key value.
                event.key = event.text.toUpper().at(0).unicode();
            }
            event.isValid = true;
        }
    }
    
    QScriptValue isShifted = object.property("isShifted");
    if (isShifted.isValid()) {
        event.isShifted = isShifted.toVariant().toBool();
    } else {
        // if no isShifted was included, get it from the text
        QChar character = event.text.at(0);
        if (character.isLetter() && character.isUpper()) {
            event.isShifted = true;
        } else {
            // if it's a symbol, then attempt to detect shifted-ness
            if (QString("[email protected]#$%^&*()_+{}|:\"<>?").contains(character)) {
                event.isShifted = true;
            }
        }
    }
    
    
    const bool wantDebug = false;
    if (wantDebug) {
        qCDebug(scriptengine) << "event.key=" << event.key
        << " event.text=" << event.text
        << " event.isShifted=" << event.isShifted
        << " event.isControl=" << event.isControl
        << " event.isMeta=" << event.isMeta
        << " event.isAlt=" << event.isAlt
        << " event.isKeypad=" << event.isKeypad
        << " event.isAutoRepeat=" << event.isAutoRepeat;
    }
}
开发者ID:AlphaStaxLLC,项目名称:hifi,代码行数:101,代码来源:KeyEvent.cpp


注:本文中的QChar::isUpper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。