示例#1
0
AddPoint::AddPoint(QWidget *parent) :
    QDialog(parent)
{
    QRegExp regExp("[1-9][0-9]*");
    infoLabel = new QLabel(tr("Set the coordinates for the new point"));
    xLabel = new QLabel(tr("x: "));
    yLabel = new QLabel(tr("y: "));
    xCoordinate = new QLineEdit();
    yCoordinate = new QLineEdit();
    xCoordinate->setValidator(new QRegExpValidator(regExp, this));
    yCoordinate->setValidator(new QRegExpValidator(regExp, this));
    confirmButton = new QPushButton(tr("Ok"));
    cancelButton = new QPushButton(tr("Cancel"));

    connect(confirmButton, SIGNAL(clicked()), this, SLOT(closeOk()));
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(closeNotOk()));

    createLayout();

}
示例#2
0
bool QAmqpChannelPrivate::_q_method(const QAmqpMethodFrame &frame)
{
    Q_ASSERT(frame.channel() == channelNumber);
    if (frame.channel() != channelNumber)
        return true;

    if (frame.methodClass() == QAmqpFrame::Basic) {
        if (frame.id() == bmQosOk) {
            qosOk(frame);
            return true;
        }

        return false;
    }

    if (frame.methodClass() != QAmqpFrame::Channel)
        return false;

    qAmqpDebug("Channel#%d:", channelNumber);

    switch (frame.id()) {
    case miOpenOk:
        openOk(frame);
        break;
    case miFlow:
        flow(frame);
        break;
    case miFlowOk:
        flowOk(frame);
        break;
    case miClose:
        close(frame);
        break;
    case miCloseOk:
        closeOk(frame);
        break;
    }

    return true;
}