This commit is contained in:
fourtf
2018-01-28 03:39:47 +01:00
76 changed files with 1645 additions and 561 deletions
+12
View File
@@ -47,6 +47,18 @@ public:
return LayoutCreator<T2>(t);
}
template <typename T2, typename Q = T,
typename std::enable_if<std::is_base_of<QWidget, Q>::value, int>::type = 0,
typename std::enable_if<std::is_base_of<QLayout, T2>::value, int>::type = 0>
LayoutCreator<T2> setLayoutType()
{
T2 *layout = new T2;
this->item->setLayout(layout);
return LayoutCreator<T2>(layout);
}
LayoutCreator<T> assign(T **ptr)
{
*ptr = this->item;
+2 -2
View File
@@ -37,14 +37,14 @@ static void get(QString url, const QObject *caller,
});
}
static void get2(QString url, const QObject *caller,
static void get2(QString url, const QObject *caller, bool useQuickLoadCache,
std::function<void(const rapidjson::Document &)> successCallback)
{
util::NetworkRequest req(url);
req.setCaller(caller);
req.setRawHeader("Client-ID", getDefaultClientID());
req.setRawHeader("Accept", "application/vnd.twitchtv.v5+json");
req.setUseQuickLoadCache(true);
req.setUseQuickLoadCache(useQuickLoadCache);
req.getJSON2([=](const rapidjson::Document &document) {
successCallback(document); //