mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-21 04:07:46 +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:
|
||||
VirtualDialog(DesktopInterface& interface, QWidget* parent = nullptr);
|
||||
|
||||
void setWindowTitle(QString title);
|
||||
void setWindowTitle(const QString& title);
|
||||
void show();
|
||||
void hide();
|
||||
void close();
|
||||
|
|
|
@ -11,7 +11,7 @@ class VirtualWindow : public QObject {
|
|||
public:
|
||||
VirtualWindow(DesktopInterface& interface, QWidget* parent = nullptr);
|
||||
|
||||
void setWindowTitle(QString title);
|
||||
void setWindowTitle(const QString& title);
|
||||
void setCentralWidget(QWidget* widget);
|
||||
void show();
|
||||
void showMaximized();
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
#include "desktopinterface.h"
|
||||
|
||||
VirtualDialog::VirtualDialog(DesktopInterface& interface, QWidget* widget) : interface(interface) {
|
||||
if(interface.oneWindow) {
|
||||
VirtualDialog::VirtualDialog(DesktopInterface& interface, QWidget* widget) : interface(interface), QObject(widget) {
|
||||
if (interface.oneWindow) {
|
||||
mdi_window = new QMdiSubWindow();
|
||||
mdi_window->setAttribute(Qt::WA_DeleteOnClose);
|
||||
} else {
|
||||
|
@ -15,8 +15,8 @@ VirtualDialog::VirtualDialog(DesktopInterface& interface, QWidget* widget) : int
|
|||
interface.addDialog(this);
|
||||
}
|
||||
|
||||
void VirtualDialog::setWindowTitle(QString title) {
|
||||
if(interface.oneWindow) {
|
||||
void VirtualDialog::setWindowTitle(const QString& title) {
|
||||
if (interface.oneWindow) {
|
||||
mdi_window->setWindowTitle(title);
|
||||
} else {
|
||||
normal_dialog->setWindowTitle(title);
|
||||
|
@ -57,7 +57,7 @@ void VirtualDialog::setWindowModality(Qt::WindowModality modality) {
|
|||
|
||||
void VirtualDialog::setLayout(QLayout* layout) {
|
||||
if(interface.oneWindow) {
|
||||
QWidget* emptyWidget = new QWidget();
|
||||
auto emptyWidget = new QWidget();
|
||||
emptyWidget->setLayout(layout);
|
||||
|
||||
mdi_window->layout()->addWidget(emptyWidget);
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
#include "desktopinterface.h"
|
||||
|
||||
VirtualWindow::VirtualWindow(DesktopInterface& interface, QWidget* widget) : interface(interface) {
|
||||
if(interface.oneWindow) {
|
||||
VirtualWindow::VirtualWindow(DesktopInterface& interface, QWidget* widget) : interface(interface), QObject(widget) {
|
||||
if (interface.oneWindow) {
|
||||
mdi_window = new QMdiSubWindow();
|
||||
mdi_window->setAttribute(Qt::WA_DeleteOnClose);
|
||||
} else {
|
||||
|
@ -16,8 +16,8 @@ VirtualWindow::VirtualWindow(DesktopInterface& interface, QWidget* widget) : int
|
|||
interface.addWindow(this);
|
||||
}
|
||||
|
||||
void VirtualWindow::setWindowTitle(QString title) {
|
||||
if(interface.oneWindow) {
|
||||
void VirtualWindow::setWindowTitle(const QString& title) {
|
||||
if (interface.oneWindow) {
|
||||
mdi_window->setWindowTitle(title);
|
||||
} else {
|
||||
normal_window->setWindowTitle(title);
|
||||
|
@ -51,14 +51,9 @@ void VirtualWindow::hide() {
|
|||
QMenuBar* VirtualWindow::menuBar() {
|
||||
if(interface.oneWindow) {
|
||||
if(mdi_window->layout()->menuBar() == nullptr) {
|
||||
auto bar = new QMenuBar();
|
||||
bar->setObjectName("test");
|
||||
qDebug() << "new obj name: " << bar->objectName();
|
||||
mdi_window->layout()->setMenuBar(bar);
|
||||
mdi_window->layout()->setMenuBar(new QMenuBar());
|
||||
}
|
||||
|
||||
qDebug() << mdi_window->layout()->menuBar()->objectName();
|
||||
|
||||
return dynamic_cast<QMenuBar*>(mdi_window->layout()->menuBar());
|
||||
} else {
|
||||
return normal_window->menuBar();
|
||||
|
|
Loading…
Add table
Reference in a new issue