Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-qt-ui
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap-qt-ui
Commits
2d798ebf
Commit
2d798ebf
authored
5 years ago
by
konstantin.kukharenko
Committed by
Alexandr Mruchok
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Features 3017
parent
c04e4dcd
No related branches found
No related tags found
1 merge request
!17
Develop old
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
controls/FAQWidget.cpp
+71
-0
71 additions, 0 deletions
controls/FAQWidget.cpp
controls/FAQWidget.h
+43
-0
43 additions, 0 deletions
controls/FAQWidget.h
controls/ListModel.h
+1
-6
1 addition, 6 deletions
controls/ListModel.h
controls/controls.pri
+2
-0
2 additions, 0 deletions
controls/controls.pri
with
117 additions
and
6 deletions
controls/FAQWidget.cpp
0 → 100644
+
71
−
0
View file @
2d798ebf
#include
"FAQWidget.h"
FAQWidget
::
FAQWidget
(
const
FAQDataModel
&
model
,
QWidget
*
parent
)
:
QWidget
(
parent
)
{
setObjectName
(
"wgtFAQWidget"
);
m_lblIcon
=
new
QLabel
(
this
);
m_lblHeader
=
new
CustomLineHeightLabel
(
this
);
m_lblText
=
new
CustomLineHeightLabel
(
this
);
m_lblBottomLine
=
new
QLabel
(
this
);
m_topLayout
=
new
QHBoxLayout
();
m_mainLayout
=
new
QVBoxLayout
();
m_lblIcon
->
setObjectName
(
"lblIcon"
);
m_lblHeader
->
setObjectName
(
"lblHeaderText"
);
m_lblText
->
setObjectName
(
"lblText"
);
m_lblBottomLine
->
setObjectName
(
"lblBottomLine"
);
m_lblHeader
->
setText
(
model
.
text
);
m_lblHeader
->
setWordWrap
(
true
);
m_lblText
->
setText
(
model
.
aboutText
);
m_lblText
->
setWordWrap
(
true
);
setSizePolicy
(
QSizePolicy
::
Fixed
,
QSizePolicy
::
Fixed
);
m_lblIcon
->
setSizePolicy
(
QSizePolicy
::
Preferred
,
QSizePolicy
::
Preferred
);
m_lblHeader
->
setSizePolicy
(
QSizePolicy
::
Fixed
,
QSizePolicy
::
Preferred
);
m_lblText
->
setSizePolicy
(
QSizePolicy
::
Fixed
,
QSizePolicy
::
Preferred
);
m_topLayout
->
addWidget
(
m_lblHeader
);
m_topLayout
->
addWidget
(
m_lblIcon
);
m_mainLayout
->
addLayout
(
m_topLayout
);
m_mainLayout
->
addWidget
(
m_lblText
);
m_mainLayout
->
addWidget
(
m_lblBottomLine
);
setLayout
(
m_mainLayout
);
m_topLayout
->
setSpacing
(
0
);
m_topLayout
->
setMargin
(
0
);
m_mainLayout
->
setSpacing
(
0
);
m_mainLayout
->
setMargin
(
0
);
m_topLayout
->
setAlignment
(
m_lblHeader
,
Qt
::
AlignTop
);
m_topLayout
->
setAlignment
(
m_lblIcon
,
Qt
::
AlignTop
);
m_mainLayout
->
setAlignment
(
m_lblText
,
Qt
::
AlignLeft
);
m_lblText
->
setVisible
(
false
);
show
();
}
void
FAQWidget
::
mousePressEvent
(
QMouseEvent
*
event
)
{
if
(
!
m_lblText
->
isVisible
())
{
m_lblIcon
->
setProperty
(
"state"
,
"arow-down"
);
m_lblText
->
setVisible
(
true
);
style
()
->
unpolish
(
m_lblIcon
);
style
()
->
polish
(
m_lblIcon
);
update
();
}
else
{
m_lblIcon
->
setProperty
(
"state"
,
"default"
);
m_lblText
->
setVisible
(
false
);
style
()
->
unpolish
(
m_lblIcon
);
style
()
->
polish
(
m_lblIcon
);
update
();
}
QWidget
::
mousePressEvent
(
event
);
}
This diff is collapsed.
Click to expand it.
controls/FAQWidget.h
0 → 100644
+
43
−
0
View file @
2d798ebf
#ifndef FAQWIDGET_H
#define FAQWIDGET_H
#include
<QWidget>
#include
<QLabel>
#include
<QBoxLayout>
#include
<QTextEdit>
#include
<QStyle>
#include
"CustomLineHeightLabel.h"
struct
FAQDataModel
{
QString
text
;
QString
aboutText
;
};
class
FAQWidget
:
public
QWidget
{
Q_OBJECT
public:
/// Widget constructor.
/// @param model Data from model with text.
/// @param parent
FAQWidget
(
const
FAQDataModel
&
model
,
QWidget
*
parent
=
nullptr
);
protected:
/// Expands and closes the list, changes the settings for the style.
/// @param event
void
mousePressEvent
(
QMouseEvent
*
event
);
private:
//Right arrow icon
QLabel
*
m_lblIcon
;
//Reference Information Description
CustomLineHeightLabel
*
m_lblHeader
;
//Description of the problem
CustomLineHeightLabel
*
m_lblText
;
//Line under the description
QLabel
*
m_lblBottomLine
;
QHBoxLayout
*
m_topLayout
;
QVBoxLayout
*
m_mainLayout
;
};
#endif // FAQWIDGET_H
This diff is collapsed.
Click to expand it.
controls/ListModel.h
+
1
−
6
View file @
2d798ebf
...
...
@@ -4,17 +4,12 @@
#include
<QAbstractListModel>
#include
<QDebug>
#include
<QString>
#include
<QStringList>
//class ListModel
//{
//public:
// ListModel();
//};
struct
DataModel
{
QString
iconPath
;
QString
text
;
QString
aboutText
;
};
...
...
This diff is collapsed.
Click to expand it.
controls/controls.pri
+
2
−
0
View file @
2d798ebf
...
...
@@ -9,6 +9,7 @@ SOURCES += \
$$PWD/CustomPlacementButton.cpp \
$$PWD/CustomPlacementButton_New.cpp \
$$PWD/CustomWidget.cpp \
$$PWD/FAQWidget.cpp \
$$PWD/ListModel.cpp \
$$PWD/ServersComboBox.cpp \
$$PWD/AnimatedLineEdit.cpp \
...
...
@@ -27,6 +28,7 @@ HEADERS += \
$$PWD/CustomPlacementButton.h \
$$PWD/CustomPlacementButton_New.h \
$$PWD/CustomWidget.h \
$$PWD/FAQWidget.h \
$$PWD/ListModel.h \
$$PWD/ServersComboBox.h \
$$PWD/AnimatedLineEdit.h \
...
...
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