forked from mfreiholz/Qt-Advanced-Docking-System
-
Notifications
You must be signed in to change notification settings - Fork 571
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to customize the DockArea Title Bar and DockWidget Tab co…
…ntext menu
- Loading branch information
1 parent
509b235
commit f237863
Showing
6 changed files
with
110 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// Created by fuga on 08 nov 2024. | ||
// | ||
|
||
#ifndef QTADS_MYDOCKAREATITLEBAR_H | ||
#define QTADS_MYDOCKAREATITLEBAR_H | ||
|
||
#include <DockAreaTitleBar.h> | ||
|
||
class MyDockAreaTitleBar : public ads::CDockAreaTitleBar { | ||
public: | ||
explicit MyDockAreaTitleBar(ads::CDockAreaWidget* parent) | ||
: CDockAreaTitleBar(parent) | ||
{} | ||
|
||
QMenu* buildContextMenu(QMenu*) override | ||
{ | ||
auto menu = ads::CDockAreaTitleBar::buildContextMenu(nullptr); | ||
menu->addSeparator(); | ||
auto action = menu->addAction(tr("Format HardDrive")); | ||
|
||
connect(action, &QAction::triggered, this, [this](){ | ||
QMessageBox msgBox; | ||
msgBox.setText("No, just kidding"); | ||
msgBox.setStandardButtons(QMessageBox::Abort); | ||
msgBox.setDefaultButton(QMessageBox::Abort); | ||
msgBox.exec(); | ||
}); | ||
|
||
return menu; | ||
} | ||
}; | ||
|
||
#endif // QTADS_MYDOCKAREATITLEBAR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters