Qt Dropsite Example - c++

In QtDemo there is an example called Dropsite in which an image can be dragged and dropped into the field to be displayed. This example used to work in an older version of Qt and works initially in 4.6 if you run it from qt\examples\draganddrop\dropsite\release folder. But if you load the project file into Qt Creator and recompile it, it no longer displays the image correctly and gives a generic image in the box. I cannot figure out how to fix this and I need to use drag and drop in a project I am working on. Please help. Thank you.

Drag and drop an image into the drop area, you'll not able to get "application/x-qt-image" in minedata since Qt4.6. But if you drag&drop an image from web page, you'll still be able to see the image. I think it's reasonable for drop area to check if the dropped file is an image or not, instead of depending on mine data.

Related

Do I have to do something special to make a file a resource file in QT C++?

Basically I have an image I'm trying to use as a splash screen. I set up the splash screen and even told it the location(":/Nuclear_Vortex_100_About.jpg") but when I run the program, all I see is a general window background "window"(no close box or any of the decoration, just a widget for lack of a better word) and no image on it.
I added the file (along with a bunch of other images I want to later load and use in the app) and they show up in the "Other Files" folder - ok so I figured since they're in the project, that they would be seen as resources if not source or headers. Do I need to add a special section to the PRO file or something in order to use the file? I'm about to just hard code an absolute path just to get it to work but I want a system independent way to get this done. I'm going to be paid for this project and I don't have much experience with the resource system in QT but it wasn't hard in Visual Studio and other C++ environments. As I see the splash screen show up, I know that part is working. The only thing I don't know for sure is that the file is not being found - that is I have not verified by using QFile and checking if it exists - I'll be doing that after I post this as it'll take some time to get a response or 2.
I have been searching for over a day and a half all over google and haven't found anything telling me what I'm doing wrong.
Thank you!
create resource file (.qrc) and add picture in it. It'll appear in resources section of your project. Then you can use it freely in your program.

Gimp Image->Guides menu item disappeared

I wanted to use the guides in Gimp but I cannot find it at their traditional place.
The Image menu contains all the usual items (Duplicate, Mode, ..., Configure Grid, Image Properties), apart from the Guides which is supposed to be right above the Configure Grid.
How can I get this menu item back?
It is Windows 7 and Gimp 2.8.22.
I couldn't find any solution in Gimp to change the content of the menus so I decided to reinstall Gimp. That is, I used the official Add/Remove Programs from the Control Panel to delete it and then I executed the installer.
It did not solve the problem, ie. the Image->Guides menu item was still missing.
So, I
uninstalled Gimp again
I used regedit.exe to remove all the references to Gimp (there were some so the uninstall was not totally clean)
I deleted the folder called .gimp-2.8 from the C:\Users\<username>\ directory (it was still there so the uninstall did not do a perfect job).
then I installed it again.
This solved the problem so it seems that the registry or the .gimp-2.8 folder got corrupted.

Qt Drag and Drop to windows explorer: How do I know the dropped destination path

What I'm trying to do is to display a listview of online files, just like an FTP client lists all the files on the FTP server, and one can drag any row or rows to any local folder to save the dragged files right there.
I'm planning to implement this through the follwing steps:
init the drag event, and save the selected files' path on the server [done]
subclass QMimeData class, and overwrite retrieveData function just as this thread suggests here [done]
Just finish the drag and drop process, and find the dropped destination path, say C:\somefolder\subfolder, then download all the files there, job done. 【not done】
But I could not find anywhere to get the dropped destionation path, not even by processing dragEnter\dragMove\dragLeave\drop events. I've also done tons of google search, found some similar questions but never any solid answer.
Please shed some light on this. Is this solutuion even doable with QT ? How should I get the destination path or is there any other way to achieve this goal ?
For anyone who's searching for this, I might find an answer, but it ain't easy and could be platform dependent.
After tons of (literally) search, I found a solution in FileZilla's source code, turns out to cope with such situatuation, you need:
you need a shell extension to monitor (or whatever) the drag process
start a normal drag and drop
when mouse is dropped, just do nothing, let the whole drag and drop process finish
through the shell extension, you can get the actual destination path, and just download your files there.
for technical details, plz visit FileZilla official website
I think this is for windows only, if anyone get the answer for other platforms, please let me know!

Sitecore 8.1 Rich Text Editor Image error

I'm developing a Sitecore 8.1 Initial Release site and have run into an issue with the Rich Text Editor and images.
When a user adds an image to the editor, everything works fine. However, if the user checks the Properties of the image in the editor, clears the Properties dialog, and accepts the RTE's changes, the image disappears and a browser error occurs saying the image cannot be found. This also happens if the Image Map Editor is opened.
Looking at the markup generated, the working src value is "-/media/.ashx". After looking at the properties, the src value is changed to "-/media/.ashx&h=230&w=375".
Any idea where this "&h=230&w=375" is coming from and how to stop or correct it?
I contacted Sitecore Support. What I found was a bug in 8.1 initial release which has been fixed in later versions. I was given an updated file to replace some Rich Text Editor javascript and that fixed it for me.
We're already committed to this release of Sitecore for now. For others, I'd probably recommend updating Sitecore to a later release.

In Sitecore 7.1 when I try to open the media library browser to insert an image a popup says the item was deleted

I have a simple template inheriting from Standard Template with an Image field. After creating a new item, when I go to add content and click on the field's toolbar item Open Media Library I get a message telling me The selected item could not be found. and suggesting that another use deleted it.
I am the only user on the installation, and the item is definitely there. I have done a few other Sitecore installs to make sure it's not just a corrupt project, and I've checked the logs to no avail.
I'm using Sitecore 7.1 rev. 130926 (the latest version as of this writing). I've done extensive searching and can't find anybody reporting a similar issue - my guess is it's a simple configuration (botched ID or path?), but I can't seem to locate it by scanning the configs for relevant keywords.
There are other issues with using the Browse editor, but I believe this is related to the missing Media Library item. The File Selector and other reasonably equivalent editors do not fail so I don't think it's a browser configuration. I've tried on Chrome, IE and Firefox and all respond the same way.
Any suggestions on further courses of action would be greatly appreciated!
I was also facing the same error, following are the step i have done to resolve.
1) I upload all my Images in the Media image folder
2) I have publish this folder.
3) Clicked on the Browse Button-> My Images
4) On Right hand side you will find the Tree view Icon above the Search Box
5) Click on it will see the Media Library with Tree consisting of all the Images.
6) Select the Image from that.
7) After this image get displayed in Image box,
8) Now click on Open Media Library Box and it will not give the error.
On your 'simple template' check the standard value for your Image field on your data template. It may be that it is pointing to a path which does not exist in your media library.
Figured it out, but it took an install on a completely separate machine and a comparison of the entire folder/file structure. There are two Sitecore XMLs that get written to the bin folder: Sitecore.Client.XML and Sitecore.Kernel.xml - both contain Sitecore assembly definitions, but the ones on my machine were not being generated properly. Once I copied the files over to my local install everything started working as expected.
So, the short answer is: a corrupted installation.
I frankly have no idea why the files would differ from my machine to another - once this project is finished, I'll have to do some research and report back. I have several Sitecore versions installed, and it could be a conflict between versions or dependencies? If I find anything, I'll make notes here.