swift
Loading...
Searching...
No Matches
swift::gui::CEnableForFramelessWindow Class Reference

Main window which can be frameless. More...

#include <enableforframelesswindow.h>

Inheritance diagram for swift::gui::CEnableForFramelessWindow:
[legend]

Public Types

enum  WindowMode { WindowNormal , WindowFrameless , WindowTool }
 Window modes. More...

Public Member Functions

 CEnableForFramelessWindow (WindowMode mode, bool isMainApplicationWindow, const char *framelessPropertyname, QWidget *correspondingWidget)
 Constructor.
virtual ~CEnableForFramelessWindow ()=default
 Destructor.
 CEnableForFramelessWindow (const CEnableForFramelessWindow &)=delete
 Copy constructor.
CEnableForFramelessWindow & operator= (const CEnableForFramelessWindow &)=delete
 Copy assignment operator.
void setMode (WindowMode mode)
 Window mode.
virtual void setFrameless (bool frameless)
 Framless.
bool isFrameless () const
 Frameless?
bool isMainApplicationWindow () const
 Is main application, explicitly set.
void alwaysOnTop (bool onTop)
 Always on top?
void activate ()
 Activates the window.
QWidget * getWidget () const
 Corresponding QMainWindow.

Static Public Member Functions

static WindowMode stringToWindowMode (const QString &s)
 String to window mode.
static const QString & windowModeToString (WindowMode m)
 String to window mode.

Protected Member Functions

virtual void windowFlagsChanged ()
 Can be used as notification if window mode changes.
void addFramelessSizeGripToStatusBar (QStatusBar *statusBar)
 Resize grip handle.
void hideFramelessSizeGripInStatusBar ()
 Resize grip handle.
void setWindowAttributes (WindowMode mode)
 Attributes.
void setDynamicProperties (bool frameless)
 Set dynamic properties such as frameless.
QHBoxLayout * addFramelessCloseButton (QMenuBar *menuBar)
 Close button for frameless windows.
void toolToNormalWindow ()
 Remove tool and add desktop window.
void normalToToolWindow ()
 Remove desktop and add tool window.
bool isToolWindow () const
 Tool window.
bool handleMousePressEvent (QMouseEvent *event)
 Mouse press, required for frameless window.
bool handleMouseMoveEvent (QMouseEvent *event)
 Mouse moving, required for frameless window.
bool handleChangeEvent (QEvent *event)
 Mouse window change event.
void showMinimizedModeChecked ()
 Check mode and then show minimized.
void showNormalModeChecked ()
 Check mode and then show normal.

Static Protected Member Functions

static Qt::WindowFlags modeToWindowFlags (WindowMode mode)
 Translate mode.

Protected Attributes

QPoint m_framelessDragPosition
 position, if moving is handled with frameless window
QSize m_moveSize
 size when moved (in frameless window)
QPushButton * m_framelessCloseButton = nullptr
 close button
WindowMode m_windowMode = WindowNormal
 Window mode,.
WindowMode m_originalWindowMode = WindowNormal
 mode when initialized
bool m_isMainApplicationWindow = false
 is this the main application window (only 1)?
QWidget * m_widget = nullptr
 corresponding window or dock widget
QSizeGrip * m_framelessSizeGrip = nullptr
 size grip object
QByteArray m_framelessPropertyName
 property name for frameless widgets
int m_windowFrameSizeW = -1
 window frame width
int m_windowFrameSizeH = -1
 window frame height

Detailed Description

Main window which can be frameless.

QMainWindows cannot be promoted. Hence a derived class does not work properly here. Furthermore frameless functionality is also required for CDockWidgets as well.

Definition at line 31 of file enableforframelesswindow.h.

Member Enumeration Documentation

◆ WindowMode

Constructor & Destructor Documentation

◆ CEnableForFramelessWindow()

swift::gui::CEnableForFramelessWindow::CEnableForFramelessWindow ( CEnableForFramelessWindow::WindowMode mode,
bool isMainApplicationWindow,
const char * framelessPropertyname,
QWidget * correspondingWidget )

Constructor.

Parameters
modewindow mode as defined in WindowMode
isMainApplicationWindowis this the main (there should be only one) application window
framelessPropertynameqss property indication frameless
correspondingWidgetthe widget representing the window

Definition at line 33 of file enableforframelesswindow.cpp.

Member Function Documentation

◆ activate()

void swift::gui::CEnableForFramelessWindow::activate ( )

Activates the window.

Definition at line 121 of file enableforframelesswindow.cpp.

◆ addFramelessCloseButton()

QHBoxLayout * swift::gui::CEnableForFramelessWindow::addFramelessCloseButton ( QMenuBar * menuBar)
protected

Close button for frameless windows.

Definition at line 343 of file enableforframelesswindow.cpp.

◆ addFramelessSizeGripToStatusBar()

void swift::gui::CEnableForFramelessWindow::addFramelessSizeGripToStatusBar ( QStatusBar * statusBar)
protected

Resize grip handle.

Definition at line 315 of file enableforframelesswindow.cpp.

◆ alwaysOnTop()

void swift::gui::CEnableForFramelessWindow::alwaysOnTop ( bool onTop)

Always on top?

Definition at line 106 of file enableforframelesswindow.cpp.

◆ getWidget()

QWidget * swift::gui::CEnableForFramelessWindow::getWidget ( ) const
inline

Corresponding QMainWindow.

Definition at line 78 of file enableforframelesswindow.h.

◆ handleChangeEvent()

bool swift::gui::CEnableForFramelessWindow::handleChangeEvent ( QEvent * event)
protected

Mouse window change event.

Definition at line 266 of file enableforframelesswindow.cpp.

◆ handleMouseMoveEvent()

bool swift::gui::CEnableForFramelessWindow::handleMouseMoveEvent ( QMouseEvent * event)
protected

Mouse moving, required for frameless window.

Definition at line 243 of file enableforframelesswindow.cpp.

◆ handleMousePressEvent()

bool swift::gui::CEnableForFramelessWindow::handleMousePressEvent ( QMouseEvent * event)
protected

Mouse press, required for frameless window.

Definition at line 231 of file enableforframelesswindow.cpp.

◆ hideFramelessSizeGripInStatusBar()

void swift::gui::CEnableForFramelessWindow::hideFramelessSizeGripInStatusBar ( )
protected

Resize grip handle.

Definition at line 334 of file enableforframelesswindow.cpp.

◆ isFrameless()

bool swift::gui::CEnableForFramelessWindow::isFrameless ( ) const
inline

Frameless?

Definition at line 66 of file enableforframelesswindow.h.

◆ isMainApplicationWindow()

bool swift::gui::CEnableForFramelessWindow::isMainApplicationWindow ( ) const
inline

Is main application, explicitly set.

Definition at line 69 of file enableforframelesswindow.h.

◆ isToolWindow()

bool swift::gui::CEnableForFramelessWindow::isToolWindow ( ) const
protected

Tool window.

Definition at line 379 of file enableforframelesswindow.cpp.

◆ modeToWindowFlags()

Qt::WindowFlags swift::gui::CEnableForFramelessWindow::modeToWindowFlags ( CEnableForFramelessWindow::WindowMode mode)
staticprotected

Translate mode.

Definition at line 381 of file enableforframelesswindow.cpp.

◆ normalToToolWindow()

void swift::gui::CEnableForFramelessWindow::normalToToolWindow ( )
protected

Remove desktop and add tool window.

Definition at line 372 of file enableforframelesswindow.cpp.

◆ setDynamicProperties()

void swift::gui::CEnableForFramelessWindow::setDynamicProperties ( bool frameless)
protected

Set dynamic properties such as frameless.

Definition at line 195 of file enableforframelesswindow.cpp.

◆ setFrameless()

void swift::gui::CEnableForFramelessWindow::setFrameless ( bool frameless)
virtual

Framless.

Reimplemented in swift::gui::CDockWidget.

Definition at line 62 of file enableforframelesswindow.cpp.

◆ setMode()

void swift::gui::CEnableForFramelessWindow::setMode ( CEnableForFramelessWindow::WindowMode mode)

Window mode.

Definition at line 47 of file enableforframelesswindow.cpp.

◆ setWindowAttributes()

void swift::gui::CEnableForFramelessWindow::setWindowAttributes ( CEnableForFramelessWindow::WindowMode mode)
protected

Attributes.

Fixme
further improve transparent widget, try out void QWidget::setMask

Definition at line 169 of file enableforframelesswindow.cpp.

◆ showMinimizedModeChecked()

void swift::gui::CEnableForFramelessWindow::showMinimizedModeChecked ( )
protected

Check mode and then show minimized.

Definition at line 213 of file enableforframelesswindow.cpp.

◆ showNormalModeChecked()

void swift::gui::CEnableForFramelessWindow::showNormalModeChecked ( )
protected

Check mode and then show normal.

Definition at line 222 of file enableforframelesswindow.cpp.

◆ stringToWindowMode()

CEnableForFramelessWindow::WindowMode swift::gui::CEnableForFramelessWindow::stringToWindowMode ( const QString & s)
static

String to window mode.

Definition at line 130 of file enableforframelesswindow.cpp.

◆ toolToNormalWindow()

void swift::gui::CEnableForFramelessWindow::toolToNormalWindow ( )
protected

Remove tool and add desktop window.

Definition at line 365 of file enableforframelesswindow.cpp.

◆ windowFlagsChanged()

void swift::gui::CEnableForFramelessWindow::windowFlagsChanged ( )
protectedvirtual

Can be used as notification if window mode changes.

Reimplemented in swift::gui::components::CNavigatorDialog.

Definition at line 164 of file enableforframelesswindow.cpp.

◆ windowModeToString()

const QString & swift::gui::CEnableForFramelessWindow::windowModeToString ( CEnableForFramelessWindow::WindowMode m)
static

String to window mode.

Definition at line 148 of file enableforframelesswindow.cpp.

Member Data Documentation

◆ m_framelessCloseButton

QPushButton* swift::gui::CEnableForFramelessWindow::m_framelessCloseButton = nullptr
protected

close button

Definition at line 89 of file enableforframelesswindow.h.

◆ m_framelessDragPosition

QPoint swift::gui::CEnableForFramelessWindow::m_framelessDragPosition
protected

position, if moving is handled with frameless window

Definition at line 87 of file enableforframelesswindow.h.

◆ m_framelessPropertyName

QByteArray swift::gui::CEnableForFramelessWindow::m_framelessPropertyName
protected

property name for frameless widgets

Definition at line 95 of file enableforframelesswindow.h.

◆ m_framelessSizeGrip

QSizeGrip* swift::gui::CEnableForFramelessWindow::m_framelessSizeGrip = nullptr
protected

size grip object

Definition at line 94 of file enableforframelesswindow.h.

◆ m_isMainApplicationWindow

bool swift::gui::CEnableForFramelessWindow::m_isMainApplicationWindow = false
protected

is this the main application window (only 1)?

Definition at line 92 of file enableforframelesswindow.h.

◆ m_moveSize

QSize swift::gui::CEnableForFramelessWindow::m_moveSize
protected

size when moved (in frameless window)

Definition at line 88 of file enableforframelesswindow.h.

◆ m_originalWindowMode

WindowMode swift::gui::CEnableForFramelessWindow::m_originalWindowMode = WindowNormal
protected

mode when initialized

Definition at line 91 of file enableforframelesswindow.h.

◆ m_widget

QWidget* swift::gui::CEnableForFramelessWindow::m_widget = nullptr
protected

corresponding window or dock widget

Definition at line 93 of file enableforframelesswindow.h.

◆ m_windowFrameSizeH

int swift::gui::CEnableForFramelessWindow::m_windowFrameSizeH = -1
protected

window frame height

Definition at line 97 of file enableforframelesswindow.h.

◆ m_windowFrameSizeW

int swift::gui::CEnableForFramelessWindow::m_windowFrameSizeW = -1
protected

window frame width

Definition at line 96 of file enableforframelesswindow.h.

◆ m_windowMode

WindowMode swift::gui::CEnableForFramelessWindow::m_windowMode = WindowNormal
protected

Window mode,.

See also
WindowMode

Definition at line 90 of file enableforframelesswindow.h.


The documentation for this class was generated from the following files: