27 #include "../../../../dataaccess/utils/Utils.h" 31 #include <QActionGroup> 36 m_menu =
new QMenu(tr(
"Char Encoding"),
this);
43 for (std::size_t t = 0; t < etNames.size(); ++t)
46 QAction* act =
new QAction(etNames[t].c_str(),
this);
48 act->setData(QVariant(etNames[t].c_str()));
49 act->setCheckable(
true);
68 QList<QAction*> actions =
m_actGroup->actions();
69 QList<QAction*>::iterator it = actions.begin();
71 while (it != actions.end())
73 std::string etCurName = (*it)->data().toString().toUtf8().data();
75 if (etCurName == etName)
77 (*it)->setChecked(
true);
97 QList<QAction*> actions =
m_actGroup->actions();
98 QList<QAction*>::iterator it = actions.begin();
100 while (it != actions.end())
102 if (ds->getType() ==
"OGR")
103 (*it)->setEnabled(
true);
105 (*it)->setEnabled(
false);
113 QAction* act =
dynamic_cast<QAction*
>(sender());
117 std::string etName = act->data().toString().toUtf8().data();
121 for (std::size_t t = 0; t < etNames.size(); ++t)
123 if (etName == etNames[t])
TEDATAACCESSEXPORT DataSourcePtr GetDataSource(const std::string &datasourceId, const bool opened=true)
Search for a data source with the informed id in the DataSourceManager.
boost::shared_ptr< DataSource > DataSourcePtr
static te::dt::Date ds(2010, 01, 01)
static std::string getEncodingName(EncodingType et)
Retrive a string from a given character encoding type enum.
static te::core::EncodingType getEncodingType(const std::string &name)
Retrive an EncodingType from a given character encoding name.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
static std::vector< std::string > getEncodingList()
Retrive a vector of string with all available encoding types name.