UI: Remove compatibility for QT < 5.10
parent
a34439aecc
commit
5620a469a9
|
@ -7,9 +7,7 @@
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
|
||||||
#include <QRandomGenerator>
|
#include <QRandomGenerator>
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -200,7 +198,6 @@ void YoutubeAuth::ResetChat()
|
||||||
|
|
||||||
QString YoutubeAuth::GenerateState()
|
QString YoutubeAuth::GenerateState()
|
||||||
{
|
{
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
|
||||||
char state[YOUTUBE_API_STATE_LENGTH + 1];
|
char state[YOUTUBE_API_STATE_LENGTH + 1];
|
||||||
QRandomGenerator *rng = QRandomGenerator::system();
|
QRandomGenerator *rng = QRandomGenerator::system();
|
||||||
int i;
|
int i;
|
||||||
|
@ -210,17 +207,6 @@ QString YoutubeAuth::GenerateState()
|
||||||
state[i] = 0;
|
state[i] = 0;
|
||||||
|
|
||||||
return state;
|
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.
|
// Static.
|
||||||
|
|
|
@ -40,7 +40,6 @@ class YoutubeAuth : public OAuthStreamKey {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
bool uiLoaded = false;
|
bool uiLoaded = false;
|
||||||
std::mt19937 randomSeed;
|
|
||||||
std::string section;
|
std::string section;
|
||||||
|
|
||||||
#ifdef BROWSER_AVAILABLE
|
#ifdef BROWSER_AVAILABLE
|
||||||
|
|
|
@ -82,10 +82,8 @@ int OBSIgnoreWheelProxyStyle::styleHint(StyleHint hint,
|
||||||
const QWidget *widget,
|
const QWidget *widget,
|
||||||
QStyleHintReturn *returnData) const
|
QStyleHintReturn *returnData) const
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
|
||||||
if (hint == SH_ComboBox_AllowWheelScrolling)
|
if (hint == SH_ComboBox_AllowWheelScrolling)
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
|
|
||||||
return QProxyStyle::styleHint(hint, option, widget, returnData);
|
return QProxyStyle::styleHint(hint, option, widget, returnData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -269,11 +269,7 @@ QWidget *OBSPropertiesView::AddText(obs_property_t *prop, QFormLayout *layout,
|
||||||
|
|
||||||
if (type == OBS_TEXT_MULTILINE) {
|
if (type == OBS_TEXT_MULTILINE) {
|
||||||
QPlainTextEdit *edit = new QPlainTextEdit(QT_UTF8(val));
|
QPlainTextEdit *edit = new QPlainTextEdit(QT_UTF8(val));
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
|
||||||
edit->setTabStopDistance(40);
|
edit->setTabStopDistance(40);
|
||||||
#else
|
|
||||||
edit->setTabStopWidth(40);
|
|
||||||
#endif
|
|
||||||
if (monospace) {
|
if (monospace) {
|
||||||
QFont f("Courier");
|
QFont f("Courier");
|
||||||
f.setStyleHint(QFont::Monospace);
|
f.setStyleHint(QFont::Monospace);
|
||||||
|
|
Loading…
Reference in New Issue