本文整理汇总了C++中QChar::upper方法的典型用法代码示例。如果您正苦于以下问题:C++ QChar::upper方法的具体用法?C++ QChar::upper怎么用?C++ QChar::upper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QChar
的用法示例。
在下文中一共展示了QChar::upper方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: match
/*
\internal
Matches the current intermediate key sequence + the latest
keyevent, with and AccelItem. Returns Identical,
PartialMatch or NoMatch, and fills \a temp with the
resulting key sequence.
*/
Qt::SequenceMatch QAccelManager::match( QKeyEvent *e, QAccelItem* item, QKeySequence& temp )
{
SequenceMatch result = Qt::NoMatch;
int index = intermediate.count();
temp = intermediate;
int modifier = translateModifiers( e->state() );
if ( e->key() && e->key() != Key_unknown) {
int key = e->key() | modifier;
if ( e->key() == Key_BackTab ) {
/*
In QApplication, we map shift+tab to shift+backtab.
This code here reverts the mapping in a way that keeps
backtab and shift+tab accelerators working, in that
order, meaning backtab has priority.*/
key &= ~SHIFT;
temp.setKey( key, index );
if ( Qt::NoMatch != (result = temp.matches( item->key )) )
return result;
if ( e->state() & ShiftButton )
key |= SHIFT;
key = Key_Tab | ( key & MODIFIER_MASK );
temp.setKey( key, index );
if ( Qt::NoMatch != (result = temp.matches( item->key )) )
return result;
} else {
temp.setKey( key, index );
if ( Qt::NoMatch != (result = temp.matches( item->key )) )
return result;
}
if ( key == Key_BackTab ) {
if ( e->state() & ShiftButton )
key |= SHIFT;
temp.setKey( key, index );
if ( Qt::NoMatch != (result = temp.matches( item->key )) )
return result;
}
}
if ( !e->text().isEmpty() ) {
QChar c = e->text()[0];
// be in accordance with accoQAccel::shortcutKey()
if ( modifier != 0 && c.isPrint() )
c = c.upper();
temp.setKey( (int)c.unicode() | UNICODE_ACCEL | modifier, index );
result = temp.matches( item->key );
}
return result;
}
示例2: shortcutKey
int QAccel::shortcutKey( const QString &str )
{
int p = 0;
while ( p >= 0 ) {
p = str.find( '&', p ) + 1;
if ( p <= 0 || p >= (int)str.length() )
return 0;
if ( str[p] != '&' ) {
QChar c = str[p];
if ( c.isPrint() ) {
c = c.upper();
return c.unicode() + ALT + UNICODE_ACCEL;
}
}
p++;
}
return 0;
}
示例3: QString
QString
wDBTable::journalFieldName(long columnId)
{
aCfgItem item;
item= md->find(md->find(columnId),md_fieldid);
item = md->find(md->text(item).toLong());
if(!item.isNull())
{
QString s = md->attr(item,mda_type);
QChar ch = s[0];
if(ch.upper()=='O')
{
return QString("text_uf%1").arg(md->attr(item,mda_id));
}
else
{
return QString("uf%1").arg(md->attr(item,mda_id));
}
}
return "uf0";
}
示例4: setKeyStr
//.........这里部分代码省略.........
case Qt::Key_Dead_Macron:
keystr += "dead-macron";
break;
case Qt::Key_Dead_Breve:
keystr += "dead-breve";
break;
case Qt::Key_Dead_Abovedot:
keystr += "dead-abovedot";
break;
case Qt::Key_Dead_Diaeresis:
keystr += "dead-diaeresis";
break;
case Qt::Key_Dead_Abovering:
keystr += "dead-abovering";
break;
case Qt::Key_Dead_Doubleacute:
keystr += "dead-doubleacute";
break;
case Qt::Key_Dead_Caron:
keystr += "dead-caron";
break;
case Qt::Key_Dead_Cedilla:
keystr += "dead-cedilla";
break;
case Qt::Key_Dead_Ogonek:
keystr += "dead-ogonek";
break;
case Qt::Key_Dead_Iota:
keystr += "dead-iota";
break;
case Qt::Key_Dead_Voiced_Sound:
keystr += "dead-voiced-sound";
break;
case Qt::Key_Dead_Semivoiced_Sound:
keystr += "dead-semivoiced-sound";
break;
case Qt::Key_Dead_Belowdot:
keystr += "dead-belowdot";
break;
case Qt::Key_Dead_Hook:
keystr += "dead-hook";
break;
case Qt::Key_Dead_Horn:
keystr += "dead-horn";
break;
#endif /* Def: QT_IMMODULE */
case Qt::Key_Shift:
keystr += "Shift_key";
break;
case Qt::Key_Control:
keystr += "Control_key";
break;
case Qt::Key_Alt:
keystr += "Alt_key";
break;
case Qt::Key_Meta:
keystr += "Meta_key";
break;
case Qt::Key_Super_L:
case Qt::Key_Super_R:
keystr += "Super_key";
break;
case Qt::Key_Hyper_L:
case Qt::Key_Hyper_R:
keystr += "Hyper_key";
break;
case Qt::Key_CapsLock:
keystr += "caps-lock";
break;
case Qt::Key_NumLock:
keystr += "num-lock";
break;
case Qt::Key_ScrollLock:
keystr += "scroll-lock";
break;
case Qt::Key_unknown:
keystr += unicodeKeyToSymStr ( pressed_unichar );
break;
default:
if( keyval >= Qt::Key_F1 && keyval <= Qt::Key_F35 )
{
keystr += "F" + QString::number( keyval - Qt::Key_F1 + 1 );
break;
}
else if( keyval < 256 )
{
QChar ch = QChar( keyval );
if( mod & Qt::ShiftButton )
ch = ch.upper();
else
ch = ch.lower();
keystr += ch;
}
}
m_keystr = keystr;
}
示例5: doObjectCompletion
bool CppEditorCompletion::doObjectCompletion( const QString &objName )
{
if ( !ths )
return FALSE;
QString object( objName );
int i = -1;
if ( ( i = object.findRev( "->" ) ) != -1 )
object = object.mid( i + 2 );
if ( ( i = object.findRev( "." ) ) != -1 )
object = object.mid( i + 1 );
object = object.simplifyWhiteSpace();
QObject *obj = 0;
if ( ths->name() == object || object == "this" ) {
obj = ths;
} else {
obj = ths->child( object );
}
if ( !obj )
return FALSE;
QValueList<CompletionEntry> lst;
if ( obj->children() ) {
for ( QObjectListIt cit( *obj->children() ); cit.current(); ++cit ) {
QString s( cit.current()->name() );
if ( s.find( " " ) == -1 && s.find( "qt_" ) == -1 && s.find( "unnamed" ) == -1 ) {
CompletionEntry c;
c.type = "variable";
c.text = s;
c.prefix = "";
lst << c;
}
}
}
QStrList props = obj->metaObject()->propertyNames( TRUE );
for ( QPtrListIterator<char> pit( props ); pit.current(); ++pit ) {
QString f( pit.current() );
QChar c = f[ 0 ];
f.remove( (uint)0, 1 );
f.prepend( c.upper() );
f.prepend( "set" );
CompletionEntry ce;
ce.type = "property";
ce.text = f;
ce.postfix = "()";
if ( lst.find( ce ) == lst.end() )
lst << ce;
}
QStrList slts = obj->metaObject()->slotNames( TRUE );
for ( QPtrListIterator<char> sit( slts ); sit.current(); ++sit ) {
QString f( sit.current() );
f = f.left( f.find( "(" ) );
CompletionEntry c;
c.type = "slot";
c.text = f;
c.postfix = "()";
if ( lst.find( c ) == lst.end() )
lst << c;
}
if ( lst.isEmpty() )
return FALSE;
showCompletion( lst );
return TRUE;
}