silvansky programming stuff

6Apr/110

assert

Наткнулся в коде (/src/gui/dialogs/qinputdialog.cpp):

void QInputDialog::setInputMode(InputMode mode)
{
    Q_D(QInputDialog);
 
    QWidget *widget;
 
    /*
        Warning: Some functions in QInputDialog rely on implementation details
        of the code below. Look for the comments that accompany the calls to
        setInputMode() throughout this file before you change the code below.
    */
 
    switch (mode) {
    case IntInput:
        d->ensureIntSpinBox();
        widget = d->intSpinBox;
        break;
    case DoubleInput:
        d->ensureDoubleSpinBox();
        widget = d->doubleSpinBox;
        break;
    default:
        Q_ASSERT(mode == TextInput);
        d->chooseRightTextInputWidget();
        return;
    }
 
    d->setInputWidget(widget);
}

switch просто поразил своим ассертом в default'е! )

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

No trackbacks yet.