1753 : QWidget(parent)
1754{
1755 setObjectName(name);
1756
1757 QGridLayout * l = new QGridLayout(this);
1758 l->setContentsMargins(0, 0, 0, 0);
1760 l->addWidget(
m_page, 0, 0);
1761
1764 m_page->pressureCurve->setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
1765 m_page->pressureCurve->setCurve(curve);
1766
1767 m_page->chkUseRightMiddleClickWorkaround->setChecked(
1768 cfg.useRightMiddleTabletButtonWorkaround());
1769
1770#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
1771# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1772 QString actualTabletProtocol = "<unknown>";
1773 using QWindowsApplication = QNativeInterface::Private::QWindowsApplication;
1774 if (auto nativeWindowsApp = dynamic_cast<QWindowsApplication *>(QGuiApplicationPrivate::platformIntegration())) {
1775 actualTabletProtocol = nativeWindowsApp->isWinTabEnabled() ? "WinTab" : "Windows Ink";
1776 }
1777 m_page->grpTabletApi->setTitle(i18n(
"Tablet Input API (currently active API: \"%1\")", actualTabletProtocol));
1778# endif
1779 m_page->radioWintab->setChecked(!cfg.useWin8PointerInput());
1780 m_page->radioWin8PointerInput->setChecked(cfg.useWin8PointerInput());
1781
1783 connect(
m_page->radioWintab, SIGNAL(toggled(
bool)),
m_page->btnResolutionSettings, SLOT(setEnabled(
bool)));
1784 m_page->btnResolutionSettings->setEnabled(
m_page->radioWintab->isChecked());
1785#else
1786 m_page->grpTabletApi->setVisible(
false);
1787#endif
1789
1790#ifdef Q_OS_WIN
1791 m_page->chkUseTimestampsForBrushSpeed->setText(i18n(
"Use tablet driver timestamps for brush speed (may cause severe artifacts when using WinTab tablet API)"));
1792#else
1793 m_page->chkUseTimestampsForBrushSpeed->setText(i18n(
"Use tablet driver timestamps for brush speed"));
1794#endif
1795 m_page->chkUseTimestampsForBrushSpeed->setChecked(cfg.readEntry(
"useTimestampsForBrushSpeed",
false));
1796
1797#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
1798 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->setChecked(
1799 cfg.usePageUpDownMouseButtonEmulationWorkaround());
1800#else
1801 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->hide();
1802#endif
1803
1804#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
1805 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->setChecked(
1806 cfg.useHighFunctionKeyMouseButtonEmulationWorkaround());
1807#else
1808 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->hide();
1809#endif
1810
1811#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
1812 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->setChecked(cfg.useIgnoreHistoricTabletEventsWorkaround());
1813#else
1814 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->hide();
1815#endif
1816
1817 m_page->intMaxAllowedBrushSpeed->setRange(1, 100);
1818 m_page->intMaxAllowedBrushSpeed->setValue(cfg.readEntry(
"maxAllowedSpeedValue", 30));
1820
1821
1822
1823 return i18np("Maximum brush speed: {n} px/ms", "Maximum brush speed: {n} px/ms", value);
1824 });
1825
1826 m_page->intBrushSpeedSmoothing->setRange(3, 100);
1827 m_page->intBrushSpeedSmoothing->setValue(cfg.readEntry(
"speedValueSmoothing", 3));
1829
1830
1831
1832 return i18np("Brush speed smoothing: {n} sample", "Brush speed smoothing: {n} samples", value);
1833 });
1834
1835 m_page->tiltDirectionOffsetAngle->setDecimals(0);
1836 m_page->tiltDirectionOffsetAngle->setRange(-180, 180);
1837
1838 m_page->tiltDirectionOffsetAngle->setAngle(-cfg.readEntry(
"tiltDirectionOffset", 0.0));
1839 m_page->tiltDirectionOffsetAngle->setPrefix(i18n(
"Pen tilt direction offset: "));
1841}
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)