mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-21 12:17:45 +00:00
Remove some debug messages in virtual window classes
This commit is contained in:
parent
feb3961dd5
commit
e9e46dd60f
4 changed files with 12 additions and 17 deletions
|
@ -11,7 +11,7 @@ class VirtualDialog : public QObject {
|
||||||
public:
|
public:
|
||||||
VirtualDialog(DesktopInterface& interface, QWidget* parent = nullptr);
|
VirtualDialog(DesktopInterface& interface, QWidget* parent = nullptr);
|
||||||
|
|
||||||
void setWindowTitle(QString title);
|
void setWindowTitle(const QString& title);
|
||||||
void show();
|
void show();
|
||||||
void hide();
|
void hide();
|
||||||
void close();
|
void close();
|
||||||
|
|
|
@ -11,7 +11,7 @@ class VirtualWindow : public QObject {
|
||||||
public:
|
public:
|
||||||
VirtualWindow(DesktopInterface& interface, QWidget* parent = nullptr);
|
VirtualWindow(DesktopInterface& interface, QWidget* parent = nullptr);
|
||||||
|
|
||||||
void setWindowTitle(QString title);
|
void setWindowTitle(const QString& title);
|
||||||
void setCentralWidget(QWidget* widget);
|
void setCentralWidget(QWidget* widget);
|
||||||
void show();
|
void show();
|
||||||
void showMaximized();
|
void showMaximized();
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include "desktopinterface.h"
|
#include "desktopinterface.h"
|
||||||
|
|
||||||
VirtualDialog::VirtualDialog(DesktopInterface& interface, QWidget* widget) : interface(interface) {
|
VirtualDialog::VirtualDialog(DesktopInterface& interface, QWidget* widget) : interface(interface), QObject(widget) {
|
||||||
if (interface.oneWindow) {
|
if (interface.oneWindow) {
|
||||||
mdi_window = new QMdiSubWindow();
|
mdi_window = new QMdiSubWindow();
|
||||||
mdi_window->setAttribute(Qt::WA_DeleteOnClose);
|
mdi_window->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
@ -15,7 +15,7 @@ VirtualDialog::VirtualDialog(DesktopInterface& interface, QWidget* widget) : int
|
||||||
interface.addDialog(this);
|
interface.addDialog(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VirtualDialog::setWindowTitle(QString title) {
|
void VirtualDialog::setWindowTitle(const QString& title) {
|
||||||
if (interface.oneWindow) {
|
if (interface.oneWindow) {
|
||||||
mdi_window->setWindowTitle(title);
|
mdi_window->setWindowTitle(title);
|
||||||
} else {
|
} else {
|
||||||
|
@ -57,7 +57,7 @@ void VirtualDialog::setWindowModality(Qt::WindowModality modality) {
|
||||||
|
|
||||||
void VirtualDialog::setLayout(QLayout* layout) {
|
void VirtualDialog::setLayout(QLayout* layout) {
|
||||||
if(interface.oneWindow) {
|
if(interface.oneWindow) {
|
||||||
QWidget* emptyWidget = new QWidget();
|
auto emptyWidget = new QWidget();
|
||||||
emptyWidget->setLayout(layout);
|
emptyWidget->setLayout(layout);
|
||||||
|
|
||||||
mdi_window->layout()->addWidget(emptyWidget);
|
mdi_window->layout()->addWidget(emptyWidget);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include "desktopinterface.h"
|
#include "desktopinterface.h"
|
||||||
|
|
||||||
VirtualWindow::VirtualWindow(DesktopInterface& interface, QWidget* widget) : interface(interface) {
|
VirtualWindow::VirtualWindow(DesktopInterface& interface, QWidget* widget) : interface(interface), QObject(widget) {
|
||||||
if (interface.oneWindow) {
|
if (interface.oneWindow) {
|
||||||
mdi_window = new QMdiSubWindow();
|
mdi_window = new QMdiSubWindow();
|
||||||
mdi_window->setAttribute(Qt::WA_DeleteOnClose);
|
mdi_window->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
@ -16,7 +16,7 @@ VirtualWindow::VirtualWindow(DesktopInterface& interface, QWidget* widget) : int
|
||||||
interface.addWindow(this);
|
interface.addWindow(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VirtualWindow::setWindowTitle(QString title) {
|
void VirtualWindow::setWindowTitle(const QString& title) {
|
||||||
if (interface.oneWindow) {
|
if (interface.oneWindow) {
|
||||||
mdi_window->setWindowTitle(title);
|
mdi_window->setWindowTitle(title);
|
||||||
} else {
|
} else {
|
||||||
|
@ -51,14 +51,9 @@ void VirtualWindow::hide() {
|
||||||
QMenuBar* VirtualWindow::menuBar() {
|
QMenuBar* VirtualWindow::menuBar() {
|
||||||
if(interface.oneWindow) {
|
if(interface.oneWindow) {
|
||||||
if(mdi_window->layout()->menuBar() == nullptr) {
|
if(mdi_window->layout()->menuBar() == nullptr) {
|
||||||
auto bar = new QMenuBar();
|
mdi_window->layout()->setMenuBar(new QMenuBar());
|
||||||
bar->setObjectName("test");
|
|
||||||
qDebug() << "new obj name: " << bar->objectName();
|
|
||||||
mdi_window->layout()->setMenuBar(bar);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << mdi_window->layout()->menuBar()->objectName();
|
|
||||||
|
|
||||||
return dynamic_cast<QMenuBar*>(mdi_window->layout()->menuBar());
|
return dynamic_cast<QMenuBar*>(mdi_window->layout()->menuBar());
|
||||||
} else {
|
} else {
|
||||||
return normal_window->menuBar();
|
return normal_window->menuBar();
|
||||||
|
|
Loading…
Add table
Reference in a new issue