Textractor_test/GUI/qtcommon.h
2019-03-13 11:44:21 -04:00

19 lines
686 B
C++

#pragma once
#include "common.h"
#include <QString>
#include <QVector>
#include <QHash>
#include <QMainWindow>
#include <QDialog>
#include <QFile>
#include <QFileInfo>
#include <QDir>
#include <QRegularExpression>
#include <QSettings>
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()); }