Menu

Tree [r27] /
 History

HTTPS access


File Date Author Commit
 clavier_matrix 2019-01-03 ha1998 [r22]
 darkstyle 2019-01-02 zanagaou [r3]
 framelesswindow 2019-01-02 zanagaou [r3]
 images 2019-01-02 zanagaou [r3]
 .gitignore 2019-01-02 zanagaou [r3]
 DarkStyle.cpp 2019-01-02 zanagaou [r3]
 DarkStyle.h 2019-01-02 zanagaou [r3]
 README.md 2019-01-02 zanagaou [r3]
 arduino.cpp 2019-01-02 ha1998 [r12]
 arduino.h 2019-01-02 ha1998 [r12]
 boisson3.cpp 2019-01-03 zanagaou [r26]
 boisson3.h 2019-01-02 ha1998 [r12]
 chanson.cpp 2019-01-02 zanagaou [r3]
 chanson.h 2019-01-02 zanagaou [r3]
 co.cpp 2019-01-02 zanagaou [r3]
 co.h 2019-01-02 zanagaou [r3]
 connexion.cpp 2019-01-03 zanagaou [r26]
 connexion.h 2019-01-02 zanagaou [r3]
 darkstyle.qrc 2019-01-02 zanagaou [r3]
 driver.cpp 2019-01-03 walid1919 [r23]
 driver.h 2019-01-03 walid1919 [r23]
 employe.cpp 2019-01-03 ha1998 [r18]
 employe.h 2019-01-03 ha1998 [r18]
 frameless_window_dark.pro 2019-01-03 zanagaou [r26]
 frameless_window_dark.pro.user 2019-01-15 zanagaou [r27]
 frameless_window_dark.pro.user.1e99d73 2019-01-02 zanagaou [r3]
 frameless_window_dark.pro.user.bbf9b68 2019-01-02 zanagaou [r3]
 framelesswindow.qrc 2019-01-02 zanagaou [r3]
 livre.cpp 2019-01-02 zanagaou [r3]
 livre.h 2019-01-02 zanagaou [r3]
 main.cpp 2019-01-03 walid1919 [r23]
 mainwindow.cpp 2019-01-15 zanagaou [r27]
 mainwindow.cpp.autosave 2019-01-03 ha1998 [r22]
 mainwindow.h 2019-01-15 zanagaou [r27]
 mainwindow.ui 2019-01-15 zanagaou [r27]
 mainwindow.ui.autosave 2019-01-03 ha1998 [r22]
 notification.cpp 2019-01-02 zanagaou [r3]
 notification.h 2019-01-02 zanagaou [r3]
 notification_d.cpp 2019-01-03 ha1998 [r20]
 notification_d.h 2019-01-03 ha1998 [r20]
 notificationh.cpp 2019-01-03 zanagaou [r26]
 notificationh.h 2019-01-03 zanagaou [r26]
 playlist.cpp 2019-01-02 zanagaou [r3]
 playlist.h 2019-01-02 zanagaou [r3]
 qcustomplot.cpp 2019-01-02 zanagaou [r3]
 qcustomplot.h 2019-01-02 zanagaou [r3]
 reclamation.cpp 2019-01-02 zanagaou [r3]
 reclamation.h 2019-01-02 zanagaou [r3]
 screenshot_mac_frameless_window_qt_dark_style_disabled.png 2019-01-02 zanagaou [r3]
 screenshot_mac_frameless_window_qt_dark_style_enabled.png 2019-01-02 zanagaou [r3]
 screenshot_win7_frameless_window_qt_dark_style_enabled.png 2019-01-02 zanagaou [r3]
 smtp.cpp 2019-01-02 zanagaou [r3]
 smtp.h 2019-01-02 zanagaou [r3]
 vehicule.cpp 2019-01-03 walid1919 [r25]
 vehicule.h 2019-01-03 walid1919 [r25]
 video.cpp 2019-01-02 amjed [r6]
 video.h 2019-01-02 amjed [r6]

Read Me

Qt Frameless Window with DarkStyle

simple MainWindow class implementation with frameless window and custom dark style.

It adds also support for titlebar and buttons (minimize, maximize, close)

Look is based on the VS2013 application window (flat and frameless window)

Screenshots
mac enabledmac disabled

Qt and OS

  • tested with Qt5.5.0, Qt5.9.0 and Qt5.10.0
  • tested on Windows 7, Windows 10,MacOSX 10.12.5 and MacOS 10.13.2

PyQt5

Here is an unofficial Python port of my implementation.

How to use

  • add additional include plath to framelesswindow
  • add resources framelesswindow.qrc and darkstyle.qrc
  • add #include "framelesswindow.h" into main.cpp, create window FramelessWindow framelessWindow; and assign your mainwindow object as content framelessWindow.setContent(mainWindow); and show it framelessWindow.show();
  • add #include "DarkStyle.h" into main.cpp and call a.setStyle(new DarkStyle);
#include <QApplication>
#include "DarkStyle.h"
#include "framelesswindow.h"
#include "mainwindow.h"

int main(int argc, char *argv[])
{
  QApplication a(argc, argv);

  // style our application with custom dark style
  a.setStyle(new DarkStyle);

  // create frameless window (and set windowState or title)
  FramelessWindow framelessWindow;
  //framelessWindow.setWindowState(Qt::WindowMaximized);
  //framelessWindow.setWindowTitle("test title");
  //framelessWindow.setWindowIcon(a.style()->standardIcon(QStyle::SP_DesktopIcon));

  // create our mainwindow instance
  MainWindow *mainWindow = new MainWindow;

  // add the mainwindow to our custom frameless window
  framelessWindow.setContent(mainWindow);
  framelessWindow.show();

  return a.exec();
}

features

  • frameless window
  • custom dark style (based on Fusion style with dark palette and custom stylesheets)
  • title bar
  • buttons (minimize | restore | maximize | close)
  • move window by drag the title bar
  • dobule click title bar to toggle between window styte (maximize and normal)
  • use of native events, like minimizing or system menu

todo

thanks

Many thanks goes to the Qt Forum and especially to Chris Kawa for pointing me to some usual issues and hints of great must have features.

Licence

The MIT License

Copyright (c) 2018, Juergen Skrotzky (https://github.com/Jorgen-VikingGod, JorgenVikingGod@gmail.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.