Exemplo n.º 1
0
void GenericCodeEditor::wheelEvent( QWheelEvent * e )
{
    // FIXME: Disable zooming for now, to avoid nasty effect when Ctrl
    // is unintentionally pressed while inertial scrolling is going on.

    // Moreover, Ctrl|Shift + Wheel scrolls by pages, which is also
    // rather annoying.

    // So rather just forward the event without modifiers.

    QWheelEvent modifiedEvent( e->pos(), e->globalPos(), e->delta(),
                               e->buttons(), 0, e->orientation() );
    QPlainTextEdit::wheelEvent( &modifiedEvent );
    return;

#if 0
    if (e->modifiers() == Qt::ControlModifier) {
        if (e->delta() > 0)
            zoomIn();
        else
            zoomOut();
        return;
    }

    QPlainTextEdit::wheelEvent(e);
#endif
}
Exemplo n.º 2
0
void HelpBrowser::createActions()
{
    QAction * action;
    OverridingAction *ovrAction;

    mActions[GoHome] = action = new QAction(tr("Home"), this);
    connect( action, SIGNAL(triggered()), this, SLOT(goHome()) );

    mActions[DocClose] = ovrAction = new OverridingAction(tr("Close"), this);
    connect( ovrAction, SIGNAL(triggered()), this, SLOT(closeDocument()) );
    ovrAction->addToWidget(mWebView);

    mActions[ZoomIn] = ovrAction = new OverridingAction(tr("Zoom In"), this);
    connect(ovrAction, SIGNAL(triggered()), this, SLOT(zoomIn()));
    ovrAction->addToWidget(mWebView);

    mActions[ZoomOut] = ovrAction = new OverridingAction(tr("Zoom Out"), this);
    connect(ovrAction, SIGNAL(triggered()), this, SLOT(zoomOut()));
    ovrAction->addToWidget(mWebView);

    mActions[ResetZoom] = ovrAction = new OverridingAction(tr("Reset Zoom"), this);
    connect(ovrAction, SIGNAL(triggered()), this, SLOT(resetZoom()));
    ovrAction->addToWidget(mWebView);

    mActions[Evaluate] = ovrAction = new OverridingAction(tr("Evaluate as Code"), this);
    connect(ovrAction, SIGNAL(triggered()), this, SLOT(evaluateSelection()));
    ovrAction->addToWidget(mWebView);

    // For the sake of display:
    mWebView->pageAction(QWebPage::Copy)->setShortcut( QKeySequence::Copy );
    mWebView->pageAction(QWebPage::Paste)->setShortcut( QKeySequence::Paste );
}
Exemplo n.º 3
0
void ImageViewer::createActions()
{
  openAct = new QAction(tr("&Open..."), this);
  openAct->setShortcut(tr("Ctrl+O"));
  connect(openAct, SIGNAL(triggered()), this, SLOT(open()));

  saveAct = new QAction(tr("&Save..."), this);
  saveAct->setShortcut(tr("Ctrl+S"));
  connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
  saveAct->setEnabled(false);


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

  zoomInAct = new QAction(tr("Zoom &In (25%)"), this);
  zoomInAct->setShortcut(tr("Ctrl++"));
  zoomInAct->setEnabled(false);
  connect(zoomInAct, SIGNAL(triggered()), this, SLOT(zoomIn()));

  zoomOutAct = new QAction(tr("Zoom &Out (25%)"), this);
  zoomOutAct->setShortcut(tr("Ctrl+-"));
  zoomOutAct->setEnabled(false);
  connect(zoomOutAct, SIGNAL(triggered()), this, SLOT(zoomOut()));

  normalSizeAct = new QAction(tr("&Normal Size"), this);
  normalSizeAct->setShortcut(tr("Ctrl+S"));
  normalSizeAct->setEnabled(false);
  connect(normalSizeAct, SIGNAL(triggered()), this, SLOT(normalSize()));

  fitToWindowAct = new QAction(tr("&Fit to Window"), this);
  fitToWindowAct->setEnabled(false);
  fitToWindowAct->setCheckable(true);
  fitToWindowAct->setShortcut(tr("Ctrl+F"));
  connect(fitToWindowAct, SIGNAL(triggered()), this, SLOT(fitToWindow()));

  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()));
  
  proceedAct = new QAction(tr("Proceed image"), this);
  proceedAct->setEnabled(false);
  proceedAct->setShortcut(tr("Ctrl+P"));
  connect(proceedAct, SIGNAL(triggered()),this, SLOT(proceed()));
  
  proceedByStepAct = new QAction(tr("Proceed image by step"), this);
  proceedByStepAct->setEnabled(false);
  connect(proceedByStepAct, SIGNAL(triggered()),this, SLOT(proceedByStep()));

  // Log function
  imageProcessor = new ImageProcessor();
  connect(imageProcessor,SIGNAL(sendLogMessage(QString,int)),
          this,SLOT(writeLog(QString,int)));
  connect(imageProcessor,SIGNAL(sendImage(QImage&)),
         this,SLOT(updateImage(QImage&)));

}
Exemplo n.º 4
0
void EditorWindow::createActions()
{
	openAct = new QAction(tr("&Open"), this);
	openAct->setShortcut(QKeySequence::Open);
	connect(openAct, SIGNAL(triggered()), this, SLOT(openImage()));

	saveAct = new QAction(tr("&Save"), this);
	saveAct->setShortcut(QKeySequence::Save);
	connect(saveAct, SIGNAL(triggered()), this, SLOT(saveImage()));

	saveAsAct = new QAction(tr("Save As"), this);
	saveAsAct->setShortcut(QKeySequence::SaveAs);
	connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveImageAs()));

	quitAct = new QAction(tr("Quit"), this);
	quitAct->setShortcut(QKeySequence::Quit);
	connect(quitAct, SIGNAL(triggered()), this, SLOT(close()));

	zoomInAct = new QAction(tr("Zoom In"), this);
	zoomInAct->setShortcut(QKeySequence::ZoomIn);
	connect(zoomInAct, SIGNAL(triggered()), imageWidget, SLOT(zoomIn()));

	zoomOutAct = new QAction(tr("Zoom Out"), this);
	zoomOutAct->setShortcut(QKeySequence::ZoomOut);
	connect(zoomOutAct, SIGNAL(triggered()), imageWidget, SLOT(zoomOut()));
	connect(imageWidget, SIGNAL(zoomOutAvailableChanged(bool)), zoomOutAct, SLOT(setEnabled(bool)));

	zoomOriginalAct = new QAction(tr("Actual Size"), this);
	connect(zoomOriginalAct, SIGNAL(triggered()), imageWidget, SLOT(zoomOriginal()));

	zoomByWheelAct = new QAction(tr("Zoom by Mouse Wheel"), this);
	zoomByWheelAct->setCheckable(true);
	zoomByWheelAct->setChecked(false);
	connect(zoomByWheelAct, SIGNAL(toggled(bool)), imageWidget, SLOT(setWheelZoom(bool)));

	autoContrastAct = new QAction(tr("Auto Contrast"), this);
	autoContrastAct->setToolTip(tr("Apply luminance histogram stretching"));
	connect(autoContrastAct, SIGNAL(triggered()), this, SLOT(doAutoContrast()));

	autoLevelsAct = new QAction(tr("Auto Levels"), this);
	autoLevelsAct->setToolTip(tr("Apply channel-wise RGB histogram stretching"));
	connect(autoLevelsAct, SIGNAL(triggered()), this, SLOT(doAutoLevels()));

	whiteBalanceAct = new QAction(tr("Correct White Balance"), this);
	whiteBalanceAct->setToolTip(tr("Apply white balance correction using greyworld model"));
	connect(whiteBalanceAct, SIGNAL(triggered()), this, SLOT(doWhiteBalance()));

	geometryAct = new QAction(tr("Scale/Rotate"), this);
	geometryAct->setToolTip(tr("Scale and rotate image relative to the center"));
	connect(geometryAct, SIGNAL(triggered()), this, SLOT(doGeometryTransform()));

	filterAct = new QAction(tr("Filters && Effects"), this);
	filterAct->setToolTip(tr("Open filtration dialog"));
	connect(filterAct, SIGNAL(triggered()), this, SLOT(doFilter()));

	convolutionAct = new QAction(tr("Convolution"), this);
	convolutionAct->setToolTip(tr("Apply convolution with arbitrary kernel"));
	connect(convolutionAct, SIGNAL(triggered()), this, SLOT(doConvolution()));
}
Exemplo n.º 5
0
/**
 * zooms out by factor f
 */
void RS_GraphicView::zoomOut(double f, const RS_Vector& center) {
	if (f<1.0e-6) {
		RS_DEBUG->print(RS_Debug::D_WARNING,
						"RS_GraphicView::zoomOut: invalid factor");
		return;
	}
	zoomIn(1/f, center);
}
Exemplo n.º 6
0
/** We received a mouse wheel movement.
 */
void CSailDispLabel::wheelEvent( QWheelEvent *event)
{
    if (event->delta()>0)
        zoomIn();
    else
        zoomOut();
    redraw();
}
Exemplo n.º 7
0
//!
//! Event handler for mouse wheel events.
//!
//! \param event The description of the mouse wheel event.
//!
void BaseGraphicsView::wheelEvent ( QWheelEvent *event )
{
    if (event->delta() != 0)
        if (event->delta() > 0)
            zoomIn();
        else
            zoomOut();
}
Exemplo n.º 8
0
void GraphicsView::wheelEvent(QWheelEvent *event) {
    if(event->delta() > 0) {
        emit zoomIn();
    }
    else {
        emit zoomOut();
    }
}
// public slot
void kpMainWindow::slotZoomIn ()
{
#if DEBUG_KP_MAIN_WINDOW
    kdDebug () << "kpMainWindow::slotZoomIn ()" << endl;
#endif

    zoomIn (false/*don't center under cursor*/);
}
Exemplo n.º 10
0
void ExprTextEdit::wheelEvent(QWheelEvent* event)
{
    if(event->modifiers() == Qt::ControlModifier){
        if(event->delta()>0) zoomIn();
        else if(event->delta()<0) zoomOut();
    }
    return QTextEdit::wheelEvent(event);
}
Exemplo n.º 11
0
/**
 * @brief Quick zoom in to a state of the Visualization model which has the
 * given bin size. The actual value of the bin size may en up being slightly
 * different because of the fine tuning performed by the model.
 *
 * @param binSize: an approximate value for the new size of the bins.
 */
void KsGraphModel::quickZoomIn(uint64_t binSize)
{
	double range, r;

	range =  _histo.max - _histo.min;
	r = 1 - (binSize * _histo.n_bins) / range;
	zoomIn(r);
}
Exemplo n.º 12
0
void XTestZoom::onChanged()
{
    float velocity = m_recognizer->velocity();
    if (velocity > m_minEffectiveVelocity) {
            zoomOut();
    } else if (velocity < -m_minEffectiveVelocity){
            zoomIn();
    }
}
Exemplo n.º 13
0
void PaintArea::mousePressEvent(QMouseEvent *event)
{
    if (event->button() == Qt::RightButton)
        _right = true;
    else
        _right = false;
    if (_tool != 0)
    {
        _redo.clear();
        emit noRedo();
    }
    if (_isselect)
    {
        Undo();
        _isselect = false;
        emit noCopy();
    }
    lastPoint = event->pos();
    if (_tool == 7)
    {
        _history.push_back(image);
        emit enableUndo();
        drawWord(lastPoint);
    }
    else if (_tool == 6)
    {
        _history.push_back(image);
        emit enableUndo();
        drawBucket(event->pos());
    }
    else if (_tool == 10)
    {
        _history.push_back(image);
        emit enableUndo();
        Paste(event->pos());
    }
    else if (_tool == 12)
    {
        if (event->button() == Qt::LeftButton)
            zoomIn();
        else
            zoomOut();
    }
    else
    {
        _history.push_back(image);
        emit enableUndo();
        _scroll = image;
        scribbling = true;
        if (_tool == 1)
            drawLineTo(event->pos());
        else if (_tool == 2)
            drawEraser(event->pos());
        else if (_tool == 11)
            drawSpray(event->pos());
    }
}
Exemplo n.º 14
0
void MyTextBrowser::setZOOM_FACTOR(int factor)
{
#ifdef NO_WEBKIT
  if(factor > 1) zoomIn();
  else           zoomOut();
#else
  setZoomFactor(factor);
#endif
}
ScalableWrapper::ScalableWrapper(QTextEdit* _editor, QWidget* _parent) :
	QGraphicsView(_parent),
	m_scene(new QGraphicsScene),
	m_editor(_editor),
	m_zoomRange(1),
	m_gestureZoomInertionBreak(0)
{
	//
	// Отслеживаем жесты
	//
	grabGesture(Qt::PinchGesture);

	//
	// Всегда показываем полосы прокрутки
	//
	setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
	setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);

	//
	// Предварительная настройка редактора текста
	//
	// FIXME: непонятно как быть с предком, у встраиваемого виджета не должно быть родителя,
	//		  но как в таком случае освобождать память?
	//
	m_editor->setParent(0);
	m_editor->setContextMenuPolicy(Qt::PreventContextMenu);
	m_editor->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
	m_editor->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
	m_editor->installEventFilter(this);

	//
	// Настраиваем само представление
	//
	m_rect = m_scene->addRect(0, 0, 1, 1, QPen(), Qt::red);
	m_editorProxy = m_scene->addWidget(m_editor);
	setScene(m_scene);

	//
	// Отключаем действия полос прокрутки, чтобы в дальнейшем проксировать ими
	// полосы прокрутки самого редактора текста
	//
	horizontalScrollBar()->disconnect();
	verticalScrollBar()->disconnect();

	//
	// Синхронизация значения ролика в обе стороны
	//
	setupScrollingSynchronization(true);

	//
	// Добавляем возможность масштабирования при помощи комбинаций Ctrl +/-
	//
	QShortcut* zoomInShortcut = new QShortcut(QKeySequence("Ctrl++"), this);
	connect(zoomInShortcut, SIGNAL(activated()), this, SLOT(zoomIn()));
	QShortcut* zoomOutShortcut = new QShortcut(QKeySequence("Ctrl+-"), this);
	connect(zoomOutShortcut, SIGNAL(activated()), this, SLOT(zoomOut()));
}
Exemplo n.º 16
0
void
Panner::wheelEvent(QWheelEvent *e)
{
    if (e->delta() > 0) {
        emit zoomOut();
    } else {
        emit zoomIn();
    }
}
Exemplo n.º 17
0
void Overview::wheelEvent(QWheelEvent* event)
{
	if (event->delta() > 0) {
		zoomIn();
	} else {
		zoomOut();
	}
	event->accept();
}
Exemplo n.º 18
0
void CFontPreview::wheelEvent(QWheelEvent *e)
{
    if(e->delta()>0)
        zoomIn();
    else if(e->delta()<0)
        zoomOut();

    e->accept();
}
Exemplo n.º 19
0
void MainWindow::showEvent(QShowEvent *)
{
    // Setting the QGraphicsScene
    scene = new QGraphicsScene(0,0,width()*2,height()*2);
    QPixmap bg;
    bg.load(":/image/backgroung.png");
    bg = bg.scaled(width()*2,height()*2);
    scene->addPixmap(bg);
    ui->graphicsView->setScene(scene);
    ui->graphicsView-> scale(0.5,0.5);
    for(int i=0;i<10;i++){
        scorenumberPic[i].load("://image/number_"+QString::number(i)+".png");
        scorenumberPic[i]=scorenumberPic[i].scaled(scorenumberPic[i].width()*4,scorenumberPic[i].height()*4);
    }
    button = new QPushButton("",this);
    QPixmap icon;
    icon.load(":/image/restart.png");
    icon = icon.scaled(800,800);
    button->setIcon(icon);
    button->setIconSize(QSize(70,70));
    button->setGeometry(10,10,70,70);
    button->setFlat(true);
    button->show();
    connect(button,SIGNAL(clicked(bool)),this,SLOT(restart()));

    button1 = new QPushButton("",this);
    icon.load(":/image/exit.png");
    icon = icon.scaled(800,800);
    button1->setIcon(icon);
    button1->setIconSize(QSize(70,70));
    button1->setGeometry(100,10,70,70);
    button1->setFlat(true);
    button1->show();
    connect(button1,SIGNAL(clicked(bool)),this,SLOT(quitgame()));

    // Create world
    world = new b2World(b2Vec2(0.0f, -9.8f));
    world->SetContactListener(&listener);
    // Setting Size
    GameItem::setGlobalSize(QSizeF(32,18),size());
    // Create ground (You can edit here)
    itemList.push_back(new Land(32,-17,64,0,QPixmap(":/ground.pn").scaled(width()*2,height()/6.0),world,scene));
    //itemList.push_back(new Land(32,1.5,3,35,QPixmap(":/ground.pn").scaled(width(),height()/6.0),world,scene));//r bound
    //itemList.push_back(new Land(0,1.5,3,35,QPixmap(":/ground.pn").scaled(width(),height()/6.0),world,scene));//l bound
    createStage();
    createBird(blue);
    // Timer
    connect(&timer,SIGNAL(timeout()),this,SLOT(tick()));
    connect(&timer,SIGNAL(timeout()),this,SLOT(showScore()));
    timer.start(100/6);
    connect(this,SIGNAL(quitGame()),this,SLOT(QUITSLOT()));

    connect(&timer_z,SIGNAL(timeout()),this,SLOT(zoomIn()));
    connect(&timer_f,SIGNAL(timeout()),this,SLOT(followBird()));
    connect(&timer_waiter,SIGNAL(timeout()),this,SLOT(createBird()));
}
Exemplo n.º 20
0
SchemaEditor::SchemaEditor(QWidget *parent, SchemaGui *schemaGui, Engine * engine, PanelScrollView *panelScrollView) :
  Q3CanvasView(schemaGui, parent, NAME.c_str(),0),
  _engine(engine),
  _schemaGui(schemaGui),
  _state(IDLE),
  _zoom(1),
  _activeConnection(0),
  _contextMenuPos(0,0),
  _contextGear(NULL),
  _panelScrollView(panelScrollView),
  _selectBox(NULL)

{
  viewport()->setMouseTracking(TRUE);
  setAcceptDrops(TRUE); 
    
  _contextMenu = new Q3PopupMenu(this);
  _gearListMenu = new GearListMenu(this);    
  _gearListMenu->create();
  
  _contextMenu->insertItem("Gears", _gearListMenu);
  QObject::connect(_gearListMenu, SIGNAL(gearSelected(QString)), this, SLOT(slotMenuGearSelected(QString)));
  
  _metaGearListMenu = new MetaGearListMenu(this);    
  _metaGearListMenu->create();
  
  _contextMenu->insertItem("MetaGears", _metaGearListMenu);
  QObject::connect(_metaGearListMenu, SIGNAL(metaGearSelected(QFileInfo*)), this, SLOT(slotMenuMetaGearSelected(QFileInfo*)));

  _contextMenu->insertItem("New MetaGear", this, SLOT(slotNewMetaGear()));
    
  _gearContextMenu = new Q3PopupMenu(this);
  _gearContextMenu->insertItem("delete",  this, SLOT(slotGearDelete()));
  _gearContextMenu->insertItem("Properties", this, SLOT(slotGearProperties()));
	_gearContextMenu->insertItem("ZoomIn", this, SLOT(zoomIn()));  
	_gearContextMenu->insertItem("ZoomOut", this, SLOT(zoomOut()));  

  _gearContextMenu->insertItem("About");    
  
  _metaGearContextMenu = new Q3PopupMenu(this);
  _metaGearContextMenu->insertItem("delete", this, SLOT(slotGearDelete()),Qt::Key_Delete);
  _metaGearContextMenu->insertItem("Select All", this, SLOT(slotGearSelectAll()),Qt::CTRL + Qt::Key_A);
  _metaGearContextMenu->insertItem("Copy", this, SLOT(slotGearCopy()),Qt::CTRL + Qt::Key_C);
  _metaGearContextMenu->insertItem("Paste", this, SLOT(slotGearPaste()),Qt::CTRL + Qt::Key_V);
  _metaGearContextMenu->insertItem("Properties", this, SLOT(slotGearProperties()));  
  _metaGearContextMenu->insertItem("About");    
  _metaGearContextMenu->insertSeparator();
  _metaGearContextMenu->insertItem("Save MetaGear",  this, SLOT(slotSaveMetaGear()));


  // plug context menu initialization
  _plugContextMenu = new Q3PopupMenu(this);
  _plugContextMenu->insertItem("expose", this, SLOT(slotPlugExpose()),0,EXPOSE);
  _plugContextMenu->insertItem("unexpose", this, SLOT(slotPlugUnexpose()),0,UNEXPOSE);

}
Exemplo n.º 21
0
//! [3]
void Graph_GraphicsView::keyPressEvent(QKeyEvent *event){
    switch (event->key()) {
    case Qt::Key_Plus:zoomIn();break;
    case Qt::Key_Minus:zoomOut();break;
    case Qt::Key_Space:mtim.turn();break;
    case Qt::Key_Enter:shuffle();break;
    default:
        QGraphicsView::keyPressEvent(event);
    }
}
Exemplo n.º 22
0
void HelpViewer::wheelEvent(QWheelEvent *e)
{
    if (e->modifiers() == Qt::CTRL) {
        e->accept();
        (e->delta() > 0) ? zoomIn() : zoomOut();
    } else {
        e->ignore();
        QTextBrowser::wheelEvent(e);
    }
}
Exemplo n.º 23
0
TableEditor::TableEditor(QWidget *parent): Editor(parent)
{
    QVBoxLayout *layout = new QVBoxLayout(this);
    setLayout(layout);

    // toolbar
    _toolbar = new QWidget(this);
    layout->addWidget(_toolbar);
    _ui_toolbar = new Ui::TableEditorToolbar;
    _ui_toolbar->setupUi(_toolbar);
    _ui_toolbar->firstPageButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/allLeft")));
    _ui_toolbar->previousPageButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/left")));
    _ui_toolbar->nextPageButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/right")));
    _ui_toolbar->lastPageButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/allRight")));

    _ui_toolbar->refreshButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/refresh")));

    _ui_toolbar->addRowButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/general/add")));
    _ui_toolbar->deleteRowButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/general/remove")));

    _ui_toolbar->commitButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/checked")));
    _ui_toolbar->rollbackButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/rollback")));

    _ui_toolbar->dumpDataButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/export")));

    _tableView = new QTableView(this);
    _tableModel = new QSqlTableModel(_tableView /* TODO database connection */);
    _tableView->setModel(_tableModel);
    layout->addWidget(_tableView);

    // connections
    connect(_ui_toolbar->commitButton, SIGNAL(clicked()), _tableModel, SLOT(submitAll()));
    connect(_ui_toolbar->rollbackButton, SIGNAL(clicked()), _tableModel, SLOT(revertAll()));
    connect(_ui_toolbar->addRowButton, SIGNAL(clicked()), this, SLOT(addRow()));
    connect(_ui_toolbar->deleteRowButton, SIGNAL(clicked()), this, SLOT(deleteRows()));
    connect(_ui_toolbar->refreshButton, SIGNAL(clicked()), _tableModel, SLOT(select()));



    connect(_ui_toolbar->toolButtonExportImage, SIGNAL(clicked()),_imageView, SLOT(exportImage()));
    connect(_ui_toolbar->toolButtonZoomIn, SIGNAL(clicked()),_imageView,SLOT(zoomIn()));
    connect(_ui_toolbar->toolButtonZoomOut, SIGNAL(clicked()),_imageView, SLOT(zoomOut()));
    connect(_ui_toolbar->toolButtonFitToScreen, SIGNAL(clicked()),_imageView, SLOT(fitToScreen()));
    connect(_ui_toolbar->toolButtonOriginalSize, SIGNAL(clicked()),_imageView, SLOT(resetToOriginalSize()));
    connect(_ui_toolbar->toolButtonBackground, SIGNAL(toggled()),_imageView, SLOT(setViewBackground()));
    connect(_ui_toolbar->toolButtonOutline, SIGNAL(toggled()),_imageView, SLOT(setViewOutline()));
    connect(_ui_toolbar->toolButtonPlayPause, SIGNAL(clicked()),this, SLOT(playToggled()));
    connect(_file, SIGNAL(imageSizeChanged()),this, SLOT(imageSizeUpdated()));
    connect(_file, SIGNAL(openFinished()),_imageView, SLOT(createScene()));
    connect(_file, SIGNAL(openFinished()),this, SLOT(updateToolButtons()));
    connect(_file, SIGNAL(aboutToReload()),_imageView, SLOT(reset()));
    connect(_file, SIGNAL(reloadFinished()),_imageView, SLOT(createScene()));
    connect(_file, SIGNAL(isPausedChanged()),this, SLOT(updatePauseAction()));
    connect(_imageView, SIGNAL(scaleFactorChanged()),this, SLOT(scaleFactorUpdate()));
}
void FixtureMainTimingUI::wheelEvent(QWheelEvent* ev)
{
    if(m_bCtrlPressed){
        if(ev->delta() > 0){
            emit zoomIn();
        }
        else if (ev->delta() < 0){
            emit zoomOut();
        }
    }
}
void ImageViewerWidget::keyPressEvent(QKeyEvent *event)
{
    if (event->modifiers().testFlag(Qt::ControlModifier)) {
        if ((event->key() == Qt::Key_Minus) || (event->key() == Qt::Key_ZoomOut)) {
            zoomOut();
        } else if ((event->key() == Qt::Key_Plus) || (event->key() == Qt::Key_Equal) || (event->key() == Qt::Key_ZoomIn)) {
            zoomIn();
        }
    }
    QScrollArea::keyPressEvent(event);
}
Exemplo n.º 26
0
		void DockableRegularData1DWidget::contextMenuEvent(QContextMenuEvent* e)
		{
			Q3PopupMenu context_menu;
			context_menu.insertItem("ZoomToFit", this, SLOT(zoomToFit()));
			context_menu.insertItem("ZoomIn", this, SLOT(zoomIn()));
			context_menu.insertItem("ZoomOut", this, SLOT(zoomOut()));
			QPoint pos = e->reason() == QContextMenuEvent::Mouse ? e->globalPos() :
				mapToGlobal( QPoint(e->pos().x(), 0) ) + QPoint( width() / 2, height() / 2 );
			context_menu.exec(pos);
			e->accept();
		}
Exemplo n.º 27
0
void IR::bulbEnd()
{
    if(make == OLYMPUS)
    {
        zoomIn(10);
    }
    else
    {
        shutterNow();
    }
}
Exemplo n.º 28
0
void RenderingView::wheelEvent(QWheelEvent *event)
{
    if ( event->delta() > 0 )
    {
        zoomIn();
    }
    else
    {
        zoomOut();
    }
}
Exemplo n.º 29
0
void MyGraphicsView::wheelEvent(QWheelEvent *event)
{
    if(event->delta() >0)
    {
        emit zoomIn(event->pos());
    }
    if(event->delta() <0)
    {
        emit zoomOut(event->pos());
    }
}
Exemplo n.º 30
0
QAction* MenuCallback::addCustomAction(QString commandId,
                                       QString label,
                                       QString tooltip)
{

   QAction* pAction = NULL;
   if (commandId == QString::fromAscii("zoomIn"))
   {
      pAction = menuStack_.top()->addAction(QIcon(),
                                            label,
                                            this,
                                            SIGNAL(zoomIn()),
                                            QKeySequence::ZoomIn);
   }
   else if (commandId == QString::fromAscii("zoomOut"))
   {
      pAction = menuStack_.top()->addAction(QIcon(),
                                            label,
                                            this,
                                            SIGNAL(zoomOut()),
                                            QKeySequence::ZoomOut);
   }
#ifdef Q_OS_LINUX
   else if (commandId == QString::fromAscii("nextTab"))
   {
      pAction = menuStack_.top()->addAction(QIcon(),
                                            label,
                                            this,
                                            SLOT(actionInvoked()),
                                            QKeySequence(Qt::CTRL +
                                                         Qt::Key_PageDown));
   }
   else if (commandId == QString::fromAscii("previousTab"))
   {
      pAction = menuStack_.top()->addAction(QIcon(),
                                            label,
                                            this,
                                            SLOT(actionInvoked()),
                                            QKeySequence(Qt::CTRL +
                                                         Qt::Key_PageUp));
   }
#endif

   if (pAction != NULL)
   {
      pAction->setData(commandId);
      pAction->setToolTip(tooltip);
      return pAction;
   }
   else
   {
      return NULL;
   }
}