Giter Site home page Giter Site logo

bringer-of-light / qt-nice-frameless-window Goto Github PK

View Code? Open in Web Editor NEW
778.0 31.0 195.0 2.47 MB

Qt Frameless Window for both Windows and OS X, support Aero Snap, drop shadow on Windows, and support Native Style such as round corner, drop shadow on OS X. Based on QMainWindow.

License: Other

QMake 15.91% C++ 63.34% Objective-C++ 20.75%
qt borderless draggable resizable cross-platform aero native drop-shadow support-aero-snap frameless

qt-nice-frameless-window's People

Contributors

bringer-of-light avatar darkshinz avatar espotek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qt-nice-frameless-window's Issues

win7 home basic版本下无法使用

谢谢你做的这么好的一个lib,在win10上体验非常非常棒。
目前的实现依赖dwmapi.dll
而在win7 home basic版本里是没有这个dll的,所以在win7 home basic版本下用的时候,鼠标移动到关闭按钮上时会出现操作系统自带的关闭按钮。

setResizeable(true)的情况下原生按钮出现

在setResizeable(true)以后最小化、最大化和关闭按钮会重新出现。一般是在鼠标移动到窗口边框时重绘出的,请问怎样可以解决这个问题呢?
setResizeable(false)时不存在此情况。

win7 + qt5.8.0显示问题

你好, 在win7+qt5.8.0环境下,测试发现显示功能异常,是个空白面板,没有显示出任何按钮. 请问是什么原因导致的

menuBar 使用疑问

你好,请问一下,我使用了 menuBar,然后把这个 menuBar 设置为窗口的“titleBar”,拖动 menuBar 可以控制窗口移动,但是怎么让 menuBar 里面的菜单可以响应?我试了事件过滤器也毫无反应。

// exampleforwindows/mainwindow.cpp 文件的开头部分

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QRect>

MainWindow::MainWindow(QWidget *parent) :
    CFramelessWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
#ifdef Q_OS_WIN
    //feel free to change this number to see how it works
    setResizeableAreaWidth(8);

    //set titlebar widget, wo we can drag MainWindow by it
// 删除titleBar,并在ui中把horizontalLayout拿出来放到一个dockWidget,
// 是为了下面可以把这一堆按钮放到menuBar中。
//    setTitleBar(ui->widgetTitlebar);
    setTitleBar(menuWidget()); // 让menuBar作为“标题栏”
    menuWidget()->setLayout(ui->horizontalLayout); // 把一堆按钮放上去
// ......其他代码......

MacOS如何将窗口设置成模态窗口?

我将是将CFramelessWindow 继承自QWidget
然后设置
this->setAttribute(Qt::WA_ShowModal, true);
this->setWindowModality(Qt::ApplicationModal);
这部分代码 窗口的标题栏又出来了。

doesn't support Qt HighDpi on Windows OS

when (Qt::AA_EnableHighDpiScaling) is enabled, after set the WindowsOS system custom scale to 125% / 150% / 200%, the dragable area of the framelesswindow titlebar breaks.

win7+qt5.8.0 + vs2013 按钮失灵

你好, 在该配置环境下, 最小化和最大化,退出按钮没有作用,点击的时候会闪现出默认的最小,最大化图标.

Vertical bar on secondary screen when window is maximized

When maximizing the window, my secondary screen displays a grey vertical bar of about ten pixels on the side towards the other screen.
This happens only with showMaximized(), not showFullscreen().

If someone knows about this issue or even has a solution, I would appreciate a hint. I'm using Windows 10, Version 21H1. One monitor is 1920x1080px, the other 1680x1050px so there is some scaling involved.

Can't move window to second screen

Hold down the left mouse button press and hold the left mouse button to move the window to the second screen the release of the mouse, and then click on the title bar to move the window, can not move

Setting fixed size on MainWindow makes the window undraggable. macOS. Qt 5.14.2

Using the CFramelessWindow in my project, if I try to set a fixed window size or set the maximum window size at all, I can no longer move the window.

Can be recreated by opening a new project, importing the framelesswindow.h, framelesswindow.cpp, and framelesswindow.mm, then setting CFramelessWindow, then try either setting maximum window size in designer, or use something like setFixedSize(w,h).

problem in window with Round corners

Hi, thanks for your great job, I only have one problem
im trying to create a program with round corners
image
but the problem is look like your code add some kind of hover in window (as you can see White things in all four corner of window)
there is anyway to fix it??
thanks

Err msg: QMainWindow::getContentsMargins(left,top,right,bottom);

G:\st_git\dragWindow\dragWinDemo\Qt-Nice-Frameless-Window\framelesswindow\framelesswindow.cpp:270: error: C2039: "getContentsMargins": 不是 "QMainWindow" 的成员
F:\QT_6.2\6.2.3\msvc2019_64\include\QtWidgets\qmainwindow.h(60): note: 参见“QMainWindow”的声明

显示界面不正确

为什么在windows10上面跑显示的是mac的界面?有什么地方需要设置吗

win10自动隐藏任务栏后,我们的窗口最大化后,无法调出任务栏

win10开启自动隐藏任务栏后,
1、鼠标移入到屏幕最下排,会自动浮现出任务栏。
2、但Cframelesswindow最大化后,鼠标移入屏幕最下排,不会自动浮现出任务栏。

原因是在第一种情况下,软件最大化了,但最下排还是预留了2个像素。比如说屏幕分辨率是1366768。在这种情况下软件占据的屏幕像素为:1366766
但在第二种情况下,Cframelesswindow最大化后占据屏幕像素还是:1366*768

父窗口不能接收到WM_GETMINMAXINFO、WM_NCCALCSIZE、WM_NCHITTEST

父窗口:parentDialog
子窗口:childDialog

第一种情况:
父窗口parentDialog使用以下方法创建子窗口
childDialog = new ChildDialog();//父窗口创建子窗口:没有指定了parent
父窗口parentDialog的事件处理方法nativeEvent,能接收到WM_GETMINMAXINFO、WM_NCCALCSIZE、WM_NCHITTEST消息

第二种情况:
父窗口parentDialog使用以下方法创建子窗口
childDialog = new ChildDialog(this);//父窗口创建子窗口:指定了parent
父窗口parentDialog的事件处理方法nativeEvent,不能接收到WM_GETMINMAXINFO、WM_NCCALCSIZE、WM_NCHITTEST消息

缺少#include <GdiPlusColor.h>,应该如何配置?

导入了framelesswindow.cpp文件之后发现缺少了<GdiPlusColor.h>,我下载了一个GDIPLUS文件,里面有一个include文件夹(包含了<GdiPlusColor.h>和很多其他的头文件)和一个lib文件夹(里面有一个GdiPlus.lib文件)请问有人清楚应该如何配置吗,是在visual studio中配置吗,还是通过Qt?我装的是visual studio 2017, Qt版本也是5.9.2。

我已经把我fork的仓库删除了

您现在这个版本的代码仓库已经比我自己那个修改版的完善很多了,与其继续修补我那个定制版,还不如直接用您的来得划算,所以我就把我那个fork来的仓库删了,决定直接用您这个仓库。LICENSE我会保留的,您放心。

QGraphicsView and QGLWidget

Hi, I try to use your Nice Frameless Window, but with a QGraphicsView.

Indeed, the content of my MainWindow, is juste a QGraphicsView.

To be able to optimize the performance of my GraphicsView, I use an openGL Viewport with :

ui->graphicsView->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));

When I add this line, then we can't move the MainWindows, and the "Hover" on button didn't work too.

Thanks

Support system menu when clicking on top left corner of frameless window on Windows

So glad to see this project solving the problem of customising window title bar using native ways for both macOS and Windows! And, from a Chinese friend :) 这个项目太棒了!

I had a quick test on Windows and found all worked well except one feature seemed missing. When we click the top left corner of a standard application window, it normally shows a system menu like this:
screen shot 2018-09-24 at 12 11 52 pm
And this:
screen shot 2018-09-24 at 12 11 01 pm
As shown above, Adobe Illustrator for Windows uses a custom window title bar and has the system menu.

Just wondering if it's possible to add the same support in this project?

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.