Hi
I'm trying using QListView to filebrowsing.
I'm trying to make a function to turn back previous directory.Code:
list->setModel(model);
Does anyone have a hint or solution ?
Printable View
Hi
I'm trying using QListView to filebrowsing.
I'm trying to make a function to turn back previous directory.Code:
list->setModel(model);
Does anyone have a hint or solution ?
your code is populating the list with the lower lever of anything you click on the list. (or, makes the clicked item as root)Quote:
I'm trying to make a function to turn back previous directory.
Where is a code that should do the "back" functionality?
I found this code on my machine:
Code:
// In constructor... listView->setRootIndex(root); // later... void MainWindow::up_button_clicked() { root = root.parent(); listView->setRootIndex(root); } { { root = index; listView->setRootIndex(root); } else { // do something with clicked file.
Hi
try this
Thanks for reply to this thread.
I tried following code
Code:
list->setModel(model);
and i received following application output message
Object::connect: No such slot QListView::setRootIndex(QDir::cdUp()) in window.h:86
I thought that I must change QlistView:: to another one.
Does this understanding is right??
thanks regard
Look, your problem is that you don't understand C++, and basics of the signal slot machanism and syntax.
When you give a slot in the connect() function, you have to specify the types the slot is taking, you however are CALLING the QDir::cdUp() method.
In addition, cdUp() returns a bool, and your slot expects a QModeIndex.
I write following slot
Code:
view->setRootIndex(index->parent()); }
And I wrote in this slot to following code
Code:
//QListView *list; list->setModel(model);
and i see following Application output
Object::connect: No such slot QListView::up_button(QModelIndex , list)
where page i have to see to understand signal and slot ?
http://doc.trolltech.com/4.6/signalsandslots.htmlQuote:
where page i have to see to understand signal and slot ?
I write two slot and "double_click" work but up_button doesn't work.
Code:
Code:
list->setRootIndex(index); } }
I write puts("debug"); in up_button() and confirm that up_button works.
I thought that
list->setRootIndex(index.parent());
is wrong way to turn back .
I have no plan .