Exemplo n.º 1
0
    EvalMessageBox(bool expired)
    {
        setWindowTitle(QLatin1String(" "));

        QString str = qt_eval_string();
        if (expired) {
            str = QLatin1String(boilerplate_expired);
        } else {
            str = qt_eval_string();
        }
        str = str.trimmed();

        QFrame *border = new QFrame(this);

        QLabel *pixmap_label = new QLabel(border);
        pixmap_label->setPixmap(qtlogo_eval_xpm);
        pixmap_label->setAlignment(Qt::AlignTop);

        QLabel *text_label = new QLabel(str, border);

        QHBoxLayout *pm_and_text_layout = new QHBoxLayout();
        pm_and_text_layout->addWidget(pixmap_label);
        pm_and_text_layout->addWidget(text_label);

        QVBoxLayout *master_layout = new QVBoxLayout(border);
        master_layout->addLayout(pm_and_text_layout);

        QVBoxLayout *border_layout = new QVBoxLayout(this);
        border_layout->setMargin(0);
        border_layout->addWidget(border);

        if (expired) {
            QPushButton *cmd = new QPushButton(QLatin1String("OK"), border);
            cmd->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
            cmd->setDefault(true);

            QHBoxLayout *button_layout = new QHBoxLayout();
            master_layout->addLayout(button_layout);
            button_layout->addWidget(cmd);

            connect(cmd, SIGNAL(clicked()), this, SLOT(close()));
        } else {
            border->setFrameShape(QFrame::WinPanel);
            border->setFrameShadow(QFrame::Raised);
            setParent(parentWidget(), Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
            QTimer::singleShot(7000, this, SLOT(close()));
            setAttribute(Qt::WA_DeleteOnClose);
        }

        setFixedSize(sizeHint());
    }
Exemplo n.º 2
0
void qt_core_eval_init(QCoreApplicationPrivate::Type type)
{
    if (type != QCoreApplicationPrivate::Tty)
        return;

    if (!qt_eval_is_supported())
        return;

    if (qt_eval_is_expired()) {
        fprintf(stderr, "%s\n", boilerplate_expired);
        exit(0);
    } else {
        fprintf(stderr, "%s\n", qPrintable(qt_eval_string()));
        Q_UNUSED(new QCoreFuriCuri());
    }
}
Exemplo n.º 3
0
void qt_core_eval_init(uint type)
{
    if (!type)
        return;     // GUI app

    switch (qt_eval_days_left()) {
    case -2:
        return;

    case -1:
        fprintf(stderr, "%s\n", boilerplate_expired);
        if (type == 0) {
            // if we're a console app only.
            exit(0);
        }

    default:
        fprintf(stderr, "%s\n", qPrintable(qt_eval_string()));
        if (type == 0) {
            Q_UNUSED(new QCoreFuriCuri());
        }
    }
}