Skip to content

Commit 2a0a57f

Browse files
Fixed exception call in QTitleBar constructor
Imported proper dependencies and replaced "std::exception" call by "std::invalid argument" (otherwise it would only work with MSVC compiler).
1 parent 09f297a commit 2a0a57f

7 files changed

Lines changed: 8 additions & 8 deletions

File tree

sample/CustomFrame-Dynamic/customtitlebar/qtitlebar.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Developer: Mauro Mascarenhas de Araújo
55
# Contact: mauro.mascarenhas@nintersoft.com
66
# Licence: Mozilla Public Licence 2.0
7-
# Date: 24 of August of 2020
7+
# Date: 25 of August of 2020
88
#
99
# Licence notice
1010
#
@@ -38,7 +38,7 @@
3838
#include <QPushButton>
3939
#include <QStyleOption>
4040

41-
#include <exception>
41+
#include <stdexcept>
4242

4343
namespace QCustomAttrs {
4444
enum WindowButton {

sample/CustomFrame-Static/customtitlebar/qtitlebar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ QTitleBar::QTitleBar(QMainWindow *parent) :
4545
"QTitleBar { background: white; }\n"
4646
));
4747

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

5151
this->lbl_windowTitle.setText("QCustomWindow");

sample/CustomFrame-Static/customtitlebar/qtitlebar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include <QPushButton>
3131
#include <QStyleOption>
3232

33-
#include <exception>
33+
#include <stdexcept>
3434

3535
namespace QCustomAttrs {
3636
enum WindowButton {

src/CustomTitlebar-Dynamic/qtitlebar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ QTitleBar::QTitleBar(QMainWindow *parent) :
4545
"QTitleBar { background: white; }\n"
4646
));
4747

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

5151
this->lbl_windowTitle.setText("QCustomWindow");

src/CustomTitlebar-Dynamic/qtitlebar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include <QPushButton>
3939
#include <QStyleOption>
4040

41-
#include <exception>
41+
#include <stdexcept>
4242

4343
namespace QCustomAttrs {
4444
enum WindowButton {

src/CustomTitlebar-Static/qtitlebar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ QTitleBar::QTitleBar(QMainWindow *parent) :
4545
"QTitleBar { background: white; }\n"
4646
));
4747

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

5151
this->lbl_windowTitle.setText("QCustomWindow");

src/CustomTitlebar-Static/qtitlebar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include <QPushButton>
3131
#include <QStyleOption>
3232

33-
#include <exception>
33+
#include <stdexcept>
3434

3535
namespace QCustomAttrs {
3636
enum WindowButton {

0 commit comments

Comments
 (0)