本文整理汇总了C++中QStatusBar::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ QStatusBar::clear方法的具体用法?C++ QStatusBar::clear怎么用?C++ QStatusBar::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QStatusBar
的用法示例。
在下文中一共展示了QStatusBar::clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dispatchAccelEvent
/*
\internal
Checks for possible accelerators, if no widget
ate the keypres, or we are in the middle of a
partial key sequence.
*/
bool QAccelManager::dispatchAccelEvent( QWidget* w, QKeyEvent* e )
{
#ifndef QT_NO_STATUSBAR
// Needs to be declared and used here because of "goto doclash"
QStatusBar* mainStatusBar = 0;
#endif
// Modifiers can NOT be accelerators...
if ( e->key() >= Key_Shift &&
e->key() <= Key_Alt )
return FALSE;
SequenceMatch result = Qt::NoMatch;
QKeySequence tocheck, partial;
QAccelPrivate* accel = 0;
QAccelItem* item = 0;
QAccelPrivate* firstaccel = 0;
QAccelItem* firstitem = 0;
QAccelPrivate* lastaccel = 0;
QAccelItem* lastitem = 0;
QKeyEvent pe = *e;
int n = -1;
int hasShift = (e->state()&Qt::ShiftButton)?1:0;
bool identicalDisabled = FALSE;
bool matchFound = FALSE;
do {
accel = accels.first();
matchFound = FALSE;
while ( accel ) {
if ( correctSubWindow( w, accel ) ) {
if ( accel->enabled ) {
item = accel->aitems.last();
while( item ) {
if ( Qt::Identical == (result = match( &pe, item, tocheck )) ) {
if ( item->enabled ) {
if ( !firstaccel ) {
firstaccel = accel;
firstitem = item;
}
lastaccel = accel;
lastitem = item;
n++;
matchFound = TRUE;
if ( n > QMAX(clash,0) )
goto doclash;
} else {
identicalDisabled = TRUE;
}
}
if ( item->enabled && Qt::PartialMatch == result ) {
partial = tocheck;
matchFound = TRUE;
}
item = accel->aitems.prev();
}
} else {
item = accel->aitems.last();
while( item ) {
if ( Qt::Identical == match( &pe, item, tocheck ) )
identicalDisabled = TRUE;
item = accel->aitems.prev();
}
}
}
accel = accels.next();
}
pe = QKeyEvent( QEvent::Accel, pe.key(), pe.ascii(), pe.state()&~Qt::ShiftButton, pe.text() );
} while ( hasShift-- && !matchFound && !identicalDisabled );
#ifndef QT_NO_STATUSBAR
mainStatusBar = (QStatusBar*) w->topLevelWidget()->child( 0, "QStatusBar" );
#endif
if ( n < 0 ) { // no match found
currentState = partial.count() ? PartialMatch : NoMatch;
#ifndef QT_NO_STATUSBAR
// Only display message if we are, or were, in a partial match
if ( mainStatusBar && (PartialMatch == currentState || intermediate.count() ) ) {
if ( currentState == Qt::PartialMatch ) {
mainStatusBar->message( (QString)partial + ", ...", 0 );
} else if (!identicalDisabled) {
QString message = QAccel::tr("%1, %2 not defined").
arg( (QString)intermediate ).
arg( QKeySequence::encodeString( e->key() | translateModifiers(e->state()) ) );
mainStatusBar->message( message, 2000 );
// Since we're a NoMatch, reset the clash count
clash = -1;
} else {
mainStatusBar->clear();
}
}
#endif
bool eatKey = (PartialMatch == currentState || intermediate.count() );
//.........这里部分代码省略.........