Re: Is it possible to dynamically populate a ListView within a GridView ?
Ok, strange.
Can you try to create a minimal example that can be built and run and shows the problem?
Cheers,
_
1 Attachment(s)
Re: Is it possible to dynamically populate a ListView within a GridView ?
Sorry for the late reply but I haven't got the time until now.
I made this little example which build and run but with the same problem.
Attachment 11788
I hope it helps to understand the issue.
Re: Is it possible to dynamically populate a ListView within a GridView ?
Ok, this is more complicated than I thought :(
I found two things that work:
- make the channels property a QList<QObject*>
- Use a QAbstractListModel derived class to provide the channel data
Some other observations:
- main.cpp cannot compile because there is no MainWindow.h, it is mainwindow.h
- this can be written much shorter. Instead of
Code:
QString::fromStdString("channel " + QString::number(i
).
toStdString()).
toStdString().
c_str())
write this
Cheers,
_
Re: Is it possible to dynamically populate a ListView within a GridView ?
Quote:
Originally Posted by
anda_skoa
Ok, this is more complicated than I thought :(
I found two things that work:
- make the channels property a QList<QObject*>
- Use a QAbstractListModel derived class to provide the channel data
Some other observations:
- main.cpp cannot compile because there is no MainWindow.h, it is mainwindow.h
- this can be written much shorter. Instead of
Code:
QString::fromStdString("channel " + QString::number(i
).
toStdString()).
toStdString().
c_str())
write this
Cheers,
_
I use your first suggestion and it worked perfectly.
Your tip for QString is a good-to-know one ;-)
For the mainwindow include, you are right but it was compiling on my setup (which is weird...).
Thank you for the help !
Re: Is it possible to dynamically populate a ListView within a GridView ?
Quote:
Originally Posted by
andrioli.n
For the mainwindow include, you are right but it was compiling on my setup (which is weird...).
You were likely building on Windows or OSX with a case-insensitve file system.
Cheers,
_