Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qtquickcontrols-nemo
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
NemoMobile
qtquickcontrols-nemo
Commits
d27167f1
Commit
d27167f1
authored
Jul 30, 2017
by
Chupligin Sergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add function to set custom mm and dp scale factor
parent
3858cd52
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
sizing.cpp
src/controls/sizing.cpp
+23
-0
sizing.h
src/controls/sizing.h
+3
-0
No files found.
src/controls/sizing.cpp
View file @
d27167f1
...
...
@@ -105,3 +105,26 @@ float Sizing::dp(float value)
{
return
value
*
m_dp_factor
;
}
void
Sizing
::
setMmScaleFactor
(
float
value
)
{
if
(
value
!=
0
)
{
qDebug
()
<<
"Set custom mm scale factor"
;
m_p_width
=
value
;
setMmScaleFactor
();
}
}
void
Sizing
::
setDpScaleFactor
(
float
value
)
{
if
(
value
!=
0
)
{
qDebug
()
<<
"Set custom dp scale factor"
;
m_dp_factor
=
value
;
}
}
src/controls/sizing.h
View file @
d27167f1
...
...
@@ -37,6 +37,9 @@ public:
Q_INVOKABLE
float
mm
(
float
value
);
Q_INVOKABLE
float
dp
(
float
value
);
Q_INVOKABLE
void
setMmScaleFactor
(
float
value
);
Q_INVOKABLE
void
setDpScaleFactor
(
float
value
);
private:
bool
m_valid
;
...
...
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