diff --git a/profiler_gui/bookmarks_editor.cpp b/profiler_gui/bookmarks_editor.cpp index 3ad7c2f..e95ded6 100644 --- a/profiler_gui/bookmarks_editor.cpp +++ b/profiler_gui/bookmarks_editor.cpp @@ -69,7 +69,6 @@ BookmarkEditor::BookmarkEditor(size_t bookmarkIndex, bool isNew, QWidget* parent , m_isNewBookmark(isNew) { setAttribute(Qt::WA_DeleteOnClose, true); - //setWindowFlags(Qt::Dialog); setSizeGripEnabled(EASY_GLOBALS.use_custom_window_header); const auto& bookmark = EASY_GLOBALS.bookmarks[m_bookmarkIndex]; @@ -135,6 +134,8 @@ BookmarkEditor::BookmarkEditor(size_t bookmarkIndex, bool isNew, QWidget* parent const WindowHeader::Buttons buttons {WindowHeader::MaximizeButton | WindowHeader::CloseButton}; auto header = new WindowHeader(isNew ? "New bookmark" : "Edit bookmark", buttons, *this); mainLayout->addWidget(header, 0, Qt::AlignTop); +#else + setWindowTitle(isNew ? "New bookmark" : "Edit bookmark"); #endif mainLayout->addWidget(content, 1); diff --git a/profiler_gui/window_header.cpp b/profiler_gui/window_header.cpp index 3265222..4f74011 100644 --- a/profiler_gui/window_header.cpp +++ b/profiler_gui/window_header.cpp @@ -74,6 +74,8 @@ WindowHeader::WindowHeader(const QString& title, Buttons buttons, QWidget& paren { auto parent = &parentRef; + parent->setWindowTitle(title); + m_title->installEventFilter(this); m_pixmap->installEventFilter(this); @@ -181,6 +183,12 @@ WindowHeader::~WindowHeader() void WindowHeader::setTitle(const QString& title) { m_title->setText(title); + parentWidget()->setWindowTitle(title); +} + +QString WindowHeader::title() const +{ + return m_title->text(); } void WindowHeader::setWindowIcon(const QIcon& icon) diff --git a/profiler_gui/window_header.h b/profiler_gui/window_header.h index 3ea27ad..4f27dac 100644 --- a/profiler_gui/window_header.h +++ b/profiler_gui/window_header.h @@ -97,6 +97,13 @@ public: setTitle(title); } + QString title() const; + + QString windowTitle() const + { + return title(); + } + private slots: void onWindowStateChanged();