Exemplo n.º 1
0
DropSiteWindow::DropSiteWindow(const QApplication &app)
{
    dropArea = new DropArea;
    Ui_Form imageViewerUi;
    imageViewerUi.setupUi(this);

    connect( imageViewerUi.pushButton_5, SIGNAL(clicked()), this, SLOT(zoomInView()) );
    connect( imageViewerUi.pushButton, SIGNAL(clicked()), this, SLOT(zoomOutView()) );
    connect( imageViewerUi.pushButton_10, SIGNAL(clicked()), this, SLOT(panLeftView()) );
    connect( imageViewerUi.pushButton_8, SIGNAL(clicked()), this, SLOT(panRightView()) );
    connect( imageViewerUi.pushButton_3, SIGNAL(clicked()), this, SLOT(panUpView()) );
    connect( imageViewerUi.pushButton_7, SIGNAL(clicked()), this, SLOT(panDownView()) );
    connect( imageViewerUi.pushButton_4, SIGNAL(clicked()), this, SLOT(rotateAntiClockwiseView()) );
    connect( imageViewerUi.pushButton_6, SIGNAL(clicked()), this, SLOT(rotateClockWiseView()) );
    connect( imageViewerUi.pushButton_2, SIGNAL(clicked()), &app, SLOT(quit()));
    connect( imageViewerUi.pushButton_9, SIGNAL(clicked()), dropArea, SLOT(clearView()));
    connect(imageViewerUi.pushButton_11, SIGNAL(clicked()), this, SLOT(openFile()));


    abstractLabel = new QLabel(tr("Drop an Image below"));
    abstractLabel->setMaximumHeight(20);
    abstractLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);

    imageViewerUi.verticalLayout_2->addWidget(abstractLabel);
    imageViewerUi.verticalLayout_2->addWidget(dropArea);

    setWindowTitle(tr("Drop Site"));
    setMinimumSize(350, 500);
}
void HtmlPreviewController::createActions()
{
    zoomInAction = createAction(tr("Zoom &In"), QKeySequence(Qt::CTRL | Qt::Key_Plus));
    connect(zoomInAction, SIGNAL(triggered()), 
            this, SLOT(zoomInView()));

    zoomOutAction = createAction(tr("Zoom &Out"), QKeySequence(Qt::CTRL | Qt::Key_Minus));
    connect(zoomOutAction, SIGNAL(triggered()),
            this, SLOT(zoomOutView()));

    zoomResetAction = createAction(tr("Reset &Zoom"), QKeySequence(Qt::CTRL | Qt::Key_0));
    connect(zoomResetAction, SIGNAL(triggered()),
            this, SLOT(resetZoomOfView()));
}