当前位置: 首页>>代码示例>>C++>>正文


C++ zoomIn函数代码示例

本文整理汇总了C++中zoomIn函数的典型用法代码示例。如果您正苦于以下问题:C++ zoomIn函数的具体用法?C++ zoomIn怎么用?C++ zoomIn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了zoomIn函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: modifiedEvent

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
}
开发者ID:gitter-badger,项目名称:supercollider,代码行数:27,代码来源:editor.cpp

示例2: QAction

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 );
}
开发者ID:DarienBrito,项目名称:supercollider,代码行数:32,代码来源:help_browser.cpp

示例3: QAction

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&)));

}
开发者ID:itroot,项目名称:university-tasks,代码行数:60,代码来源:ImageViewer.cpp

示例4: QAction

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()));
}
开发者ID:romovpa,项目名称:machgraphics,代码行数:59,代码来源:editorwindow.cpp

示例5: zoomIn

/**
 * 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);
}
开发者ID:CNClaus,项目名称:LibreCAD,代码行数:11,代码来源:rs_graphicview.cpp

示例6: zoomIn

/** We received a mouse wheel movement.
 */
void CSailDispLabel::wheelEvent( QWheelEvent *event)
{
    if (event->delta()>0)
        zoomIn();
    else
        zoomOut();
    redraw();
}
开发者ID:sailcut,项目名称:sailcut,代码行数:10,代码来源:saildisplabel.cpp

示例7: zoomIn

//!
//! 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();
}
开发者ID:banduladh,项目名称:levelfour,代码行数:13,代码来源:BaseGraphicsView.cpp

示例8: zoomIn

void GraphicsView::wheelEvent(QWheelEvent *event) {
    if(event->delta() > 0) {
        emit zoomIn();
    }
    else {
        emit zoomOut();
    }
}
开发者ID:Theverat,项目名称:NormalmapGenerator,代码行数:8,代码来源:graphicsview.cpp

示例9: kdDebug

// public slot
void kpMainWindow::slotZoomIn ()
{
#if DEBUG_KP_MAIN_WINDOW
    kdDebug () << "kpMainWindow::slotZoomIn ()" << endl;
#endif

    zoomIn (false/*don't center under cursor*/);
}
开发者ID:serghei,项目名称:kde3-kdegraphics,代码行数:9,代码来源:kpmainwindow_view.cpp

示例10: wheelEvent

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);
}
开发者ID:ezhangle,项目名称:SeExpr,代码行数:8,代码来源:ExprEditor.cpp

示例11: zoomIn

/**
 * @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);
}
开发者ID:rostedt,项目名称:trace-cmd,代码行数:15,代码来源:KsModels.cpp

示例12: zoomOut

void XTestZoom::onChanged()
{
    float velocity = m_recognizer->velocity();
    if (velocity > m_minEffectiveVelocity) {
            zoomOut();
    } else if (velocity < -m_minEffectiveVelocity){
            zoomIn();
    }
}
开发者ID:Pardus-Kurumsal,项目名称:eta-gestemas,代码行数:9,代码来源:xtestzoom.cpp

示例13: noRedo

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());
    }
}
开发者ID:ly2314,项目名称:QtPainter_Qt5,代码行数:57,代码来源:paintarea.cpp

示例14: setZOOM_FACTOR

void MyTextBrowser::setZOOM_FACTOR(int factor)
{
#ifdef NO_WEBKIT
  if(factor > 1) zoomIn();
  else           zoomOut();
#else
  setZoomFactor(factor);
#endif
}
开发者ID:pvbrowser,项目名称:pvb,代码行数:9,代码来源:MyTextBrowser_v4.cpp

示例15: QGraphicsView

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()));
}
开发者ID:dimkanovikov,项目名称:ScalableWrapper,代码行数:57,代码来源:ScalableWrapper.cpp


注:本文中的zoomIn函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。