本文整理汇总了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();
}
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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());
}
示例7: setZoomFactor
bool ofx2DFormMapping::mouseScrolled(ofMouseEventArgs &args) {
if(!direct_edit && mapping_rect_dst.inside(ofGetMouseX(), ofGetMouseY())) {
setZoomFactor(args.y);
}
return ofxPanel::mouseScrolled(args);
}
示例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);
}
}
示例9: LevelForZoom
void CustomWebView::zoomOut ()
{
int i = LevelForZoom (zoomFactor ());
if (i > 0)
setZoomFactor (Zooms_ [i - 1]);
emit invalidateSettings ();
}
示例10: zoomOut
void MyTextBrowser::setZOOM_FACTOR(int factor)
{
#ifdef NO_WEBKIT
if(factor > 1) zoomIn();
else zoomOut();
#else
setZoomFactor(factor);
#endif
}
示例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)));
}
示例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);
}
示例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);
}
}
示例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);
}
示例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)));
}