Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
b091a789
Commit
b091a789
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
use QApplication instance; set return values
parent
6e3201d4
No related branches found
No related tags found
2 merge requests
!1525
Updates from r20.0
,
!1518
Failed assertion throws runtime_error; message box moved to GUI main loop try..catch wrapper (#496)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
App/main.cpp
+8
-5
8 additions, 5 deletions
App/main.cpp
with
8 additions
and
5 deletions
App/main.cpp
+
8
−
5
View file @
b091a789
...
@@ -36,11 +36,11 @@ int main(int argc, char* argv[])
...
@@ -36,11 +36,11 @@ int main(int argc, char* argv[])
qRegisterMetaType
<
QVector
<
double
>>
(
"QVector<double>"
);
qRegisterMetaType
<
QVector
<
double
>>
(
"QVector<double>"
);
QApplication
app
(
argc
,
argv
);
QApplication
app
(
argc
,
argv
);
QApplication
::
setApplicationName
(
"BornAgain"
);
app
.
setApplicationName
(
"BornAgain"
);
QApplication
::
setApplicationVersion
(
GUI
::
Util
::
Path
::
getBornAgainVersionString
());
app
.
setApplicationVersion
(
GUI
::
Util
::
Path
::
getBornAgainVersionString
());
QApplication
::
setOrganizationName
(
"BornAgain"
);
app
.
setOrganizationName
(
"BornAgain"
);
#ifndef Q_OS_MAC
#ifndef Q_OS_MAC
QApplication
::
setWindowIcon
(
QIcon
(
":/images/BornAgain.ico"
));
app
.
setWindowIcon
(
QIcon
(
":/images/BornAgain.ico"
));
#endif
#endif
ApplicationSettings
applicationSettings
;
ApplicationSettings
applicationSettings
;
...
@@ -62,8 +62,9 @@ int main(int argc, char* argv[])
...
@@ -62,8 +62,9 @@ int main(int argc, char* argv[])
win
.
loadProject
(
options
.
projectFile
());
win
.
loadProject
(
options
.
projectFile
());
win
.
show
();
win
.
show
();
int
ret
=
-
1
;
try
{
try
{
ret
urn
QApplication
::
exec
();
ret
=
app
.
exec
();
}
catch
(
const
std
::
exception
&
ex
)
{
}
catch
(
const
std
::
exception
&
ex
)
{
QMessageBox
msgbox
(
QMessageBox
::
Critical
,
"BornAgain: fatal bug"
,
QMessageBox
msgbox
(
QMessageBox
::
Critical
,
"BornAgain: fatal bug"
,
QString
(
"Sorry, you encountered a fatal bug.
\n
"
QString
(
"Sorry, you encountered a fatal bug.
\n
"
...
@@ -72,5 +73,7 @@ int main(int argc, char* argv[])
...
@@ -72,5 +73,7 @@ int main(int argc, char* argv[])
+
ex
.
what
()
+
"
\n
"
,
+
ex
.
what
()
+
"
\n
"
,
QMessageBox
::
Ok
,
QApplication
::
activeWindow
());
QMessageBox
::
Ok
,
QApplication
::
activeWindow
());
msgbox
.
exec
();
msgbox
.
exec
();
return
1
;
}
}
return
ret
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment