Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
723118a2
Commit
723118a2
authored
Aug 28, 2010
by
Michael Schulz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved global font settings from app to stylesheet
parent
9597d772
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
style-mission.css
images/style-mission.css
+1
-0
Core.cc
src/Core.cc
+6
-2
No files found.
images/style-mission.css
View file @
723118a2
*
{
font-family
:
"Bitstream Vera Sans"
;
font
:
"Roman"
;
font-size
:
12px
;
}
QWidget
#colorIcon
{}
QWidget
{
...
...
src/Core.cc
View file @
723118a2
...
...
@@ -72,6 +72,8 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
// Show splash screen
QPixmap
splashImage
(
":images/splash.png"
);
QSplashScreen
*
splashScreen
=
new
QSplashScreen
(
splashImage
,
Qt
::
WindowStaysOnTopHint
);
// Delete splash screen after mainWindow was displayed
splashScreen
->
setAttribute
(
Qt
::
WA_DeleteOnClose
);
splashScreen
->
show
();
splashScreen
->
showMessage
(
tr
(
"Loading application fonts"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
...
...
@@ -79,13 +81,15 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
// Exit main application when last window is closed
connect
(
this
,
SIGNAL
(
lastWindowClosed
()),
this
,
SLOT
(
quit
()));
//
Set
application font
//
Load
application font
QFontDatabase
fontDatabase
=
QFontDatabase
();
const
QString
fontFileName
=
":/general/vera.ttf"
;
///< Font file is part of the QRC file and compiled into the app
const
QString
fontFamilyName
=
"Bitstream Vera Sans"
;
if
(
!
QFile
::
exists
(
fontFileName
))
printf
(
"ERROR! font file: %s DOES NOT EXIST!
\n
"
,
fontFileName
.
toStdString
().
c_str
());
fontDatabase
.
addApplicationFont
(
fontFileName
);
setFont
(
fontDatabase
.
font
(
fontFamilyName
,
"Roman"
,
12
));
// Avoid Using setFont(). In the Qt docu you can read the following:
// "Warning: Do not use this function in conjunction with Qt Style Sheets."
// setFont(fontDatabase.font(fontFamilyName, "Roman", 12));
// Start the comm link manager
splashScreen
->
showMessage
(
tr
(
"Starting Communication Links"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment