1640 : QWidget(parent)
1641{
1642 setObjectName(name);
1643
1644 QGridLayout * l = new QGridLayout(this);
1645 l->setContentsMargins(0, 0, 0, 0);
1647 l->addWidget(
m_page, 0, 0);
1648
1651 m_page->pressureCurve->setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
1652 m_page->pressureCurve->setCurve(curve);
1653
1654 m_page->chkUseRightMiddleClickWorkaround->setChecked(
1655 cfg.useRightMiddleTabletButtonWorkaround());
1656
1657#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
1658# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1659 QString actualTabletProtocol = "<unknown>";
1660 using QWindowsApplication = QNativeInterface::Private::QWindowsApplication;
1661 if (auto nativeWindowsApp = dynamic_cast<QWindowsApplication *>(QGuiApplicationPrivate::platformIntegration())) {
1662 actualTabletProtocol = nativeWindowsApp->isWinTabEnabled() ? "WinTab" : "Windows Ink";
1663 }
1664 m_page->grpTabletApi->setTitle(i18n(
"Tablet Input API (currently active API: \"%1\")", actualTabletProtocol));
1665# endif
1666 m_page->radioWintab->setChecked(!cfg.useWin8PointerInput());
1667 m_page->radioWin8PointerInput->setChecked(cfg.useWin8PointerInput());
1668
1670 connect(
m_page->radioWintab, SIGNAL(toggled(
bool)),
m_page->btnResolutionSettings, SLOT(setEnabled(
bool)));
1671 m_page->btnResolutionSettings->setEnabled(
m_page->radioWintab->isChecked());
1672#else
1673 m_page->grpTabletApi->setVisible(
false);
1674#endif
1676
1677#ifdef Q_OS_WIN
1678 m_page->chkUseTimestampsForBrushSpeed->setText(i18n(
"Use tablet driver timestamps for brush speed (may cause severe artifacts when using WinTab tablet API)"));
1679#else
1680 m_page->chkUseTimestampsForBrushSpeed->setText(i18n(
"Use tablet driver timestamps for brush speed"));
1681#endif
1682 m_page->chkUseTimestampsForBrushSpeed->setChecked(cfg.readEntry(
"useTimestampsForBrushSpeed",
false));
1683
1684#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
1685 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->setChecked(
1686 cfg.usePageUpDownMouseButtonEmulationWorkaround());
1687#else
1688 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->hide();
1689#endif
1690
1691#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
1692 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->setChecked(
1693 cfg.useHighFunctionKeyMouseButtonEmulationWorkaround());
1694#else
1695 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->hide();
1696#endif
1697
1698#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
1699 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->setChecked(cfg.useIgnoreHistoricTabletEventsWorkaround());
1700#else
1701 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->hide();
1702#endif
1703
1704 m_page->intMaxAllowedBrushSpeed->setRange(1, 100);
1705 m_page->intMaxAllowedBrushSpeed->setValue(cfg.readEntry(
"maxAllowedSpeedValue", 30));
1707
1708
1709
1710 return i18np("Maximum brush speed: {n} px/ms", "Maximum brush speed: {n} px/ms", value);
1711 });
1712
1713 m_page->intBrushSpeedSmoothing->setRange(3, 100);
1714 m_page->intBrushSpeedSmoothing->setValue(cfg.readEntry(
"speedValueSmoothing", 3));
1716
1717
1718
1719 return i18np("Brush speed smoothing: {n} sample", "Brush speed smoothing: {n} samples", value);
1720 });
1721
1722 m_page->tiltDirectionOffsetAngle->setDecimals(0);
1723 m_page->tiltDirectionOffsetAngle->setRange(-180, 180);
1724
1725 m_page->tiltDirectionOffsetAngle->setAngle(-cfg.readEntry(
"tiltDirectionOffset", 0.0));
1726 m_page->tiltDirectionOffsetAngle->setPrefix(i18n(
"Pen tilt direction offset: "));
1728}
float value(const T *src, size_t ch)
@ FlipOptionsMode_MenuButton
The flip options are shown as a menu accessible via a options button.
void slotResolutionSettings()
WdgTabletSettings * m_page
void install(QSpinBox *spinBox, std::function< QString(int)> messageFn)