Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
Executable
+97
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
**
|
||||
** @RDE_HEADER@
|
||||
** PlanEditor.
|
||||
** $Id$
|
||||
** $HeadURL$
|
||||
** $Author$
|
||||
**
|
||||
** -----------------------------------------------------------------------------------------------
|
||||
**
|
||||
** Hardware-Environment: Intel-PC
|
||||
** Software-Environment: Windows 7, Qt 5.4. ArcGIS 10.2.5
|
||||
**
|
||||
** Language ........: C++ 11
|
||||
**
|
||||
** -----------------------------------------------------------------------------------------------
|
||||
**
|
||||
** Author ...........: Jörg Turla, SPD G, Tel. 3132
|
||||
**
|
||||
** -----------------------------------------------------------------------------------------------
|
||||
**
|
||||
** Notes .........:
|
||||
**
|
||||
** 09.12.2015, JT : First edition for use with Qt5
|
||||
**
|
||||
** -----------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "plan_editor_utils.h"
|
||||
|
||||
#include <nglapplication/nglapplication.h>
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QLatin1String>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QFile>
|
||||
|
||||
#include <QtWidgets/QFrame>
|
||||
|
||||
|
||||
namespace PlanEditor
|
||||
{
|
||||
|
||||
QIcon Utils::getIcon(const char *iconName) { return Utils::getIcon(QLatin1String(iconName)); }
|
||||
|
||||
QIcon Utils::getIcon(const QString &iconName)
|
||||
{
|
||||
static QStringList iconPostfixes;
|
||||
|
||||
if (iconPostfixes.isEmpty())
|
||||
{
|
||||
QDir::setSearchPaths( QStringLiteral("PlanEditorIcon")
|
||||
, QStringList() << QStringLiteral(":/style")
|
||||
<< QStringLiteral(":/style/icons")
|
||||
<< QStringLiteral(":/style/icons/svg")
|
||||
<< QStringLiteral(":/style/icons/png")
|
||||
<< QStringLiteral(":/style/icons/32x32")
|
||||
<< QStringLiteral(":/style/icons/22x22")
|
||||
<< QStringLiteral(":/style/icons/16x16"));
|
||||
|
||||
iconPostfixes << QStringLiteral(".svg")
|
||||
<< QStringLiteral(".png")
|
||||
<< QStringLiteral(".gif");
|
||||
}
|
||||
|
||||
for (const QString &postfix : qAsConst(iconPostfixes))
|
||||
{
|
||||
QString fn = QStringLiteral("PlanEditorIcon:") + iconName + postfix;
|
||||
if (!QFile::exists(fn))
|
||||
continue;
|
||||
QIcon icon(fn);
|
||||
if (!icon.isNull())
|
||||
return icon;
|
||||
}
|
||||
return QIcon();
|
||||
|
||||
} // Utils::getIcon( const QString & iconName )
|
||||
|
||||
|
||||
QWidget *Utils::buildVerticalSeparator(QWidget *papa)
|
||||
{
|
||||
QFrame *separator = new QFrame(papa);
|
||||
separator -> setFrameStyle(QFrame::VLine | QFrame::Plain);
|
||||
return separator;
|
||||
} // QWidget * Utils::buildVerticalSeparator( QWidget * papa )
|
||||
|
||||
|
||||
QWidget *Utils::buildHorizontalSeparator(QWidget *papa)
|
||||
{
|
||||
QFrame *separator = new QFrame(papa);
|
||||
separator -> setFrameStyle(QFrame::HLine | QFrame::Plain);
|
||||
return separator;
|
||||
} // QWidget * Utils::buildHorizontalSeparator( QWidget * papa )
|
||||
|
||||
|
||||
} // namespace PlanEditor
|
||||
Reference in new issue
Block a user