Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Using a label as a link to a folder
Re: Using a label as a link to a folder [message #46919 is a reply to message #46918] Wed, 14 September 2016 19:29 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
Hi,

to open path as directory, I am using this snippet:

void ShellOpenFolder(const String& dir)
{
	#if defined(PLATFORM_WIN32)
		LaunchWebBrowser(dir);
	#elif __APPLE__
		String tempDir = dir;
		tempDir.Replace(" ", "\\ ");

		IGNORE_RESULT(
			system("open " + tempDir + " &")
		);
	#else
		String tempDir = dir;
		tempDir.Replace(" ", "\\ ");
		
		IGNORE_RESULT(
			system("xdg-open " + tempDir + " &")
		);
	#endif
}


To have clickable label, use RichText instead of Label and QTF.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Truncation
Next Topic: System Requirements, target platforms
Goto Forum:
  


Current Time: Mon Jun 17 20:26:14 CEST 2024

Total time taken to generate the page: 0.02068 seconds