mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Add extended RDMenu
This commit is contained in:
@@ -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));
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
@@ -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 \
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user