Textractor_test/GUI/qtcommon.h

19 lines
686 B
C
Raw Normal View History

2018-08-23 00:24:55 +08:00
#pragma once
#include "common.h"
#include <QString>
#include <QVector>
2018-11-02 02:46:37 +08:00
#include <QHash>
#include <QMainWindow>
2018-11-10 18:13:59 +08:00
#include <QDialog>
#include <QFile>
#include <QFileInfo>
#include <QDir>
#include <QRegularExpression>
2018-12-19 01:14:54 +08:00
#include <QSettings>
2019-03-13 23:44:21 +08:00
struct QTextFile : QFile { QTextFile(QString name, QIODevice::OpenMode mode) : QFile(name) { open(mode | QIODevice::Text); } };
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()); }