Drop-in code to remove border of Qt C++ GUI application
I need someone to write code that I can easily implement into my existing Qt C++ project. Keyword... EXISTING. Whether that be code I can simply copy and paste, or a library with instructions. This is because the application is mostly complete and took tons of work, so rewriting it all to work with your code is not an option.
Don't be afraid of the long post. It's not a bunch of tasks for you to do, but instead guidelines to follow. Should make things easier to understand :)
After implementing your code, the following should happen:
- The window frame/border generated by the Window Manager (Windows OS) should be removed. Essentially turning an Aero-themed window into a flat, borderless window (similar to Metro Apps from Windows 8).
- After the border is removed, a drop shadow should still be cast onto anything behind the program.
With your code: http://i.gyazo.com/05650cd98aebd485332347ed58fccf61.png
Border was removed, light drop shadow added.
Your code must follow these guidelines:
- It must NOT use "setWindowFlags(Qt::FramelessWindowHint)" to remove the border. Simply disabling the border won't work with what I need, and it can create problems with Windows 8. I've already created working code with FramelessWindowHint...
- It must be simple and barebones. Code I can copy and paste throughout my project is preferred over new libraries I have to add.
- The code must be able to be added to (virtually) any basic Qt C++ gui program. It should be able to take any existing gui program and remove the border/add a shadow.
- The area where the border used to be should not interact with any mouse events. (The user should be able to click through the shadow to another window behind it.)
- Must be compatible with Qt Creator v5.0.1
- You will NOT be getting a copy of the source code. It's really not needed.
I have already written code to accomplish this task (See pics above). It used setWindowFlags(Qt::FramelessWindowHint) and worked well. However using setWindowFlags(Qt::FramelessWindowHint) has also produced a bunch of unwanted effects that I cannot fix ( http://stackoverflow.com/questions/31418494/qtframelesswindowhint-window-cant-be-recorded-with-obs ). So I need a different solution. After much research, the solution appears to require the use of WinApi, which I have very little experience with. That's where you come in.
For someone well-versed with Qt and WinApi, this should be a quick and painless job. Thanks for your time. :)