本文整理汇总了C++中KisConfig::vastScrolling方法的典型用法代码示例。如果您正苦于以下问题:C++ KisConfig::vastScrolling方法的具体用法?C++ KisConfig::vastScrolling怎么用?C++ KisConfig::vastScrolling使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisConfig
的用法示例。
在下文中一共展示了KisConfig::vastScrolling方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: centeringCorrection
QPointF KisCoordinatesConverter::centeringCorrection() const
{
KisConfig cfg;
QSize documentSize = imageRectInWidgetPixels().toAlignedRect().size();
QPointF dPoint(documentSize.width(), documentSize.height());
QPointF wPoint(m_d->canvasWidgetSize.width(), m_d->canvasWidgetSize.height());
QPointF minOffset = -cfg.vastScrolling() * wPoint;
QPointF maxOffset = dPoint - wPoint + cfg.vastScrolling() * wPoint;
QPointF range = maxOffset - minOffset;
range.rx() = qMin(range.x(), (qreal)0.0);
range.ry() = qMin(range.y(), (qreal)0.0);
range /= 2;
return -range;
}
示例2: imagePositionChanged
void KisInfinityManager::imagePositionChanged()
{
QRect imageRect = view()->canvasBase()->coordinatesConverter()->imageRectInWidgetPixels().toAlignedRect();
QRect widgetRect = view()->canvasBase()->canvasWidget()->rect();
KisConfig cfg;
qreal vastScrolling = cfg.vastScrolling();
int xReserve = vastScrolling * widgetRect.width();
int yReserve = vastScrolling * widgetRect.height();
int xThreshold = imageRect.width() - 0.4 * xReserve;
int yThreshold = imageRect.height() - 0.4 * yReserve;
const int stripeWidth = 48;
int xCut = widgetRect.width() - stripeWidth;
int yCut = widgetRect.height() - stripeWidth;
m_decorationPath = QPainterPath();
m_decorationPath.setFillRule(Qt::WindingFill);
m_handleTransform.clear();
m_sideRects.clear();
m_sideRects.resize(NSides);
bool visible = false;
if (imageRect.x() <= -xThreshold) {
QRect areaRect(widgetRect.adjusted(xCut, 0, 0, 0));
QPointF pt = areaRect.center() + QPointF(-0.1 * stripeWidth, 0);
addDecoration(areaRect, pt, 0, Right);
visible = true;
}
if (imageRect.y() <= -yThreshold) {
QRect areaRect(widgetRect.adjusted(0, yCut, 0, 0));
QPointF pt = areaRect.center() + QPointF(0, -0.1 * stripeWidth);
addDecoration(areaRect, pt, 90, Bottom);
visible = true;
}
if (imageRect.right() > widgetRect.width() + xThreshold) {
QRect areaRect(widgetRect.adjusted(0, 0, -xCut, 0));
QPointF pt = areaRect.center() + QPointF(0.1 * stripeWidth, 0);
addDecoration(areaRect, pt, 180, Left);
visible = true;
}
if (imageRect.bottom() > widgetRect.height() + yThreshold) {
QRect areaRect(widgetRect.adjusted(0, 0, 0, -yCut));
QPointF pt = areaRect.center() + QPointF(0, 0.1 * stripeWidth);
addDecoration(areaRect, pt, 270, Top);
visible = true;
}
if (visible && !m_filteringEnabled) {
view()->canvasBase()->inputManager()->attachPriorityEventFilter(this);
m_filteringEnabled = true;
}
if (!visible && m_filteringEnabled) {
view()->canvasBase()->inputManager()->detachPriorityEventFilter(this);
m_filteringEnabled = false;
}
}
示例3: grp
KisView2::KisView2(KisPart2 *part, KisDoc2 * doc, QWidget * parent)
: KoView(part, doc, parent),
m_d(new KisView2Private())
{
setXMLFile("krita.rc");
setFocusPolicy(Qt::NoFocus);
if (mainWindow()) {
mainWindow()->setDockNestingEnabled(true);
actionCollection()->addAction(KStandardAction::KeyBindings, "keybindings", mainWindow()->guiFactory(), SLOT(configureShortcuts()));
}
m_d->doc = doc;
m_d->part = part;
m_d->viewConverter = new KisCoordinatesConverter();
KisCanvasController *canvasController = new KisCanvasController(this, actionCollection());
canvasController->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
canvasController->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
canvasController->setDrawShadow(false);
canvasController->setCanvasMode(KoCanvasController::Infinite);
KisConfig cfg;
canvasController->setZoomWithWheel(cfg.zoomWithWheel());
canvasController->setVastScrolling(cfg.vastScrolling());
m_d->canvasController = canvasController;
m_d->resourceProvider = new KisCanvasResourceProvider(this);
m_d->resourceProvider->resetDisplayProfile(QApplication::desktop()->screenNumber(this));
KConfigGroup grp(KGlobal::config(), "krita/crashprevention");
if (grp.readEntry("CreatingCanvas", false)) {
KisConfig cfg;
cfg.setUseOpenGL(false);
}
grp.writeEntry("CreatingCanvas", true);
m_d->canvas = new KisCanvas2(m_d->viewConverter, this, doc->shapeController());
grp.writeEntry("CreatingCanvas", false);
connect(m_d->resourceProvider, SIGNAL(sigDisplayProfileChanged(const KoColorProfile*)), m_d->canvas, SLOT(slotSetDisplayProfile(const KoColorProfile*)));
m_d->canvasController->setCanvas(m_d->canvas);
m_d->resourceProvider->setResourceManager(m_d->canvas->resourceManager());
createManagers();
createActions();
m_d->controlFrame = new KisControlFrame(this);
Q_ASSERT(m_d->canvasController);
KoToolManager::instance()->addController(m_d->canvasController);
KoToolManager::instance()->registerTools(actionCollection(), m_d->canvasController);
// krita/krita.rc must also be modified to add actions to the menu entries
m_d->saveIncremental = new KAction(i18n("Save Incremental &Version"), this);
m_d->saveIncremental->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_S));
actionCollection()->addAction("save_incremental_version", m_d->saveIncremental);
connect(m_d->saveIncremental, SIGNAL(triggered()), this, SLOT(slotSaveIncremental()));
m_d->saveIncrementalBackup = new KAction(i18n("Save Incremental Backup"), this);
m_d->saveIncrementalBackup->setShortcut(Qt::Key_F4);
actionCollection()->addAction("save_incremental_backup", m_d->saveIncrementalBackup);
connect(m_d->saveIncrementalBackup, SIGNAL(triggered()), this, SLOT(slotSaveIncrementalBackup()));
connect(shell(), SIGNAL(documentSaved()), this, SLOT(slotDocumentSaved()));
if (koDocument()->localFilePath().isNull()) {
m_d->saveIncremental->setEnabled(false);
m_d->saveIncrementalBackup->setEnabled(false);
}
m_d->totalRefresh = new KAction(i18n("Total Refresh"), this);
actionCollection()->addAction("total_refresh", m_d->totalRefresh);
m_d->totalRefresh->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_R));
connect(m_d->totalRefresh, SIGNAL(triggered()), this, SLOT(slotTotalRefresh()));
m_d->createTemplate = new KAction( i18n( "&Create Template From Image..." ), this);
actionCollection()->addAction("createTemplate", m_d->createTemplate);
connect(m_d->createTemplate, SIGNAL(triggered()), this, SLOT(slotCreateTemplate()));
m_d->mirrorCanvas = new KToggleAction(i18n("Mirror View"), this);
m_d->mirrorCanvas->setChecked(false);
actionCollection()->addAction("mirror_canvas", m_d->mirrorCanvas);
m_d->mirrorCanvas->setShortcut(QKeySequence(Qt::Key_M));
connect(m_d->mirrorCanvas, SIGNAL(toggled(bool)),m_d->canvasController, SLOT(mirrorCanvas(bool)));
KAction *rotateCanvasRight = new KAction(i18n("Rotate Canvas Right"), this);
actionCollection()->addAction("rotate_canvas_right", rotateCanvasRight);
rotateCanvasRight->setShortcut(QKeySequence("Ctrl+]"));
connect(rotateCanvasRight, SIGNAL(triggered()),m_d->canvasController, SLOT(rotateCanvasRight15()));
KAction *rotateCanvasLeft = new KAction(i18n("Rotate Canvas Left"), this);
actionCollection()->addAction("rotate_canvas_left", rotateCanvasLeft);
rotateCanvasLeft->setShortcut(QKeySequence("Ctrl+["));
connect(rotateCanvasLeft, SIGNAL(triggered()),m_d->canvasController, SLOT(rotateCanvasLeft15()));
KAction *resetCanvasTransformations = new KAction(i18n("Reset Canvas Transformations"), this);
//.........这里部分代码省略.........