Skip to content

Commit

Permalink
Fixed exception call in QTitleBar constructor
Browse files Browse the repository at this point in the history
Imported proper dependencies and replaced "std::exception" call by "std::invalid argument" (otherwise it would only work with MSVC compiler).
  • Loading branch information
mauromascarenhas committed Sep 13, 2020
1 parent 09f297a commit 2a0a57f
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions sample/CustomFrame-Dynamic/customtitlebar/qtitlebar.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Developer: Mauro Mascarenhas de Araújo
# Contact: [email protected]
# Licence: Mozilla Public Licence 2.0
# Date: 24 of August of 2020
# Date: 25 of August of 2020
#
# Licence notice
#
Expand Down Expand Up @@ -38,7 +38,7 @@
#include <QPushButton>
#include <QStyleOption>

#include <exception>
#include <stdexcept>

namespace QCustomAttrs {
enum WindowButton {
Expand Down
2 changes: 1 addition & 1 deletion sample/CustomFrame-Static/customtitlebar/qtitlebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ QTitleBar::QTitleBar(QMainWindow *parent) :
"QTitleBar { background: white; }\n"
));

if (!parent) throw std::exception("Parent must be a QCustomWindow object (cannot be null).");
if (!parent) throw std::invalid_argument("Parent must be a QCustomWindow object (cannot be null).");
this->m_parentWindow = parent;

this->lbl_windowTitle.setText("QCustomWindow");
Expand Down
2 changes: 1 addition & 1 deletion sample/CustomFrame-Static/customtitlebar/qtitlebar.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <QPushButton>
#include <QStyleOption>

#include <exception>
#include <stdexcept>

namespace QCustomAttrs {
enum WindowButton {
Expand Down
2 changes: 1 addition & 1 deletion src/CustomTitlebar-Dynamic/qtitlebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ QTitleBar::QTitleBar(QMainWindow *parent) :
"QTitleBar { background: white; }\n"
));

if (!parent) throw std::exception("Parent must be a QCustomWindow object (cannot be null).");
if (!parent) throw std::invalid_argument("Parent must be a QCustomWindow object (cannot be null).");
this->m_parentWindow = parent;

this->lbl_windowTitle.setText("QCustomWindow");
Expand Down
2 changes: 1 addition & 1 deletion src/CustomTitlebar-Dynamic/qtitlebar.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <QPushButton>
#include <QStyleOption>

#include <exception>
#include <stdexcept>

namespace QCustomAttrs {
enum WindowButton {
Expand Down
2 changes: 1 addition & 1 deletion src/CustomTitlebar-Static/qtitlebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ QTitleBar::QTitleBar(QMainWindow *parent) :
"QTitleBar { background: white; }\n"
));

if (!parent) throw std::exception("Parent must be a QCustomWindow object (cannot be null).");
if (!parent) throw std::invalid_argument("Parent must be a QCustomWindow object (cannot be null).");
this->m_parentWindow = parent;

this->lbl_windowTitle.setText("QCustomWindow");
Expand Down
2 changes: 1 addition & 1 deletion src/CustomTitlebar-Static/qtitlebar.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <QPushButton>
#include <QStyleOption>

#include <exception>
#include <stdexcept>

namespace QCustomAttrs {
enum WindowButton {
Expand Down

0 comments on commit 2a0a57f

Please sign in to comment.