Stellarium  24.4
Signals | Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes | Properties
TitleBar Class Reference

A title bar control used in windows derived from StelDialog. More...

#include <Dialog.hpp>

Signals

void closeClicked ()
 
void movedTo (QPoint newPosition)
 

Public Member Functions

 TitleBar (QWidget *parent=nullptr)
 
void setTitle (const QString &title)
 
QString title () const
 

Data Fields

QPoint mousePos
 

Protected Member Functions

void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 

Protected Attributes

bool moving = false
 
QLabel * label
 

Properties

QString title
 

Detailed Description

A title bar control used in windows derived from StelDialog.

As window classes derived from StelDialog are basic QWidgets, they have no title bar. A TitleBar control needs to be used in each window's design to allow the user to move them.

Typically, the frame should contain a centered label displaying the window's title and a button for closing the window (connected to the StelDialog::close() slot).