Esempio n. 1
0
void Grabber::createActions()
{
    renderIntoPixmapAct = new QAction(tr("&Render into Pixmap..."), this);
    renderIntoPixmapAct->setShortcut(tr("Ctrl+R"));
    connect(renderIntoPixmapAct, SIGNAL(triggered()),
            this, SLOT(renderIntoPixmap()));

    grabFrameBufferAct = new QAction(tr("&Grab Frame Buffer"), this);
    grabFrameBufferAct->setShortcut(tr("Ctrl+G"));
    connect(grabFrameBufferAct, SIGNAL(triggered()),
            this, SLOT(grabFrameBuffer()));

    clearPixmapAct = new QAction(tr("&Clear Pixmap"), this);
    clearPixmapAct->setShortcut(tr("Ctrl+L"));
    connect(clearPixmapAct, SIGNAL(triggered()), this, SLOT(clearPixmap()));

    exitAct = new QAction(tr("Close"), this);
    exitAct->setShortcuts(QKeySequence::Quit);
    connect(exitAct, SIGNAL(triggered()), this, SLOT(actionClose()));

    aboutAct = new QAction(tr("&About"), this);
    connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));

    aboutQtAct = new QAction(tr("About &CopperSpice"), this);
    connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
}
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: setGL(); break;
        case 1: setPixelmap(); break;
        case 2: refresh(); break;
        case 3: grabFrameBuffer(); break;
        case 4: clearPixmap(); break;
        case 5: about(); break;
        case 6: open(); break;
        case 7: hideDim(); break;
        case 8: ctxMenu((*reinterpret_cast< const QPoint(*)>(_a[1]))); break;
        case 9: dimensionClick((*reinterpret_cast< const QPoint(*)>(_a[1]))); break;
        case 10: marginClick((*reinterpret_cast< const QPoint(*)>(_a[1]))); break;
        case 11: setLinear(); break;
        case 12: setLog(); break;
        case 13: insertDim(); break;
        case 14: brush(); break;
        case 15: reset(); break;
        case 16: finishedDrawing(); break;
        default: ;
        }
        _id -= 17;
    }
    return _id;
}
Esempio n. 3
0
void MainWindow::createActions()
{
    renderIntoPixmapAct = new QAction(tr("&start kinect"), this);
    renderIntoPixmapAct->setShortcut(tr("Ctrl+R"));
    connect(renderIntoPixmapAct, SIGNAL(triggered()),
            this, SLOT(start()));

    grabFrameBufferAct = new QAction(tr("&Pause/Continue"), this);
    grabFrameBufferAct->setShortcut(tr("Ctrl+G"));
    connect(grabFrameBufferAct, SIGNAL(triggered()),
            this, SLOT(grabFrameBuffer()));

    clearPixmapAct = new QAction(tr("&for feature"), this);
    clearPixmapAct->setShortcut(tr("Ctrl+L"));
    connect(clearPixmapAct, SIGNAL(triggered()), this, SLOT(clearPixmap()));

    exitAct = new QAction(tr("E&xit"), this);
    exitAct->setShortcuts(QKeySequence::Quit);
    connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));

    aboutAct = new QAction(tr("&About"), this);
    connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));

    aboutQtAct = new QAction(tr("About &Qt"), this);
    connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
}
Esempio n. 4
0
void iDrawMainWindow::createActions()
{
    renderIntoPixmapAct = new QAction(tr("&Render into Pixmap..."), this);
    renderIntoPixmapAct->setShortcut(tr("Ctrl+R"));
    connect(renderIntoPixmapAct, SIGNAL(triggered()),
            this, SLOT(renderIntoPixmap()));

    grabFrameBufferAct = new QAction(tr("&Grab Frame Buffer"), this);
    grabFrameBufferAct->setShortcut(tr("Ctrl+G"));
    connect(grabFrameBufferAct, SIGNAL(triggered()),
            this, SLOT(grabFrameBuffer()));

    clearPixmapAct = new QAction(tr("&Clear Pixmap"), this);
    clearPixmapAct->setShortcut(tr("Ctrl+L"));
    connect(clearPixmapAct, SIGNAL(triggered()), this, SLOT(clearPixmap()));

    exitAct = new QAction(tr("E&xit"), this);
    exitAct->setShortcut(tr("Ctrl+Q"));
    connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));

    aboutAct = new QAction(tr("&About"), this);
    connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));

    aboutQtAct = new QAction(tr("About &Qt"), this);
    connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
}
Esempio n. 5
0
QSearchLineEdit::QSearchLineEdit(QWidget* parent,
                                 const QString &clearIconFileName,
                                 const QString &optionsIconFileName,
                                 const QString &cancelIconFileName)
    : QLineEdit(parent)
{
    maybeFound = true;

    cancelPointer = 0;
    cancelButtonIcon = cancelIconFileName;

    searchStarted = false;
    sPbar = 0;
    stopButton = 0;

    QSize msz = minimumSizeHint();

    QPixmap optionsPixmap(optionsIconFileName.isEmpty() ? ":/images/search.png" : optionsIconFileName);
    optionsPixmap = optionsPixmap.scaledToHeight(fontMetrics().height() , Qt::SmoothTransformation);
    optionButton = new QToolButton(this);
    optionButton->setIcon(QIcon(optionsPixmap));
    optionButton->setIconSize(optionsPixmap.size());
    optionButton->setCursor(Qt::ArrowCursor);
    optionButton->setStyleSheet("QToolButton { border: none; padding: 0px; }");

    clearButton = new QToolButton(this);
    QString defaultClearIcon = ":/images/clear-left.png";
    if (layoutDirection() == Qt::RightToLeft) {
        defaultClearIcon = ":/images/clear-right.png";
    }
    QPixmap clearPixmap(clearIconFileName.isEmpty() ? defaultClearIcon : clearIconFileName);
    clearPixmap = clearPixmap.scaledToHeight(fontMetrics().height() /*msz.height()*/, Qt::SmoothTransformation);
    clearButton->setIcon(QIcon(clearPixmap));
    clearButton->setIconSize(clearPixmap.size());
    clearButton->setCursor(Qt::ArrowCursor);
    clearButton->hide();



    connect(clearButton, SIGNAL(clicked()), this, SIGNAL(clearButtonPressed()));
    connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));
    connect(clearButton, SIGNAL(clicked()), this, SLOT(resetNotFound()));
    connect(this, SIGNAL(textChanged(QString)), this, SLOT(updateCloseButton(QString)));

    setMinimumSize(qMax(msz.width(), optionButton->sizeHint().width() + clearButton->sizeHint().width()),
                   qMax(qMax(msz.height(), optionButton->sizeHint().height()), clearButton->sizeHint().height()));
    setStyleSheet(QString("QLineEdit { padding-left: %1px; padding-right: %2px; } ").arg(clearButton->sizeHint().width()).arg(optionButton->sizeHint().width()));
    clearButton->setStyleSheet("QToolButton { border: none; padding: 0px; }");
}
Esempio n. 6
0
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: renderIntoPixmap(); break;
        case 1: grabFrameBuffer(); break;
        case 2: clearPixmap(); break;
        case 3: about(); break;
        default: ;
        }
        _id -= 4;
    }
    return _id;
}