Closed ouuan closed 4 years ago
Please check for Qt version (>=5.10) when using tabStopDistance
, as I have to use Qt 5.7.1 for cross compiling.
Please check for Qt version (>=5.10) when using
tabStopDistance
, as I have to use Qt 5.7.1 for cross compiling.
So should I close this for backwards compatibility?
Or check Qt version then use different functions?
Checking the Qt version and using tabStopDistance
for version >= 5.10 and else using tabStopWidth
should be fine. This way QCodeEditor will use the new property if available but remains backward compatible.
Something like:
#if QT_VERSION >= 0x050A00
const int defaultIndent = tabStopDistance() / fontMetrics().averageCharWidth();
#else
const int defaultIndent = tabStopWidth() / fontMetrics().averageCharWidth();
#endif
See: