1780 : QWidget(parent)
1781{
1782 setObjectName(name);
1783
1784 QGridLayout * l = new QGridLayout(this);
1785 l->setContentsMargins(0, 0, 0, 0);
1787 l->addWidget(
m_page, 0, 0);
1788
1791 m_page->pressureCurve->setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
1792 m_page->pressureCurve->setCurve(curve);
1793
1794 m_page->chkUseRightMiddleClickWorkaround->setChecked(
1795 cfg.useRightMiddleTabletButtonWorkaround());
1796
1797#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
1798# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1799 QString actualTabletProtocol = "<unknown>";
1800 using QWindowsApplication = QNativeInterface::Private::QWindowsApplication;
1801 if (auto nativeWindowsApp = dynamic_cast<QWindowsApplication *>(QGuiApplicationPrivate::platformIntegration())) {
1802 actualTabletProtocol = nativeWindowsApp->isWinTabEnabled() ? "WinTab" : "Windows Ink";
1803 }
1804 m_page->grpTabletApi->setTitle(i18n(
"Tablet Input API (currently active API: \"%1\")", actualTabletProtocol));
1805# endif
1806 m_page->radioWintab->setChecked(!cfg.useWin8PointerInput());
1807 m_page->radioWin8PointerInput->setChecked(cfg.useWin8PointerInput());
1808
1810 connect(
m_page->radioWintab, SIGNAL(toggled(
bool)),
m_page->btnResolutionSettings, SLOT(setEnabled(
bool)));
1811 m_page->btnResolutionSettings->setEnabled(
m_page->radioWintab->isChecked());
1812#else
1813 m_page->grpTabletApi->setVisible(
false);
1814#endif
1816
1817#ifdef Q_OS_WIN
1818 m_page->chkUseTimestampsForBrushSpeed->setText(i18n(
"Use tablet driver timestamps for brush speed (may cause severe artifacts when using WinTab tablet API)"));
1819#else
1820 m_page->chkUseTimestampsForBrushSpeed->setText(i18n(
"Use tablet driver timestamps for brush speed"));
1821#endif
1822 m_page->chkUseTimestampsForBrushSpeed->setChecked(cfg.readEntry(
"useTimestampsForBrushSpeed",
false));
1823
1824#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
1825 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->setChecked(
1826 cfg.usePageUpDownMouseButtonEmulationWorkaround());
1827#else
1828 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->hide();
1829#endif
1830
1831#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
1832 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->setChecked(
1833 cfg.useHighFunctionKeyMouseButtonEmulationWorkaround());
1834#else
1835 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->hide();
1836#endif
1837
1838#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
1839 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->setChecked(cfg.useIgnoreHistoricTabletEventsWorkaround());
1840#else
1841 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->hide();
1842#endif
1843
1844 m_page->intMaxAllowedBrushSpeed->setRange(1, 100);
1845 m_page->intMaxAllowedBrushSpeed->setValue(cfg.readEntry(
"maxAllowedSpeedValue", 30));
1847
1848
1849
1850 return i18np("Maximum brush speed: {n} px/ms", "Maximum brush speed: {n} px/ms", value);
1851 });
1852
1853 m_page->intBrushSpeedSmoothing->setRange(3, 100);
1854 m_page->intBrushSpeedSmoothing->setValue(cfg.readEntry(
"speedValueSmoothing", 3));
1856
1857
1858
1859 return i18np("Brush speed smoothing: {n} sample", "Brush speed smoothing: {n} samples", value);
1860 });
1861
1862 m_page->tiltDirectionOffsetAngle->setDecimals(0);
1863 m_page->tiltDirectionOffsetAngle->setRange(-180, 180);
1864
1865 m_page->tiltDirectionOffsetAngle->setAngle(-cfg.readEntry(
"tiltDirectionOffset", 0.0));
1866 m_page->tiltDirectionOffsetAngle->setPrefix(i18n(
"Pen tilt direction offset: "));
1868}
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)