Qt 4.8
Static Private Functions | Properties | Friends | List of all members
QmlApplicationViewerPrivate Class Reference

Static Private Functions

static QString adjustPath (const QString &path)
 

Properties

QString mainQmlFile
 

Friends

class QmlApplicationViewer
 

Detailed Description

Definition at line 86 of file qmlapplicationviewer.cpp.

Functions

◆ adjustPath()

QString QmlApplicationViewerPrivate::adjustPath ( const QString path)
staticprivate

Definition at line 93 of file qmlapplicationviewer.cpp.

Referenced by QmlApplicationViewer::addImportPath(), and QmlApplicationViewer::setMainQmlFile().

94 {
95 #ifdef Q_OS_UNIX
96 #ifdef Q_OS_MAC
97  if (!QDir::isAbsolutePath(path))
99  + QLatin1String("/../Resources/") + path;
100 #else
101  const QString pathInInstallDir = QCoreApplication::applicationDirPath()
102  + QLatin1String("/../") + path;
103  if (pathInInstallDir.contains(QLatin1String("opt"))
104  && pathInInstallDir.contains(QLatin1String("bin"))
105  && QFileInfo(pathInInstallDir).exists()) {
106  return pathInInstallDir;
107  }
108 #endif
109 #endif
110  return path;
111 }
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.h:904
static bool isAbsolutePath(const QString &path)
Returns true if path is absolute; returns false if it is relative.
Definition: qdir.h:192
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool exists() const
Returns true if the file exists; otherwise returns false.
Definition: qfileinfo.cpp:675
The QString class provides a Unicode character string.
Definition: qstring.h:83
static QString applicationDirPath()
Returns the directory that contains the application executable.
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:60

Friends and Related Functions

◆ QmlApplicationViewer

friend class QmlApplicationViewer
friend

Definition at line 89 of file qmlapplicationviewer.cpp.

Properties

◆ mainQmlFile

QString QmlApplicationViewerPrivate::mainQmlFile
private

Definition at line 88 of file qmlapplicationviewer.cpp.

Referenced by QmlApplicationViewer::setMainQmlFile().


The documentation for this class was generated from the following file: