QTreeView and its signals, and setting directory of its QFileSystemModel
-
Did you check if you had any warnings on the console ?
-
Yes - there were no warnings at all on the console.
-
Does your QTreeWidget get populated correctly ?
-
Seems to be. I can definitely navigate the filesystem with it.
I am starting to wonder if only the Enter key can send these signals on Linux, and in my case Enter is closing the dialog. That wouldn't make much sense with clicked() though.
Ultimately I want a signal to fire when a user clicks or moves the highlight through the tree with the arrow keys.
-
Then it should be the activated signal IIRC
-
Yeah, that's what I thought too, and it's the first one I tried; it's just not getting fired!
I guess I should try to come up with a minimal example and see if it works there.
-
In between, what version of Qt and what OS are you using ?
-
qt 5.3.1 on Arch Linux, from the Arch repos....
-
Guess I'll eat my words here. In the slot I added this:
@ QMessageBox::information(this, "test", "hello we reached the slot!");
@and changed the signal to activated(), and it did show this when I clicked on an entry! (But not on moving the selection with the arrow keys.)
But that leaves the perplexing question of why these did not output anything.
@ qDebug("hello world\n");
qDebug(photoSelectionModel->data(index).toString().toLatin1());@I've used qDebug before in this project ...
Thanks!
-
Add some defines somewhere in your pro file ?
Changed Qt version ? Release VS Debug ?