本文整理汇总了C++中zoomOut函数的典型用法代码示例。如果您正苦于以下问题:C++ zoomOut函数的具体用法?C++ zoomOut怎么用?C++ zoomOut使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zoomOut函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QgsDebugMsg
void QgsMapCanvas::wheelEvent( QWheelEvent *e )
{
// Zoom the map canvas in response to a mouse wheel event. Moving the
// wheel forward (away) from the user zooms in
QgsDebugMsg( "Wheel event delta " + QString::number( e->delta() ) );
if ( mMapTool )
{
mMapTool->wheelEvent( e );
}
if ( QgsApplication::keyboardModifiers() )
{
// leave the wheel for map tools if any modifier pressed
return;
}
switch ( mWheelAction )
{
case WheelZoom:
// zoom without changing extent
if ( e->delta() > 0 )
zoomIn();
else
zoomOut();
break;
case WheelZoomAndRecenter:
// zoom and don't change extent
zoomWithCenter( e->x(), e->y(), e->delta() > 0 );
break;
case WheelZoomToMouseCursor:
{
// zoom map to mouse cursor
double scaleFactor = e->delta() > 0 ? 1 / mWheelZoomFactor : mWheelZoomFactor;
QgsPoint oldCenter = center();
QgsPoint mousePos( getCoordinateTransform()->toMapPoint( e->x(), e->y() ) );
QgsPoint newCenter( mousePos.x() + (( oldCenter.x() - mousePos.x() ) * scaleFactor ),
mousePos.y() + (( oldCenter.y() - mousePos.y() ) * scaleFactor ) );
zoomByFactor( scaleFactor, &newCenter );
break;
}
case WheelNothing:
// well, nothing!
break;
}
}
示例2: zoomIn
void FlickableMap::wheelEvent(QWheelEvent *event)
{
if (event->orientation() == Qt::Horizontal) {
event->ignore();
} else {
if (event->delta() > 0) {
zoomIn();
} else {
zoomOut();
}
event->accept();
}
}
示例3: zoomIn
/** Ctrl + Rotating the mouse wheel will increase/decrease the font size
*
*/
void ScriptEditor::wheelEvent(QWheelEvent *e) {
if (e->modifiers() == Qt::ControlModifier) {
if (e->delta() > 0) {
zoomIn();
emit textZoomedIn(); // allows tracking
} else {
zoomOut();
emit textZoomedOut(); // allows tracking
}
} else {
QsciScintilla::wheelEvent(e);
}
}
示例4: zoomIn
void HelpViewer::wheelEvent(QWheelEvent *e)
{
if (e->modifiers() & Qt::ControlModifier) {
const int delta = e->delta();
if (delta > 0)
zoomIn(delta / 120);
else if (delta < 0)
zoomOut(-delta / 120);
e->accept();
return;
}
QWebView::wheelEvent(e);
}
示例5: qDebug
void MapTilesFrame::zoomOut()
{
qDebug() << "zooming OUT . . . viewport coordinate: " << getViewportCoordinate();
qDebug() << "viewport size: " << size();
// ZoomEffect *ze = createZoomEffect(QPoint(width() / 2, height() / 2));
// ze->zoomOutEffect();
//以视口中心点为视点缩放(服务器坐标系)
QPoint viewportCenterPoint(getViewportCoordinate().x() + getViewportWidth() / 2,
getViewportCoordinate().y() - getViewportHeight() / 2);
zoomOut(viewportCenterPoint);
}
示例6: zoomOut
void CodeEditer::wheelEvent(QWheelEvent *e)
{
//d->clearVisibleCollapsedBlock();
if (e->modifiers() & Qt::ControlModifier) {
const int delta = e->delta();
if (delta < 0)
zoomOut();
else if (delta > 0)
zoomIn();
return;
}
QPlainTextEdit::wheelEvent(e);
}
示例7: zoomTerminate
static Bool
zoomTerminate(CompDisplay *d,
CompAction *action,
CompActionState state,
CompOption *option,
int nOption)
{
CompScreen *s;
Window xid;
xid = getIntOptionNamed(option, nOption, "root", 0);
for (s = d->screens; s; s = s->next)
{
ZOOM_SCREEN(s);
if (xid && s->root != xid)
continue;
if (zs->grab)
{
int output;
output = outputDeviceForPoint(s, zs->x1, zs->y1);
if (zs->x2 > s->outputDev[output].region.extents.x2)
zs->x2 = s->outputDev[output].region.extents.x2;
if (zs->y2 > s->outputDev[output].region.extents.y2)
zs->y2 = s->outputDev[output].region.extents.y2;
zoomInitiateForSelection(s, output);
zs->grab = FALSE;
}
else
{
CompOption o;
o.type = CompOptionTypeInt;
o.name = "root";
o.value.i = s->root;
zoomOut(d, action, state, &o, 1);
}
}
action->state &= ~(CompActionStateTermKey | CompActionStateTermButton);
return FALSE;
}
示例8: zoomIn
void MapWidget::wheelEvent(QWheelEvent* event)
{
int numDegrees=event->delta()/8;
int numSteps=numDegrees/15;
if (numSteps>=0) {
zoomIn(numSteps*1.35);
}
else {
zoomOut(-numSteps*1.35);
}
event->accept();
}
示例9: QWidget
Topology::Topology(QWidget *parent) :
QWidget(parent),
ui(new Ui::Topology)
{
ui->setupUi(this);
ui->flushBtn->setEnabled(false);
flushClass = NULL;
timerId = 0;
seq = 0;
scene = new QGraphicsScene(this);
scene->setItemIndexMethod(QGraphicsScene::NoIndex);
scene->setSceneRect(-960, -540, 1920, 1080);
ui->graphicsView->setScene(scene);
ui->graphicsView->setAcceptDrops(true);
ui->graphicsView->setCacheMode(QGraphicsView::CacheBackground);
ui->graphicsView->setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
ui->graphicsView->setRenderHint(QPainter::Antialiasing);
ui->graphicsView->setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
ui->graphicsView->scale(qreal(0.8), qreal(0.8));
centerNode = NULL;
connect(ui->zoomOutBtn, SIGNAL(clicked()), this, SLOT(zoomOut()));
connect(ui->zoomInBtn, SIGNAL(clicked()), this, SLOT(zoomIn()));
configFile = new QFile("config.dat");
if(!configFile->open(QIODevice::ReadWrite))
{
std::cerr << "Cannot open file:"
<< qPrintable(configFile->errorString())
<< endl;
return;
}
QDataStream in(configFile);
in.setVersion(QDataStream::Qt_4_3);
QStringList argList;
in >> argList;
if(argList.count() == 3)
{
comName = argList[0];
comStatue = argList[1];
netStatue = argList[2];
in >> panid >> chanel;
}
示例10: connect
void Navigation::setMap( MarbleWidget* widget )
{
d->m_marbleWidget = widget;
if ( d->m_marbleWidget ) {
// Avoid the QWidget based warning
d->m_marbleWidget->model()->routingManager()->setShowGuidanceModeStartupWarning( false );
connect( d->m_marbleWidget->model()->routingManager()->routingModel(),
SIGNAL(positionChanged()), this, SLOT(update()) );
delete d->m_autoNavigation;
d->m_autoNavigation = new Marble::AutoNavigation( d->m_marbleWidget->model(), d->m_marbleWidget->viewport(), this );
connect( d->m_autoNavigation, SIGNAL(zoomIn(FlyToMode)),
d->m_marbleWidget, SLOT(zoomIn()) );
connect( d->m_autoNavigation, SIGNAL(zoomOut(FlyToMode)),
d->m_marbleWidget, SLOT(zoomOut()) );
connect( d->m_autoNavigation, SIGNAL(centerOn(GeoDataCoordinates,bool)),
d->m_marbleWidget, SLOT(centerOn(GeoDataCoordinates)) );
connect( d->m_marbleWidget, SIGNAL(visibleLatLonAltBoxChanged()),
d->m_autoNavigation, SLOT(inhibitAutoAdjustments()) );
connect( d->m_marbleWidget->model()->positionTracking(), SIGNAL(statusChanged(PositionProviderStatus)),
&d->m_voiceNavigation, SLOT(handleTrackingStatusChange(PositionProviderStatus)) );
}
示例11: switch
void MapWidget::keyPressEvent(QKeyEvent* e) {
if ( _canvas.filterKeyPressEvent(e) ) {
e->accept();
return;
}
e->accept();
int key = e->key();
switch ( key ) {
case Qt::Key_Plus:
case Qt::Key_I:
if ( e->modifiers() == Qt::NoModifier )
zoomIn();
break;
case Qt::Key_Minus:
case Qt::Key_O:
if ( e->modifiers() == Qt::NoModifier )
zoomOut();
break;
case Qt::Key_Left:
_canvas.translate(QPointF(-1.0,0.0));
update();
break;
case Qt::Key_Right:
_canvas.translate(QPointF(1.0,0.0));
update();
break;
case Qt::Key_Up:
_canvas.translate(QPointF(0.0,1.0));
update();
break;
case Qt::Key_Down:
_canvas.translate(QPointF(0.0,-1.0));
update();
break;
case Qt::Key_G:
_canvas.setDrawGrid(!_canvas.isDrawGridEnabled());
break;
case Qt::Key_C:
_canvas.setDrawCities(!_canvas.isDrawCitiesEnabled());
break;
default:
e->ignore();
emit keyPressed(e);
break;
};
}
示例12: qPow
void QmlMapControl::touchEvent(QTouchEvent *evnt)
{
const QList<QTouchEvent::TouchPoint> & touchs = evnt->touchPoints();
if( touchs.count() != 2 )
{
QQuickPaintedItem::touchEvent(evnt);
}
else
{
evnt->accept();
const QTouchEvent::TouchPoint & t0 = touchs.first();
const QTouchEvent::TouchPoint & t1 = touchs.last();
if( last_t0_startPos.isNull() )
last_t0_startPos = t0.startPos();
if( last_t1_startPos.isNull() )
last_t1_startPos = t1.startPos();
qreal startW = qPow( qPow(last_t0_startPos.x()-last_t1_startPos.x(),2)+qPow(last_t0_startPos.y()-last_t1_startPos.y(),2), 0.5 );
qreal endW = qPow( qPow(t0.pos().x()-t1.pos().x(),2)+qPow(t0.pos().y()-t1.pos().y(),2), 0.5 );
if( startW*4/3<endW )
{
QPoint pnt( last_t0_startPos.x()/2+last_t1_startPos.x()/2, last_t0_startPos.y()/2+last_t1_startPos.y()/2 );
QPoint newPoint( width()-pnt.x(), height()-pnt.y() );
setView(clickToWorldCoordinate(pnt));
zoomIn(pnt);
setView(clickToWorldCoordinate(newPoint));
last_t0_startPos = t0.pos();
last_t1_startPos = t1.pos();
}
else
if( startW*3/4>endW )
{
QPoint pnt( t0.pos().x()/2+t1.pos().x()/2, t0.pos().y()/2+t1.pos().y()/2 );
QPoint newPoint( width()-pnt.x(), height()-pnt.y() );
setView(clickToWorldCoordinate(pnt));
zoomOut(pnt);
setView(clickToWorldCoordinate(newPoint));
last_t0_startPos = t0.pos();
last_t1_startPos = t1.pos();
}
}
}
示例13: zoomIn
void VMdEditor::zoomPage(bool p_zoomIn, int p_range)
{
int delta;
const int minSize = 2;
if (p_zoomIn) {
delta = p_range;
zoomIn(p_range);
} else {
delta = -p_range;
zoomOut(p_range);
}
m_zoomDelta += delta;
QVector<HighlightingStyle> &styles = m_mdHighlighter->getHighlightingStyles();
for (auto & it : styles) {
int size = it.format.fontPointSize();
if (size == 0) {
// It contains no font size format.
continue;
}
size += delta;
if (size < minSize) {
size = minSize;
}
it.format.setFontPointSize(size);
}
QHash<QString, QTextCharFormat> &cbStyles = m_mdHighlighter->getCodeBlockStyles();
for (auto it = cbStyles.begin(); it != cbStyles.end(); ++it) {
int size = it.value().fontPointSize();
if (size == 0) {
// It contains no font size format.
continue;
}
size += delta;
if (size < minSize) {
size = minSize;
}
it.value().setFontPointSize(size);
}
m_mdHighlighter->rehighlight();
}
示例14: switch
int FreqView::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = ViewWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: zoomIn(); break;
case 1: zoomOut(); break;
case 2: setAmplitudeZoom((*reinterpret_cast< double(*)>(_a[1]))); break;
}
_id -= 3;
}
return _id;
}
示例15: connect
void ImageView::makeConnection()
{
connect(tBtn_menu, SIGNAL(triggered(QAction*)), this, SLOT(goBack(QAction*)));
connect(btn_oriMode, SIGNAL(clicked()), this, SLOT(enterOriginalMode()));
connect(btn_proMode, SIGNAL(clicked()), this, SLOT(enterProcessedMode()));
connect(btn_editMode, SIGNAL(clicked()), this, SLOT(enterEditableMode()));
connect(btn_save, SIGNAL(clicked()), this, SLOT(saveImage()));
connect(btn_process, SIGNAL(clicked()), this, SLOT(processImage()));
connect(btn_zoomIn, SIGNAL(clicked()), this, SLOT(zoomIn()));
connect(btn_zoomOut, SIGNAL(clicked()), this, SLOT(zoomOut()));
connect(com_zoom, SIGNAL(currentIndexChanged(int)), this, SLOT(zoomTo(int)));
}