• Stars
    star
    1,130
  • Rank 41,066 (Top 0.9 %)
  • Language
    C++
  • Created over 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

simple MainWindow class implementation with frameless window and custom dark style. It adds also support for titlebar and buttons (minimize, maximize, close)

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.

Alternative Window class

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
  QApplication::setStyle(new DarkStyle);
  //QApplication::setPalette(QApplication::style()->standardPalette());

  // 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, [email protected])

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.

More Repositories

1

ESP8266-MFRC522

MFRC522 RFID module connected to ESP8266 (ESP-12) WiFi module
Arduino
163
star
2

node-rpi-ws2801

A node.js library to control a WS2801 RGB LED stripe via SPI with your Raspberry Pi
JavaScript
27
star
3

FastLED-GFX

FastLED port of https://github.com/adafruit/Adafruit-GFX-Library
C
25
star
4

ESP8266-WiFi-Relay

simple sketch of using ESP8266WebServer to switch relays on GPIO pins. It serves a simple website with toggle buttons for each relay
HTML
21
star
5

ESP8266-WiFi-Relay-Async

simple sketch for ESP8266 of using ESPAsyncWebServer to switch relays on GPIO pins, serves a simple website with toggle buttons for each relay and uses AsyncWiFiManager to configure WiFi network.
C++
16
star
6

visa32

simple VISA SCPI interface for node.js (tested only on Windows + no commercial use!)
JavaScript
8
star
7

Espruino-Pico-Examples

some examples with Espruino Pico (Javascript on microcontroller)
JavaScript
6
star
8

FastLEDMatrix

obsolete >> use LEDMatrix fork instead
C++
4
star
9

3M-Controller

3M-Controller = Multi Modular MIDI Controller
C++
3
star
10

RobustRotaryEncoder

Simple library for robust reading of rotary encoders
C++
3
star
11

WordClock-15x15

C
1
star
12

mqtt-ws-bridge

simple bridge between socket.io (in browser) and mqtt client (in node.js)
HTML
1
star
13

FastLED-examples

Some short examples to try out FastLED library, running on Teensy 3.1.
Arduino
1
star
14

ESP8266-WiFi-Relay-Bahtinov-Masks

simple sketch for ESP8266 of using ESP8266WebServer to switch relays on GPIO pins, control servos to open and close masks, serves a simple website with toggle buttons for each relay and mask servo.
HTML
1
star