Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
melos
qtquickexamples
提交
6cca5d0f
Q
qtquickexamples
项目概览
melos
/
qtquickexamples
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qtquickexamples
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6cca5d0f
编写于
12月 04, 2017
作者:
zhengtianzuo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
42019612
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
33 addition
and
19 deletion
+33
-19
QmlTabBar/BaseTabBar.qml
QmlTabBar/BaseTabBar.qml
+21
-7
QmlTabBar/images/Chat_FriendManager.svg
QmlTabBar/images/Chat_FriendManager.svg
+0
-0
QmlTabBar/images/Chat_FriendManagerG.svg
QmlTabBar/images/Chat_FriendManagerG.svg
+0
-0
QmlTabBar/images/Chat_MsgRecord.svg
QmlTabBar/images/Chat_MsgRecord.svg
+0
-0
QmlTabBar/images/Chat_MsgRecordG.svg
QmlTabBar/images/Chat_MsgRecordG.svg
+0
-0
QmlTabBar/images/Main_P2PChat.svg
QmlTabBar/images/Main_P2PChat.svg
+0
-0
QmlTabBar/images/Main_P2PChatG.svg
QmlTabBar/images/Main_P2PChatG.svg
+0
-0
QmlTabBar/images/Mobile_Find.svg
QmlTabBar/images/Mobile_Find.svg
+0
-0
QmlTabBar/images/Mobile_FindG.svg
QmlTabBar/images/Mobile_FindG.svg
+0
-0
QmlTabBar/main.qml
QmlTabBar/main.qml
+4
-4
QmlTabBar/qml.qrc
QmlTabBar/qml.qrc
+8
-8
未找到文件。
QmlTabBar/BaseTabBar.qml
浏览文件 @
6cca5d0f
...
...
@@ -11,38 +11,52 @@ import QtQuick.Layouts 1.0
TabBar
{
property
alias
myModel
:
myModel
property
int
lastIndex
:
0
id
:
bar
height
:
48
width
:
parent
.
width
currentIndex
:
0
ListModel
{
id
:
myModel
// ListElement { modelText: "消息"; modelColor: "#000000"; modelColorG: "#148014"; modelSrc: "qrc:/Chat_MsgRecord.svg"; modelSrcG: "qrc:/Chat_MsgRecordG.svg";}
// ListElement { modelText: "联系人"; modelColor: "#000000"; modelColorG: "#148014"; modelSrc: "qrc:/Chat_FriendManager.svg"; modelSrcG: "qrc:/Chat_FriendManagerG.svg";}
// ListElement { modelText: "发现"; modelColor: "#000000"; modelColorG: "#148014"; modelSrc: "qrc:/Mobile_Find.svg"; modelSrcG: "qrc:/Mobile_FindG.svg";}
// ListElement { modelText: "我"; modelColor: "#000000"; modelColorG: "#148014"; modelSrc: "qrc:/Main_P2PChat.svg"; modelSrcG: "qrc:/Main_P2PChatG.svg";}
}
Repeater
{
id
:
repeater
model
:
myModel
TabButton
{
property
alias
imageSource
:
image
.
source
property
alias
textColor
:
text
.
color
height
:
bar
.
height
contentItem
:
Text
{
id
:
text
text
:
modelText
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignBottom
color
:
(
model
.
index
===
bar
.
currentIndex
)
?
modelColorG
:
modelColor
}
background
:
Image
{
id
:
image
width
:
24
height
:
24
anchors.horizontalCenter
:
parent
.
horizontalCenter
source
:
(
model
.
index
===
bar
.
currentIndex
)
?
modelSrcG
:
modelSrc
}
onHoveredChanged
:
{
if
(
model
.
index
!==
bar
.
currentIndex
){
hovered
?
text
.
color
=
modelColorG
:
text
.
color
=
modelColor
hovered
?
image
.
source
=
modelSrcG
:
image
.
source
=
modelSrc
}
}
onClicked
:
{
repeater
.
itemAt
(
bar
.
lastIndex
).
imageSource
=
myModel
.
get
(
bar
.
lastIndex
).
modelSrc
;
repeater
.
itemAt
(
bar
.
lastIndex
).
textColor
=
modelColor
;
image
.
source
=
modelSrcG
;
text
.
color
=
modelColorG
;
bar
.
lastIndex
=
model
.
index
;
}
}
}
}
QmlTabBar/Chat_FriendManager.svg
→
QmlTabBar/
images/
Chat_FriendManager.svg
浏览文件 @
6cca5d0f
文件已移动
QmlTabBar/Chat_FriendManagerG.svg
→
QmlTabBar/
images/
Chat_FriendManagerG.svg
浏览文件 @
6cca5d0f
文件已移动
QmlTabBar/Chat_MsgRecord.svg
→
QmlTabBar/
images/
Chat_MsgRecord.svg
浏览文件 @
6cca5d0f
文件已移动
QmlTabBar/Chat_MsgRecordG.svg
→
QmlTabBar/
images/
Chat_MsgRecordG.svg
浏览文件 @
6cca5d0f
文件已移动
QmlTabBar/Main_P2PChat.svg
→
QmlTabBar/
images/
Main_P2PChat.svg
浏览文件 @
6cca5d0f
文件已移动
QmlTabBar/Main_P2PChatG.svg
→
QmlTabBar/
images/
Main_P2PChatG.svg
浏览文件 @
6cca5d0f
文件已移动
QmlTabBar/Mobile_Find.svg
→
QmlTabBar/
images/
Mobile_Find.svg
浏览文件 @
6cca5d0f
文件已移动
QmlTabBar/Mobile_FindG.svg
→
QmlTabBar/
images/
Mobile_FindG.svg
浏览文件 @
6cca5d0f
文件已移动
QmlTabBar/main.qml
浏览文件 @
6cca5d0f
...
...
@@ -22,10 +22,10 @@ ApplicationWindow {
height
:
48
width
:
parent
.
width
Component.onCompleted
:
{
myModel
.
append
({
"
modelText
"
:
"
消息
"
,
"
modelColor
"
:
"
#000000
"
,
"
modelColorG
"
:
"
#148014
"
,
"
modelSrc
"
:
"
qrc:/
Chat_MsgRecord.svg
"
,
"
modelSrcG
"
:
"
qrc:
/Chat_MsgRecordG.svg
"
})
myModel
.
append
({
modelText
:
"
联系人
"
;
modelColor
:
"
#000000
"
;
modelColorG
:
"
#148014
"
;
modelSrc
:
"
qrc:/Chat_FriendManager.svg
"
;
modelSrcG
:
"
qrc:/Chat_FriendManagerG.svg
"
;}
// ListElement { modelText: "发现"; modelColor: "#000000"; modelColorG: "#148014"; modelSrc: "qrc:/Mobile_Find.svg"; modelSrcG: "qrc:/Mobile_FindG.svg";}
// ListElement { modelText: "我"; modelColor: "#000000"; modelColorG: "#148014"; modelSrc: "qrc:/Main_P2PChat.svg"; modelSrcG: "qrc:/Main_P2PChatG.svg";}
myModel
.
append
({
"
modelText
"
:
"
消息
"
,
"
modelColor
"
:
"
#000000
"
,
"
modelColorG
"
:
"
#148014
"
,
"
modelSrc
"
:
"
qrc:/
images/Chat_MsgRecord.svg
"
,
"
modelSrcG
"
:
"
qrc:/images
/Chat_MsgRecordG.svg
"
})
myModel
.
append
({
"
modelText
"
:
"
联系人
"
,
"
modelColor
"
:
"
#000000
"
,
"
modelColorG
"
:
"
#148014
"
,
"
modelSrc
"
:
"
qrc:/images/Chat_FriendManager.svg
"
,
"
modelSrcG
"
:
"
qrc:/images/Chat_FriendManagerG.svg
"
})
myModel
.
append
({
"
modelText
"
:
"
发现
"
,
"
modelColor
"
:
"
#000000
"
,
"
modelColorG
"
:
"
#148014
"
,
"
modelSrc
"
:
"
qrc:/images/Mobile_Find.svg
"
,
"
modelSrcG
"
:
"
qrc:/images/Mobile_FindG.svg
"
})
myModel
.
append
({
"
modelText
"
:
"
我
"
,
"
modelColor
"
:
"
#000000
"
,
"
modelColorG
"
:
"
#148014
"
,
"
modelSrc
"
:
"
qrc:/images/Main_P2PChat.svg
"
,
"
modelSrcG
"
:
"
qrc:/images/Main_P2PChatG.svg
"
})
}
}
...
...
QmlTabBar/qml.qrc
浏览文件 @
6cca5d0f
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>Chat_FriendManager.svg</file>
<file>Chat_MsgRecord.svg</file>
<file>Main_P2PChat.svg</file>
<file>Mobile_Find.svg</file>
<file>Chat_FriendManagerG.svg</file>
<file>Chat_MsgRecordG.svg</file>
<file>Main_P2PChatG.svg</file>
<file>Mobile_FindG.svg</file>
<file>
images\
Chat_FriendManager.svg</file>
<file>
images\
Chat_MsgRecord.svg</file>
<file>
images\
Main_P2PChat.svg</file>
<file>
images\
Mobile_Find.svg</file>
<file>
images\
Chat_FriendManagerG.svg</file>
<file>
images\
Chat_MsgRecordG.svg</file>
<file>
images\
Main_P2PChatG.svg</file>
<file>
images\
Mobile_FindG.svg</file>
<file>BaseTabBar.qml</file>
</qresource>
</RCC>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录