48 qDebug()<<
"axlInspectorObjectInterface::setData : Default implementation";
60 QDir dirShader(
":axlShader/shader/");
61 dirShader.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
63 dirShader.setNameFilters(filters);
65 QFileInfoList list = dirShader.entryInfoList();
70 QSettings settings(
"inria",
"dtk");
72 settings.beginGroup(
"shader");
73 QString defaultPathShader = settings.value(
"path", defaultPath).toString();
74 defaultPathShader.append(
"/");
76 QDir defaultDirShader(defaultPathShader);
77 defaultDirShader.setNameFilters(filters);
78 QFileInfoList list2 = defaultDirShader.entryInfoList();
84 for (
int i = 0; i < list.size(); ++i) {
85 if(!items.contains(list.at(i).fileName()))
86 items << list.at(i).fileName();
90 int indInitShader = -1;
91 int indCurrentShader = -1;
93 foreach(QString item, items) {
95 comboBoxShader->addItem(item);
97 QFileInfo currentFileInfo(lineEditShader->text());
99 if(currentFileInfo.exists())
101 if(item == currentFileInfo.fileName())
102 indInitShader =indCurrentShader;
107 if(indInitShader != -1)
108 comboBoxShader->setCurrentIndex(indInitShader);
117 QDir dirShader(
":axlShader/shader/");
118 dirShader.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
120 QFileInfo currentFile(dirShader, shader);
121 if(!currentFile.exists())
123 QSettings settings(
"inria",
"dtk");
125 settings.beginGroup(
"shader");
126 QString defaultPathShader = settings.value(
"path", defaultPath).toString();
127 defaultPathShader.append(
"/");
129 QDir defaultDirShader(defaultPathShader);
130 currentFile = QFileInfo(defaultDirShader, shader);
133 return currentFile.absoluteFilePath();
140 class axlInspectorObjectFactoryPrivate
156 if(!d->creators.contains(interface_name))
157 d->creators.insert(interface_name, func);
164 if(!d->creators.contains(interface_name))
167 return d->creators[interface_name]();
172 axlInspectorObjectFactory::axlInspectorObjectFactory(
void) : QObject(), d(new axlInspectorObjectFactoryPrivate)
177 axlInspectorObjectFactory::~axlInspectorObjectFactory(
void)
bool registerInspectorObject(const QString &interface_name, axlInspectorObjectCreator func)
axlInspectorObjectInterface * create(const QString &interface_name)
bool caseInsensitiveLessThan(const QString &s1, const QString &s2)
virtual ~axlInspectorObjectInterface(void)
static axlInspectorObjectFactory * instance(void)
virtual void setData(dtkAbstractData *data)
void setObjectFactorySingleton(axlInspectorObjectFactory *objectFactorySingleton)
static axlInspectorObjectFactory * s_instance
axlInspectorObjectInterface(QWidget *parent=0)
QHash< QString, axlInspectorObjectCreator > axlInspectorObjectCreatorHash
void initComboBoxShaderValue(QComboBox *comboBoxShader, QLineEdit *lineEditShader)
axlInspectorObjectFactory * objectFactorySingleton(void)
axlInspectorObjectFactory * m_objectFactorySingleton
QString filePath(const QString &shader)