PDA

View Full Version : [Qt] Two questions regarding my newly made directory browsing dialog ..



ahmadka
6th July 2010, 00:56
OK so I've just finished making a custom directory browsing dialog, and I had two questions about its customization .. But first, here are some pictures ..

Here's what I was trying to achieve (taken from Xournal):

http://i49.tinypic.com/b87ay8.png

http://i50.tinypic.com/552usy.png

And here's my copy :P ..

http://i50.tinypic.com/xofu3l.png

I have two questions regarding my copy here:

1) First question is, how can I make my QDialog take more of the screen ? I mean as it is right now, its taking about 60% of the screen, but still the list area is not tall enough .. How can I make the QDialog fill more of the screen ?

2) Second question is, I'm using QDir to help me browse through the directories, but there are some folders which are shown in the Xournal control, but which QDir doesn't give me .. For example, In the first two pictures, there are folders with special icons named 'Documents' and 'Audio Clips' .. these folders dont show up when I browse the same path through QDir .. There are about 4 or 5 of these folders .. Also, the directory shown in the first two Xournal pictures is /home/user/MyDocs/ .. however, in Xournal they are listed as 'Ahmad's N900' .. I must have set this name somewhere, but still, why are there these differences between the two models, and how can I make changed to my directory structure so that these differences are ironed out ?

I'm using the following filters/options for my QDir:


dir->setFilter(QDir::AllDirs | QDir::NoDotAndDotDot);
dir->setSorting(QDir::Name);

nish
6th July 2010, 16:28
1. you can use setFixedSize(), showMaximised(), or better connect the signal qApp->desktop()->resized() or something to your dialog's slot and setFixedsize() according to the screen size, this will also help to resize the dialog when the screen rotates.

2. I dont know why QDir is not showing those dirs, are you sure that audio clips is physically present on the same path, are they just quick links to other places just like we have desktop, my computer etc links in open dialog on windows? . Try QFileSystemModel