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