Textractor_test/GUI/misc.h

9 lines
486 B
C
Raw Normal View History

2018-12-02 08:12:45 +08:00
#pragma once
2018-07-26 12:48:18 +08:00
2018-08-23 00:24:55 +08:00
#include "qtcommon.h"
2018-07-26 12:48:18 +08:00
2019-02-03 21:49:58 +08:00
struct QTextFile : QFile { QTextFile(QString name, QIODevice::OpenMode mode) : QFile(name) { open(mode | QIODevice::Text); } };
2018-12-23 05:17:08 +08:00
inline std::wstring S(const QString& S) { return { S.toStdWString() }; }
inline QString S(const std::wstring& S) { return QString::fromStdWString(S); }
inline HMODULE LoadLibraryOnce(std::wstring fileName) { if (HMODULE module = GetModuleHandleW(fileName.c_str())) return module; return LoadLibraryW(fileName.c_str()); }