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


C++ setZoomFactor函数代码示例

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


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

示例1: zoomMin

void ImportView::setThumbSize(int size)
{
    if (d->stackedView->viewMode() == ImportStackedView::PreviewImageMode)
    {
        double z = DZoomBar::zoomFromSize(size, zoomMin(), zoomMax());
        setZoomFactor(z);
    }
    else if (d->stackedView->viewMode() == ImportStackedView::PreviewCameraMode)
    {
        if (size > ThumbnailSize::maxThumbsSize())
        {
            d->thumbSize = ThumbnailSize::maxThumbsSize();
        }
        else if (size < ThumbnailSize::Small)
        {
            d->thumbSize = ThumbnailSize::Small;
        }
        else
        {
            d->thumbSize = size;
        }

        emit signalThumbSizeChanged(d->thumbSize);

        d->thumbSizeTimer->start();
    }
}
开发者ID:rickysarraf,项目名称:digikam,代码行数:27,代码来源:importview.cpp

示例2: QWebEngineView

MyWebView::MyWebView(QWidget *parent):
   QWebEngineView(parent)
      {
      page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
      QNetworkAccessManager* networkManager = new MyNetworkAccessManager(this);
#ifndef QT_NO_OPENSSL
      connect(networkManager,SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),this, SLOT(ignoreSSLErrors(QNetworkReply*,QList<QSslError>)));
#endif

      connect(this, SIGNAL(loadFinished(bool)), SLOT(stopBusy(bool)));
      connect(this, SIGNAL(linkClicked(const QUrl&)), SLOT(link(const QUrl&)));

      QWebFrame* frame = page()->mainFrame();
      connect(frame, SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(addToJavascript()));

      page()->setNetworkAccessManager(networkManager);

      setZoomFactor(guiScaling);

      if (!enableExperimental)
            setContextMenuPolicy(Qt::NoContextMenu);

      //set cookie jar for persistent cookies
      CookieJar* jar = new CookieJar(QString(dataPath + "/cookie_store.txt"));
      page()->networkAccessManager()->setCookieJar(jar);

      page()->currentFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
      page()->currentFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAsNeeded);
      }
开发者ID:eplanet,项目名称:MuseScore,代码行数:29,代码来源:startcenter.cpp

示例3: switch

int QPrintPreviewWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: paintRequested((*reinterpret_cast< QPrinter*(*)>(_a[1]))); break;
        case 1: previewChanged(); break;
        case 2: print(); break;
        case 3: zoomIn((*reinterpret_cast< qreal(*)>(_a[1]))); break;
        case 4: zoomIn(); break;
        case 5: zoomOut((*reinterpret_cast< qreal(*)>(_a[1]))); break;
        case 6: zoomOut(); break;
        case 7: setZoomFactor((*reinterpret_cast< qreal(*)>(_a[1]))); break;
        case 8: setOrientation((*reinterpret_cast< QPrinter::Orientation(*)>(_a[1]))); break;
        case 9: setViewMode((*reinterpret_cast< ViewMode(*)>(_a[1]))); break;
        case 10: setZoomMode((*reinterpret_cast< ZoomMode(*)>(_a[1]))); break;
        case 11: setCurrentPage((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 12: fitToWidth(); break;
        case 13: fitInView(); break;
        case 14: setLandscapeOrientation(); break;
        case 15: setPortraitOrientation(); break;
        case 16: setSinglePageViewMode(); break;
        case 17: setFacingPagesViewMode(); break;
        case 18: setAllPagesViewMode(); break;
        case 19: updatePreview(); break;
        case 20: d_func()->_q_fit(); break;
        case 21: d_func()->_q_updateCurrentPage(); break;
        }
        _id -= 22;
    }
    return _id;
}
开发者ID:pk-codebox-evo,项目名称:remixos-usb-tool,代码行数:34,代码来源:moc_qprintpreviewwidget.cpp

示例4: setZoomFactor

void ScrolledImage::resize(const Box& newExterior)
	{
	/* Resize the parent class widget: */
	Container::resize(newExterior);
	
	/* Get the new interior size: */
	Box iBox=getInterior();
	
	/* Make room for and position the horizontal and vertical scroll bars: */
	Vector hbSize=horizontalScrollBar->calcNaturalSize();
	Vector vbSize=verticalScrollBar->calcNaturalSize();
	Box hbBox=iBox;
	hbBox.size[0]-=vbSize[0];
	hbBox.size[1]=hbSize[1];
	horizontalScrollBar->resize(hbBox);
	Box vbBox=iBox;
	vbBox.size[0]=vbSize[0];
	vbBox.origin[0]+=iBox.size[0]-vbBox.size[0];
	vbBox.size[1]-=hbSize[1];
	vbBox.origin[1]+=hbSize[1];
	verticalScrollBar->resize(vbBox);
	
	/* Resize the image: */
	iBox.size[0]-=vbSize[0];
	iBox.size[1]-=hbSize[1];
	iBox.origin[1]+=hbSize[1];
	image->resize(iBox);
	
	/* Adjust the image's display region: */
	setZoomFactor(zoomFactor);
	}
开发者ID:Doc-Ok,项目名称:OpticalTracking,代码行数:31,代码来源:ScrolledImage.cpp

示例5: stopTracking

void SkyMap::mouseReleaseEvent( QMouseEvent * ) {
    if ( ZoomRect.isValid() ) {
        stopTracking();
        SkyPoint newcenter = projector()->fromScreen( ZoomRect.center(), data->lst(), data->geo()->lat() );
        setFocus( &newcenter );
        setDestination( newcenter );

        //Zoom in on center of Zoom Circle, by a factor equal to the ratio
        //of the sky pixmap's width to the Zoom Circle's diameter
        float factor = float(width()) / float(ZoomRect.width());
        setZoomFactor( Options::zoomFactor() * factor );
    }
    setDefaultMouseCursor();
    ZoomRect = QRect(); //invalidate ZoomRect

    if(m_previewLegend) {
        slotCancelLegendPreviewMode();
    }

    //false if double-clicked, because it's unset there.
    if (mouseButtonDown) {
        mouseButtonDown = false;
        if ( slewing ) {
            slewing = false;
            if ( Options::useAltAz() )
                setDestinationAltAz( focus()->alt(), focus()->az() );
            else
                setDestination( *focus() );
        }
        forceUpdate();	// is needed because after moving the sky not all stars are shown
    }
    // if middle button was pressed unset here
    midMouseButtonDown = false;
}
开发者ID:felipebetancur,项目名称:kstars,代码行数:34,代码来源:skymapevents.cpp

示例6: setZoomFactor

// Adjust to settings changes {{{
void MiniWeb::updateConfiguration()
{
	setZoomFactor(MWSettings::zoomLevel());
	settings()->setFontFamily(QWebSettings::StandardFont,
								MWSettings::generalFont().family());
	settings()->setFontFamily(QWebSettings::FixedFont,
								MWSettings::fixedFont().family());
}
开发者ID:jeorgun,项目名称:miniweb,代码行数:9,代码来源:miniweb.cpp

示例7: setZoomFactor

bool ofx2DFormMapping::mouseScrolled(ofMouseEventArgs &args) {

	if(!direct_edit && mapping_rect_dst.inside(ofGetMouseX(), ofGetMouseY())) {
		setZoomFactor(args.y);
	}

	return ofxPanel::mouseScrolled(args);
}
开发者ID:frauzufall,项目名称:ofx2DMapping,代码行数:8,代码来源:ofx2DFormMapping.cpp

示例8: setZoomFactor

/*!
 * \brief DocumentationViewer::mouseDoubleClickEvent
 * Reimplementation of mousedoubleclickevent.
 * Defines what to do for control+doubleclick
 * \param event
 */
void DocumentationViewer::mouseDoubleClickEvent(QMouseEvent *event)
{
  if (event->modifiers().testFlag(Qt::ControlModifier)) {
    mZoomFactor=1.;
    setZoomFactor(mZoomFactor);
  } else {
    QWebView::mouseDoubleClickEvent(event);
  }
}
开发者ID:hkiel,项目名称:OMEdit,代码行数:15,代码来源:DocumentationWidget.cpp

示例9: LevelForZoom

	void CustomWebView::zoomOut ()
	{
		int i = LevelForZoom (zoomFactor ());

		if (i > 0)
			setZoomFactor (Zooms_ [i - 1]);

		emit invalidateSettings ();
	}
开发者ID:Akon32,项目名称:leechcraft,代码行数:9,代码来源:customwebview.cpp

示例10: zoomOut

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

示例11: setEditable

void ZoomAction::init()
{
	setEditable(true);
	setToolTip(tr("Select or insert zoom factor here"));
	setWhatsThis(tr("<p>Select the zoom factor here.  "
	                "Alternatively, you can also introduce a zoom factor and "
	                "press Enter.</p>"));
	setCurrentZoomFactor();
	connect(this, SIGNAL(triggered(QString)), this, SLOT(setZoomFactor(QString)));
}
开发者ID:flying-sheep,项目名称:ktikz,代码行数:10,代码来源:zoomaction.cpp

示例12: setZoomFactor

	void CustomWebView::wheelEvent (QGraphicsSceneWheelEvent *e)
	{
		if (e->modifiers () & Qt::ControlModifier)
		{
			int degrees = e->delta () / 8;
			qreal delta = static_cast<qreal> (degrees) / 150;
			setZoomFactor (zoomFactor () + delta);
			e->accept ();
		}
		else
			QGraphicsWebView::wheelEvent (e);
	}
开发者ID:Akon32,项目名称:leechcraft,代码行数:12,代码来源:customwebview.cpp

示例13: setZoomFactor

void pvQWebView::keyPressEvent(QKeyEvent *event)
{
  if(event->matches(QKeySequence::ZoomIn))
  {
    factor = factor*1.1f;
#if QT_VERSION >= 0x040500
    setZoomFactor(factor);
#endif    
  }
  else if(event->matches(QKeySequence::ZoomOut))
  {
    factor = factor*0.9f;
#if QT_VERSION >= 0x040500    
    setZoomFactor(factor);
#endif    
  }
  else
  {
    QWebView::keyPressEvent(event);
  }
}
开发者ID:pvbrowser,项目名称:pvb,代码行数:21,代码来源:dlgmybrowser.v4.cpp

示例14: qMax

void SinglePhotoPreviewLayout::decreaseZoom(const QPoint& viewportAnchor)
{
    if (!d->item || !d->view)
    {
        return;
    }

    double zoom    = d->zoomSettings()->zoomFactor() / d->zoomMultiplier;
    zoom           = qMax(zoom, d->minZoom);
    zoom           = d->zoomSettings()->snappedZoomStep(zoom, d->frameSize());
    setZoomFactor(zoom, viewportAnchor);
}
开发者ID:UIKit0,项目名称:digikam,代码行数:12,代码来源:previewlayout.cpp

示例15: formatZoomFactor

void ZoomAction::setCurrentZoomFactor(qreal newZoomFactor)
{
	const qreal zoomFactorArray[] = {12.50, 25, 50, 75, 100, 125, 150, 200, 250, 300};
	const int zoomFactorNumber = 10;
	QStringList zoomFactorList;
	int newZoomFactorPosition = -1;
	bool addNewZoomFactor = true;

	if (newZoomFactor < s_minZoomFactor || newZoomFactor > s_maxZoomFactor)
		addNewZoomFactor = false;

	newZoomFactor *= 100;
	for (int i = 0; i < zoomFactorNumber; ++i)
	{
		if (addNewZoomFactor && newZoomFactor < zoomFactorArray[i])
		{
			zoomFactorList << formatZoomFactor(newZoomFactor);
			newZoomFactorPosition = i;
			addNewZoomFactor = false;
		}
		else if (newZoomFactor == zoomFactorArray[i])
		{
			newZoomFactorPosition = i;
			addNewZoomFactor = false;
		}
		zoomFactorList << formatZoomFactor(zoomFactorArray[i]);
	}
	if (addNewZoomFactor)
	{
		zoomFactorList << formatZoomFactor(newZoomFactor);
		newZoomFactorPosition = zoomFactorNumber;
	}

	disconnect(this, SIGNAL(triggered(QString)), this, SLOT(setZoomFactor(QString)));
	removeAllActions();
	setItems(zoomFactorList);
	if (newZoomFactorPosition >= 0)
		setCurrentItem(newZoomFactorPosition);
	connect(this, SIGNAL(triggered(QString)), this, SLOT(setZoomFactor(QString)));
}
开发者ID:flying-sheep,项目名称:ktikz,代码行数:40,代码来源:zoomaction.cpp


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