How to browse and select files and directories together using Qt? - qt

I've noticed that QFileDialog::getOpenFileName can browse and select file and QFileDialog::getExistingDirectory can browse and select directories, but is there anyway to let me select file or directory at once (instead of only be able to select one of the two kind) ?

Related

Add back un-loaded folder in ASP.Net project

I am working on a ASP.Net project and I unloaded a folder "Reports" that had subfolders and RDLC files in it. The folder I un-loaded is from this path:
"C:\Users\TestUser\Documents\Project1\changerapp\Content\reports"
The folder Reports has some sub folders and RDLC files. Now I want to load the Reports folder like the same way it was before. But when I select "Add existing item" , it is not letting me add the folder (with all its contents). Rather it is making me select files inside that Reports folder. Any way to achieve this?
Figured out in 2 minutes after posting the question.
So we have to click the "Show all files" icon on top and select the folder we want to add back. Right click the folder and select "Include in the project" and the folder will be included.

How do I have a Headers folder in Code::Blocks?

I am using Code::Blocks 17.12 on Windows, and would like to create a folder to house the header files.
By default, when I create a console project, a Sources folder is created virtually (there isn't such a folder on disk, but it appears as such in Code::Blocks in the Management window's Project tab.
How do I create additional folders? When I right-click on the project (in the Management window's Project tab), I don't see a way to create a folder.
After Googling around for a bit, I came across this post, although dated 2009:
http://forums.codeblocks.org/index.php?topic=11365.0
Combining that answer with mine, these are the steps for creating a folder in Code::Blocks:
On your disk (i.e. outside of Code::Blocks), create your folders and add any existing files that you need to it. In my case I created an Includes folder and copied existing .h files into it.
Right-click on the project name in the Management windows' Project tab, and choose Project tree. Tick the Display folders as disk option.
Right-click on the project name again, and choose Add files recursively....
A dialog box appears. Navigate to your subfolder and click OK. Another dialog box appears asking you to select the files to add to the project. By default all the files in the subfolder are selected, so click OK.
The folder will appear in Code::Blocks, under a folder called Headers.
You will also need to add the folder(s) that you created outside of Code::Blocks to the compiler's search directories by clicking on Settings -> Compiler.... Then click on the Search directories tab, select the Compiler tab, then click Add.
In the dialog box that appears, click on the folder icon and navigate to your folder. Then click OK.

How to change the default Open File... (folder) in Netbeans 8.2?

How can I change the default Open File... directory in Netbeans 8.2 for Java SE\ME\EE?
I've edited my projectui.properties file line projectsFolder=DIRECTORY but that only works for projects. I am trying to open individual files without opening the entire project.
File was found (Windows) under "C:\Users\MYNAME\AppData\Roaming\NetBeans\8.2\config\Preferences\org\netbeans\modules"
Unlike setting the default project directory in NetBeans, you can't modify the default Open File... directory because there is no such "default directory" to change.
NetBeans behavior when you select Open File... from the File menu (on Windows 10 at least) is as follows:
[1] On the first occasion within a NetBeans session the Documents icon will be pre-selected in the Open dialog window, and your Documents directory will be opened. That's just the way NetBeans works, and cannot be modified. Although you can change the Documents folder that will be opened, you probably shouldn't. See below for details**.
[2] Within the Open dialog you can obviously navigate to any alternative folder to open a file. Thereafter, within that NetBeans session only, that alternative folder will be opened by default on the subsequent File -> Open File... selections, until an alternative directory is selected.
~~~~~
** To change the Documents folder in Windows (which will also change the folder that NetBeans opens on the initial use of File -> Open File..):
In Windows File Explorer select Desktop -> This PC -> Documents and right-click.
Select Properties from the drop down menu, and then select the Location tab in the Document Properties window.
Enter the name of the new folder to be used as the Documents folder and click OK.
Restart NetBeans, select File-> Open File... and the folder NetBeans opens will now be the one you specified in the previous step.
That may appear to have the desired affect, but other Windows applications also use the Documents folder, and may depend on files in that folder, so it shouldn't really be changed without good reason. If you really need to open files in NetBeans that are not within any project the cleanest approach would be to place such files in the Documents folder if possible.
One solution would be to move the NetBeansProjects in the Documents folder mentioned above to the desired place and to place a permanent symlink to the desired folder. Instructions for latter referenced here https://superuser.com/questions/1020821/how-to-create-a-symbolic-link-on-windows-10
Watch out if the secondary location could be temporary (like a network drive) that it's always in place before you launch Netbeans.

How do I get the resources folder back in Xcode 4?

The question says it all: where is the group and where is the "physical" folder?
So, to get the Resources group back, do this:
Right-click on your project icon in the navigation view on the left (blue icon).
Rename the group to "Resources."
That's it.
But what if you also want the Resources folder on your disk? Easy:
Open Finder.
Navigate to your project folder and create a new folder on the same level of the .xcodeproj directory, named "Resources".
Back in Xcode, select the Resources group and activate the "Utilities" view (all the way in the top right corner next to the Organizer icon).
Under the "Location" drop down box you see a small white-ish icon: Click it: A dialog called "Choose a directory this group represents" will come up.
Choose the Resources folder you created in step 2.
That's it. Now you can drag resources into the Resources group in Xcode and they will end up in the Resources folder on your disk.
I had the same problem by accidentally deleting the folder in the project.
For my environment (XCode v11), right click on the project in the project navigator and select "Add Files to ...
This will bring up your current project folder (if not, simply navigate to that directory) and then select the Assets.xcassets folder and click Add.
This will bring the assets folder back to your project.

How to get URL of file on a different drive from the ASP.NET application?

I have a server with a C: drive and a D: drive. My ASP.NET application is on D: drive as follows:
D:\inetpub\vhosts\mywebsite.com
I want my application to read and download files located on C:\sessionVideos\
My problem is how do I create an URL pointing to the "C:\sessionVideos\" folder?
Thanks,
James
Assuming that you have direct access to the server, you would use the IIS Manager and right-click the site within which you want to create the URL, select 'New', and then click 'Virtual Directory'.
In the Virtual Directory Creation Wizard, click Next. In the Alias box, type a name for the url (ie: MyWebSite/Videos) and then click Next. In the Path box, type or browse to the 'C:\sessionVideos\' directory, and then click Next. Note that you can select an existing folder or create a new one to contain the content for the virtual directory. Select the check boxes for the access permissions that you want to assign to your users. Click Next and then click Finish.
Now the url http://MyWebSite/Videos will access 'C:\sessionVideos\'
Depends what you're looking to do exactly - you could create a virtual directory underneath your site that maps to the directory hence the folder will seamlessly slot in as if it was located in your application/sites directory.

Resources