UI: Remove compatibility for QT < 5.10

master
derrod 2022-07-31 22:50:33 +02:00 committed by Jim
parent a34439aecc
commit 5620a469a9
4 changed files with 0 additions and 21 deletions

View File

@ -7,9 +7,7 @@
#include <QDesktopServices>
#include <QHBoxLayout>
#include <QUrl>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
#include <QRandomGenerator>
#endif
#ifdef WIN32
#include <windows.h>
@ -200,7 +198,6 @@ void YoutubeAuth::ResetChat()
QString YoutubeAuth::GenerateState()
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
char state[YOUTUBE_API_STATE_LENGTH + 1];
QRandomGenerator *rng = QRandomGenerator::system();
int i;
@ -210,17 +207,6 @@ QString YoutubeAuth::GenerateState()
state[i] = 0;
return state;
#else
std::uniform_int_distribution<> distr(0, allowedCount);
std::string result;
result.reserve(YOUTUBE_API_STATE_LENGTH);
std::generate_n(std::back_inserter(result), YOUTUBE_API_STATE_LENGTH,
[&] {
return static_cast<char>(
allowedChars[distr(randomSeed)]);
});
return result.c_str();
#endif
}
// Static.

View File

@ -40,7 +40,6 @@ class YoutubeAuth : public OAuthStreamKey {
Q_OBJECT
bool uiLoaded = false;
std::mt19937 randomSeed;
std::string section;
#ifdef BROWSER_AVAILABLE

View File

@ -82,10 +82,8 @@ int OBSIgnoreWheelProxyStyle::styleHint(StyleHint hint,
const QWidget *widget,
QStyleHintReturn *returnData) const
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
if (hint == SH_ComboBox_AllowWheelScrolling)
return 0;
#endif
return QProxyStyle::styleHint(hint, option, widget, returnData);
}

View File

@ -269,11 +269,7 @@ QWidget *OBSPropertiesView::AddText(obs_property_t *prop, QFormLayout *layout,
if (type == OBS_TEXT_MULTILINE) {
QPlainTextEdit *edit = new QPlainTextEdit(QT_UTF8(val));
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
edit->setTabStopDistance(40);
#else
edit->setTabStopWidth(40);
#endif
if (monospace) {
QFont f("Courier");
f.setStyleHint(QFont::Monospace);