Solved how to add children to the QTree Widget
-
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?
-
Is there any way 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 -
contains( UNAME, [lL]inux ):message( This looks like Linux ($$UNAME) to me )
This message where it will be printed sir?
-
And i have another doubt ?
-
@ManiRon
yes message print out the variable name $$UNAME ( what it contains)
what is other doubt? -
@mrjj ok where i can see this message sir?
-
@ManiRon
in the Creator output pane.
below where code is.
-
@mrjj my anogther doubt is
I am trying to view the data in a list . i have specified already
-
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 }
-
@mrjj said in how to add children to the QTree Widget:
but
if i give
int i = m_data.size();
and print the i value , I can see the data size that which i have inserted in the list.But if i try to see the data
QString H = m_data.at(i);
and print the H value using qDebug i data is not coming and the application crashes -
@ManiRon
Yes, you access to high index.
as u start with 1.
and list start with zero.
So that can crash. -
This post is deleted! -
@mrjj but my size is two. I have inserted two data and i am trying to see the second data then it should work right?
-
@ManiRon OK SIR IT WORKED
-
I have another doubt sir
-
@ManiRon
super :)
ask away :) -
How to use this ? for this only i am trying