Code Monkey home page Code Monkey logo

borderlesswindow's Introduction

BorderlessWindow for Qt

Native borderless window for Windows OS. Allows to create gui like in Office 2013 or Visual Studio 2012.

ScreenShot

Difference from Qt:FramelessWindowHint

  • Resizable
  • Draggable
  • Minimize animation
  • Aero snap support
  • Aero shake support
  • ALT+Space system menu works
  • System shadow support


General Info

Creates a simple borderless WinAPI window, like this one. Then adds QWinWidget from QtWinMigrate and fills window with it.

Then you can use that QWinWidget to create your Qt gui.

Resizable edges of the window is drawn by WinAPI, everything else is handled by QWinWidget.

Application has two event loops: one from WinApi, one from QApplication. You should use appropriate event loop, depending on what event you trying to catch.

For simplicity, my example uses only one QWinWidget. Keep in mind, that you can add multiple QWinWidgets, if necessary.

Code obviously works only on Windows OS. Should work fine with both Qt4 and Qt5. Tested with Visual Studio 2012 Compiler (Qt 4.8.5 and Qt 5.3.)

If you use Visual Studio, you'll need to import BorderlessWindow.pro file (VS Main menu -> Qt -> open Qt Project file).

Usage

  • main.cpp -> Example
  • MainWindow.cpp -> WinAPI Window
  • QMainPanel.cpp -> QWinWidget, add your widgets here

Controls:

  • F5 - Toggle resizable
  • F6 - Toggle borderless/normal window
  • F7 - Toggle shadow
BorderlessWindow( QApplication *app, HBRUSH windowBackground, const int x, const int y, const int width, const int height );

Toggle functions

void toggleBorderless();
void toggleShadow();
void toggleResizeable();
bool isResizeable();

Size constrains

void setMinimumSize( const int width, const int height );
bool isSetMinimumSize();
void removeMinimumSize();
int getMinimumHeight();
int getMinimumWidth();

void setMaximumSize( const int width, const int height );
bool isSetMaximumSize();
int getMaximumHeight();
int getMaximumWidth();
void removeMaximumSize();

borderlesswindow's People

Contributors

deimos1877 avatar maxleiter avatar

Watchers

James Cloos avatar KubiZhan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.