1818 : QWidget(parent)
1819{
1820 setObjectName(name);
1821
1822 QGridLayout * l = new QGridLayout(this);
1823 l->setContentsMargins(0, 0, 0, 0);
1825 l->addWidget(
m_page, 0, 0);
1826
1829 m_page->pressureCurve->setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
1830 m_page->pressureCurve->setCurve(curve);
1831
1832 m_page->chkUseRightMiddleClickWorkaround->setChecked(
1833 cfg.useRightMiddleTabletButtonWorkaround());
1834
1835#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
1836# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1837 QString actualTabletProtocol = "<unknown>";
1838 using QWindowsApplication = QNativeInterface::Private::QWindowsApplication;
1839 if (auto nativeWindowsApp = dynamic_cast<QWindowsApplication *>(QGuiApplicationPrivate::platformIntegration())) {
1840 actualTabletProtocol = nativeWindowsApp->isWinTabEnabled() ? "WinTab" : "Windows Ink";
1841 }
1842 m_page->grpTabletApi->setTitle(i18n(
"Tablet Input API (currently active API: \"%1\")", actualTabletProtocol));
1843# endif
1844 m_page->radioWintab->setChecked(!cfg.useWin8PointerInput());
1845 m_page->radioWin8PointerInput->setChecked(cfg.useWin8PointerInput());
1846
1848 connect(
m_page->radioWintab, SIGNAL(toggled(
bool)),
m_page->btnResolutionSettings, SLOT(setEnabled(
bool)));
1849 m_page->btnResolutionSettings->setEnabled(
m_page->radioWintab->isChecked());
1850#else
1851 m_page->grpTabletApi->setVisible(
false);
1852#endif
1854
1855#ifdef Q_OS_WIN
1856 m_page->chkUseTimestampsForBrushSpeed->setText(i18n(
"Use tablet driver timestamps for brush speed (may cause severe artifacts when using WinTab tablet API)"));
1857#else
1858 m_page->chkUseTimestampsForBrushSpeed->setText(i18n(
"Use tablet driver timestamps for brush speed"));
1859#endif
1860 m_page->chkUseTimestampsForBrushSpeed->setChecked(cfg.readEntry(
"useTimestampsForBrushSpeed",
false));
1861
1862#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
1863 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->setChecked(
1864 cfg.usePageUpDownMouseButtonEmulationWorkaround());
1865#else
1866 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->hide();
1867#endif
1868
1869#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
1870 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->setChecked(
1871 cfg.useHighFunctionKeyMouseButtonEmulationWorkaround());
1872#else
1873 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->hide();
1874#endif
1875
1876#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
1877 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->setChecked(cfg.useIgnoreHistoricTabletEventsWorkaround());
1878#else
1879 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->hide();
1880#endif
1881
1882#ifdef Q_OS_ANDROID
1884 m_page->chkHideTouchAndStylusCursorsWorkaround->setChecked(cfg.hideTouchAndStylusCursorsWorkaround());
1885 } else {
1886 m_page->chkHideTouchAndStylusCursorsWorkaround->hide();
1887 }
1888#else
1889 m_page->chkHideTouchAndStylusCursorsWorkaround->hide();
1890#endif
1891
1892 m_page->intMaxAllowedBrushSpeed->setRange(1, 100);
1893 m_page->intMaxAllowedBrushSpeed->setValue(cfg.readEntry(
"maxAllowedSpeedValue", 30));
1895
1896
1897
1898 return i18np("Maximum brush speed: {n} px/ms", "Maximum brush speed: {n} px/ms", value);
1899 });
1900
1901 m_page->intBrushSpeedSmoothing->setRange(3, 100);
1902 m_page->intBrushSpeedSmoothing->setValue(cfg.readEntry(
"speedValueSmoothing", 3));
1904
1905
1906
1907 return i18np("Brush speed smoothing: {n} sample", "Brush speed smoothing: {n} samples", value);
1908 });
1909
1910 m_page->tiltDirectionOffsetAngle->setDecimals(0);
1911 m_page->tiltDirectionOffsetAngle->setRange(-180, 180);
1912
1913 m_page->tiltDirectionOffsetAngle->setAngle(-cfg.readEntry(
"tiltDirectionOffset", 0.0));
1914 m_page->tiltDirectionOffsetAngle->setPrefix(i18n(
"Pen tilt direction offset: "));
1916}
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
bool canHideTouchAndStylusCursors()
void install(QSpinBox *spinBox, std::function< QString(int)> messageFn)