Skip to content

About

🔲 Custom Title Bar Template for C++ Qt

Topics

Resources

Stars

47 stars

Watchers

1 watching

Forks

Latest commit

 

History

61 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Custom Title Bar Template for C++ Qt

GitHub stars GitHub forks

Qt version MinGW version OS

About project

In standard C++/Qt applications, the window's title bar is managed by the operating system, which imposes limitations on customization.

This repository provides a template for creating a custom title bar in a C++ Qt application. The custom title bar replicates essential window functionality, including hiding, dragging, maximizing, and closing the window. It serves as an excellent starting point for developers looking to design a more personalized and visually appealing title bar for their Qt applications.

Example

Quick Start

#include "mainwindow.h"
#include "windowframe.h"

#include <QApplication>
#include <QProxyStyle>
#include <QStyleFactory>
#include <QFile>

const QString style = "Fusion";
const QString appstylePath = ":/recources/style/appstyles.qss";

int main(int argc, char *argv[]){
    QApplication a(argc, argv);
    a.setStyle(new QProxyStyle(QStyleFactory::create(style)));

    QFile styleFile(appstylePath);
    styleFile.open(QFile::ReadOnly);
    QString styleQSS = styleFile.readAll();

    a.setStyleSheet(styleQSS);

    WindowFrame w(nullptr, new MainWindow());
    w.show();

    return a.exec();
}

Demo

demo.mp4

About

🔲 Custom Title Bar Template for C++ Qt

Topics

Resources

Stars

47 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages