how to add children to the QTree Widget
-
Sir i am trying to add
uinx{
LIBS+= -L$$PWD/.../lib/linus/-lData
LIBS+= -L$$PWD/.../lib/Xenomai/-lData1 -lrtdm -lrt -lxenomai
}
win32
{
LIBS += path
}I am adding the linux and xenomai library and trying to compile . but it throws error. As it detects the linux library and it couldnt find the xenomai library it throws error.
My question is i want to define all my library and based on the platform or OS i am running it should detect its particular library.
For example : linux, xenomai, windiows. These are the platforms i am running the application. Why i ask this is because every time i have to add the corresponding library and compile it and the run the application . So is there any solution for this? -
One of the person from this forum told me to use "unix" and "win32". But i asked for linux,xenomai what should i define, he told to use "unix" itself. But i have separate library for linux and xenomai. but i want to add both is there any way?
-
Hi it seems ok what you did
except you missspelled unix (uinx)
and it sometimes a bit funny with scopes so make sure t to
unix {
}
and not
unix
{
}
http://doc.qt.io/qt-5/qmake-advanced-usage.html
http://doc.qt.io/qt-5/third-party-libraries.html -
Ok Sir,
But my doubt is i am able to add the library.
But i am adding another library that supports xenomai. while running the application in linux OS it goes to the unix{
LIBS+= -L$$PWD/.../lib/linus/-lData
LIBS+= -L$$PWD/.../lib/Xenomai/-lData1 -lrtdm -lrt -lxenomai
}
part and searches for the library which is my problem, I want the application to detect the library based on the platform i run. As one person from Qt forum said unix is common for xenomai, linux. So is there any possibility i can make my application to run that particular library based on OS platform? -
its linux sir,
but for xenomai also it is unix i think so
unix{
LIBS+= -L$$PWD/.../lib/linus/-lData
LIBS+= -L$$PWD/.../lib/Xenomai/-lData1 -lrtdm -lrt -lxenomai
}this is my problem sir,
I am want to run library if its linux i want linux library and if its xenomai i want xenomai library to run
-
Hi
Now i understand.
For qmake both plain linux and xenomai will be the same
as far as i know. (unix)you can call .sh script and things like that from the pro file
so maybe you can detect your self if linux or xenomai ?
http://doc.qt.io/archives/qt-4.8/qmake-function-reference.html#system-commandCheck what
UNAME = $$system(uname -s) contains( UNAME, [lL]inux ):message( This looks like Linux ($$UNAME) to me )
will output
also did u try what been suggested in
https://forum.qt.io/topic/94393/how-to-add-macro-for-the-libs-in-the-pro-file/9 -
@mrjj said in how to add children to the QTree Widget:
UNAME = $$system(uname -s)
contains( UNAME, [lL]inux ):message( This looks like Linux ($$UNAME) to me )So thsi is for linux?
UNAME = $$system(uname -s)
contains( UNAME, [lL]inux ):message( This looks like Linux ($$UNAME) to me )If i want to check for xenomai what should i do sir?
-
@ManiRon
Hi
Yes you can do it.
But you need to find out how. I dont have xenomai
installed so i cant say how we can spot the difference between plain linux and
xenomai
so try
UNAME = $$system(uname -s)
on both systems and see what it types.
If different, you can use that as a flag -
And i have another doubt .
I am trying to see the data which i have inserted into my QList . I can see the size but i cannot see the data.Code:
QList<QString> m_Data;
for(int i=1;i<3;i++)
{
Data = QString("SubItem"+QString::number(i));
m_Data.append(Data.toLatin1().constData());
QString H = m_Data.at(i); //trying to see data
qDebug()<<"Data"<< m_Data.at(i);
}while running the application crashesdonno why
-
@ManiRon
Hi
what you mean u can see the size but not the data?qDebug()<<"Data"<< m_Data.at(i); <<< u print index from 1,2,3
but u call append so first call, there is data in zero
but u print 1
then next loop
you print from 2, but only data in 0,1
and so on.
it starts in zero. so adjust the for loop.for(int i=0;i<2;i++) { Data = QString("SubItem"+QString::number(i+1)); m_Data.append(Data.toLatin1().constData()); qDebug()<<"Data"<< m_Data.at(i); //trying to see data }