Add extended RDMenu

This commit is contained in:
baldurk
2020-05-16 11:12:51 +01:00
parent 22d5cf2313
commit 8a5fdda6b1
5 changed files with 100 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
/******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2020 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/
#include "RDMenu.h"
#include <QKeyEvent>
RDMenu::RDMenu(QWidget *parent) : QMenu(parent)
{
}
RDMenu::~RDMenu()
{
}
void RDMenu::keyPressEvent(QKeyEvent *event)
{
QMenu::keyPressEvent(event);
emit(keyPress(event));
}
+42
View File
@@ -0,0 +1,42 @@
/******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2019-2020 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/
#pragma once
#include <QMenu>
class RDMenu : public QMenu
{
private:
Q_OBJECT
public:
explicit RDMenu(QWidget *parent = 0);
~RDMenu();
signals:
void keyPress(QKeyEvent *event);
protected:
void keyPressEvent(QKeyEvent *event) override;
};
+2
View File
@@ -190,6 +190,7 @@ SOURCES += Code/qrenderdoc.cpp \
Widgets/Extended/RDLineEdit.cpp \
Widgets/Extended/RDTextEdit.cpp \
Widgets/Extended/RDLabel.cpp \
Widgets/Extended/RDMenu.cpp \
Widgets/Extended/RDHeaderView.cpp \
Widgets/Extended/RDToolButton.cpp \
Widgets/Extended/RDDoubleSpinBox.cpp \
@@ -269,6 +270,7 @@ HEADERS += Code/CaptureContext.h \
Widgets/Extended/RDLineEdit.h \
Widgets/Extended/RDTextEdit.h \
Widgets/Extended/RDLabel.h \
Widgets/Extended/RDMenu.h \
Widgets/Extended/RDHeaderView.h \
Widgets/Extended/RDToolButton.h \
Widgets/Extended/RDDoubleSpinBox.h \
+8
View File
@@ -628,6 +628,7 @@
<ClCompile Include="$(IntDir)generated\moc_RDDoubleSpinBox.cpp" />
<ClCompile Include="$(IntDir)generated\moc_RDSplitter.cpp" />
<ClCompile Include="$(IntDir)generated\moc_RDLabel.cpp" />
<ClCompile Include="$(IntDir)generated\moc_RDMenu.cpp" />
<ClCompile Include="$(IntDir)generated\moc_RDHeaderView.cpp" />
<ClCompile Include="$(IntDir)generated\moc_RDToolButton.cpp" />
<ClCompile Include="$(IntDir)generated\moc_RDLineEdit.cpp" />
@@ -704,6 +705,7 @@
<ClCompile Include="Widgets\Extended\RDDoubleSpinBox.cpp" />
<ClCompile Include="Widgets\Extended\RDSplitter.cpp" />
<ClCompile Include="Widgets\Extended\RDLabel.cpp" />
<ClCompile Include="Widgets\Extended\RDMenu.cpp" />
<ClCompile Include="Widgets\Extended\RDHeaderView.cpp" />
<ClCompile Include="Widgets\Extended\RDToolButton.cpp" />
<ClCompile Include="Widgets\Extended\RDListView.cpp" />
@@ -1031,6 +1033,12 @@
<Message>MOC %(Filename).h</Message>
<Outputs>$(IntDir)generated\moc_%(Filename).cpp</Outputs>
</CustomBuild>
<CustomBuild Include="Widgets\Extended\RDMenu.h">
<AdditionalInputs>%(Fullpath);$(ProjectDir)3rdparty\qt\$(Platform)\bin\moc.exe;%(AdditionalInputs)</AdditionalInputs>
<Command>"$(ProjectDir)3rdparty\qt\$(Platform)\bin\moc.exe" -DUNICODE -DWIN32 -DWIN64 -D_WIN32 -D_WIN64 -DRENDERDOC_PLATFORM_WIN32 -DSCINTILLA_QT=1 -DSCI_LEXER=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1900 -I"$(ProjectDir)." -I"$(SolutionDir)\renderdoc\api\replay" -I"$(ProjectDir)3rdparty\qt\$(Platform)\mkspecs/win32-msvc2015" -I"$(ProjectDir)3rdparty\qt\include" -I"$(ProjectDir)3rdparty\qt\include\QtWidgets" -I"$(ProjectDir)3rdparty\qt\include\QtGui" -I"$(ProjectDir)3rdparty\qt\include\QtCore" "%(Fullpath)" -o "$(IntDir)generated\moc_%(Filename).cpp"</Command>
<Message>MOC %(Filename).h</Message>
<Outputs>$(IntDir)generated\moc_%(Filename).cpp</Outputs>
</CustomBuild>
<CustomBuild Include="Widgets\Extended\RDHeaderView.h">
<AdditionalInputs>%(Fullpath);$(ProjectDir)3rdparty\qt\$(Platform)\bin\moc.exe;%(AdditionalInputs)</AdditionalInputs>
<Command>"$(ProjectDir)3rdparty\qt\$(Platform)\bin\moc.exe" -DUNICODE -DWIN32 -DWIN64 -D_WIN32 -D_WIN64 -DRENDERDOC_PLATFORM_WIN32 -DSCINTILLA_QT=1 -DSCI_LEXER=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1900 -I"$(ProjectDir)." -I"$(SolutionDir)\renderdoc\api\replay" -I"$(ProjectDir)3rdparty\qt\$(Platform)\mkspecs/win32-msvc2015" -I"$(ProjectDir)3rdparty\qt\include" -I"$(ProjectDir)3rdparty\qt\include\QtWidgets" -I"$(ProjectDir)3rdparty\qt\include\QtGui" -I"$(ProjectDir)3rdparty\qt\include\QtCore" "%(Fullpath)" -o "$(IntDir)generated\moc_%(Filename).cpp"</Command>
@@ -735,6 +735,12 @@
<ClCompile Include="Windows\Dialogs\ConfigEditor.cpp">
<Filter>Windows\Dialogs</Filter>
</ClCompile>
<ClCompile Include="Widgets\Extended\RDMenu.cpp">
<Filter>Widgets\Extended</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)generated\moc_RDMenu.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="3rdparty\flowlayout\FlowLayout.h">
@@ -1496,6 +1502,9 @@
<CustomBuild Include="Windows\Dialogs\ConfigEditor.ui">
<Filter>Windows\Dialogs</Filter>
</CustomBuild>
<CustomBuild Include="Widgets\Extended\RDMenu.h">
<Filter>Widgets\Extended</Filter>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<Image Include="Resources\action.png">