source: s10k/Vago/util.h@ 1092

Last change on this file since 1092 was 1054, checked in by s10k, 8 years ago

Vago 1.1

File size: 2.1 KB
Line 
1#ifndef UTIL_H
2#define UTIL_H
3
4#include <QtGlobal> // for debug macros
5#ifdef QT_DEBUG
6 #include <QDebug>
7#endif
8#include <QString>
9#include <QMessageBox>
10#include <QFileDialog>
11#include <QListView>
12#include <QTreeView>
13#include <QDesktopServices>
14#include <QUrl>
15#include <QCoreApplication>
16#include <QDesktopWidget>
17#include <QSettings>
18#include <QXmlStreamReader>
19#include <memory>
20
21/**
22 Utilities functions (global)
23 **/
24namespace Util{
25QString normalizePath(QString path);
26QString cutName(QString path);
27QString cutNameWithoutBackSlash(QString path);
28QString insertQuotes(const QString &currString);
29QString normalizeAndQuote(QString path);
30QString fullTrim(QString str);
31QString normalizeDecimalSeparator(QString value);
32
33inline const char* qStrToCstr(const QString &currentString){
34 return currentString.toUtf8().constData();
35}
36
37inline const char* boolToCstr(bool currentBoolean){
38 return currentBoolean ? "true" : "false";
39}
40
41QStringList multipleDirDialog(QString title);
42QStringList substring(QString myString,QString separator,Qt::CaseSensitivity cs = Qt::CaseSensitive);
43int indexOfBackward(QString myString, QString toSearch, int from = -1);
44bool showQuestionPopUp(QWidget * parent, QString message, QMessageBox::StandardButton standardButton=QMessageBox::NoButton);
45QMessageBox::StandardButton showQuestionPopUpWithCancel(QWidget * parent, QString message, QMessageBox::StandardButton standardButton=QMessageBox::NoButton);
46bool checkEmptySpaces(QStringList toCheck);
47bool checkIfIntegers(QStringList toCheck);
48bool checkIfDoubles(QStringList toCheck);
49bool isStringInteger(QString myString);
50bool isStringDouble(QString myString);
51bool copyDir(const QString &fromPath, QString toPath, const bool isRecursive = false);
52bool rmDir(const QString &dirPath);
53QRect getScreenResolution();
54void showPopUp(const QString &message);
55void showRichPopUp(const QString &message);
56void showWarningPopUp(const QString &message);
57void showErrorPopUp(const QString &message);
58void showRichErrorPopUp(const QString &message);
59}
60#endif // UTIL_H
Note: See TracBrowser for help on using the repository browser.