Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
captainwong
jlib
Commits
0c479ac8
Commit
0c479ac8
authored
5 years ago
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jlibqt/BaseScrollView
parent
2869e857
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
0 deletions
+64
-0
BaseScrollView.cpp
jlib/qt/View/BaseScrollView.cpp
+35
-0
BaseScrollView.h
jlib/qt/View/BaseScrollView.h
+21
-0
qt.vcxproj
jlib/qt/qt.vcxproj
+2
-0
qt.vcxproj.filters
jlib/qt/qt.vcxproj.filters
+6
-0
No files found.
jlib/qt/View/BaseScrollView.cpp
0 → 100644
View file @
0c479ac8
#include "BaseScrollView.h"
#include <qscrollbar.h>
#include "../QtUtils.h"
#include "../QtStylesheet.h"
using
namespace
jlib
::
qt
;
BaseScrollView
::
BaseScrollView
(
QWidget
*
parent
)
:
QScrollArea
(
parent
)
{
setFrameShape
(
QFrame
::
NoFrame
);
verticalScrollBar
()
->
setStyleSheet
(
def_style_sheets
::
vertical_scroll_bar
);
//fill_bg_with_color(this, def_colors::window_bk);
root_
=
new
QWidget
(
this
);
setWidget
(
root_
);
refresh
();
}
BaseScrollView
::~
BaseScrollView
()
{
}
void
BaseScrollView
::
resizeEvent
(
QResizeEvent
*
)
{
root_
->
resize
(
width
()
-
8
,
qMax
(
height
(),
root_
->
height
()));
}
void
BaseScrollView
::
refresh
()
{
root_
->
move
(
0
,
0
);
root_
->
resize
(
width
()
-
8
,
qMax
(
height
(),
root_
->
height
()));
//fill_bg_with_color(root_, def_colors::control_bk);
}
This diff is collapsed.
Click to expand it.
jlib/qt/View/BaseScrollView.h
0 → 100644
View file @
0c479ac8
#pragma once
#include <QScrollArea>
class
BaseScrollView
:
public
QScrollArea
{
Q_OBJECT
public
:
BaseScrollView
(
QWidget
*
parent
=
nullptr
);
~
BaseScrollView
();
auto
root
()
const
{
return
root_
;
}
virtual
void
refresh
();
protected
:
virtual
void
resizeEvent
(
QResizeEvent
*
)
override
;
private
:
QWidget
*
root_
=
{};
};
This diff is collapsed.
Click to expand it.
jlib/qt/qt.vcxproj
View file @
0c479ac8
...
...
@@ -93,6 +93,7 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile
Include=
"qt.cpp"
/>
<ClCompile
Include=
"View\BaseScrollView.cpp"
/>
<ClCompile
Include=
"View\BgColorBtn.cpp"
/>
<ClCompile
Include=
"View\IconBtn.cpp"
/>
<ClCompile
Include=
"View\PageTitle.cpp"
/>
...
...
@@ -100,6 +101,7 @@
</ItemGroup>
<ItemGroup>
<ClInclude
Include=
"resource.h"
/>
<QtMoc
Include=
"View\BaseScrollView.h"
/>
<QtMoc
Include=
"View\RndButton.h"
/>
<QtMoc
Include=
"View\PageTitle.h"
/>
<QtMoc
Include=
"View\IconBtn.h"
/>
...
...
This diff is collapsed.
Click to expand it.
jlib/qt/qt.vcxproj.filters
View file @
0c479ac8
...
...
@@ -45,6 +45,9 @@
<ClCompile
Include=
"View\BgColorBtn.cpp"
>
<Filter>
View
</Filter>
</ClCompile>
<ClCompile
Include=
"View\BaseScrollView.cpp"
>
<Filter>
View
</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude
Include=
"qt.h"
>
...
...
@@ -96,5 +99,8 @@
<QtMoc
Include=
"View\RndButton.h"
>
<Filter>
View
</Filter>
</QtMoc>
<QtMoc
Include=
"View\BaseScrollView.h"
>
<Filter>
View
</Filter>
</QtMoc>
</ItemGroup>
</Project>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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