diff --git a/qrenderdoc/Widgets/Extended/RDListWidget.cpp b/qrenderdoc/Widgets/Extended/RDListWidget.cpp new file mode 100644 index 000000000..d021dae01 --- /dev/null +++ b/qrenderdoc/Widgets/Extended/RDListWidget.cpp @@ -0,0 +1,46 @@ +/****************************************************************************** + * The MIT License (MIT) + * + * Copyright (c) 2016 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 "RDListWidget.h" +#include + +RDListWidget::RDListWidget(QWidget *parent) : QListWidget(parent) +{ +} + +RDListWidget::~RDListWidget() +{ +} + +void RDListWidget::mousePressEvent(QMouseEvent *event) +{ + emit(mouseClicked(event)); + QListWidget::mousePressEvent(event); +} + +void RDListWidget::mouseDoubleClickEvent(QMouseEvent *event) +{ + emit(mouseDoubleClicked(event)); + QListWidget::mouseDoubleClickEvent(event); +} diff --git a/qrenderdoc/Widgets/Extended/RDListWidget.h b/qrenderdoc/Widgets/Extended/RDListWidget.h new file mode 100644 index 000000000..ab0ee5daa --- /dev/null +++ b/qrenderdoc/Widgets/Extended/RDListWidget.h @@ -0,0 +1,45 @@ +/****************************************************************************** + * The MIT License (MIT) + * + * Copyright (c) 2016 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 + +class RDListWidget : public QListWidget +{ +private: + Q_OBJECT +public: + explicit RDListWidget(QWidget *parent = 0); + ~RDListWidget(); + +signals: + void mouseClicked(QMouseEvent *event); + void mouseDoubleClicked(QMouseEvent *event); + +public slots: + +protected: + void mousePressEvent(QMouseEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; +}; diff --git a/qrenderdoc/qrenderdoc.pro b/qrenderdoc/qrenderdoc.pro index 474a4f161..a4b2dbf3c 100644 --- a/qrenderdoc/qrenderdoc.pro +++ b/qrenderdoc/qrenderdoc.pro @@ -101,7 +101,8 @@ SOURCES += 3rdparty/toolwindowmanager/ToolWindowManager.cpp \ Widgets/RangeHistogram.cpp \ Windows/Dialogs/TextureSaveDialog.cpp \ Windows/Dialogs/CaptureDialog.cpp \ - Code/QRDUtils.cpp + Code/QRDUtils.cpp \ + Widgets/Extended/RDListWidget.cpp HEADERS += 3rdparty/toolwindowmanager/ToolWindowManager.h \ 3rdparty/toolwindowmanager/ToolWindowManagerArea.h \ @@ -127,7 +128,8 @@ HEADERS += 3rdparty/toolwindowmanager/ToolWindowManager.h \ Widgets/RangeHistogram.h \ Windows/Dialogs/TextureSaveDialog.h \ Windows/Dialogs/CaptureDialog.h \ - Code/QRDUtils.h + Code/QRDUtils.h \ + Widgets/Extended/RDListWidget.h FORMS += Windows/Dialogs/AboutDialog.ui \ Windows/MainWindow.ui \ diff --git a/qrenderdoc/qrenderdoc_local.vcxproj b/qrenderdoc/qrenderdoc_local.vcxproj index b9bb706ef..a05102941 100644 --- a/qrenderdoc/qrenderdoc_local.vcxproj +++ b/qrenderdoc/qrenderdoc_local.vcxproj @@ -296,6 +296,7 @@ + @@ -305,6 +306,7 @@ + @@ -350,6 +352,7 @@ + diff --git a/qrenderdoc/qrenderdoc_local.vcxproj.filters b/qrenderdoc/qrenderdoc_local.vcxproj.filters index 8582dbec1..21d4e438c 100644 --- a/qrenderdoc/qrenderdoc_local.vcxproj.filters +++ b/qrenderdoc/qrenderdoc_local.vcxproj.filters @@ -184,6 +184,12 @@ Code + + Widgets\Extended + + + Generated Files + @@ -276,6 +282,9 @@ Code + + Widgets\Extended +