Showing preview only (495K chars total). Download the full file or copy to clipboard to get everything.
Repository: zccrs/QQStars
Branch: master
Commit: b2a18d88d27a
Files: 89
Total size: 447.0 KB
Directory structure:
gitextract_ckkfy0u8/
├── .gitignore
├── QQStars.pro
├── README.md
├── deployment.pri
├── faces.qrc
├── images.qrc
├── other.qrc
├── qml/
│ ├── Api/
│ │ ├── QQApi.qml
│ │ └── api.js
│ ├── Chat/
│ │ ├── ChatPage.qml
│ │ ├── ChatWindowCommand.qml
│ │ ├── DiscuChatPage.qml
│ │ ├── FriendChatPage.qml
│ │ ├── GroupChatPage.qml
│ │ └── MessageListComponent.qml
│ ├── Login/
│ │ ├── LoginPanel/
│ │ │ ├── AccountList.qml
│ │ │ ├── LoginCheckBox.qml
│ │ │ ├── LoginInputArea.qml
│ │ │ └── LoginPage.qml
│ │ ├── MyLoginButton.qml
│ │ ├── SettingPage.qml
│ │ └── main.qml
│ ├── MainPanel/
│ │ ├── ListPage/
│ │ │ ├── AllListPage.qml
│ │ │ ├── DiscuList.qml
│ │ │ ├── FriendList.qml
│ │ │ ├── GroupAndDiscuPage.qml
│ │ │ ├── GroupList.qml
│ │ │ └── RecentList.qml
│ │ ├── MainPanelPage.qml
│ │ └── main.qml
│ ├── QQItemInfo/
│ │ ├── DiscuInfo.qml
│ │ ├── FriendInfo.qml
│ │ └── GroupInfo.qml
│ └── Utility/
│ ├── CodeInput.qml
│ ├── ComboBox/
│ │ ├── MyComboBox.qml
│ │ └── MyComboBoxComponent.qml
│ ├── KeyboardPage/
│ │ ├── SoftKeyboard.qml
│ │ └── SoftKeyboardButton.qml
│ ├── MyButton.qml
│ ├── MyMessageBox.qml
│ ├── MyRectangularGlow.qml
│ ├── MyScrollView.qml
│ ├── MyTextArea.qml
│ ├── MyTextField.qml
│ ├── MyTextView.qml
│ ├── MyWindow.qml
│ ├── SystemTray.qml
│ └── TrayMessageWindow.qml
├── qml.qrc
├── qmlapplicationviewer.pri
├── qt_zh_CN.qm
├── src/
│ ├── main.cpp
│ ├── mywidgets/
│ │ ├── myimage.cpp
│ │ ├── myimage.h
│ │ ├── mymessagebox.cpp
│ │ ├── mymessagebox.h
│ │ ├── mysvgview.cpp
│ │ ├── mysvgview.h
│ │ ├── mywindow.cpp
│ │ ├── mywindow.h
│ │ ├── systemtrayicon.cpp
│ │ └── systemtrayicon.h
│ ├── qqstars/
│ │ ├── qqiteminfo.cpp
│ │ ├── qqiteminfo.h
│ │ ├── qqstars.cpp
│ │ └── qqstars.h
│ ├── qxtglobalshortcut/
│ │ ├── myshortcut.cpp
│ │ ├── myshortcut.h
│ │ ├── qxtglobal.h
│ │ ├── qxtglobalshortcut.cpp
│ │ ├── qxtglobalshortcut.h
│ │ ├── qxtglobalshortcut.pri
│ │ ├── qxtglobalshortcut_mac.cpp
│ │ ├── qxtglobalshortcut_p.h
│ │ ├── qxtglobalshortcut_win.cpp
│ │ └── qxtglobalshortcut_x11.cpp
│ └── utility/
│ ├── downloadimage.cpp
│ ├── downloadimage.h
│ ├── myhttprequest.cpp
│ ├── myhttprequest.h
│ ├── mynetworkaccessmanagerfactory.cpp
│ ├── mynetworkaccessmanagerfactory.h
│ ├── texteditplaygif.cpp
│ ├── texteditplaygif.h
│ ├── utility.cpp
│ └── utility.h
├── style/
│ ├── menuStyle.css
│ └── messageBoxStyle.css
└── style.qrc
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# C++ objects and libs
*.slo
*.lo
*.o
*.a
*.la
*.lai
*.so
*.dll
*.dylib
# Qt-es
/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.moc
moc_*.cpp
qrc_*.cpp
ui_*.h
Makefile*
*-build-*
# QtCreator
*.autosave
#QtCtreator Qml
*.qmlproject.user
*.qmlproject.user.*
#custom
/build
================================================
FILE: QQStars.pro
================================================
TEMPLATE = app
TARGET = QQStars
QT += widgets network webkit svg qml quick concurrent sql quick-private#widgets-private core-private gui-private
QT += webkitwidgets
linux:LIBS += -lXext
INCLUDEPATH += \
src \
src/qxtglobalshortcut \
src/qqstars \
src/mywidgets \
src/utility
SOURCES += src/main.cpp \
src/utility/mynetworkaccessmanagerfactory.cpp \
src/utility/utility.cpp \
src/mywidgets/mywindow.cpp \
src/qqstars/qqstars.cpp \
src/mywidgets/systemtrayicon.cpp \
src/mywidgets/mysvgview.cpp \
src/mywidgets/myimage.cpp \
src/mywidgets/mymessagebox.cpp \
src/utility/myhttprequest.cpp \
src/qqstars/qqiteminfo.cpp \
src/utility/downloadimage.cpp \
src/utility/texteditplaygif.cpp
RESOURCES += \
images.qrc \
other.qrc \
faces.qrc \
qml.qrc \
style.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Default rules for deployment.
include(deployment.pri)
include (src/qxtglobalshortcut/qxtglobalshortcut.pri)
#include (qmlapplicationviewer.pri)
#qtcAddDeployment()
HEADERS += \
src/utility/mynetworkaccessmanagerfactory.h \
src/utility/utility.h \
src/mywidgets/mywindow.h \
src/qqstars/qqstars.h \
src/mywidgets/systemtrayicon.h \
src/mywidgets/mysvgview.h \
src/mywidgets/myimage.h \
src/mywidgets/mymessagebox.h \
src/utility/myhttprequest.h \
src/qqstars/qqiteminfo.h \
src/utility/downloadimage.h \
src/utility/texteditplaygif.h
OTHER_FILES += \
qml/Utility/CodeInput.qml \
qml/Utility/MyButton.qml \
qml/Utility/MyMessageBox.qml \
qml/Utility/MyTextArea.qml \
qml/Utility/MyTextField.qml \
qml/Utility/SystemTray.qml \
qml/Api/api.js \
qml/Api/QQApi.qml \
qml/Login/KeyboardPage/SoftKeyboard.qml \
qml/Login/KeyboardPage/SoftKeyboardButton.qml \
qml/Login/main.qml \
qml/Login/SettingPage.qml \
qml/MainPanel/ChatWindow/qqshow.png \
qml/MainPanel/ListPage/AllListPage.qml \
qml/MainPanel/ListPage/FriendList.qml \
qml/MainPanel/ListPage/GroupList.qml \
qml/MainPanel/ListPage/RecentList.qml \
qml/MainPanel/main.qml \
qml/MainPanel/MainPanelPage.qml \
qml/Utility/ComboBox/MyComboBox.qml \
qml/Utility/ComboBox/MyComboBoxComponent.qml \
qml/Login/MyLoginButton.qml \
qml/Chat/ChatWindowCommand.qml \
qml/Chat/MessageListComponent.qml \
qml/Chat/qqshow.png \
qml/Utility/KeyboardPage/SoftKeyboard.qml \
qml/Utility/KeyboardPage/SoftKeyboardButton.qml \
qml/Utility/MyRectangularGlow.qml \
qml/Utility/MyWindow.qml \
qml/Utility/MyScrollView.qml \
qml/Login/LoginPanel/AccountList.qml \
qml/Login/LoginPanel/LoginCheckBox.qml \
qml/Login/LoginPanel/LoginInputArea.qml \
qml/Login/LoginPanel/LoginPage.qml \
qml/QQItemInfo/DiscuInfo.qml \
qml/QQItemInfo/FriendInfo.qml \
qml/QQItemInfo/GroupInfo.qml \
qml/MainPanel/ListPage/DiscuList.qml \
qml/MainPanel/ListPage/GroupAndDiscuPage.qml \
style/menuStyle.css \
style/messageBoxStyle.css \
qml/Chat/FriendChatPage.qml \
qml/Chat/GroupChatPage.qml \
qml/Chat/DiscuChatPage.qml \
qml/Chat/ChatPage.qml \
qml/Utility/TrayMessageWindow.qml \
qml/Login/textedit.html \
qml/Utility/MyTextView.qml
FORMS +=
================================================
FILE: README.md
================================================
#### 接口都已失效,此程序不再更新。
QQStars
=======
[](https://dartnode.com "Powered by DartNode - Free VPS for Open Source")
<b>此开源代码使用GPL授权方式</b>
基于webqq协议的qq客户端,qt开发,可跨平台(主要给linux用户用,windows用户肯定不稀罕了)
开发环境windows 7,qt 5.3.2
下载链接:http://pan.baidu.com/s/1ntwW5DZ 密码: eeir。
其中<b>QQStars-20141215gitd665984-1.fc21.x86_64.rpm</b>和<b>QQStars-20141215gitd665984-1.fc21.src.rpm</b>
为朋友<b>LunarShaddow</b>编译和打包,在此表示衷心的感谢。
直接解压,windows下直接运行QQStars.exe。
linux下运行QQStars.sh,如果程序无法启动就给同目录的QQStars加可执行权限。如果还是无法启动就是用终端运行QQStars.sh看有什么错误提示
在LInux下如果无法输入中文的话请看此博客:http://www.cnblogs.com/AfterTheRainOfStars/p/3768484.html#3022718










================================================
FILE: deployment.pri
================================================
android-no-sdk {
target.path = /data/user/qt
export(target.path)
INSTALLS += target
} else:android {
x86 {
target.path = /libs/x86
} else: armeabi-v7a {
target.path = /libs/armeabi-v7a
} else {
target.path = /libs/armeabi
}
export(target.path)
INSTALLS += target
} else:unix {
isEmpty(target.path) {
qnx {
target.path = /tmp/$${TARGET}/bin
} else {
target.path = /opt/$${TARGET}/bin
}
export(target.path)
}
INSTALLS += target
}
export(INSTALLS)
================================================
FILE: faces.qrc
================================================
<RCC>
<qresource prefix="/">
<file>faces/classic/0.gif</file>
<file>faces/classic/0.png</file>
<file>faces/classic/1.gif</file>
<file>faces/classic/1.png</file>
<file>faces/classic/2.gif</file>
<file>faces/classic/2.png</file>
<file>faces/classic/3.gif</file>
<file>faces/classic/3.png</file>
<file>faces/classic/4.gif</file>
<file>faces/classic/4.png</file>
<file>faces/classic/5.gif</file>
<file>faces/classic/5.png</file>
<file>faces/classic/6.gif</file>
<file>faces/classic/6.png</file>
<file>faces/classic/7.gif</file>
<file>faces/classic/7.png</file>
<file>faces/classic/8.gif</file>
<file>faces/classic/8.png</file>
<file>faces/classic/9.gif</file>
<file>faces/classic/9.png</file>
<file>faces/classic/10.gif</file>
<file>faces/classic/10.png</file>
<file>faces/classic/11.gif</file>
<file>faces/classic/11.png</file>
<file>faces/classic/12.gif</file>
<file>faces/classic/12.png</file>
<file>faces/classic/13.gif</file>
<file>faces/classic/13.png</file>
<file>faces/classic/14.gif</file>
<file>faces/classic/14.png</file>
<file>faces/classic/21.png</file>
<file>faces/classic/23.gif</file>
<file>faces/classic/23.png</file>
<file>faces/classic/25.png</file>
<file>faces/classic/26.gif</file>
<file>faces/classic/26.png</file>
<file>faces/classic/27.gif</file>
<file>faces/classic/27.png</file>
<file>faces/classic/29.gif</file>
<file>faces/classic/29.png</file>
<file>faces/classic/32.png</file>
<file>faces/classic/33.png</file>
<file>faces/classic/34.png</file>
<file>faces/classic/36.png</file>
<file>faces/classic/37.gif</file>
<file>faces/classic/37.png</file>
<file>faces/classic/38.gif</file>
<file>faces/classic/38.png</file>
<file>faces/classic/39.png</file>
<file>faces/classic/42.png</file>
<file>faces/classic/45.png</file>
<file>faces/classic/46.gif</file>
<file>faces/classic/46.png</file>
<file>faces/classic/47.gif</file>
<file>faces/classic/47.png</file>
<file>faces/classic/50.png</file>
<file>faces/classic/51.gif</file>
<file>faces/classic/51.png</file>
<file>faces/classic/53.gif</file>
<file>faces/classic/53.png</file>
<file>faces/classic/54.gif</file>
<file>faces/classic/54.png</file>
<file>faces/classic/55.gif</file>
<file>faces/classic/55.png</file>
<file>faces/classic/56.gif</file>
<file>faces/classic/56.png</file>
<file>faces/classic/57.gif</file>
<file>faces/classic/57.png</file>
<file>faces/classic/58.gif</file>
<file>faces/classic/58.png</file>
<file>faces/classic/59.png</file>
<file>faces/classic/62.gif</file>
<file>faces/classic/62.png</file>
<file>faces/classic/63.gif</file>
<file>faces/classic/63.png</file>
<file>faces/classic/64.png</file>
<file>faces/classic/71.gif</file>
<file>faces/classic/71.png</file>
<file>faces/classic/72.gif</file>
<file>faces/classic/72.png</file>
<file>faces/classic/73.gif</file>
<file>faces/classic/73.png</file>
<file>faces/classic/74.gif</file>
<file>faces/classic/74.png</file>
<file>faces/classic/75.gif</file>
<file>faces/classic/75.png</file>
<file>faces/classic/76.gif</file>
<file>faces/classic/76.png</file>
<file>faces/classic/77.gif</file>
<file>faces/classic/77.png</file>
<file>faces/classic/78.gif</file>
<file>faces/classic/78.png</file>
<file>faces/classic/79.gif</file>
<file>faces/classic/79.png</file>
<file>faces/classic/80.gif</file>
<file>faces/classic/80.png</file>
<file>faces/classic/81.gif</file>
<file>faces/classic/81.png</file>
<file>faces/classic/82.gif</file>
<file>faces/classic/82.png</file>
<file>faces/classic/83.gif</file>
<file>faces/classic/83.png</file>
<file>faces/classic/84.gif</file>
<file>faces/classic/84.png</file>
<file>faces/classic/85.png</file>
<file>faces/classic/86.png</file>
<file>faces/classic/87.gif</file>
<file>faces/classic/87.png</file>
<file>faces/classic/88.gif</file>
<file>faces/classic/88.png</file>
<file>faces/classic/91.png</file>
<file>faces/classic/93.gif</file>
<file>faces/classic/93.png</file>
<file>faces/classic/95.gif</file>
<file>faces/classic/95.png</file>
<file>faces/classic/96.gif</file>
<file>faces/classic/96.png</file>
<file>faces/classic/97.gif</file>
<file>faces/classic/97.png</file>
<file>faces/classic/98.gif</file>
<file>faces/classic/98.png</file>
<file>faces/classic/99.gif</file>
<file>faces/classic/99.png</file>
<file>faces/classic/100.gif</file>
<file>faces/classic/100.png</file>
<file>faces/classic/101.gif</file>
<file>faces/classic/101.png</file>
<file>faces/classic/102.gif</file>
<file>faces/classic/102.png</file>
<file>faces/classic/103.gif</file>
<file>faces/classic/103.png</file>
<file>faces/classic/104.gif</file>
<file>faces/classic/104.png</file>
<file>faces/classic/105.gif</file>
<file>faces/classic/105.png</file>
<file>faces/classic/106.gif</file>
<file>faces/classic/106.png</file>
<file>faces/classic/107.gif</file>
<file>faces/classic/107.png</file>
<file>faces/classic/108.gif</file>
<file>faces/classic/108.png</file>
<file>faces/classic/109.gif</file>
<file>faces/classic/109.png</file>
<file>faces/classic/110.gif</file>
<file>faces/classic/110.png</file>
<file>faces/classic/111.gif</file>
<file>faces/classic/111.png</file>
<file>faces/classic/112.gif</file>
<file>faces/classic/112.png</file>
<file>faces/classic/113.gif</file>
<file>faces/classic/113.png</file>
<file>faces/classic/114.gif</file>
<file>faces/classic/114.png</file>
<file>faces/classic/115.gif</file>
<file>faces/classic/115.png</file>
<file>faces/classic/116.gif</file>
<file>faces/classic/116.png</file>
<file>faces/classic/117.gif</file>
<file>faces/classic/117.png</file>
<file>faces/classic/118.gif</file>
<file>faces/classic/118.png</file>
<file>faces/classic/119.gif</file>
<file>faces/classic/119.png</file>
<file>faces/classic/120.gif</file>
<file>faces/classic/120.png</file>
<file>faces/classic/121.gif</file>
<file>faces/classic/121.png</file>
<file>faces/classic/122.gif</file>
<file>faces/classic/122.png</file>
<file>faces/classic/123.gif</file>
<file>faces/classic/123.png</file>
<file>faces/classic/124.png</file>
<file>faces/classic/125.gif</file>
<file>faces/classic/125.png</file>
<file>faces/classic/126.gif</file>
<file>faces/classic/126.png</file>
<file>faces/classic/127.gif</file>
<file>faces/classic/127.png</file>
<file>faces/classic/128.gif</file>
<file>faces/classic/128.png</file>
<file>faces/classic/129.gif</file>
<file>faces/classic/129.png</file>
<file>faces/classic/130.gif</file>
<file>faces/classic/130.png</file>
<file>faces/classic/131.gif</file>
<file>faces/classic/131.png</file>
<file>faces/classic/132.gif</file>
<file>faces/classic/132.png</file>
<file>faces/classic/133.gif</file>
<file>faces/classic/133.png</file>
<file>faces/classic/134.gif</file>
<file>faces/classic/134.png</file>
<file>faces/classic/dfp.png</file>
<file>faces/classic/dfr.png</file>
<file>faces/classic/dhp.png</file>
<file>faces/classic/K歌.png</file>
<file>faces/classic/棒棒糖.png</file>
<file>faces/classic/爆筋.png</file>
<file>faces/classic/鞭炮.png</file>
<file>faces/classic/彩球.png</file>
<file>faces/classic/钞票.png</file>
<file>faces/classic/车厢.png</file>
<file>faces/classic/打伞.png</file>
<file>faces/classic/灯笼.png</file>
<file>faces/classic/灯泡.png</file>
<file>faces/classic/多云.png</file>
<file>faces/classic/发财.png</file>
<file>faces/classic/飞机.png</file>
<file>faces/classic/风车.png</file>
<file>faces/classic/高铁右车头.png</file>
<file>faces/classic/高铁左车头.png</file>
<file>faces/classic/购物.png</file>
<file>faces/classic/喝彩.png</file>
<file>faces/classic/喝奶.png</file>
<file>faces/classic/开车.png</file>
<file>faces/classic/闹钟.png</file>
<file>faces/classic/祈祷.png</file>
<file>faces/classic/青蛙.png</file>
<file>faces/classic/沙发.png</file>
<file>faces/classic/手枪.png</file>
<file>faces/classic/帅.png</file>
<file>faces/classic/双喜.png</file>
<file>faces/classic/下面.png</file>
<file>faces/classic/下雨.png</file>
<file>faces/classic/香蕉.png</file>
<file>faces/classic/熊猫.png</file>
<file>faces/classic/药.png</file>
<file>faces/classic/邮件.png</file>
<file>faces/classic/纸巾.png</file>
<file>faces/classic/钻戒.png</file>
</qresource>
</RCC>
================================================
FILE: images.qrc
================================================
<RCC>
<qresource prefix="/">
<file>images/avatar.svg</file>
<file>images/avatar_left.png</file>
<file>images/avatar-border.svg</file>
<file>images/imaway.png</file>
<file>images/background_arabesquitic.svg</file>
<file>images/background_input.png</file>
<file>images/imbusy.png</file>
<file>images/button-login.svg</file>
<file>images/button-login-hover.svg</file>
<file>images/button-login-press.svg</file>
<file>images/button-minimize.svg</file>
<file>images/button-quit.svg</file>
<file>images/checkBox-hover.svg</file>
<file>images/imoffline.png</file>
<file>images/imonline.png</file>
<file>images/inputBox.svg</file>
<file>images/inputBox1.png</file>
<file>images/inputBox2.png</file>
<file>images/inputBox-close.svg</file>
<file>images/inputBox-more.svg</file>
<file>images/inputBox-password-clicked.svg</file>
<file>images/inputBox-password-hover.svg</file>
<file>images/inputBox-qq-clicked.svg</file>
<file>images/inputBox-qq-hover.svg</file>
<file>images/imhidden.png</file>
<file>images/list_arrow_down.png</file>
<file>images/list_arrow_up.png</file>
<file>images/list_item.png</file>
<file>images/list_item_bottom.png</file>
<file>images/lock20.png</file>
<file>images/login-panel.svg</file>
<file>images/login-panel-shadow.png</file>
<file>images/imsilent.png</file>
<file>images/progress-bar.png</file>
<file>images/imcallme.png</file>
<file>images/QQ-for-ubuntu.svg</file>
<file>images/soft-keyboard.svg</file>
<file>images/status-away-1.svg</file>
<file>images/status-busy-1.svg</file>
<file>images/status-callme-1.svg</file>
<file>images/status-hidden-1.svg</file>
<file>images/status-online-1.svg</file>
<file>images/status-silent-1.svg</file>
<file>images/unfold_icon.png</file>
<file>images/unlock20.png</file>
<file>images/checkBox-select.svg</file>
<file>images/checkBox-unselect.svg</file>
<file>images/bit.bmp</file>
<file>images/avatar.png</file>
<file>images/contact_press.png</file>
<file>images/group_press.png</file>
<file>images/TempSession_press.png</file>
<file>images/menu_background.png</file>
<file>images/button-settings.svg</file>
<file>images/inputBox1.svg</file>
<file>images/inputBox2.svg</file>
<file>images/bubble_放飞心情_left.png</file>
<file>images/bubble_放飞心情_right.png</file>
<file>images/bubble_经典_left.png</file>
<file>images/bubble_经典_right.png</file>
<file>images/bubble_祈福_left.png</file>
<file>images/bubble_祈福_right.png</file>
<file>images/bubble_微笑河马_left.png</file>
<file>images/bubble_微笑河马_right.png</file>
<file>images/friendList_select.svg</file>
<file>images/friendList_unselect.svg</file>
<file>images/groupList_select.svg</file>
<file>images/groupList_unselect.svg</file>
<file>images/recentList_select.svg</file>
<file>images/recentList_unselect.svg</file>
<file>images/未标题-1.png</file>
<file>images/star.png</file>
<file>images/greenStar.png</file>
<file>images/blueStar.png</file>
<file>images/login-panel2.svg</file>
<file>images/loading.png</file>
<file>images/dud.png</file>
<file>images/duz.png</file>
</qresource>
</RCC>
================================================
FILE: other.qrc
================================================
<RCC>
<qresource prefix="/">
<file>qt_zh_CN.qm</file>
</qresource>
</RCC>
================================================
FILE: qml/Api/QQApi.qml
================================================
import QtQuick 2.2
import utility 1.0
import QtQuick.Window 2.1
import QQItemInfo 1.0
import qqstars 1.0
QQ{
id: root
property string re_uin: ""//用来存放测试qq是否需要验证码后返回的uin值(密码加密中需要用到)
property var loginReData//二次登陆后返回的数据(JSON格式)
property var userData//储存用户资料(JSON格式)
property var panelSize//存放主面板大小(网络数据)
property string clientid//存放网络强求需要的clientid
property var friendListData//储存好友列表
property string list_hash//获取好友列表时需要的hash
property string ptwebqq//登录后返回的cookie
property string psessionid: loginReData?loginReData.psessionid:""//登录后返回的数据
property string vfwebqq: loginReData?loginReData.vfwebqq:""//登录后返回的数据
windowScale: {
var dosktopWidth = Screen.desktopAvailableWidth
if(dosktopWidth<=1366)
return 1
else if(dosktopWidth>1366&&dosktopWidth<=1600)
return 1.2
else if(dosktopWidth>1600&&dosktopWidth<=1920)
return 1.4
else if(dosktopWidth>1920&&dosktopWidth<=2300)
return 1.6
else if(dosktopWidth>2300&&dosktopWidth<=2600)
return 1.8
else if(dosktopWidth>2600)
return 2
}
onStateChanged: {
editUserState()//改变在线状态
}
function random(min,max){
return Math.floor(min+Math.random()*(max-min));
}
function getClientid() {
return String(random(0, 99)) + String((new Date()).getTime() % 1000000)
}
function showInputCodePage(callbackFun, uin) {
var component = Qt.createComponent("../Utility/CodeInput.qml");
if (component.status == Component.Ready){
var url = "https://ssl.captcha.qq.com/getimage?aid=1003903&r=0.9101365606766194&uin="+myqq.userQQ+"&cap_cd="+uin
var data = {"source": url, "backFun":callbackFun};
var sprite = component.createObject(null, data);
}
}
function login(code) {
if( myqq.loginStatus == QQ.Logining ){
if( code ) {//开始第一次登陆GET
var p = encryptionPassword(re_uin, code)
var url1 = "https://ssl.ptlogin2.qq.com/login?u="+myqq.userQQ+"&p="+p+"&verifycode="+code+"&webqq_type=10&remember_uin=1&login2qq=1&aid=1003903&u1=http%3A%2F%2Fweb2.qq.com%2Floginproxy.html%3Flogin2qq%3D1%26webqq_type%3D10&h=1&ptredirect=0&ptlang=2052&daid=164&from_ui=1&pttype=1&dumy=&fp=loginerroralert&action=5-42-29419&mibao_css=m_webqq&t=1&g=1&js_type=0&js_ver=10087&login_sig=0RH3iE1ODTjmJJtKJ5MtDyoG*Q*pwgh2ABgmvw0E0zjdJpjPBbS*H9aZ4WRwLSFk&pt_uistyle=5"
utility.httpGet(login1Finished, url1)
}else{//先检测qq号是否需要输入验证码
utility.socketAbort()//取消以前的网络请求
var url2 = "https://ssl.ptlogin2.qq.com/check?uin="+myqq.userQQ+"&appid=1003903&r=0.08757076971232891"
utility.httpGet(testQQFinished, url2)
}
}
}
function testQQFinished(error, data) {//服务器返回qq是否需要验证码
if(error){//如果出错了
login()
return
}
if( myqq.loginStatus == QQ.Logining ){
var temp = data.split("'")
re_uin = temp[5]//储存用来加密密码或获取验证码的uin
if( temp[1]=="0" ){
login(temp[3])//不需要验证码,直接登录
}else{
showCodeWindow(login, temp[3])//调用输入验证码,login为验证码获取成功后的回调函数
}
}
}
function login1Finished(error, data){//登录之后服务器返回的数据
if(error){//如果出错了
login(myqq.codeText)//再次请求
return
}
if( myqq.loginStatus == QQ.Logining ){
var list = data.split ("'");
if( list[1]==0 ){
closeCodeWindow()//关闭输入验证码的窗口
var url = list[5]//先get一下返回数据中的url,来获取必要的Cookie
utility.httpGet(login2, url)//此地址GET完成后调用二次登录
}else{
myqq.showWarningInfo("登录失败:"+list[9])
myqq.error(list[9])
}
}
}
function login2() {
if( myqq.loginStatus == QQ.Logining ){
var url = "http://d.web2.qq.com/channel/login2"
ptwebqq = utility.getCookie("ptwebqq")//储存cookie
list_hash = getHash()//储存hash
clientid = getClientid()//设置clientid
var data = 'r={"status":"'+myqq.stateToString+'","ptwebqq":"'+ptwebqq+'","passwd_sig":"","clientid":"'+clientid+'","psessionid":null}&clientid='+clientid+'&psessionid=null'
data = encodeURI(data)
utility.httpPost(login2Finished, url, data)
}
}
function reLogin(){//用于掉线后重新登录
var url = "http://d.web2.qq.com/channel/login2"
ptwebqq = utility.getCookie("ptwebqq")//储存cookie
var data = 'r={"status":"'+myqq.stateToString+'","ptwebqq":"'+ptwebqq+'","passwd_sig":"","clientid":"'+clientid+'","psessionid":null}&clientid='+clientid+'&psessionid=null'
data = encodeURI(data)
utility.httpPost(reLoginFinished, url, data, true)
}
function reLoginFinished(error, data) {
if(error){
reLogin()
return
}
data = JSON.parse(data)
if( data.retcode==0 ) {
console.debug("重新登录完成")
loginReData = data.result//将数据记录下来
var poll2data = 'r={"clientid":"'+clientid+'","psessionid":"'+psessionid+'","key":0,"ids":[]}&clientid='+clientid+'&psessionid='+psessionid
myqq.startPoll2(encodeURI(poll2data))//启动心跳包的post
}else{
console.debug("重新登录失败")
showWarningInfo("QQ已掉线,请重新登录")
root.loginStatus = QQ.WaitLogin//将登录状态设置为离线
}
}
function login2Finished(error, data) {//二次登录,这次才是真正的登录
if(error){//如果出错了
login2(null)
return
}
if( myqq.loginStatus == QQ.Logining ){
var list = JSON.parse(data)
if( list.retcode==0 ) {
loginReData = list.result//将数据记录下来
getUserData(myqq.userQQ, getDataFinished)//获取自己的资料
myqq.openSqlDatabase();//登录完成后,打开数据库(用来储存聊天记录)
myqq.loginStatus = QQ.LoginFinished//设置为登录成功
var poll2data = 'r={"clientid":"'+clientid+'","psessionid":"'+psessionid+'","key":0,"ids":[]}&clientid='+clientid+'&psessionid='+psessionid
myqq.startPoll2(encodeURI(poll2data))//启动心跳包的post
var url = "http://q.qlogo.cn/headimg_dl?spec=240&dst_uin="+myqq.userQQ
downloadImage(QQItemInfo.Friend, url, myqq.userQQ, "240", getAvatarFinished)//获取头像
}else{
myqq.showWarningInfo("登陆出错,错误代码:"+list.retcode)
}
}
}
function getUserData(uin, backFun) {//获取用户资料,登录完成后的操作
var url = "http://s.web2.qq.com/api/get_friend_info2?tuin="+uin+"&verifysession=&code=&vfwebqq="+vfwebqq+"&t=1407324674215"
utility.httpGet(backFun, url, true)//第三个参数为true,是使用高优先级的网络请求
}
function getDataFinished(error, data) {//获取用户资料成功后
if(error){//如果出错了
getUserData(myqq.userQQ, getDataFinished)//再次获取自己的资料
return
}
var list = JSON.parse(data)
if( list.retcode==0 ) {
userData = list.result
//console.debug("获取资料成功,我的昵称是:"+userData.nick)
root.nick = String(userData.nick)//储存昵称
myqq.addLoginedQQInfo(userQQ, nick)//保存此账号的登录信息
//getPanelSize()//获取主面板的大小
}else{
getUserData(myqq.userQQ, getDataFinished)//再次获取自己的资料
//myqq.showWarningInfo("获取用户资料出错,错误代码:"+list.retcode)
}
}
function getPanelSize() {
if( myqq.loginStatus == QQ.Logining ){
//var url = "http://cgi.web2.qq.com/keycgi/qqweb/newuac/get.do"
//var data = 'r={"appid":50,"itemlist":["width","height","defaultMode"]}&uin='+myqq.userQQ
//data = encodeURI(data)
//utility.httpPost(getPanelSizeFinished, url, data)
getPanelSizeFinished(false, "")
}
}
function getPanelSizeFinished ( error, data){
//var list = JSON.parse(data)
//if( list.retcode==0 ) {
//panelSize = list.result//保存获取的数据
//}else{
//utility.consoleLog("获取主面板大小出错,错误代码:"+list.retcode)
panelSize = JSON.parse('{"height":500,"defaultMode":"restore","width":240}')
//}
/*var temp = myqq.value("rememberpassword", 0)==1
console.log("是否保存密码:"+temp)
if( temp ){//如果要保存密码
var pass = utility.stringEncrypt(myqq.userPassword, "xingchenQQ")//加密后储存
//myqq.setValue("password", pass)
console.log("保存的密码为:"+myqq.value("password", ""))
}*/
//myqq.setValue( "nick", userData.nick)//保存昵称
}
function getQQSignature(uin, backFun){//获取好友个性签名 backFun为签名获取成功后调用
var url = "http://s.web2.qq.com/api/get_single_long_nick2?tuin="+uin+"&vfwebqq="+vfwebqq
utility.httpGet(backFun, url)
}
function getFriendList(backFun) {//获取好友列表
var url = "http://s.web2.qq.com/api/get_user_friends2"
var data = 'r={"h":"hello","hash":"'+getHash()+'","vfwebqq":"'+vfwebqq+'"}'
data = encodeURI(data)
utility.httpPost(backFun, url, data, true)
}
function getGroupList(backFun) {//获取群列表
var url = "http://s.web2.qq.com/api/get_group_name_list_mask2"
var data = 'r={"hash":"'+getHash()+'","vfwebqq":"'+vfwebqq+'"}'
data = encodeURI(data)
utility.httpPost(backFun, url, data, true)
}
function getRecentList(backFun) {//获取最近联系人
var url = "http://d.web2.qq.com/channel/get_recent_list2"
var data = 'r={"vfwebqq":"'+vfwebqq+'","clientid":"'+clientid+'","psessionid":"'+psessionid+'"}&clientid='+clientid+'&psessionid='+psessionid
data = encodeURI(data)
utility.httpPost(backFun, url, data, true)
}
function getDiscusList(backFun) {//讨论组列表
var url = "http://s.web2.qq.com/api/get_discus_list?clientid="+clientid+"&psessionid="+psessionid+"&vfwebqq="+vfwebqq
utility.httpGet(backFun, url, true)
}
function getFriendQQ( tuin, backFun ) {//获得好友真实的qq
var url = "http://s.web2.qq.com/api/get_friend_uin2?tuin="+tuin+"&verifysession=&type=1&code=&vfwebqq="+vfwebqq
utility.httpGet(backFun, url)
}
function getAvatarFinished( error, path, name ){//获得自己头像完成
if(error==DownloadImage.DownloadError){//如果是下载出错
downloadImage(QQItemInfo.Friend, url, myqq.userQQ, "240", getAvatarFinished)//重新获取头像
return
}
if(error==DownloadImage.NoError)
myqq.avatar240 = path+"/"+name
}
function getFriendInfo( tuin,backFun ) {//获取好友资料
var url = "http://s.web2.qq.com/api/get_friend_info2?tuin="+tuin+"&verifysession=&code=&vfwebqq="+vfwebqq
utility.httpGet(backFun, url)
}
function editUserState(){
if( loginStatus == QQ.LoginFinished ) {
var url = "http://d.web2.qq.com/channel/change_status2?newstatus="+myqq.stateToString+"&clientid="+clientid+"&psessionid="+psessionid
utility.httpGet(editUserStateFinished, url)
}
}
function editUserStateFinished(error, data){
if(error){
editUserState()//再次请求
return
}
data = JSON.parse(data)
if( data.retcode==0&&data.result=="ok" ){
console.log("状态改变成功")
if(root.state==QQ.Offline){//如果状态变为离线
root.loginStatus = QQ.WaitLogin//改变登录状态
}
}
}
function sendFriendMessage(backFun, uin, message){
while(message[message.length-1]=="\n"){
message = message.substr(0, message.length-1)
}
var url = "http://d.web2.qq.com/channel/send_buddy_msg2"
var data = 'r={"to":'+uin+',"face":549,"content":"[\\"'+message+'\\",\\"\\",[\\"font\\",{\\"name\\":\\"宋体\\",\\"size\\":\\"10\\",\\"style\\":[0,0,0],\\"color\\":\\"000000\\"}]]","msg_id":45070001,"clientid":"'+clientid+'","psessionid":"'+psessionid+'"}&clientid='+clientid+'&psessionid='+psessionid
data = encodeURI(data)
utility.httpPost(backFun, url, data, true)
}
function sendGroupMessage(backFun, uin, message){
while(message[message.length-1]=="\n"){
message = message.substr(0, message.length-1)
}
var url = "http://d.web2.qq.com/channel/send_qun_msg2"
var data = 'r={"group_uin":'+uin+',"content":"[\\"'+message+'\\",\\"\\",[\\"font\\",{\\"name\\":\\"宋体\\",\\"size\\":\\"10\\",\\"style\\":[0,0,0],\\"color\\":\\"000000\\"}]]","msg_id":29780002,"clientid":"'+clientid+'","psessionid":"'+psessionid+'"}&clientid='+clientid+'&psessionid='+psessionid
data = encodeURI(data)
utility.httpPost(backFun, url, data, true)
}
function sendDiscuMessage(backFun, uin, message){
while(message[message.length-1]=="\n"){
message = message.substr(0, message.length-1)
}
var url = "http://d.web2.qq.com/channel/send_discu_msg2"
var data = 'r={"did":'+uin+',"content":"[\\"'+message+'\\",\\"\\",[\\"font\\",{\\"name\\":\\"宋体\\",\\"size\\":\\"10\\",\\"style\\":[0,0,0],\\"color\\":\\"000000\\"}]]","msg_id":29780002,"clientid":"'+clientid+'","psessionid":"'+psessionid+'"}&clientid='+clientid+'&psessionid='+psessionid
data = encodeURI(data)
utility.httpPost(backFun, url, data, true)
}
function getGroupMembersList(callbackFun, gcode){//获取群成员列表
var url = "http://s.web2.qq.com/api/get_group_info_ext2?gcode="+gcode+"&cb=undefined&vfwebqq="+vfwebqq
utility.httpGet(callbackFun, url, true)
}
function getOnlineFriends(callbackFun){//获取在线好友列表
var url = "http://d.web2.qq.com/channel/get_online_buddies2?clientid="+clientid+"&psessionid="+psessionid
utility.httpGet(callbackFun, url, true)
}
function getDiscusMemberList(callbackFun, did) {//获取讨论组成员列表
var url = "http://d.web2.qq.com/channel/get_discu_info?did="+did+"&clientid="+clientid+"&psessionid="+psessionid
utility.httpGet(callbackFun, url, true)
}
}
================================================
FILE: qml/Api/api.js
================================================
var hexcase = 1;
var b64pad = "";
var chrsz = 8;
var mode = 32;
function md5(a) {
return hex_md5(a)
}
function hex_md5(a) {
return binl2hex(core_md5(str2binl(a), a.length * chrsz))
}
function str_md5(a) {
return binl2str(core_md5(str2binl(a), a.length * chrsz))
}
function hex_hmac_md5(a, b) {
return binl2hex(core_hmac_md5(a, b))
}
function b64_hmac_md5(a, b) {
return binl2b64(core_hmac_md5(a, b))
}
function str_hmac_md5(a, b) {
return binl2str(core_hmac_md5(a, b))
}
function core_md5(p, k) {
p[k >> 5] |= 128 << ((k) % 32);
p[(((k + 64) >>> 9) << 4) + 14] = k;
var o = 1732584193;
var n = -271733879;
var m = -1732584194;
var l = 271733878;
for (var g = 0; g < p.length; g += 16) {
var j = o;
var h = n;
var f = m;
var e = l;
o = md5_ff(o, n, m, l, p[g + 0], 7, -680876936);
l = md5_ff(l, o, n, m, p[g + 1], 12, -389564586);
m = md5_ff(m, l, o, n, p[g + 2], 17, 606105819);
n = md5_ff(n, m, l, o, p[g + 3], 22, -1044525330);
o = md5_ff(o, n, m, l, p[g + 4], 7, -176418897);
l = md5_ff(l, o, n, m, p[g + 5], 12, 1200080426);
m = md5_ff(m, l, o, n, p[g + 6], 17, -1473231341);
n = md5_ff(n, m, l, o, p[g + 7], 22, -45705983);
o = md5_ff(o, n, m, l, p[g + 8], 7, 1770035416);
l = md5_ff(l, o, n, m, p[g + 9], 12, -1958414417);
m = md5_ff(m, l, o, n, p[g + 10], 17, -42063);
n = md5_ff(n, m, l, o, p[g + 11], 22, -1990404162);
o = md5_ff(o, n, m, l, p[g + 12], 7, 1804603682);
l = md5_ff(l, o, n, m, p[g + 13], 12, -40341101);
m = md5_ff(m, l, o, n, p[g + 14], 17, -1502002290);
n = md5_ff(n, m, l, o, p[g + 15], 22, 1236535329);
o = md5_gg(o, n, m, l, p[g + 1], 5, -165796510);
l = md5_gg(l, o, n, m, p[g + 6], 9, -1069501632);
m = md5_gg(m, l, o, n, p[g + 11], 14, 643717713);
n = md5_gg(n, m, l, o, p[g + 0], 20, -373897302);
o = md5_gg(o, n, m, l, p[g + 5], 5, -701558691);
l = md5_gg(l, o, n, m, p[g + 10], 9, 38016083);
m = md5_gg(m, l, o, n, p[g + 15], 14, -660478335);
n = md5_gg(n, m, l, o, p[g + 4], 20, -405537848);
o = md5_gg(o, n, m, l, p[g + 9], 5, 568446438);
l = md5_gg(l, o, n, m, p[g + 14], 9, -1019803690);
m = md5_gg(m, l, o, n, p[g + 3], 14, -187363961);
n = md5_gg(n, m, l, o, p[g + 8], 20, 1163531501);
o = md5_gg(o, n, m, l, p[g + 13], 5, -1444681467);
l = md5_gg(l, o, n, m, p[g + 2], 9, -51403784);
m = md5_gg(m, l, o, n, p[g + 7], 14, 1735328473);
n = md5_gg(n, m, l, o, p[g + 12], 20, -1926607734);
o = md5_hh(o, n, m, l, p[g + 5], 4, -378558);
l = md5_hh(l, o, n, m, p[g + 8], 11, -2022574463);
m = md5_hh(m, l, o, n, p[g + 11], 16, 1839030562);
n = md5_hh(n, m, l, o, p[g + 14], 23, -35309556);
o = md5_hh(o, n, m, l, p[g + 1], 4, -1530992060);
l = md5_hh(l, o, n, m, p[g + 4], 11, 1272893353);
m = md5_hh(m, l, o, n, p[g + 7], 16, -155497632);
n = md5_hh(n, m, l, o, p[g + 10], 23, -1094730640);
o = md5_hh(o, n, m, l, p[g + 13], 4, 681279174);
l = md5_hh(l, o, n, m, p[g + 0], 11, -358537222);
m = md5_hh(m, l, o, n, p[g + 3], 16, -722521979);
n = md5_hh(n, m, l, o, p[g + 6], 23, 76029189);
o = md5_hh(o, n, m, l, p[g + 9], 4, -640364487);
l = md5_hh(l, o, n, m, p[g + 12], 11, -421815835);
m = md5_hh(m, l, o, n, p[g + 15], 16, 530742520);
n = md5_hh(n, m, l, o, p[g + 2], 23, -995338651);
o = md5_ii(o, n, m, l, p[g + 0], 6, -198630844);
l = md5_ii(l, o, n, m, p[g + 7], 10, 1126891415);
m = md5_ii(m, l, o, n, p[g + 14], 15, -1416354905);
n = md5_ii(n, m, l, o, p[g + 5], 21, -57434055);
o = md5_ii(o, n, m, l, p[g + 12], 6, 1700485571);
l = md5_ii(l, o, n, m, p[g + 3], 10, -1894986606);
m = md5_ii(m, l, o, n, p[g + 10], 15, -1051523);
n = md5_ii(n, m, l, o, p[g + 1], 21, -2054922799);
o = md5_ii(o, n, m, l, p[g + 8], 6, 1873313359);
l = md5_ii(l, o, n, m, p[g + 15], 10, -30611744);
m = md5_ii(m, l, o, n, p[g + 6], 15, -1560198380);
n = md5_ii(n, m, l, o, p[g + 13], 21, 1309151649);
o = md5_ii(o, n, m, l, p[g + 4], 6, -145523070);
l = md5_ii(l, o, n, m, p[g + 11], 10, -1120210379);
m = md5_ii(m, l, o, n, p[g + 2], 15, 718787259);
n = md5_ii(n, m, l, o, p[g + 9], 21, -343485551);
o = safe_add(o, j);
n = safe_add(n, h);
m = safe_add(m, f);
l = safe_add(l, e)
}
if (mode == 16) {
return Array(n, m)
} else {
return Array(o, n, m, l)
}
}
function md5_cmn(h, e, d, c, g, f) {
return safe_add(bit_rol(safe_add(safe_add(e, h), safe_add(c, f)), g), d)
}
function md5_ff(g, f, k, j, e, i, h) {
return md5_cmn((f & k) | ((~f) & j), g, f, e, i, h)
}
function md5_gg(g, f, k, j, e, i, h) {
return md5_cmn((f & j) | (k & (~j)), g, f, e, i, h)
}
function md5_hh(g, f, k, j, e, i, h) {
return md5_cmn(f ^ k ^ j, g, f, e, i, h)
}
function md5_ii(g, f, k, j, e, i, h) {
return md5_cmn(k ^ (f | (~j)), g, f, e, i, h)
}
function core_hmac_md5(c, f) {
var e = str2binl(c);
if (e.length > 16) {
e = core_md5(e, c.length * chrsz)
}
var a = Array(16),
d = Array(16);
for (var b = 0; b < 16; b++) {
a[b] = e[b] ^ 909522486;
d[b] = e[b] ^ 1549556828
}
var g = core_md5(a.concat(str2binl(f)), 512 + f.length * chrsz);
return core_md5(d.concat(g), 512 + 128)
}
function safe_add(a, d) {
var c = (a & 65535) + (d & 65535);
var b = (a >> 16) + (d >> 16) + (c >> 16);
return (b << 16) | (c & 65535)
}
function bit_rol(a, b) {
return (a << b) | (a >>> (32 - b))
}
function str2binl(d) {
var c = Array();
var a = (1 << chrsz) - 1;
for (var b = 0; b < d.length * chrsz; b += chrsz) {
c[b >> 5] |= (d.charCodeAt(b / chrsz) & a) << (b % 32)
}
return c
}
function binl2str(c) {
var d = "";
var a = (1 << chrsz) - 1;
for (var b = 0; b < c.length * 32; b += chrsz) {
d += String.fromCharCode((c[b >> 5] >>> (b % 32)) & a)
}
return d
}
function binl2hex(c) {
var b = hexcase ? "0123456789ABCDEF": "0123456789abcdef";
var d = "";
for (var a = 0; a < c.length * 4; a++) {
d += b.charAt((c[a >> 2] >> ((a % 4) * 8 + 4)) & 15) + b.charAt((c[a >> 2] >> ((a % 4) * 8)) & 15)
}
return d
}
function binl2b64(d) {
var c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var f = "";
for (var b = 0; b < d.length * 4; b += 3) {
var e = (((d[b >> 2] >> 8 * (b % 4)) & 255) << 16) | (((d[b + 1 >> 2] >> 8 * ((b + 1) % 4)) & 255) << 8) | ((d[b + 2 >> 2] >> 8 * ((b + 2) % 4)) & 255);
for (var a = 0; a < 4; a++) {
if (b * 8 + a * 6 > d.length * 32) {
f += b64pad
} else {
f += c.charAt((e >> 6 * (3 - a)) & 63)
}
}
}
return f
}
function hexchar2bin(str) {
var arr = [];
for (var i = 0; i < str.length; i = i + 2) {
arr.push("\\x" + str.substr(i, 2))
}
arr = arr.join("");
eval("var temp = '" + arr + "'");
return temp
}
function uin2hex(str) {
var maxLength = 16;
str = parseInt(str);
var hex = str.toString(16);
var len = hex.length;
for (var i = len; i < maxLength; i++) {
hex = "0" + hex
}
var arr = [];
for (var j = 0; j < maxLength; j += 2) {
arr.push("\\x" + hex.substr(j, 2))
}
var result = arr.join("");
eval('result="' + result + '"');
return result
}
function hexToString( hex ) {
var temp = hex.split("\\x")
hex = ""
for( var i=1;i<temp.length;++i ) {
hex += ("%"+temp[i])
}
return unescape(hex)
}
function encryptionPassword( password , uin ,code) {
var j = hexchar2bin(md5(password));
var h = md5(j + hexToString(uin));
var g = md5(h + code.toUpperCase());
return g;
}
function getHash(b, j) {//b为自己的uin(qq号),j为ptwebqq,获取地址http://web.qstatic.com/webqqpic/pubapps/0/50/eqq.all.js
for (var a = j + "password error",
i = "",
E = [];;) if (i.length <= a.length) {
if (i += b, i.length == a.length) break
} else {
i = i.slice(0, a.length);
break
}
for (var c = 0; c < i.length; c++) E[c] = i.charCodeAt(c) ^ a.charCodeAt(c);
a = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
i = "";
for (c = 0; c < E.length; c++) i += a[E[c] >> 4 & 15],
i += a[E[c] & 15];
return i;
}
================================================
FILE: qml/Chat/ChatPage.qml
================================================
import QtQuick 2.2
import utility 1.0
import mywindow 1.0
import QQItemInfo 1.0
import "../"
import "../Utility"
Item{
id: root
anchors.fill: parent
property string myuin
property int type//记录自己的类型(好友,群,讨论组)
signal sendClicked//点击发送按钮好调用此函数
property alias menuBar: menu_bar
property alias rightBar: right_bar
property alias inputBox: input
property alias listModel: mymodel
property QQItemInfo myinfo//用来储存自己的各种信息(用uin标识)
onMyinfoChanged: {
if(myinfo){//从缓冲区中读取数据
var message_list = myinfo.getChatRecords()//获取内存中的所有聊天记录
for(var i=0;i<message_list.size();++i){
var messageInfo = message_list.at(i)//读取第i条消息
var data = {
"sender_info":myqq.createFriendInfo(messageInfo.senderUin),//发送者的info
"to_uin":"",//如果mode为right才需要此值(为发送给谁)
"mode": messageInfo.senderUin==myqq.userQQ?"right":"left",//要判断发送者是不是自己(这条消息是发送的还是接收的)
"message_info": messageInfo,//此消息的各种信息
"parent_info": myinfo
}
listModel.append(data)
}
scroll_list.contentAtEnd()//将内容拉到最后
}
}
Connections{
target: myqq//记录自己各种信息的类对象
onNewMessage:{
if(fromUin==myuin&&type == myinfo.mytype){
var data = {
"sender_info":myqq.createFriendInfo(info.senderUin),//发送者的info
"to_uin": "",
"mode": "left",//要判断发送者是不是自己(这条消息是发送的还是接收的)
"message_info": info,//消息内容
"parent_info": myinfo
}
var temp = scroll_list.isContentEnd()//记录是否应该讲聊天页面拉到最后
listModel.append(data)
if(temp){
scroll_list.contentAtEnd()//将内容拉到最后
}
}
}
}
MyShortcut{
target: input
shortcut: "Ctrl+Return"
onTrigger: {
input.insert(input.cursorPosition, "<br>")
}
}
MyShortcut{
target: input
shortcut: "Ctrl+Enter"
onTrigger: {
input.insert(input.cursorPosition, "<br>")
}
}
MyShortcut{
target: input
shortcut: "Return"
onTrigger: {
button_send.clicked()
}
}
MyShortcut{
target: input
shortcut: "Enter"
onTrigger: {
button_send.clicked()
}
}
Rectangle{
anchors.fill: parent
color: "#eee"
radius: 10
Item{
id: menu_bar
height: 30
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
}
Item{
id: right_bar
anchors.top: menu_bar.bottom
anchors.right: parent.right
anchors.bottom: parent.bottom
width: 180
}
MyTextArea{
id: input
//font.pointSize: 12
//wrapMode: TextEdit.Wrap
anchors.bottom: button_send.top
anchors.left: parent.left
anchors.right: right_bar.left
anchors.margins: 10
height: 100
}
MyButton{
id: button_send
anchors.right: right_bar.left
anchors.bottom: parent.bottom
anchors.margins: 10
text: "发送"
property int image_index: 0
onClicked: {
inputBox.selectAll()//先选中全部
var messageInfo = myinfo.getChatMessageInfoById(myinfo.getMessageIndex())
//创建一个新的聊天储存聊天内容各种信息的对象(例如发送时间等等)
messageInfo.contentData = input.selectedText
messageInfo.senderUin = myqq.userQQ//发送者为当前登录的qq
var data = {
"sender_info":myqq,//发送者是当前登录的用户qq
"to_uin":myuin,//发送给当前聊天页的好友或群
"mode": "right",
"message_info": messageInfo,
"parent_info": myinfo
}
listModel.append(data)
inputBox.text = ""
scroll_list.contentAtEnd()//将内容放到最后
}
}
Rectangle{
anchors.top: menu_bar.bottom
anchors.right: right_bar.left
anchors.bottom: input.top
anchors.left: parent.left
anchors.margins: 10
radius: 5
color: "#f5f5f5"
border.width: 2
border.color: "#ddd"
MyScrollView{
id: scroll_list
anchors.fill: parent
anchors.margins: 5
function contentAtEnd(){
var flickableItem = scroll_list.flickableItem
flickableItem.contentY = flickableItem.contentHeight-scroll_list.height+60
//console.debug(flickableItem.contentY+","+(flickableItem.contentHeight-scroll_list.height+60))
}
function isContentEnd(){
var flickableItem = scroll_list.flickableItem
//console.debug(flickableItem.contentY+","+(flickableItem.contentHeight-scroll_list.height-5))
return flickableItem.contentY > flickableItem.contentHeight-scroll_list.height-5
}
Item{
height: list.contentHeight+10
width: scroll_list.width-25
x:5
implicitHeight: height
implicitWidth: width
ListView{
id: list
anchors.fill: parent
spacing: 10
property int old_contentHeight: 0
model: ListModel{
id: mymodel
}
delegate: MessageListComponent{}
}
}
}
}
}
}
================================================
FILE: qml/Chat/ChatWindowCommand.qml
================================================
import QtQuick 2.2
import utility 1.0
import mywindow 1.0
import QQItemInfo 1.0
import "../Utility"
MyWindow{
id: root
property ChatPage currentShowPage//记录当前显示中的聊天页面
property int chatPageWidth: myqq.value("chatPageWidth", 600)//获取聊天页面的width, 初始化为600,聊天也的width
visible: true
minimumHeight: 500
minimumWidth: item_chatPage.minWidth+left_bar.width//设置最小宽度
width: left_bar.width+item_chatPage.width
noBorder: true//无边框的
removable: true//可移动的
fixedSize: false//固定大小的
dockableWindow: false//可停靠的
topHint: false//窗口保持在最前端
noNotifyIcon:false//隐藏任务栏图标
color: "transparent"
windowGlowItem.color: "black"//"#f07000"
windowIcon: currentShowPage?currentShowPage.myinfo.avatar40:"qrc:/images/avatar.png"
setLeftBorder: function(arg){
if(left_bar.isOpen&&left_bar.setBarDefaultWidth(left_bar.defaultWidth+arg)){//如果窗口大小设置成功
root.mySetLeftBorder(arg)//设置窗口位置
}else if(!left_bar.isOpen){
if(item_chatPage.setPageWidth(chatPageWidth+arg)){
root.mySetLeftBorder(arg)
}
}
}
setRightBorder: function(arg){
if(item_chatPage.setPageWidth(chatPageWidth+arg)){
root.mySetRightBorder(arg)
}
}
onVisibleChanged: {
if(visible)
root.showFront()//显示到最屏幕最前端
}
function setCurrentShowPage(page){
//console.log(page+","+currentShowPage)
if(currentShowPage!==page&&page){//判断是否page就是当前活动页面
page.myinfo.isActiveChatPage=true//将他信息中是否为活跃页面的属性设置为true
page.visible = true
if(currentShowPage){
currentShowPage.visible = false//先将旧的page设置为隐藏
currentShowPage.myinfo.isActiveChatPage=false//将他信息中是否为活跃页面的属性设置为false
}
currentShowPage = page//
}
}
Item{
id: item_chatPage
property int maxWidth: 99999
property int minWidth: 500
objectName: "ChatWindowCommandItem"
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: left_bar.right
width: chatPageWidth
function setPageWidth(arg){
if(arg<=maxWidth&&arg>=minWidth){
chatPageWidth = arg
return true
}else{
return false
}
}
Rectangle{
anchors.left: parent.left
color: "#eee"
width: 10
height: width
visible: left_bar.width>0
}
Rectangle{
anchors.bottom: parent.bottom
anchors.left: parent.left
color: "#eee"
width: 10
height: width
visible: left_bar.width>0
}
}
Connections{
target: myqq
onAddChatPageToWindow:{
setCurrentShowPage(item)//设置当前显示的页面为item
left_bar.addItem(item)//增加左栏
}
onActiveChatPageChanged:{//如果活跃的Page改变为item
//console.log(item)
setCurrentShowPage(item)//设置当前显示的页面为item
}
}
Rectangle{//用来管理当前聊天窗口内聊天页面的左栏
id:left_bar
property bool isOpen: false//记录此栏是否处于打开状态
property int maxWidth:200
property int minWidth:70
property int defaultWidth: myqq.value("chatWindowLeftBarWidth", 150)//获取上次储存的值
anchors.top: parent.top
anchors.left: parent.left
anchors.bottom: parent.bottom
color:"#ddd"
radius:10
clip: true
onDefaultWidthChanged: {
if(isOpen){//如果是打开状态
setBarWidth(defaultWidth)//如果默认宽度改变就设置此栏的当前width
}
}
onWidthChanged: {
root.width = width+chatPageWidth//设置窗口的大小
}
function openBar(){
console.debug("调用了打开侧栏:"+isOpen)
if(!animation_width.running&&(!isOpen)){
isOpen = true
animation_width.to = defaultWidth
animation_width.start()//启动动画
}
}
function hideBar(){
if(!animation_width.running&&isOpen){
isOpen = false
animation_width.to = 0
animation_width.start()//启动动画
}
}
function setBarDefaultWidth(arg){//设置默认的width
if(arg<=maxWidth&&arg>=minWidth){
defaultWidth = arg
return true
}else{
return false
}
}
function addItem(item){
var data={
"obj_item": item
}
mymodel.append(data)//增加条目
}
function setBarWidth(arg){
if(arg<=maxWidth&&arg>=minWidth){
width = arg
}
}
NumberAnimation{//动画控件
id: animation_width
target: left_bar
running: false
duration: 300
property: "width"
}
Rectangle{
anchors.right: parent.right
color: left_bar.color
width: parent.radius
height: width
visible: parent.width>0
}
Rectangle{
anchors.bottom: parent.bottom
anchors.right: parent.right
color: left_bar.color
width: parent.radius
height: width
visible: parent.width>0
}
MyScrollView{
anchors.fill: parent
anchors.topMargin: image_quit_icon.height+15
Item{
height: mymodel.count*45+10
width: left_bar.width
implicitHeight: height
implicitWidth: width
ListView{
id: list
interactive: false
anchors.fill: parent
anchors.margins: 5
model: ListModel{
id:mymodel
onCountChanged: {
if(count <= 1){//如果没有了Item就让左栏的width为0
left_bar.hideBar()//隐藏此栏
}else if(count==2){
left_bar.openBar()//打开此栏
}
}
}
spacing :10
delegate: component
}
}
}
Component{
id: component
Item{
id: item_root
width: parent.width
height: avatar.height
property ChatPage my: obj_item
Rectangle{
id: rect_hover
width: parent.width+10
height: parent.height+10
anchors.centerIn: parent
color: root.currentShowPage==my?"#f07000":"#eee"
radius: 5
opacity: 0.8
visible: item_mouse.hovered||root.currentShowPage==my
}
MouseArea{
id: item_mouse
anchors.fill: parent
hoverEnabled: true
property bool hovered
onEntered: {
hovered = true
}
onExited: {
hovered = false
}
onClicked: {
setCurrentShowPage(my)//将自己设置为活跃页面
}
}
MyImage{
id: avatar
x:10
width:35
height: 35
sourceSize.width: width
grayscale: {//头像是否显示为黑白
if(my)
return my.myinfo.state == FriendInfo.Offline
return false
}
source: {
if(my!==null)
return my.myinfo.avatar40
else
return ""
}
maskSource: "qrc:/images/bit.bmp"
}
Text{
id:text_nick
anchors.verticalCenter: avatar.verticalCenter
anchors.left: avatar.right
anchors.leftMargin: 10
//font.pointSize: 14
text: my?my.myinfo.aliasOrNick:""
}
Rectangle{
width: image_close_page.width+16
height: image_close_page.height+10
anchors.centerIn: image_close_page
color: "#eee"
radius: 5
opacity: 0.75
visible: image_close_page.visible&&root.currentShowPage!=my
}
Rectangle{
width: text_message_count.implicitWidth+10
height: image_close_page.width
anchors.right: rect_hover.right
anchors.rightMargin: 5
anchors.verticalCenter: parent.verticalCenter
color: "red"
radius: height
visible: my?my.myinfo.unreadMessagesCount>0:false
Text{
id: text_message_count
anchors.centerIn: parent
text: my?my.myinfo.unreadMessagesCount:"0"//未读消息的个数
color: "white"
onTextChanged: {
if(text == "100"){
text = "99+"
}
}
}
}
SvgView{
id:image_close_page
width: defaultSize.width*myqq.windowScale
source: "qrc:/images/button-quit.svg"
anchors.right: rect_hover.right
anchors.rightMargin: 5
anchors.verticalCenter: parent.verticalCenter
visible: item_mouse.hovered
MouseArea{
anchors.fill: parent
onClicked: {
mymodel.remove(index)//移除自己
myqq.removeChatPage(my.myuin, my.type)//移除聊天页面
}
}
}
}
}
MouseArea{//接收这栏右边的鼠标事件
cursorShape :enabled?Qt.SizeHorCursor:Qt.ArrowCursor
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
height: root.height
width: 2
property real pressedX: 0
property real pressedY: 0
onPressed: {
pressedX = mouseX
}
onPositionChanged: {
var num_temp = mouseX-pressedX
left_bar.setBarDefaultWidth(left_bar.defaultWidth+num_temp)//设置左栏的width
}
}
}
SvgView{
id:image_quit_icon
width: defaultSize.width*myqq.windowScale
source: "qrc:/images/button-quit.svg"
anchors.left: parent.left
anchors.top: parent.top
anchors.margins: 10
MouseArea{
anchors.fill: parent
onClicked: {
root.close()//关闭窗口
mymodel.clear()//清除所有model
}
}
}
SvgView{
id:image_minimize_icon
width: defaultSize.width*myqq.windowScale
source: "qrc:/images/button-minimize.svg"
anchors.top: image_quit_icon.top
anchors.left: image_quit_icon.right
MouseArea{
anchors.fill: parent
onClicked: {
root.showMinimized()
}
}
}
}
================================================
FILE: qml/Chat/DiscuChatPage.qml
================================================
import QtQuick 2.2
import utility 1.0
import QQItemInfo 1.0
import mywindow 1.0
import "../Utility"
ChatPage{
id: root
myinfo: myuin!=""?myqq.createDiscuInfo(myuin):null
onMyinfoChanged: {
if(!myinfo)
return
if(myinfo.membersCount>0){//如果成员列表已经存在就直接添加到list中
for(var i=0;i<myinfo.membersCount;++i){
mymodel.append({"obj_info": myinfo.getMemberInfoByIndex(i)})
}
}else if(myinfo.uin!=""){//去获取群列表
myqq.getDiscusMemberList(getMembersListFinished, myinfo.uin)
}
}
function getMembersListFinished(error, data){//获取群成员列表完成
if(error){
myqq.getDiscusMemberList(getMembersListFinished, myinfo.uin)//如果出错就再次获取
console.debug("获取讨论组成员列表出错:"+data)
return
}
data = JSON.parse(data)
if( data.retcode == 0 ){
var members = data.result.mem_info
for(var j in members){
//console.debug(members[j].uin+","+members[j].nick)
var info = myqq.createFriendInfo(members[j].uin)
//console.debug(members[j].uin+","+members[j].nick)
info.nick = members[j].nick//储存讨论组成员昵称
//console.debug(members[j].uin+","+members[j].nick)
root.myinfo.addMember(info)//将讨论组成员添加进去
//console.debug(members[j].uin+","+members[j].nick)
}
members = data.result.mem_status
for( j in members ){//设置讨论组成员的在线状态
info = myqq.createFriendInfo(members[j].uin)
info.stateToString = members[j].status
}
}
}
Rectangle{
parent: rightBar
anchors.fill: parent
anchors.margins: 10
anchors.leftMargin: 0
radius: 5
color: "#f5f5f5"
border.width: 2
border.color: "#ddd"
MyScrollView{
id: scroll_list
anchors.fill: parent
Item{
height: list_member.contentHeight+10
width: scroll_list.width-25
x:5
implicitHeight: height
implicitWidth: width
ListView{
id: list_member
anchors.fill: parent
model: ListModel{
id: mymodel
}
delegate: Item{
id: item_root
property FriendInfo myinfo: obj_info
height: 30
width: parent.width
MyImage{
id: image_avatar
width: 24
height: 24
sourceSize.width: width
anchors.verticalCenter: parent.verticalCenter
grayscale: item_root.myinfo.state==FriendInfo.Offline
maskSource: "qrc:/images/bit.bmp"
source: item_root.myinfo.avatar40
}
Text{
anchors.verticalCenter: image_avatar.verticalCenter
anchors.left: image_avatar.right
anchors.leftMargin: 5
anchors.right: parent.right
elide:Text.ElideRight
text: item_root.myinfo.aliasOrNick+"("+item_root.myinfo.account+")"
}
MouseArea{
anchors.fill: parent
onDoubleClicked: {
myqq.addChatPage(item_root.myinfo.uin, QQItemInfo.Friend)//双击开始聊天
}
}
}
}
Connections{
target: root.myinfo
onMemberIncrease:{//增加item
mymodel.append({"obj_info": info})
}
onMemberReduce:{//移除item
mymodel.remove(index)
}
}
}
}
}
}
================================================
FILE: qml/Chat/FriendChatPage.qml
================================================
import QtQuick 2.2
import utility 1.0
import "../QQItemInfo"
ChatPage{
id: root
myinfo: myuin!=""?myqq.createFriendInfo(myuin):null
rightBar.width: 0//设置右边栏宽度为0
Connections{
target: myqq
onShakeWindow:{
if(fromUin==myuin){
console.log("窗口震动消息")
myqq.shakeChatMainWindow(root)//抖动聊天窗口
}
}
onFriendInputNotify:{
if(fromUin==myuin){
console.log("正在输入消息")
show_text.text = myinfo.aliasOrNick+"正在输入"
}
}
}
Timer{
id: timer_show_text
interval: 2000
onTriggered: {
show_text.text = ""
}
}
Text{
id: show_text
parent: menuBar
anchors.right: parent.right
anchors.rightMargin: 10
verticalAlignment: Text.AlignVCenter
anchors.verticalCenter: parent.verticalCenter
onTextChanged: {
if(text!=""){
timer_show_text.start()
}
}
}
}
================================================
FILE: qml/Chat/GroupChatPage.qml
================================================
import QtQuick 2.2
import utility 1.0
import mywindow 1.0
import QQItemInfo 1.0
import "../Utility"
ChatPage{
id: root
myinfo: myuin!=""?myqq.createGroupInfo(myuin):null
onMyinfoChanged: {
if(!myinfo)
return
if(myinfo.membersCount>0){//如果成员列表已经存在就直接添加到list中
for(var i=0;i<myinfo.membersCount;++i){
mymodel.append({"obj_info": myinfo.getMemberInfoByIndex(i)})
}
}else if(myinfo.code!=""){//去获取群列表
myqq.getGroupMembersList(getMembersListFinished, myinfo.code)
}
}
function getMembersListFinished(error, data){//获取群成员列表完成
if(error){
myqq.getGroupMembersList(getMembersListFinished, myinfo.code)//如果出错就再次获取
console.debug("获取群成员列表出错:"+data)
return
}
data = JSON.parse(data)
if( data.retcode == 0 ){
myinfo.announcement = data.result.ginfo.memo//设置群公告
var members = data.result.cards
for ( var i in members ){
root.myinfo.setMemberCard(members[i].muin, members[i].card)//储存群名片
}
members = data.result.minfo
for(var j in members){
var info = myqq.createFriendInfo(members[j].uin)
info.nick = members[j].nick//储存群成员昵称
root.myinfo.addMember(info)//将群成员添加进去
}
members = data.result.stats
for(j in members){//设置群成员的在线状态
info = myqq.createFriendInfo(members[j].uin)
switch(members[j].stat){
case 10://在线
info.state = FriendInfo.Online
break;
case 60://Q我吧
info.state = FriendInfo.Callme
break;
case 30://离开
info.state = FriendInfo.Away
break;
case 40://隐身
info.state = FriendInfo.Hidden
break;
case 50://忙碌
info.state = FriendInfo.Busy
break;
case 70://请勿打扰
info.state = FriendInfo.Silent
break;
default: break;
}
}
}
}
Item{
parent: rightBar
anchors.fill: parent
Rectangle{
id: group_announcement//群公告
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
height: width
anchors.margins: 10
anchors.leftMargin: 0
radius: 5
color: "#f5f5f5"
border.width: 2
border.color: "#ddd"
Text{
id: text_announcement
text: myinfo.announcement//群公告
anchors.fill: parent
anchors.margins: 10
wrapMode: Text.WordWrap
elide:Text.ElideRight
}
}
Rectangle{
anchors.top: group_announcement.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: 10
anchors.leftMargin: 0
radius: 5
color: "#f5f5f5"
border.width: 2
border.color: "#ddd"
MyScrollView{
id: scroll_list
anchors.fill: parent
Item{
height: mymodel.count*30+10
width: scroll_list.width-25
x:5
implicitHeight: height
implicitWidth: width
ListView{
id: list_member
anchors.fill: parent
model: ListModel{
id: mymodel
}
delegate: Item{
id: item_root
property FriendInfo myinfo: obj_info
height: 30
width: parent.width
MyImage{
id: image_avatar
width: 24
height: 24
sourceSize.width: width
anchors.verticalCenter: parent.verticalCenter
maskSource: "qrc:/images/bit.bmp"
grayscale: item_root.myinfo.state==FriendInfo.Offline
source: item_root.myinfo.avatar40
}
Text{
anchors.verticalCenter: image_avatar.verticalCenter
anchors.left: image_avatar.right
anchors.leftMargin: 5
anchors.right: parent.right
elide:Text.ElideRight
text: root.myinfo.getMemberCardByUin(
item_root.myinfo.uin,
item_root.myinfo.aliasOrNick)+
"("+item_root.myinfo.account+")"
}
MouseArea{
anchors.fill: parent
onDoubleClicked: {
myqq.addChatPage(item_root.myinfo.uin, QQItemInfo.Friend)//双击开始聊天
}
}
}
}
Connections{
target: root.myinfo
onMemberIncrease:{//增加item
mymodel.append({"obj_info": info})
}
onMemberReduce:{//移除item
mymodel.remove(index)
}
}
}
}
}
}
}
================================================
FILE: qml/Chat/MessageListComponent.qml
================================================
import QtQuick 2.2
import mywindow 1.0
import QQItemInfo 1.0
import MyTextEditPlugin 1.0
import "../Utility"
Component{
Item{
id: root
width: parent.width
height: nick.implicitHeight+backgound.height+backgound.anchors.topMargin
property FriendInfo myinfo: sender_info
//这条消息的发送者的信息,好友发送的话就是你的好友本身,群里边就是此条群消息的发送者
property QQItemInfo parentInfo: parent_info
//消息属主的info,好友里面就是你的好友本身,群里边就是群本身
property ChatMessageInfo messageInfo: message_info
//这条消息自身的信息,千万不要和parentInfo和myinfo搞混了
property string toUin: to_uin
property var sendMessage: {
if(!parentInfo)
return null
switch(parentInfo.mytype){
case QQItemInfo.Friend:
return myqq.sendFriendMessage
case QQItemInfo.Group:
return myqq.sendGroupMessage
case QQItemInfo.Discu:
return myqq.sendDiscuMessage
default:{
return
}
}
}
Component.onCompleted: {
//console.log(message)//输出消息内容
if(sendMessage&&mode=="right"&&toUin!=""){//如果为模式right代表是要发送消息
sendMessage(sendMessageFinished, toUin, messageInfo.contentData)//发送消息
}
}
function sendMessageFinished(error, data){//如果这个Item发送信息,此函数用来接收发送结果
//console.log(data)
if(!error){//如果没有出错
data = JSON.parse(data)
if(data.retcode==0&&data.result=="ok"){
var date_time = new Date
messageInfo.date = date_time.getDate()
messageInfo.time = date_time.getTime()
parentInfo.addChatRecord(messageInfo)//将聊天记录保存到内存当中
console.debug("消息发送成功")
}else{
console.log("发送失败")
mytext.append('<font color="red">[发送失败]</font>')
messageInfo.destroy()//销毁此对象
}
}else{
console.log("发送失败")
mytext.text+=":发送失败"
}
}
MyImage{
id: avatar
x:mode=="left"?0:root.width-width
width:40
height: 40
sourceSize.width: width
maskSource: "qrc:/images/bit.bmp"
source: root.myinfo.avatar40
onLoadError: {
avatar.source = "qrc:/images/avatar.png"
}
}
Text{
id: nick
x: mode=="left"?avatar.x+avatar.width+5:avatar.x-implicitWidth-5
anchors.top: avatar.top
text: root.myinfo.aliasOrNick
}
BorderImage {
id: backgound
x: mode=="left"?avatar.x+avatar.width+5:avatar.x-width-5
anchors.top: nick.bottom
anchors.topMargin: 5
source: "qrc:/images/bubble_放飞心情_"+mode+".png"
height: mytext.height+20
width: mytext.width+30
border.left: 20; border.top: 20
border.right: 20; border.bottom: 20
TextEdit{
id: mytext
anchors.centerIn: parent
readOnly: true
textFormat :TextEdit.RichText//支持富文本
selectByMouse :true
selectByKeyboard :true
wrapMode: TextEdit.Wrap
text: root.messageInfo.contentData
onWidthChanged: {
var temp = root.width-avatar.width-35
if(width>temp){
width = temp
}
}
onTextChanged: {
//console.debug(text)
if(text[text.length-1]=="\n"){
text = text.substr(0, text.length-1)
}
}
TextEditPlayGif{
target: mytext
}
}
}
}
}
================================================
FILE: qml/Login/LoginPanel/AccountList.qml
================================================
import QtQuick 2.2
import QtQuick.Window 2.1
import mywindow 1.0
import utility 1.0
Window{
id:root
height: list.contentHeight
flags: Qt.SplashScreen
color: "transparent"
visible: true
property bool isCanClose: false
signal listClose
signal clicked( var qq )
property int highlightIndex: 0//初始化为第0个
Component{
id: component
Image{
id: background_iamge
source: index == mymodel.count-1?"qrc:/images/list_item_bottom.png":"qrc:/images/list_item.png"
width: root.width
height: {
if(root.highlightIndex == index)
return 5/21*width
else
return Math.max(5/21*width-10*Math.max(root.highlightIndex-index, index-root.highlightIndex), 4/21*width)
}
property bool is: false
Behavior on height{
NumberAnimation{
duration: 200
}
}
Rectangle{
id: background_rect
anchors.top: parent.top
anchors.topMargin: 1
x:2
width: parent.width-4
anchors.bottom: parent.bottom
anchors.bottomMargin: index == mymodel.count-1?2:1
color: root.highlightIndex == index?"#fd7000":"#F3F2F2"
}
MyImage{
id: image
maskSource: "qrc:/images/bit.bmp"
source: mysource
x:5
width: parent.height-10
height: width
sourceSize.width: width
anchors.verticalCenter: parent.verticalCenter
onLoadError: {
source = "qrc:/images/avatar.png"
}
}
Text{
id:text
font.pointSize: parent.height/6
anchors.left: image.right
anchors.leftMargin: 10
anchors.verticalCenter: parent.verticalCenter
text: root.highlightIndex==index?"<font color=\"black\">"+nick+"</font>"+"<br><br><font color=\"white\">"+myaccount+"</font>":myaccount
color: "black"
}
MouseArea{
anchors.fill: parent
hoverEnabled: true
onEntered: {
root.highlightIndex = index
}
onClicked: {
root.clicked(myaccount)
root.close()
listClose()
}
}
SvgView{
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 20
width: defaultSize.width*myqq.windowScale
visible: root.highlightIndex == index
source: "qrc:/images/button-quit.svg"
property string qq: myaccount
MouseArea{
anchors.fill: parent
onClicked: {
mymodel.remove(index)
myqq.removeLoginedQQInfo(myaccount)//清除此账号的信息
}
}
}
}
}
Component.onCompleted: {
var qq_list = myqq.getLoginedQQInfo()//读取已经登录过的qq的信息
for( var i=0;i<qq_list.length;++i ){
mymodel.append({"myaccount": qq_list[i].account, "nick": qq_list[i].nick, "mysource": qq_list[i].avatarSource})
}
}
ListView{
id:list
interactive: false
anchors.fill: parent
model: ListModel{id:mymodel}
delegate: component
}
onFocusObjectChanged: {
if( isCanClose ){
root.close()
listClose()
} else
isCanClose = true
}
}
================================================
FILE: qml/Login/LoginPanel/LoginCheckBox.qml
================================================
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import mywindow 1.0
CheckBox {
id:root
style: CheckBoxStyle {
indicator: Item{
implicitHeight: image.implicitHeight
implicitWidth: image.implicitWidth
SvgView{
width: defaultSize.width*myqq.windowScale
source: control.checked?"qrc:/images/checkBox-select.svg":"qrc:/images/checkBox-unselect.svg"
}
SvgView{
id: image
width: defaultSize.width*myqq.windowScale
source: "qrc:/images/checkBox-hover.svg"
visible: mouse.hover
Component.onCompleted: root.height = width
}
}
label: Text{
text: control.text
font.pointSize: root.height/2
}
}
MouseArea{
id:mouse
anchors.fill: parent
property bool hover: false
hoverEnabled: true
onEntered: {
hover = true
}
onExited: hover = false
onClicked: {
parent.checked=!parent.checked
}
}
}
================================================
FILE: qml/Login/LoginPanel/LoginInputArea.qml
================================================
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import mywindow 1.0
Item{
id:root
property bool qqlistopen: false
//color: "red"
TextField{
id: input_qq
font.pointSize: root.height/6
KeyNavigation.down: input_password
KeyNavigation.up: input_password
KeyNavigation.tab: KeyNavigation.down
text: utility.value("mainqq", "")
style: TextFieldStyle {
textColor: "black"
background: Item{
implicitWidth: border_qq.width-unfold_icon.width
implicitHeight: 25/64*border_qq.height
//color: "black"
SvgView {
id: border_qq
width: defaultSize.width*myqq.windowScale
x: -5/220*width
y: -6/64*height
source: "qrc:/images/inputBox1.svg"
}
}
}
onTextChanged: {
myqq.userQQ=text
}
Component.onCompleted: {
input_qq.forceActiveFocus()
}
}
TextField{
id: input_password
anchors.top: input_qq.bottom
anchors.topMargin: 4/128*root.height
echoMode: TextInput.Password
font.pointSize: root.height/8
KeyNavigation.up: input_qq
KeyNavigation.down: input_qq
KeyNavigation.tab: KeyNavigation.down
validator: RegExpValidator{
regExp: /[0-9a-zA-Z`~\!@\#\$%\^&\*\(\)\-\=_\+\[\]\{\}\\\|;\:'"<>\?,\.\/]{6,16}/
}
text: myqq.userPassword
onTextChanged: {
//console.log(myqq.userPassword+","+text)
myqq.userPassword=text
}
style: TextFieldStyle {
textColor: "black"
background: Item{
implicitWidth: border_password.width-soft_keyboard_icon.width
implicitHeight: 23/64*border_password.height
//color: "blue"
SvgView {
id: border_password
x: -5/220*width
width: defaultSize.width*myqq.windowScale
anchors.bottom: parent.bottom
anchors.bottomMargin: -6/64*height
source: "qrc:/images/inputBox2.svg"
}
}
}
}
SvgView {
id: unfold_icon
width: defaultSize.width*myqq.windowScale
source: "qrc:/images/inputBox-more.svg"
anchors.left: input_qq.right
anchors.leftMargin: -1/16*root.width
anchors.verticalCenter: input_qq.verticalCenter
property bool isCloseing: false
onIsCloseingChanged: {
if(isCloseing&&!mymouse1.hovered) {
unfold_icon.rotation = 0
isCloseing=false
qqlistopen = false
}
}
Connections{
id: connection
target: null
onClicked:{
input_qq.text = qq//填充qq号码
}
onListClose:{
unfold_icon.isCloseing=true
}
}
MouseArea{
id: mymouse1
anchors.fill: parent
hoverEnabled: true
property bool hovered: false
onEntered: hovered = true
onExited: hovered = false
onClicked: {
if( unfold_icon.isCloseing ){
unfold_icon.rotation = 0
unfold_icon.isCloseing=false
qqlistopen = false
}else if( unfold_icon.rotation == 0 ){
unfold_icon.rotation = 180
qqlistopen = true
var component = Qt.createComponent("AccountList.qml");
if (component.status == Component.Ready){
var data={"width":21/22*root.width,"x": utility.mouseDesktopPos().x-mouse.x-unfold_icon.x,"y": utility.mouseDesktopPos().y-mouse.y-unfold_icon.y+input_qq.height}
connection.target = component.createObject(input_qq, data);
}
}
}
}
}
SvgView {
id: soft_keyboard_icon
width: defaultSize.width*myqq.windowScale
source: "qrc:/images/soft-keyboard.svg"
anchors.left: input_password.right
anchors.leftMargin: -1/16*root.width
anchors.verticalCenter: input_password.verticalCenter
property bool keyboardClose: true
property bool isCloseing: false
onIsCloseingChanged: {
if(isCloseing&&!mymouse2.hovered) {
keyboardClose=true
isCloseing=false
}
}
Connections{
id: connections
target: null
onInput:{
input_password.text+=arg
}
onBackspace:{
input_password.text = input_password.text.substr(0, input_password.text.length-1)
}
onKeyboardClose:{
soft_keyboard_icon.isCloseing=true
}
}
MouseArea{
id: mymouse2
anchors.fill: parent
property bool hovered: false
hoverEnabled: true
onEntered: hovered = true
onExited: hovered = false
onClicked: {
if(soft_keyboard_icon.isCloseing){
soft_keyboard_icon.keyboardClose=true
soft_keyboard_icon.isCloseing=false
}else if( soft_keyboard_icon.keyboardClose){
soft_keyboard_icon.keyboardClose=false
var component = Qt.createComponent("../../Utility/KeyboardPage/SoftKeyboard.qml");
if (component.status == Component.Ready){
var sprite = component.createObject(input_password);
connections.target = sprite
}
}
}
}
}
}
================================================
FILE: qml/Login/LoginPanel/LoginPage.qml
================================================
import QtQuick 2.2
import utility 1.0
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QtQuick.Particles 2.0
import mywindow 1.0
import qqstars 1.0
import "../../Utility"
import "../"
Item{
property alias contentItem: effect
width: effect.actualWidth
height: effect.actualHeight
function reLogin(){
myqq.loginStatus = QQ.WaitLogin
animation_avatar.stop()//停止动画
avatar_image.x = -30/77*avatar_image.width//将头像位置复原
}
MyRectangularGlow{
id: effect
glowRadius: 50
spread: 0.1
color: "black"
glowOpacity: 0.75
width: root.width
height: root.height
biasY: 20
item:SvgView {
id: root
source: "qrc:/images/login-panel2.svg"
width: defaultSize.width*myqq.windowScale
Connections{
target: myqq
onLoginStatusChanged:{
if( myqq.loginStatus == QQ.Logining )
animation_avatar.start()
}
}
ParticleSystem {
id: particles
anchors.fill: parent
//running: true
ImageParticle {
source: "qrc:/images/未标题-1.png"
}
Emitter {
id: pulseEmitter
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: 120
emitRate: 10
lifeSpan: 2000
velocity: AngleDirection{
magnitude: 35;
magnitudeVariation: 20
angle: -90
angleVariation: 45
}
size: 5
sizeVariation: 20
}
}
MyImage{
id:avatar_image
maskSource: "qrc:/images/bit.bmp"
width: 80*myqq.windowScale
height: width
sourceSize.width: width
source: myqq.avatar240
x:-30/80*width
anchors.verticalCenter: inputarea.verticalCenter
Connections{
target: myqq
onUserQQChanged:{
avatar_image.source = myqq.avatar240
}
}
onLoadError:{
console.log("头像加载出错:"+myqq.avatar240)
source = "qrc:/images/avatar.png"
}
SvgView{
id: rect_border
source: "qrc:/images/avatar-border.svg"
anchors.centerIn: parent
width: avatar_image.width*1.23
}
Timer{
id: timer_login
interval: 10
onTriggered: myqq.login()//开始登录
}
NumberAnimation{
id: animation_avatar
target: avatar_image
property: "x"
duration: 300
from: -30/77*avatar_image.width
to: root.width/2 - avatar_image.width/2
onStopped: timer_login.start()//必须在结束后启动定时器然后在定时器结束后在调用login(),不然会导致ui卡一下
}
SvgView{
id: user_status_icon
width: defaultSize.width*myqq.windowScale
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: -0.02*avatar_image.width
//sourceSize.width: width
//width: 5/16*avatar_image.width
enabled: myqq.loginStatus == QQ.WaitLogin
source: "qrc:/images/status-"+myqq.stateToString+"-1.svg"
MyMenu{
id: menu_state
styleSheet: "QMenu::item:selected {
background: #F07000;
color:#E6FFFF;
height:25px;
}
QMenu{
background-image: url(':/images/menu_background.png');
}
QMenu::icon{
padding-left:8px;
}
QMenu::item{
padding-left:32px;
padding-right:20px;
height:22px;
}
QMenu::separator {
height: 1px;
margin:5px 0px 5px 22px;
background: #B2C0CD;
}
"
MyMenuItem{
text: "我在线上"
icon: "qrc:/images/imonline.png"
onTriggered: {
myqq.state = QQ.Online
}
}
MyMenuItem{
text: "Q我吧"
icon: "qrc:/images/imcallme.png"
onTriggered: {
myqq.state = QQ.Callme
}
}
MyMenuItem{
text: "离开"
icon: "qrc:/images/imaway.png"
onTriggered: {
myqq.state = QQ.Away
}
}
MyMenuItem{
text: "忙碌"
icon: "qrc:/images/imbusy.png"
onTriggered: {
myqq.state = QQ.Busy
}
}
MyMenuItem{
text: "请勿打扰"
icon: "qrc:/images/imsilent.png"
onTriggered: {
myqq.state = QQ.Silent
}
}
MyMenuItem{
text: "隐身"
icon: "qrc:/images/imhidden.png"
onTriggered: {
myqq.state = QQ.Hidden
}
}
}
MouseArea{
anchors.fill: parent
onClicked: {
menu_state.popup()
}
}
}
Text{
text: myqq.userQQ
font.pointSize: avatar_image.width/8
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.bottom
anchors.topMargin: 10
visible: myqq.loginStatus == QQ.Logining
}
}
SvgView{
id:image_quit_icon
width: defaultSize.width*myqq.windowScale
source: "qrc:/images/button-quit.svg"
anchors.left: parent.left
anchors.top: parent.top
anchors.margins: 10
MouseArea{
anchors.fill: parent
onClicked: Qt.quit()
}
}
SvgView {
id: image_qq_for_ubuntu
width: defaultSize.width*myqq.windowScale
//sourceSize.width: width
source: "qrc:/images/QQ-for-ubuntu.svg"
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: 20
}
LoginInputArea{
id: inputarea
width: 220*myqq.windowScale
height: 64*myqq.windowScale
visible: myqq.loginStatus == QQ.WaitLogin
anchors.left: avatar_image.right
anchors.leftMargin: 30
anchors.top: image_qq_for_ubuntu.bottom
anchors.topMargin: root.height/10
Component.onCompleted: {
//console.log(width)
//console.log(height)
}
LoginCheckBox{
id: checkbox_rememberpassword
//height:2/40*root.width
checked: myqq.rememberPassword//myqq.value("rememberpassword", 0)==1
anchors.left: inputarea.left
anchors.top: inputarea.bottom
anchors.topMargin: root.height/12
text: "记住密码"
onCheckedChanged: {
if( !checked ){
checkbox_autologin.checked = false
//myqq.removeValue("password")//将密码置空
}
}
}
LoginCheckBox{
id:checkbox_autologin
//height:2/40*root.width
checked: myqq.autoLogin//myqq.value("autologin", 0)==1
anchors.right: inputarea.right
anchors.rightMargin: 10
anchors.top: inputarea.bottom
anchors.topMargin: root.height/12
text: "自动登录"
onCheckedChanged: {
if(checked)
checkbox_rememberpassword.checked = true
}
}
}
Connections{
target: myqq
onUserQQChanged:{
checkbox_rememberpassword.checked = myqq.rememberPassword//myqq.value("rememberpassword", 0)==1
checkbox_autologin.checked = myqq.autoLogin//myqq.value("autologin", 0)==1
}
}
Item{
id: progress_item
clip: true
anchors.bottom: parent.bottom
anchors.bottomMargin: root.height/4.2-height
visible: myqq.loginStatus == QQ.Logining
onVisibleChanged: {
if(visible)
progress_animation1.start()
else{
progress_animation1.stop()
}
}
width: root.implicitWidth
height: image_progress1.implicitHeight
Image{
id: image_progress1
source: "qrc:/images/progress-bar.png"
width: root.width
NumberAnimation{
id:progress_animation1
running: false
target: image_progress1
property: "x"
from: 0
to: root.width
duration: 5000
onStopped: {
if( progress_item.visible )
start()
}
}
}
Image{
id: image_progress2
source: "qrc:/images/progress-bar.png"
width: root.width
anchors.right: image_progress1.left
}
}
MyLoginButton{
id:button_login
anchors.bottom: parent.bottom
anchors.bottomMargin: 30/250*root.height-height/2-1*height/defaultSize.height
width: defaultSize.width*myqq.windowScale
anchors.horizontalCenter: parent.horizontalCenter
text: myqq.loginStatus != QQ.WaitLogin?"取 消":"登 录"
font.pointSize: width/15
onClicked: {
if( myqq.loginStatus == QQ.WaitLogin ){
if( myqq.userQQ!=""&&myqq.userPassword!="" ){
myqq.loginStatus = QQ.Logining
myqq.autoLogin = checkbox_autologin.checked
myqq.rememberPassword = checkbox_rememberpassword.checked
myqq.saveUserPassword()//保存密码
utility.setValue("mainqq", myqq.userQQ)//设置当前活动qq为myqq.userQQ
}
}else if( myqq.loginStatus == QQ.Logining ){
reLogin()//调用重新登录
myqq.loginStatus = QQ.WaitLogin
}
}
}
SvgView{
id: button_setting
width: defaultSize.width*myqq.windowScale
source: "qrc:/images/button-settings.svg"
anchors.right: parent.right
anchors.verticalCenter: button_login.verticalCenter
visible: myqq.loginStatus == QQ.WaitLogin
MouseArea{
anchors.fill: parent
onClicked: {
main.openSettingPage()//进行设置
}
}
}
Component.onCompleted: {
//if( myqq.value("autologin", 0)==1 )//此账号如果设置了自动登录
if(myqq.autoLogin)//如果是自动登录
myqq.loginStatus = QQ.Logining
forceActiveFocus()
}
Keys.onEnterPressed: {
button_login.clicked()
}
Keys.onReturnPressed: {
button_login.clicked()
}
}
}
}
================================================
FILE: qml/Login/MyLoginButton.qml
================================================
import QtQuick 2.2
import mywindow 1.0
SvgView{
id:root
//sourceSize.width: width
property alias text: button_text.text
property alias font: button_text.font
source: {
if( mouse.pressed )
return "qrc:/images/button-login-press.svg"
else if(mouse.hover)
return "qrc:/images/button-login-hover.svg"
else
return "qrc:/images/button-login.svg"
}
signal clicked
Rectangle{
radius: 10
anchors.fill: parent
color: "#888"
visible: !root.enabled
}
Text {
id: button_text
anchors.centerIn: parent
color: "white"
}
MouseArea{
id:mouse
enabled: root.enabled
property bool hover: false
anchors.fill: parent
hoverEnabled: true
onEntered: {
hover = true
}
onExited: {
hover = false
}
onClicked: {
root.clicked()
}
}
}
================================================
FILE: qml/Login/SettingPage.qml
================================================
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import utility 1.0
import mywindow 1.0
import "../Utility"
import "../Utility/ComboBox"
Item{
width: effect.actualWidth
height: effect.actualHeight
MyRectangularGlow{
id: effect
glowRadius: 50
spread: 0.1
color: "black"
glowOpacity: 0.75
width: root.width
height: root.height
biasY: 20
item:SvgView {
id:root
source: "qrc:/images/login-panel.svg"
width: defaultSize.width*myqq.windowScale
SvgView{
id:image_quit_icon
width: defaultSize.width*myqq.windowScale
source: "qrc:/images/button-quit.svg"
anchors.left: parent.left
anchors.top: parent.top
anchors.margins: 10
MouseArea{
anchors.fill: parent
onClicked: {
main.openLoginPage()//返回登录
}
}
}
SvgView {
id: image_qq_for_ubuntu
width: defaultSize.width*myqq.windowScale
source: "qrc:/images/QQ-for-ubuntu.svg"
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: 20
}
Grid{
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: image_qq_for_ubuntu.bottom
anchors.topMargin: root.height/10
columns: 2
rowSpacing: root.width/20
columnSpacing: root.height/20
horizontalItemAlignment: Qt.AlignHCenter
verticalItemAlignment: Qt.AlignVCenter
MyTextField{
id: proxy_location_input
enabled: proxy_combo.currentIndex != 0
width: root.width/2.5
height: width/8
title: "地址:"
text: utility.value("proxyLocation", "")
}
MyTextField{
id: proxy_port_input
enabled: proxy_combo.currentIndex != 0
width: root.width/2.5
height: width/8
title: "端口:"
text: utility.value("proxyPort", "")
}
MyTextField{
id: proxy_username_input
enabled: proxy_combo.currentIndex != 0
width: root.width/2.5
height: width/8
title: "账户:"
text: utility.value("proxyUsername", "")
}
MyTextField{
id: proxy_password_input
enabled: proxy_combo.currentIndex != 0
width: root.width/2.5
height: width/8
title: "密码:"
text: utility.value("proxyPassword", "")
}
Item{
width: root.width/2.5
height: width/8
Text {
id: proxy_type_text
text: "类型:"
font.pointSize: parent.height/2
anchors.verticalCenter: parent.verticalCenter
}
MyComboBox{
id: proxy_combo
height: parent.height
anchors.left: proxy_type_text.right
anchors.right: parent.right
currentIndex: utility.value("proxyTypeIndex", 0)
model: ListModel {
ListElement { text: "不使用代理"; value: Utility.NoProxy}
ListElement { text: "HTTP代理"; value: Utility.HttpProxy}
ListElement { text: "SOCKS5代理"; value: Utility.Socks5Proxy}
}
}
}
MyButton {
text: "测 试"
width: root.width/4
height: width/4
visible: proxy_combo.currentIndex != 0
font.pointSize: proxy_type_text.font.pointSize
onClicked:{
console.log("fdsafds")
utility.setApplicationProxy(proxy_combo.currentValue, proxy_location_input.text, proxy_port_input.text, proxy_username_input.text, proxy_password_input.text)
utility.httpGet(testNetwork, "http://d.web2.qq.com/channel/poll2")
button_affirm.enabled = false
enabled = false
}
function testNetwork(error ,data) {
var temp1 = utility.value("proxyLocation", "")
var temp2 = utility.value("proxyPort", "")
var temp3 = utility.value("proxyUsername", "")
var temp4 = utility.value("proxyPassword", "")
var temp5 = utility.value("proxyType", Utility.NoProxy)
utility.setApplicationProxy(temp5, temp1, temp2, temp3, temp4)//将代理设置复原
button_affirm.enabled = true
enabled = true
if( error )
myqq.showWarningInfo("测试失败")
else
myqq.showWarningInfo("测试通过")
}
}
}
MyLoginButton{
id: button_affirm
anchors.bottom: parent.bottom
anchors.bottomMargin: 30/250*root.height-height/2-1*height/defaultSize.height
width: defaultSize.width*myqq.windowScale
anchors.horizontalCenter: parent.horizontalCenter
text:"确 认"
font.pointSize: width/15
onClicked: {
utility.setApplicationProxy(proxy_combo.currentValue, proxy_location_input.text, proxy_port_input.text, proxy_username_input.text, proxy_password_input.text)
utility.setValue("proxyLocation", proxy_location_input.text)
utility.setValue("proxyPort", proxy_port_input.text)
utility.setValue("proxyUsername", proxy_username_input.text)
utility.setValue("proxyPassword", proxy_password_input.text)
utility.setValue("proxyType", proxy_combo.currentValue)
utility.setValue("proxyTypeIndex", proxy_combo.currentIndex)
main.openLoginPage()//返回登录
}
}
Keys.onEnterPressed: {
button_affirm.clicked()
}
Keys.onReturnPressed: {
button_affirm.clicked()
}
}
}
}
================================================
FILE: qml/Login/main.qml
================================================
import QtQuick 2.2
import QtQuick.Particles 2.0
import mywindow 1.0
import utility 1.0
//import Qt.labs.settings 1.0
import QQItemInfo 1.0
import MyTextEditPlugin 1.0
import "../Utility"
import "../MainPanel"
import "LoginPanel"
import "../Chat"
MyWindow{
id:main
windowIcon: "qrc:/images/avatar.png"
actualWidth: 350*myqq.windowScale+200
actualHeight: 250*myqq.windowScale+150
visible: true//可视的
contentItemAreaTop: login_page.contentItem.y///////////////////////////设置
contentItemAreaBottom: contentItemAreaTop+login_page.contentItem.height//响应
contentItemAreaLeft: login_page.contentItem.x/////////////////////////鼠标的
contentItemAreaRight: contentItemAreaLeft+login_page.contentItem.width//区域
noBorder: true//无边框的
removable: true//可移动的
fixedSize: true//固定大小的
dockableWindow: false//可停靠的
topHint: false//窗口保持在最前端
noNotifyIcon: true//隐藏任务栏图标
windowGlow: false//是否开启阴影
color: "transparent"
function openSettingPage() {//进行设置
settings_page.enabled = true
flipable.flipped = false
}
function openLoginPage() {//打开登录面板
login_page.enabled = true
flipable.flipped = true
}
Connections{
target: myqq
onError:{
if( message.indexOf("验证码")<0 ){
login_page.reLogin()//重新登录
myqq.closeCodeWindow()//关闭输入验证码的窗口
}else{
myqq.updataCode()//刷新验证码
}
}
}
Connections{
target: systemTray
onActivated:{
if( arg == MySystemTrayIcon.Trigger ) {
main.showFront()
}
}
onTriggered: {
if(arg == "打开主面板"){
main.showFront()
}
}
}
ParticleSystem {//粒子系统
id: particles
anchors.centerIn: parent
width: main.actualWidth
height: main.actualHeight
Age{
system: particles
anchors.left: parent.left
height: parent.height
width: 80
once: true
lifeLeft: 3000
advancePosition: false
}
Age{
system: particles
anchors.right: parent.right
height: parent.height
width: 80
once: true
lifeLeft: 3000
advancePosition: false
}
Age{
system: particles
anchors.bottom: parent.bottom
height: 80
width: parent.width
once: true
lifeLeft: 3000
advancePosition: false
}
ImageParticle {
source: "qrc:/images/star.png"
groups: ['star']
alpha: 0.2
alphaVariation: 0.1
colorVariation: 2
autoRotation: true
rotationVariation: 360
rotationVelocity: 40
}
Emitter {
id: pulseEmitter
anchors.top: parent.top
width: parent.width
group: 'star'
emitRate: 8
lifeSpan: parent.height*1000/40
velocityFromMovement: 20
velocity: AngleDirection{
angle: 90
angleVariation: 50
magnitude: 90
magnitudeVariation: 10
}
acceleration: AngleDirection{
angle: -90
magnitude: 5
magnitudeVariation: 2
}
size: 20
sizeVariation: 5
endSize: 0
}
}
Flipable {
id: flipable
anchors.fill: parent
property bool flipped: true
onFlippedChanged:{
timer.start()
}
Timer{
id: timer
interval: 200
onTriggered: {
if( flipable.flipped ){
settings_page.enabled = false
}else{
login_page.enabled = false
}
}
}
front: LoginPage{
id: login_page
anchors.right: parent.right
}
back: SettingPage{
id: settings_page;
enabled: false
anchors.right: parent.right
}
transform: Rotation {
id: rotation
origin.x: flipable.width/2
origin.y: flipable.height/2
axis.x: 0; axis.y: 1; axis.z: 0 // set axis.y to 1 to rotate around y-axis
angle: 0 // the default angle
}
states: State {
name: "back"
PropertyChanges { target: rotation; angle: 180 }
when: !flipable.flipped
}
transitions: Transition {
NumberAnimation {
target: rotation;
property: "angle";
duration: timer.interval ;
easing.type: Easing.InQuart
}
}
}
}
================================================
FILE: qml/MainPanel/ListPage/AllListPage.qml
================================================
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import mywindow 1.0
TabView {
id: frame
property int old_current:0
Tab {
active: true
id: friend_list
FriendList{
id: rect1
width: parent.width
height: parent.height
NumberAnimation{
id: animat1
target: rect1
duration: 200
running: false
easing.type: Easing.InCubic
property: "x"
from: -width
to:0
}
Connections{
target: frame
onCurrentIndexChanged: {
if(frame.currentIndex==0){
animat1.start()
frame.old_current = 0
}
}
}
}
}
Tab {
active: true
GroupAndDiscuPage{
id:rect2
width: parent.width
height: parent.height
NumberAnimation{
id: animat2
target: rect2
duration: 200
running: false
easing.type: Easing.InCubic
property: "x"
from: frame.old_current==0?width:-width
to:0
}
Connections{
target: frame
onCurrentIndexChanged: {
if(frame.currentIndex==1){
animat2.start()
frame.old_current = 1
}
}
}
}
}
Tab {
active: true
id: recent_list
RecentList{
id:rect3
width: parent.width
height: parent.height
NumberAnimation{
id: animat3
target: rect3
duration: 200
running: false
easing.type: Easing.InCubic
property: "x"
from: width
to:0
}
Connections{
target: frame
onCurrentIndexChanged: {
if(frame.currentIndex==2){
animat3.start()
frame.old_current = 2
}
}
}
}
}
style: TabViewStyle {
//tabOverlap: 10
tabsMovable : true
tabsAlignment:Qt.AlignHCenter
tab: Item{
implicitHeight: icon.height+20
implicitWidth: control.width/3
//width: control.width/3
SvgView{
id: icon
anchors.horizontalCenter: parent.horizontalCenter
source: {
if(index==0)
return "qrc:/images/friendList_select.svg"
else if(index==1)
return "qrc:/images/groupList_select.svg"
else
return "qrc:/images/recentList_select.svg"
}
}
}
frame: Item {}
}
}
================================================
FILE: qml/MainPanel/ListPage/DiscuList.qml
================================================
import QtQuick 2.2
import mywindow 1.0
import utility 1.0
import "../"
import "../../Utility"
import QQItemInfo 1.0
Item{
id: root
clip: true
function getDiscusListFinished(error, data) {//获取讨论组列表完成
if(error){
myqq.getDiscusList(getDiscusListFinished) //讨论组列表
return
}
data = JSON.parse(data)
if(data.retcode ==0 ) {
var list_info = data.result.dnamelist
for( var i=0; i< list_info.length;++i ) {
var info = myqq.createDiscuInfo(list_info[i].did)
info.nick = list_info[i].name//设置昵称
mymodel.append({"obj_info": info})
}
}
}
Component.onCompleted: {
myqq.getDiscusList(getDiscusListFinished) //讨论组列表
}
MyScrollView{
anchors.fill: parent
Item{
height: mymodel.count*40+10
width: root.width
implicitHeight: height
implicitWidth: width
ListView{
id: list
interactive: false
anchors.fill: parent
model: ListModel{
id:mymodel
}
spacing :10
delegate: component
}
}
}
Component{
id: component
Item{
id: item_root
width: parent.width
height: avatar.height
property DiscuInfo myinfo: obj_info
MyImage{
id: avatar
x:10
width:40
height: 40
sourceSize.width: width
source: "qrc:/images/avatar.png"
maskSource: "qrc:/images/bit.bmp"
}
Text{
id:text_nick
anchors.top: avatar.top
anchors.left: avatar.right
anchors.leftMargin: 10
font.pointSize: 14
text: item_root.myinfo.aliasOrNick
}
MouseArea{
anchors.fill: parent
onDoubleClicked: {
myqq.addChatPage(item_root.myinfo.uin, QQItemInfo.Discu)
}
}
}
}
}
================================================
FILE: qml/MainPanel/ListPage/FriendList.qml
================================================
import QtQuick 2.2
import mywindow 1.0
import utility 1.0
import "../"
import "../../Utility"
import QQItemInfo 1.0
Item{
id: friendlist_main
width: parent.width
height: parent.height
clip:true
function addModel( name, index ,obj_friendListData ){
mymodel.append({"obj_groupingName": name, "obj_groupingIndex": index, "obj_friendListData":obj_friendListData})
}
function insertModel( sort, name, index ,obj_friendListData ){
mymodel.insert(sort, {"obj_groupingName": name, "obj_groupingIndex": index, "obj_friendListData":obj_friendListData})
}
function getFriendListFinished(error, data) {//获取好友列表完成
if(error){
myqq.getFriendList(getFriendListFinished) //获取好友列表
return
}
data = JSON.parse(data)
if( data.retcode == 0) {
var marknames = data.result.marknames//备注信息
for( var i=0; i<marknames.length;++i ) {
var obj_info = myqq.createFriendInfo(marknames[i].uin)
if(obj_info){
obj_info.alias = marknames[i].markname//储存备注信息
}
}
for( i=0; i< data.result.friends.length;++i ) {
myqq.addFriendUin(data.result.friends[i].uin)
//将所有好友的uin都添加进去,为判断一个uin是否为陌生人做基础
}
var categories = data.result.categories//分组信息
if(categories.length>0&&categories[0].index>0)//如果分组数目大于0,但是第一个分组的index不为0
addModel("我的好友", 0, data.result)//则将默认的"我的好友"分组加进去
var arr = new Array
for(i=0; i<categories.length;++i){
arr.push(categories[i])//现将每个对象都放到数组当中
}
arr.sort(function(a,b){
//console.log("调用了排序,"+(a.sort>b.sort))
return a.sort>b.sort?1:-1//将数组按照里边的sort属性排序
})
for(i=0; i<arr.length; ++i){//遍历数组
addModel(arr[i].name, arr[i].index, data.result)//增加分组
}
}else{
console.debug("好友列表获取失败:"+data.retcode)
}
}
function getOnlineFriendsFinished(error, data){//获取在线好友完成
if(error){
myqq.getOnlineFriends(getOnlineFriendsFinished)//再去获取
}
data = JSON.parse(data)
if(data.retcode == 0){
for(var i in data.result){
var info = myqq.createFriendInfo(data.result[i].uin)
info.stateToString = data.result[i].status//设置状态
}
}
}
Component.onCompleted: {
myqq.getOnlineFriends(getOnlineFriendsFinished)//获取在线好友
myqq.getFriendList(getFriendListFinished) //获取好友列表
}
MyScrollView{
anchors.fill: parent
Item{
height: list.contentHeight+10
width: friendlist_main.width
implicitHeight: height
implicitWidth: width
ListView{
id: list
interactive: false
anchors.fill: parent
model: ListModel{
id:mymodel
}
spacing :10
delegate: component1
}
}
}
Component{
id: component1
Item{
id: root
clip: true
property string name: obj_groupingName
property int groupingIndex:obj_groupingIndex
property var friendListData: obj_friendListData
onFriendListDataChanged: {
var friends = friendListData.friends//好友列表
var friends_info = friendListData.info//好友信息
for( var i=0; i< friends.length;++i ) {
if( friends[i].categories==groupingIndex ){//判断是否是本分组的内容
var info = myqq.createFriendInfo(friends_info[i].uin)
info.nick = friends_info[i].nick//设置昵称
var data = {"obj_info": info}
mymodel2.append(data)//增加好友
}
}
}
property alias model: mymodel2
height: titleBar.height
width: parent.width
state: "close"
function stateSwitch(){
if( state=="close" )
state = "unfold"
else
state="close"
}
states: [
State {
name: "close"
PropertyChanges {
target: root
height: titleBar.height
}
},
State {
name: "unfold"
PropertyChanges {
target: root
height: titleBar.height+list2.contentHeight+10
}
}
]
Item{
id: titleBar
width: parent.width
height: Math.max(image_icon.implicitHeight, text_name.implicitHeight)
Text{
id: image_icon
x:10
anchors.verticalCenter: text_name.verticalCenter
text: root.state == "close"?"+":"-"
font.pointSize: 16
}
Text{
id: text_name
text: name
anchors.left: image_icon.right
anchors.leftMargin: 10
font.pointSize: 10
font.bold: true
}
MouseArea{
anchors.fill: parent
onClicked: {
root.stateSwitch()
}
}
}
ListView{
id: list2
interactive: false
model: ListModel{
id:mymodel2
property int onlineIndex: 0//在线好友的序列,初始为0
function stateToOnline(index){
//当序列为index的model项调用此函数后,会将他前移到onlineIndex尾部
if(index>=onlineIndex)
move(index, onlineIndex++, 1)//移动此项
}
function stateToOffline(index){
//当序列为index的model项调用此函数后,会将他前移到尾部
if(index<=count-1){
--onlineIndex
move(index, count-1, 1)
}
}
}
spacing: 10
delegate: component2
anchors.top: titleBar.bottom
anchors.topMargin: 10
width: parent.width
height: parent.height
}
Component{
id: component2
Item{
id: item_root
width: parent.width
height: avatar.height
property FriendInfo myinfo: obj_info
Component.onCompleted: {
if(myinfo.state != FriendInfo.Offline){//如果不是离线状态
mymodel2.stateToOnline(index)//将自己移动到前面
}
}
Connections{
target: myinfo
onStateChanged:{//如果状态改变
if(myinfo.state == FriendInfo.Offline){//如果是离线状态
mymodel2.stateToOffline(index)//将自己移动到最后
}else{
mymodel2.stateToOnline(index)//否则就往上移动
}
}
}
MyImage{
id: avatar
x:10
width:40
height: 40
sourceSize.width: width
grayscale: myinfo.state==FriendInfo.Offline
maskSource: "qrc:/images/bit.bmp"
cache: false
source: item_root.myinfo.avatar40
onLoadError: {
myinfo.avatar40 = "qrc:/images/avatar.png"
}
}
Text{
id:text_nick
anchors.top: avatar.top
anchors.left: avatar.right
anchors.leftMargin: 10
font.pointSize: 14
text: myinfo.aliasOrNick//myqq.value(info.uin+"alias", info.nick)
}
Text{
id:text_signature//个性签名
anchors.left: text_nick.left
anchors.bottom: avatar.bottom
font.pointSize: 8
text: myinfo.QQSignature//myqq.value(info.uin+"signature", "获取中...")
}
MouseArea{
anchors.fill: parent
onDoubleClicked: {
myqq.addChatPage(myinfo.uin, QQItemInfo.Friend)
}
}
}
}
}
}
}
================================================
FILE: qml/MainPanel/ListPage/GroupAndDiscuPage.qml
================================================
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
Item{
TabView{
anchors.fill: parent
Tab{
title: "QQ群"
active: true
GroupList{
width: parent.width
height: parent.height
}
}
Tab{
title: "讨论组"
active: true
DiscuList{
width: parent.width
height: parent.height
}
}
style: TabViewStyle {
//tabOverlap: 10
frameOverlap: -10
tabsMovable : true
tabsAlignment:Qt.AlignHCenter
tab:Rectangle {
color: styleData.selected ? "#f07000" :"#eee"
border.color: "#888"
border.width: 1
implicitWidth: Math.max(text.width + 4, 80)
implicitHeight: 20
radius: 10
Rectangle{
height: parent.implicitHeight
width: height
x:index==1?0:parent.width-width
color: parent.color
border.width: parent.border.width
border.color: parent.border.color
Rectangle{
height: parent.height-2*width
width: parent.border.width
anchors.verticalCenter: parent.verticalCenter
x:index==0?0:parent.width-width
color: parent.color
}
}
Text {
id: text
anchors.centerIn: parent
text: styleData.title
color: styleData.selected ? "white" : "black"
}
}
frame: Item {}
}
}
}
================================================
FILE: qml/MainPanel/ListPage/GroupList.qml
================================================
import QtQuick 2.2
import mywindow 1.0
import utility 1.0
import "../"
import "../../Utility"
import QQItemInfo 1.0
Item{
id: root
clip: true
function getGroupListFinished( error, data ) {
if(error){
myqq.getGroupList(getGroupListFinished) //获取群列表
return
}
data = JSON.parse(data)
if(data.retcode ==0 ) {
var groupmarknames = data.result.gmarklist//群备注信息
var i=0;
for( i=0; i<groupmarknames.length;++i ) {
var obj_info = myqq.createGroupInfo(groupmarknames[i].uin)
if(obj_info){
obj_info.alias = groupmarknames[i].markname//储存备注信息
}
}
var list_info = data.result.gnamelist
for( i=0; i< list_info.length;++i ) {
var info = myqq.createGroupInfo(list_info[i].gid)
info.nick = list_info[i].name
info.code = list_info[i].code
mymodel.append({"obj_info": info})
}
}
}
Component.onCompleted: {
myqq.getGroupList(getGroupListFinished)
}
MyScrollView{
anchors.fill: parent
Item{
height: list.contentHeight+10
width: root.width
implicitHeight: height
implicitWidth: width
ListView{
id: list
interactive: false
anchors.fill: parent
model: ListModel{
id:mymodel
}
spacing :10
delegate: component
}
}
}
Component{
id: component
Item{
id: item_root
width: parent.width
height: avatar.height
property var myinfo: obj_info
MyImage{
id: avatar
x:10
width:40
height: 40
sourceSize.width: width
maskSource: "qrc:/images/bit.bmp"
cache: false
source: myinfo.avatar40
onLoadError: {
item_root.myinfo.avatar40 = "qrc:/images/avatar.png"
}
}
Text{
id:text_nick
anchors.top: avatar.top
anchors.left: avatar.right
anchors.leftMargin: 10
font.pointSize: 14
text: myinfo.aliasOrNick
}
MouseArea{
anchors.fill: parent
onDoubleClicked: {
myqq.addChatPage(item_root.myinfo.uin, QQItemInfo.Group)//打开聊天页
}
}
}
}
}
================================================
FILE: qml/MainPanel/ListPage/RecentList.qml
================================================
import QtQuick 2.2
import mywindow 1.0
import QQItemInfo 1.0
import "../"
import "../../QQItemInfo"
import "../../Utility"
Item{
id: root
clip:true
Component.onCompleted: {
myqq.getRecentList(getRecentListFinished) //获取最近联系人
}
function getRecentListFinished(error, data){//当获取最近联系人列表完成后
if(error){
myqq.getRecentList(getRecentListFinished) //获取最近联系人
return
}
data = JSON.parse(data)
if( data.retcode==0 ) {
data = data.result
for(var i=0;i<data.length;++i){
var info
switch(data[i].type) {
case 0://0为好友
info=myqq.createFriendInfo(data[i].uin)
break
case 1://1为群
info=myqq.createGroupInfo(data[i].uin)
break
case 2://2为讨论组
info=myqq.createDiscuInfo(data[i].uin)
break
default:break
}
mymodel.addEnd(info)//添加最近联系人
}
}
}
Connections{
target: myqq
onAddRecentContacts:{//收到增加最近联系人的信号
mymodel.addBegin(info)
}
}
MyScrollView{
anchors.fill: parent
Item{
height: list.contentHeight+10
width: root.width
implicitHeight: height
implicitWidth: width
ListView{
id: list
anchors.fill: parent
interactive: false
model: ListModel{
id:mymodel
function addEnd(item_info){
for(var i=0; i<mymodel.count; ++i)
if(mymodel.get(i).obj_info == item_info){
return
}
mymodel.append({"obj_info": item_info})
}
function addBegin(item_info){//判断一个对象是否存在于list中,是的话返回他的index
for(var i=0; i<mymodel.count; ++i)
//console.debug(mymodel.get(i).obj_info+","+item_info)
if(mymodel.get(i).obj_info == item_info){
mymodel.move(i,0,1)
return
}
mymodel.append({"obj_info": item_info})
}
}
//spacing :10
delegate: component
}
}
}
Component{
id: component
Item{
id: item_root
property QQItemInfo myinfo: obj_info
width: parent.width
height: avatar.height+16
MyImage{
id: avatar
x:10
width:40
height: 40
sourceSize.width: width
anchors.verticalCenter: parent.verticalCenter
cache: false
grayscale: myinfo.mytype == QQItemInfo.Friend&&myinfo.state==FriendInfo.Offline//是否为黑白图
maskSource: "qrc:/images/bit.bmp"
source: myinfo.avatar40
onLoadError: {
myinfo.avatar40 = "qrc:/images/avatar.png"
}
}
Text{
id:text_nick
anchors.top: avatar.top
anchors.left: avatar.right
anchors.leftMargin: 10
font.pointSize: 14
text: myinfo.aliasOrNick
}
Rectangle{
id: rect_message_count
width: text_message_count.implicitWidth+10
height: text_message_count.implicitHeight+10
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.rightMargin: 15
anchors.bottomMargin: 5
color: "red"
radius: height
visible: myinfo.unreadMessagesCount>0
Text{
id: text_message_count
anchors.centerIn: parent
text: myinfo.unreadMessagesCount//未读消息的个数
color: "white"
onTextChanged: {
if(text == "100"){
text = "99+"
}
}
}
}
Rectangle{
height: 1
anchors.left: avatar.left
anchors.right: rect_message_count.right
anchors.bottom: parent.bottom
color: "#ddd"
}
MouseArea{
anchors.fill: parent
onDoubleClicked: {
myqq.addChatPage(myinfo.uin, myinfo.mytype)
}
}
}
}
}
================================================
FILE: qml/MainPanel/MainPanelPage.qml
================================================
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import mywindow 1.0
import "ListPage"
Item{
id: root
clip:true
Text{
id: text_nick
x: 10
font.pointSize: 16
font.bold: true
color: "black"
text: myqq.nick
}
Text{
id: text_signature
anchors.left: text_nick.left
anchors.top: text_nick.bottom
anchors.topMargin: 10
color: "black"
font.pointSize: 8
Component.onCompleted: {
myqq.getQQSignature(myqq.userQQ, getMeSignature)//去网络请求签名
}
function getMeSignature(data){//获得自己的个性签名成功后
data = JSON.parse(data)
if( data.retcode==0 ){
text = data.result[0].lnick
}
}
}
AllListPage{
anchors.top: text_signature.bottom
anchors.topMargin: 1
width: root.width-4
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: 2
}
}
================================================
FILE: qml/MainPanel/main.qml
================================================
import QtQuick 2.2
import mywindow 1.0
import QtQuick.Window 2.1
import utility 1.0
import "../Utility"
import "../Chat"
import qqstars 1.0
//import Qt.labs.settings 1.0
MyWindow{
id:main
visible: true//可视的
noBorder: true//无边框的
removable: true//可移动的
fixedSize: false//固定大小的
dockableWindow: true//可停靠的
topHint: true//窗口保持在最前端
noNotifyIcon: true//隐藏任务栏图标
color: "transparent"
centered: false
minimumWidth: 220
minimumHeight: 400
maximumWidth: 500
maximumHeight: 700
width: 240
height: 500
Component.onCompleted: {
width = Math.max(200, minimumWidth)
height = Math.max(500, minimumHeight)
main.x = Screen.desktopAvailableWidth - main.actualWidth
main.y = 20
}
function windowToActive(){//将窗口转为活动状态
main.showFront()
if(main.visible) {
main.showWindow()//从停靠状态转为可停靠状态
}
}
Connections{
target: systemTray
onActivated:{
if( arg == MySystemTrayIcon.Trigger ) {
windowToActive()//将窗口转为活动状态
}
}
onTriggered: {
if(arg == "打开主面板"){
windowToActive()//将窗口转为活动状态
}
}
}
Rectangle{
anchors.fill: parent
radius: 10
gradient: Gradient {
GradientStop { position: 0 ; color: "#EEEDEC" }
GradientStop { position: 120/main.height ; color: "#E7E5E4" }
GradientStop { position: 120/main.height+0.01 ; color: "#f9f9f8" }
GradientStop { position: 1 ; color: "#f9f9f8" }
}
SvgView{
id:image_quit_icon
width: defaultSize.width*myqq.windowScale
source: "qrc:/images/button-quit.svg"
anchors.left: parent.left
anchors.top: parent.top
anchors.margins: 10
MouseArea{
anchors.fill: parent
onClicked: {
myqq.state = QQ.Offline//将状态改为离线
Qt.quit()
}
}
}
SvgView{
id:image_minimize_icon
width: defaultSize.width*myqq.windowScale
source: "qrc:/images/button-minimize.svg"
anchors.top: image_quit_icon.top
anchors.left: image_quit_icon.right
MouseArea{
anchors.fill: parent
onClicked: {
main.showMinimized()
}
}
}
MainPanelPage{
id: panel_page
anchors.top: image_minimize_icon.bottom
anchors.topMargin: 10
anchors.bottom: parent.bottom
width: parent.width
}
}
}
================================================
FILE: qml/QQItemInfo/DiscuInfo.qml
================================================
import QtQuick 2.2
import QQItemInfo 1.0
DiscuInfo{
userQQ: myqq.userQQ
}
================================================
FILE: qml/QQItemInfo/FriendInfo.qml
================================================
import QQItemInfo 1.0
import QtQuick 2.2
FriendInfo{
id: root
property bool getImageing: false//记录是否正在获取图片
userQQ: myqq.userQQ
onUinChanged: {//如果uin变了
myqq.getFriendQQ( uin, getQQFinished )//获取好友的真实qq号
}
function getUserDataFinished(error, data){//获取资料完成
if(error){//如果出错了
myqq.getUserData(uin, getUserDataFinished)//去获取好友资料
return
}
data = JSON.parse(data)
if( data.retcode==0 ){
nick = data.result.nick//设置昵称
}
}
function getQQFinished(error, data){//获取好友真实qq后调用的函数
//console.log(root.uin+"获得真实QQ结束:"+data)
if(error){
myqq.getFriendQQ( uin, getQQFinished )//获取好友的真实qq号
return
}
data = JSON.parse(data)
if( data.retcode==0 ){
account = data.result.account
if( avatar40=="qrc:/images/avatar.png" )
getAvatar(40)//去获取头像
}
}
function getAvatarFinished( error, path ,name){
getImageing = false//获取图像结束
if(error){//如果出错了
getAvatar(40)//重新获取
return
}
var imageName = path+"/"+name
avatar40 = imageName//保存自己头像的地址
//console.log(nick+"获取头像完成:"+imageName)
}
function getQQSignatureFinished(error, data){//获取个性签名完成
if(error){
myqq.getQQSignature( uin, getQQSignatureFinished )//获取个性签名
return
}
data = JSON.parse(data)
if( data.retcode==0 ){
QQSignature = data.result[0].lnick//储存个性签名
}
}
onHttpGetQQSignature:{//如果收到c++端发来的去获取个性签名的信号
myqq.getQQSignature( uin, getQQSignatureFinished )//获取个性签名
}
function getAvatar(size){
if(account!=""&&!getImageing){
getImageing = true//正在获取头像
myqq.downloadImage(QQItemInfo.Friend
, "http://q.qlogo.cn/headimg_dl?spec="+String(size)+"&dst_uin="+account
, account, String(size), getAvatarFinished)//下载头像
}
}
onAvatar40Changed: {
if( avatar40=="qrc:/images/avatar.png" )
getAvatar(40)
}
}
================================================
FILE: qml/QQItemInfo/GroupInfo.qml
================================================
import QtQuick 2.2
import QQItemInfo 1.0
GroupInfo{
id: root
property bool getImageing: false//记录是否正在获取图片
userQQ: myqq.userQQ
onCodeChanged: {
//console.log(nick+"将要获取真实qq")
if(code!=""){
myqq.getFriendQQ(code, getQQFinished)//获得真实qq
}
}
onAccountChanged: {
if(account==""&&code!="")
myqq.getFriendQQ(nick, getQQFinished)//获得真实qq
}
function getQQFinished(error, data){//获取真实群号后调用的函数
if(error){
myqq.getFriendQQ(code, getQQFinished)
return
}
data = JSON.parse(data)
if( data.retcode==0 ){
account = data.result.account
//console.log(code+"的真实qq:"+account)
if(avatar40=="qrc:/images/avatar.png")
getAvatar(40)
}
}
function getAvatarFinished( error, path ,name){
getImageing=false//将正在获取头像置为false
if(error){//如果出错了
getAvatar(40)//重新获取
return
}
var imageName = path+"/"+name
avatar40 = imageName
}
function getAvatar(size){
if(account!=""&&!getImageing){
getImageing = true//置为true,不然可能会多次请求头像
myqq.downloadImage(QQItemInfo.Group
, "http://p.qlogo.cn/gh/"+account+"/"+account+"/"+String(size)
, account, String(size), getAvatarFinished)//下载头像
}
}
onAvatar40Changed: {
if(avatar40=="qrc:/images/avatar.png")
getAvatar(40)
}
}
================================================
FILE: qml/Utility/CodeInput.qml
================================================
import mywindow 1.0
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import utility 1.0
import qqstars 1.0
MyWindow{
id: root_window
visible: true//可视的
color: "transparent"
noBorder: true//无边框的
removable: true//可移动的
fixedSize: true//固定大小的
dockableWindow: false//可停靠的
topHint: false//窗口保持在最前端
noNotifyIcon: true//隐藏任务栏图标
modality : Qt.ApplicationModal
width: root_page.width
height: root_page.height
property string code: code_input.text
property var backFun//验证码获取成功后调用此函数
property alias source: code_image.source
function updateCode(){
var temp = source
source = ""
source = temp
code_input.text = ""
}
SvgView {
id:root_page
width: 300*myqq.windowScale
source: "qrc:/images/login-panel.svg"
SvgView{
id:image_quit_icon
width: defaultSize.width*myqq.windowScale
source: "qrc:/images/button-quit.svg"
anchors.left: parent.left
anchors.top: parent.top
anchors.margins: 10
MouseArea{
anchors.fill: parent
onClicked: root_window.close()
}
}
Text{
id: text_code
text: "请输入验证码"
anchors.left: parent.left
anchors.top: parent.top
anchors.leftMargin: root_page.width/15
anchors.topMargin: root_page.height/6
color: "#f47421"
font.pointSize: root_page.height/25
}
TextField{
id: code_input
anchors.left: code_image.left
anchors.top: code_image.bottom
anchors.topMargin: 10
width: code_image.width
height: root_page.height/12
font.pointSize: text_code.font.pointSize
style: TextFieldStyle {
textColor: "black"
background: BorderImage {
source: "qrc:/images/background_input.png"
border.left: 5; border.top: 5
border.right: 5; border.bottom: 5
}
}
Component.onCompleted: code_input.forceActiveFocus()
}
Image{
id: code_image
width: 130
height: 53
cache: false
anchors.horizontalCenter: parent.horizontalCenter
anchors.top :text_code.top
anchors.topMargin: root_page.height/12
MouseArea{
anchors.fill: parent
onClicked: {
updateCode()
}
}
}
MyButton{
id: button_affirm
anchors.bottom: parent.bottom
anchors.bottomMargin: root_page.height/20
width: 19/42*parent.width
anchors.horizontalCenter: parent.horizontalCenter
text:"确 认"
font.pointSize: width/15
onClicked: {
if( myqq.loginStatus == QQ.Logining&&code_input.text!="" ) {
backFun(code_input.text)
}
}
}
Keys.onEnterPressed: {
button_affirm.clicked()
}
Keys.onReturnPressed: {
button_affirm.clicked()
}
}
}
================================================
FILE: qml/Utility/ComboBox/MyComboBox.qml
================================================
import QtQuick 2.2
import mywindow 1.0
Item{
id: root
signal accepted
property int currentIndex
property var currentValue
property ListModel model
property MyComboBoxComponent mycomboboxcomponent
onCurrentIndexChanged: {
mytext.text = model.get(currentIndex).text
currentValue = model.get(currentIndex).value
}
property alias currentText: mytext.text
property bool hovered: false
property bool pressed: false
property bool isComboBoxCloseing: false
onIsComboBoxCloseingChanged: {
if(isComboBoxCloseing&&!root.hovered){
pressed = false
isComboBoxCloseing = false
}
}
BorderImage {
id: background
anchors.fill: parent
source: "qrc:/images/background_input.png"
border.left: 5; border.top: 5
border.right: 5; border.bottom: 5
Text {
id: mytext
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 5
text: model.get(0).text
font.pointSize: root.height/2
}
SvgView {
source: "qrc:/images/inputBox-more.svg"
rotation: root.pressed?180:0
anchors.right: parent.right
anchors.rightMargin: 5
anchors.verticalCenter: parent.verticalCenter
}
MouseArea{
id: mymouse
anchors.fill: parent
hoverEnabled: true
onEntered: root.hovered=true
onExited: root.hovered=false
onClicked: {
root.pressed=!root.pressed
if(isComboBoxCloseing){
isComboBoxCloseing = false
}else if( root.pressed ){
var component = Qt.createComponent("MyComboBoxComponent.qml");
if (component.status == Component.Ready){
var temp = utility.mouseDesktopPos();
var data = {"root":root, "mymodel":model, "x":temp.x-mouse.x, "y":temp.y+root.height-mouse.y+5, "width": root.width, "height": root.height*model.count, "visible":true}
mycomboboxcomponent = component.createObject(root, data);
}
}
}
}
}
}
================================================
FILE: qml/Utility/ComboBox/MyComboBoxComponent.qml
================================================
import QtQuick 2.2
import QtQuick.Window 2.0
Window{
id: rootwindow
flags: Qt.SplashScreen
color: "transparent"
property bool isCanClose: false
property ListModel mymodel
property var root
onFocusObjectChanged: {
if( isCanClose ){
root.isComboBoxCloseing=true
close()
} else
isCanClose = true
}
Rectangle{
anchors.fill: parent
color: "white"
radius: 5
border.width: 1
border.color: "#f07000"
}
ListView{
id: list
interactive: false
anchors.fill: parent
model: mymodel
delegate: Component{
Item{
width: root.width
height: root.height
Rectangle{
width: parent.width-4
height: parent.height-4
anchors.centerIn: parent
color: "#f07900"
radius: 5
visible: mymouse.hovered
}
Text {
id: text
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 5
text: model.text
color: mymouse.hovered?"white":"black"
font.pointSize: parent.height/2
}
MouseArea{
id: mymouse
anchors.fill: parent
hoverEnabled: true
property bool hovered: false
onEntered: {
hovered = true
}
onExited: {
hovered = false
}
onClicked: {
root.pressed=false
root.currentIndex = index
root.accepted()
rootwindow.close()
}
}
}
}
}
}
================================================
FILE: qml/Utility/KeyboardPage/SoftKeyboard.qml
================================================
import QtQuick 2.2
import QtQuick.Window 2.1
import mywindow 1.0
Window{
id:root
visible: true
property bool is: false
x: utility.mouseDesktopPos().x - 200
y: utility.mouseDesktopPos().y + 13
width: 450*myqq.windowScale
height: 2/7*width
flags: Qt.SplashScreen
signal input(var arg)
signal backspace(var arg)
signal keyboardClose
Rectangle {
anchors.fill: parent
radius: 3
border.width:1
border.color: "#F07000"
gradient: Gradient {
GradientStop { position: 0 ; color: "#E7E5E4" }
GradientStop { position: 1 ; color: "#D9D7D6" }
}
}
SvgView{
width: defaultSize.width*myqq.windowScale
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: 2
source: "qrc:/images/inputBox-close.svg"
MouseArea{
anchors.fill: parent
onClicked: {
root.close()
keyboardClose()
}
}
}
Component.onCompleted: {
object.createKeyboard()
}
QtObject{
id: object
property string ascii1_1: "0123456789`-=[]\\;',./"
property string ascii1_2: ")!@#$%^&*(~_+{}|:\"<>?"
property string ascii2_1: "abcdefghijklmnopqrstuvwxyz"
property string ascii2_2: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
function randomOrder (targetArray)
{
var arrayLength = targetArray.length//先创建一个正常顺序的数组
var tempArray1 = new Array();
for (var i = 0; i < arrayLength; i ++){
tempArray1 [i] = i
}
var tempArray2 = new Array();//再根据上一个数组创建一个随机乱序的数组
for (var i = 0; i < arrayLength; i ++){//从正常顺序数组中随机抽出元素
tempArray2 [i] = tempArray1.splice (Math.floor (Math.random () * tempArray1.length) , 1)
}
var tempArray3 = new Array();//最后创建一个临时数组存储 根据上一个乱序的数组从targetArray中取得数据
for (var i = 0; i < arrayLength; i ++){
tempArray3 [i] = targetArray [tempArray2 [i]]
}
return tempArray3//返回最后得出的数组
}
function createObject(parent, data) {
var component = Qt.createComponent("SoftKeyboardButton.qml");
if (component.status == Component.Ready){
return component.createObject(parent, data);
}
}
function createKeyboard(){
var data = {"text1": "Shift", "isShiftButton": true,"width": root.width/8, "height":root.width/17}
var shift = createObject(row2, data)
var temp = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];
temp = randomOrder(temp)//随机排序
for( var i=0;i<11;++i ){
data = {"width": root.width/17, "height":root.width/17,"text1": ascii1_1[temp[i]],"text2": ascii1_2[temp[i]],"switchButton": shift,"backFun": input}
createObject(row1, data);
}
data = {"text1": "Backspace","width": root.width/6, "height":root.width/17,"backFun": backspace}
var backsoace = createObject(row1,data);
for( i=11;i<21;++i ){
data = {"width": root.width/17, "height":root.width/17,"text1": ascii1_1[temp[i]],"text2": ascii1_2[temp[i]],"switchButton": shift,"backFun": input}
createObject(row2, data);
}
data = {"text1": "CapsLock","width": root.width/6, "height":root.width/17,"isShiftButton":true}
var capslock = createObject(row2,data);
temp = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
temp = randomOrder(temp)//随机排序
for( i=0;i<13;++i ){
data = {"width": root.width/17, "height":root.width/17,"text1": ascii2_1[temp[i]],"text2": ascii2_2[temp[i]],"switchButton": capslock,"backFun": input}
createObject(row3, data);
}
for( i=13;i<26;++i ){
data = {"width": root.width/17, "height":root.width/17,"text1": ascii2_1[temp[i]],"text2": ascii2_2[temp[i]],"switchButton": capslock,"backFun": input}
createObject(row4, data);
}
}
}
Grid{
anchors.centerIn: parent
spacing: 3
rows:4
horizontalItemAlignment : Qt.AlignHCenter
Row{id:row1;spacing: 3}
Row{id:row2;spacing: 3}
Row{id:row3;spacing: 3}
Row{id:row4;spacing: 3}
}
onFocusObjectChanged: {
if( is ){
root.close()
keyboardClose()
}
else
is = true
}
}
================================================
FILE: qml/Utility/KeyboardPage/SoftKeyboardButton.qml
================================================
import QtQuick 2.2
Rectangle{
id: root
border.width: 1//control.activeFocus ? 2 : 1
border.color: "#888"
radius: 4
property string text1: ""
property string text2: ""
property Item switchButton: null
property bool shiftText: false
property bool isShiftButton: false
property bool isLetter: false
property var backFun//回调函数,按下按键就调用这个函数
signal trigger(var arg)
onTrigger: {
if( backFun )
backFun(arg)
}
Connections{
target: (isShiftButton||isLetter)?null:switchButton
onTrigger: {
shiftText = !shiftText
}
}
Text{
text:text1
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.margins: 5
visible: text2!=""
color: shiftText?"#999":"black"
font.bold: shiftText?false:true
font.pointSize: root.width/3
}
Text{
text:text2
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: 5
visible: text2!=""
color: !shiftText?"#999":"black"
font.bold: !shiftText?false:true
font.pointSize: root.width/3
}
Text{
text: text1
anchors.centerIn: parent
visible: text2==""
font.pointSize: root.width/7
}
MouseArea{
id:mouse
anchors.fill: parent
hoverEnabled: true
property bool mouseArea: false
onEntered: {
mouseArea = true
}
onExited: {
mouseArea = false
}
onClicked: {
if(isShiftButton){
shiftText =!shiftText
trigger(text1)
}else if( text2=="" )
trigger(text1)
else{
if( shiftText )
trigger(text2)
else
trigger(text1)
}
}
}
gradient: Gradient {
GradientStop {
position: 0
color: {
if(isShiftButton&&shiftText){
return "#f09000"
}else
return (mouse.pressed||mouse.mouseArea)?"#f09000":"#fff"
}
}
GradientStop {
position: 1
color: {
if(isShiftButton&&shiftText){
return "#f07000"
}else
return (mouse.pressed||mouse.mouseArea)?"#f07000":"#eee"
}
}
}
}
================================================
FILE: qml/Utility/MyButton.qml
================================================
import QtQuick 2.2
Rectangle {
id: root
property alias pressed: mymouse.pressed
property bool hovered: false
property alias font: text.font
property alias text: text.text
signal clicked
implicitWidth: 80
implicitHeight: 20
radius: 6
border.width: 1
border.color: "#aaa"
gradient: Gradient {
GradientStop { position: 0 ; color: {
if(!root.enabled)
return "#888"
if( root.pressed )
return "#ff9000"
if( root.hovered )
return "#eee"
return "#fff"
}
}
GradientStop { position: 1 ; color: {
if(!root.enabled)
return "#777"
if( root.pressed )
return "#f07000"
if( root.hovered )
return "#ddd"
return "#eee"
}
}
}
Text{
id: text
text: parent.text
anchors.centerIn: parent
color: parent.pressed?"white":"black"
}
MouseArea{
id: mymouse
anchors.fill: parent
hoverEnabled: true
onClicked: {
root.clicked()
}
onEntered: {
root.hovered = true
}
onExited: {
root.hovered = false
}
}
}
================================================
FILE: qml/Utility/MyMessageBox.qml
================================================
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
MyWindow {
id:root
visible: true//可视的
noBorder: true//无边框的
removable: true//可移动的
fixedSize: true//固定大小的
dockableWindow: false//可停靠的
topHint: true//窗口保持在最前端
noNotifyIcon: true//隐藏任务栏图标
modality : Qt.ApplicationModal
color: "transparent"
width: 360
height: 200
property string text
Component.onCompleted: {
button_ok.forceActiveFocus()
}
Rectangle{
anchors.fill: parent
gradient: Gradient {
GradientStop { position: 0 ; color: "#EEEDEC" }
GradientStop { position: 1 ; color: "#f9f9f8" }
}
radius: 10
Text{
id: text
text: root.text
anchors.centerIn: parent
wrapMode :Text.WordWrap//自动换行
color: "#f47421"
width: parent.width-20
anchors.bottom: button_ok.top
anchors.top: parent.top
anchors.margins: 10
}
MyButton{
id: button_ok
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: 10
width: 60
height: 25
text: "确认"
Keys.onEnterPressed: {
button_ok.clicked()
}
Keys.onReturnPressed: {
button_ok.clicked()
}
onClicked: {
root.close()
}
}
}
}
================================================
FILE: qml/Utility/MyRectangularGlow.qml
================================================
import QtQuick 2.2
Item{
id: root
x: actualX+glowLeftWidth
y: actualY+glowTopHeight
property Item item: null
property int glowTopHeight: (shaderItem.height-rootItem.height)/2-rootItem.y
property int glowBottomHeight: shaderItem.height-height-glowTopHeight
property int glowLeftWidth: (shaderItem.height-rootItem.height)/2-rootItem.x
property int glowRightWidth: shaderItem.width-width-glowLeftWidth
property int actualWidth: glowLeftWidth+width+glowRightWidth
property int actualHeight: glowTopHeight+height+glowBottomHeight
onItemChanged: {
item.parent=root
}
property real biasX: 0//阴影偏移量
property real biasY: 0//阴影偏移量
property alias glowRadius: rootItem.glowRadius
property alias spread: rootItem.spread
property alias color: rootItem.color
property alias cornerRadius: rootItem.cornerRadius
property alias cached: rootItem.cached
property alias glowOpacity: rootItem.opacity
property int actualX: 0//真实的X,算着阴影
onActualXChanged: {
x = actualX+glowLeftWidth
}
property int actualY: 0//真实的Y,算着阴影
onActualYChanged: {
y = actualY+glowTopHeight
}
onXChanged: {
actualX = x-glowLeftWidth
}
onYChanged: {
actualY = y-glowTopHeight
}
Item {
id: rootItem
property real glowRadius: 0.0
property real spread: 0.0
property color color: "white"
property real cornerRadius: glowRadius
property bool cached: false
x: (biasX>0?biasX:0)
y: (biasY>0?biasY:0)
width: root.width-biasX
height: root.height-biasY
ShaderEffectSource {
id: cacheItem
anchors.fill: shaderItem
visible: rootItem.cached
smooth: true
sourceItem: shaderItem
live: true
hideSource: visible
}
ShaderEffect {
id: shaderItem
x: (parent.width - width) / 2.0
y: (parent.height - height) / 2.0
width: parent.width + rootItem.glowRadius * 2 + cornerRadius * 2
height: parent.height + rootItem.glowRadius * 2 + cornerRadius * 2
function clampedCornerRadius() {
var maxCornerRadius = Math.min(rootItem.width, rootItem.height) / 2 + glowRadius;
return Math.max(0, Math.min(rootItem.cornerRadius, maxCornerRadius))
}
property color color: rootItem.color
property real inverseSpread: 1.0 - rootItem.spread
property real relativeSizeX: ((inverseSpread * inverseSpread) * rootItem.glowRadius + cornerRadius * 2.0) / width
property real relativeSizeY: relativeSizeX * (width / height)
property real spread: rootItem.spread / 2.0
property real cornerRadius: clampedCornerRadius()
fragmentShader: "
uniform highp float qt_Opacity;
uniform mediump float relativeSizeX;
uniform mediump float relativeSizeY;
uniform mediump float spread;
uniform lowp vec4 color;
varying highp vec2 qt_TexCoord0;
highp float linearstep(highp float e0, highp float e1, highp float x) {
return clamp((x - e0) / (e1 - e0), 0.0, 1.0);
}
void main() {
lowp float alpha =
smoothstep(0.0, relativeSizeX, 0.5 - abs(0.5 - qt_TexCoord0.x)) *
smoothstep(0.0, relativeSizeY, 0.5 - abs(0.5 - qt_TexCoord0.y));
highp float spreadMultiplier = linearstep(spread, 1.0 - spread, alpha);
gl_FragColor = color * qt_Opacity * spreadMultiplier * spreadMultiplier;
}
"
}
}
}
================================================
FILE: qml/Utility/MyScrollView.qml
================================================
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
ScrollView{
id:root
anchors.fill: parent
style: ScrollViewStyle{
id: scroll_style
property int hovered_count: 0
property bool hovered: hovered_count>0
handle: Rectangle{
radius: 10
implicitWidth: 10
property bool hovered: styleData.hovered
onHoveredChanged: {
if( hovered )
scroll_style.hovered_count++
else
scroll_style.hovered_count--
}
color: scroll_style.hovered?"#808080":"#BDBFBE"
}
scrollBarBackground:Rectangle{
implicitWidth: 10
color:"#f0f0f0"
radius: 10
property bool hovered: styleData.hovered
onHoveredChanged: {
if( hovered )
scroll_style.hovered_count++
else
scroll_style.hovered_count--
}
opacity: scroll_style.hovered?1:0
Behavior on opacity{
NumberAnimation{
duration: 200
}
}
}
decrementControl : Item{
implicitHeight: 10
implicitWidth: 10
Image{
source: "qrc:/images/list_arrow_up.png"
property bool hovered: styleData.hovered
anchors.centerIn: parent
onHoveredChanged: {
if( hovered )
scroll_style.hovered_count++
else
scroll_style.hovered_count--
}
opacity: scroll_style.hovered?1:0
Behavior on opacity{
NumberAnimation{
duration: 200
}
}
}
}
incrementControl : Item{
implicitHeight: 10
implicitWidth: 10
Image{
anchors.centerIn: parent
source: "qrc:/images/list_arrow_down.png"
property bool hovered: styleData.hovered
onHoveredChanged: {
if( hovered )
scroll_style.hovered_count++
else
scroll_style.hovered_count--
}
opacity: scroll_style.hovered?1:0
Behavior on opacity{
NumberAnimation{
duration: 200
}
}
}
}
}
}
================================================
FILE: qml/Utility/MyTextArea.qml
================================================
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QtQuick.Controls.Private 1.0
ScrollView {
id: area
property alias activeFocusOnPress: edit.activeFocusOnPress
property alias baseUrl: edit.baseUrl
readonly property alias canPaste: edit.canPaste
readonly property alias canRedo: edit.canRedo
readonly property alias canUndo: edit.canUndo
property alias textColor: edit.color
property alias cursorPosition: edit.cursorPosition
property alias font: edit.font
property alias horizontalAlignment: edit.horizontalAlignment
readonly property alias effectiveHorizontalAlignment: edit.effectiveHorizontalAlignment
property alias verticalAlignment: edit.verticalAlignment
property alias inputMethodHints: edit.inputMethodHints
readonly property alias length: edit.length
readonly property alias lineCount: edit.lineCount
property alias readOnly: edit.readOnly
Accessible.readOnly: readOnly
readonly property alias selectedText: edit.selectedText
readonly property alias selectionEnd: edit.selectionEnd
readonly property alias selectionStart: edit.selectionStart
property bool tabChangesFocus: false
property alias text: edit.text
property alias textFormat: edit.textFormat
property alias wrapMode: edit.wrapMode
property alias selectByMouse: edit.selectByMouse
property alias selectByKeyboard: edit.selectByKeyboard
signal linkActivated(string link)
signal linkHovered(string link)
readonly property alias hoveredLink: edit.hoveredLink
property alias textDocument: edit.textDocument
default property alias data: area.data
property alias textMargin: edit.textMargin
frameVisible: true
activeFocusOnTab: true
Accessible.role: Accessible.EditableText
function append (string) {
edit.append(string)
__verticalScrollBar.value = __verticalScrollBar.maximumValue
}
function copy() {
edit.copy();
}
function cut() {
edit.cut();
}
function deselect() {
edit.deselect();
}
function getFormattedText(start, end) {
return edit.getFormattedText(start, end);
}
function getText(start, end) {
return edit.getText(start, end);
}
function insert(position, text) {
edit.insert(position, text);
}
function isRightToLeft(start, end) {
return edit.isRightToLeft(start, end);
}
function moveCursorSelection(position, mode) {
edit.moveCursorSelection(position, mode);
}
function paste() {
edit.paste();
}
function positionAt(x, y) {
return edit.positionAt(x, y);
}
function positionToRectangle(position) {
return edit.positionToRectangle(position);
}
function redo() {
edit.redo();
}
function remove(start, end) {
return edit.remove(start, end);
}
function select(start, end) {
edit.select(start, end);
}
function selectAll() {
edit.selectAll();
}
function selectWord() {
edit.selectWord();
}
function undo() {
edit.undo();
}
style: ScrollViewStyle {
id: scroll_style
//textColor: "black"
frame: Rectangle{
color: "#f5f5f5"
radius: 5
border.width: 2
border.color: "#ddd"
}
property int hovered_count: 0
property bool hovered: hovered_count>0
handle: Rectangle{
radius: 10
implicitWidth: 10
property bool hovered: styleData.hovered
onHoveredChanged: {
if( hovered )
scroll_style.hovered_count++
else
scroll_style.hovered_count--
}
color: scroll_style.hovered?"#808080":"#BDBFBE"
}
scrollBarBackground:Rectangle{
implicitWidth: 10
color:"#f0f0f0"
radius: 10
property bool hovered: styleData.hovered
onHoveredChanged: {
if( hovered )
scroll_style.hovered_count++
else
scroll_style.hovered_count--
}
opacity: scroll_style.hovered?1:0
Behavior on opacity{
NumberAnimation{
duration: 200
}
}
}
decrementControl : Item{
implicitHeight: 10
implicitWidth: 10
Image{
source: "qrc:/images/list_arrow_up.png"
property bool hovered: styleData.hovered
anchors.centerIn: parent
onHoveredChanged: {
if( hovered )
scroll_style.hovered_count++
else
scroll_style.hovered_count--
}
opacity: scroll_style.hovered?1:0
Behavior on opacity{
NumberAnimation{
duration: 200
}
}
}
}
incrementControl : Item{
implicitHeight: 10
implicitWidth: 10
Image{
anchors.centerIn: parent
source: "qrc:/images/list_arrow_down.png"
property bool hovered: styleData.hovered
onHoveredChanged: {
if( hovered )
scroll_style.hovered_count++
else
scroll_style.hovered_count--
}
opacity: scroll_style.hovered?1:0
Behavior on opacity{
NumberAnimation{
duration: 200
}
}
}
}
}
Flickable {
id: flickable
interactive: false
anchors.fill: parent
TextEdit {
id: edit
focus: true
property int layoutRecursionDepth: 0
textFormat :TextEdit.RichText
function doLayout() {
// scrollbars affect the document/viewport size and vice versa, so we
// must allow the layout loop to recurse twice until the sizes stabilize
if (layoutRecursionDepth <= 2) {
layoutRecursionDepth++
if (wrapMode == TextEdit.NoWrap) {
__horizontalScrollBar.visible = edit.contentWidth > viewport.width
edit.width = Math.max(viewport.width, edit.contentWidth)
} else {
__horizontalScrollBar.visible = false
edit.width = viewport.width
}
edit.height = Math.max(viewport.height, edit.contentHeight)
flickable.contentWidth = edit.contentWidth
flickable.contentHeight = edit.contentHeight
layoutRecursionDepth--
}
}
Connections {
target: area.viewport
onWidthChanged: edit.doLayout()
onHeightChanged: edit.doLayout()
}
onContentWidthChanged: edit.doLayout()
onContentHeightChanged: edit.doLayout()
onWrapModeChanged: edit.doLayout()
renderType: Text.NativeRendering
font: TextSingleton.font
color: "black"
selectionColor: "#888"
selectedTextColor: "white"
wrapMode: TextEdit.WordWrap
textMargin: 4
selectByMouse: Qt.platform.os !== "android" // Workaround for QTBUG-36515
readOnly: false
Keys.forwardTo: area
KeyNavigation.priority: KeyNavigation.BeforeItem
KeyNavigation.tab: area.tabChangesFocus ? area.KeyNavigation.tab : null
KeyNavigation.backtab: area.tabChangesFocus ? area.KeyNavigation.backtab : null
// keep textcursor within scroll view
onCursorPositionChanged: {
if (cursorRectangle.y >= flickableItem.contentY + viewport.height - cursorRectangle.height - textMargin) {
// moving down
flickableItem.contentY = cursorRectangle.y - viewport.height + cursorRectangle.height + textMargin
} else if (cursorRectangle.y < flickableItem.contentY) {
// moving up
flickableItem.contentY = cursorRectangle.y - textMargin
}
if (cursorRectangle.x >= flickableItem.contentX + viewport.width - textMargin) {
// moving right
flickableItem.contentX = cursorRectangle.x - viewport.width + textMargin
} else if (cursorRectangle.x < flickableItem.contentX) {
// moving left
flickableItem.contentX = cursorRectangle.x - textMargin
}
}
onLinkActivated: area.linkActivated(link)
onLinkHovered: area.linkHovered(link)
MouseArea {
parent: area.viewport
anchors.fill: parent
cursorShape: edit.hoveredLink ? Qt.PointingHandCursor : Qt.IBeamCursor
acceptedButtons: Qt.NoButton
}
}
}
Keys.onPressed: {
if (event.key == Qt.Key_PageUp) {
__verticalScrollBar.value -= area.height
} else if (event.key == Qt.Key_PageDown)
__verticalScrollBar.value += area.height
}
}
================================================
FILE: qml/Utility/MyTextField.qml
================================================
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
Item{
id: root
property alias title: text.text
property alias text: input.text
property alias font: input.font
property alias field: input
Text {
id: text
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
font.pointSize: root.height/2
}
TextField{
id: input
anchors.left: text.right
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
font.pointSize:text.font.pointSize
style: TextFieldStyle {
textColor: "black"
background: BorderImage {
source: "qrc:/images/background_input.png"
border.left: 5; border.top: 5
border.right: 5; border.bottom: 5
}
}
}
Rectangle{
radius: 1
anchors.top: input.top
anchors.topMargin: 2
anchors.bottom: input.bottom
anchors.bottomMargin: 0
anchors.left: input.left
anchors.leftMargin: 1
anchors.right: parent.right
anchors.rightMargin: 1
visible: !root.enabled
color: "#f0efef"
opacity: 0.75
}
}
================================================
FILE: qml/Utility/MyTextView.qml
================================================
import QtQuick 2.2
import QtWebKit 3.0
Item{
id:root
property string html: ""
property alias url: webview.url
implicitWidth: webview.contentWidth
implicitHeight: webview.contentHeight
onHtmlChanged: {
webview.loadHtml(html)
}
WebView{
id: webview
anchors.fill: parent
}
}
================================================
FILE: qml/Utility/MyWindow.qml
================================================
import QtQuick 2.2
import mywindow 1.0
import QtQuick.Window 2.1
MyQuickWindow{
id: root
property bool removable: true//窗口可移动?
property bool fixedSize: false//窗口是否固定大小?
property bool fixedTopBorder: false//固定上边框,上边不可拉动
property bool fixedBottomBorder: false//同上
property bool fixedLeftBorder: false//同上
property bool fixedRightBorder: false//同上
property var setTopBorder: mySetTopBorder//用鼠标拉动上边框后调用的函数
property var setBottomBorder: mySetBottomBorder//同上
property var setLeftBorder: mySetLeftBorder//同上
property var setRightBorder: mySetRightBorder//同上
property bool dockableWindow: false//窗口可停靠?
property bool windowGlow: true//开启窗口阴影?
property alias windowGlowItem: glow//阴影Item
property int windowShakeInterval: animation_shake.duration*16///窗口抖动的时间
property bool centered: true//初次显示时是否居中
property int contentItemAreaTop: -5//设定内容区域的上边界坐标
property int contentItemAreaBottom: contentItemAreaTop+height+10//同上
property int contentItemAreaLeft: -5//同上
property int contentItemAreaRight: contentItemAreaLeft+width+10//同上
signal manulPullLeftBorder//如果用户在窗口左边拉动改变了窗口大小
signal manulPullRightBorder//同上
signal manulPullTopBorder//同上
signal manulPullBottomBorder//同上
actualWidth: windowGlow?glow.actualWidth:width+2*mouse_left.width
actualHeight: windowGlow?glow.actualHeight:height+2*mouse_top.height
onContentItemAreaTopChanged: updateMousePenetrateArea()
onContentItemAreaBottomChanged: updateMousePenetrateArea()
onContentItemAreaLeftChanged: updateMousePenetrateArea()
onContentItemAreaRightChanged: updateMousePenetrateArea()
Component.onCompleted: {
if(centered){
var old_visible = visible
visible = false
actualX = Screen.desktopAvailableWidth/2 - actualWidth/2
actualY = Screen.desktopAvailableHeight/2 - actualHeight/2
visible = old_visible
}
}
contentItem{
x: windowGlow?glow.glowLeftWidth:mouse_left.width
y: windowGlow?glow.glowTopHeight:mouse_top.height
}
Connections{
target: windowGlow?contentItem:null
onWidthChanged:{
contentItem.width=width
}
onHeightChanged:{
contentItem.height=height
}
}
QtObject{
id: obj
property int windowShakeCount: 0
property real back_glowOpacity
Component.onCompleted: {
back_glowOpacity = glow.glowOpacity
}
}
function updateMousePenetrateArea(){
var rect = Qt.rect(contentItemAreaLeft, contentItemAreaTop, 0, 0)
rect.width = contentItemAreaRight - rect.x + 1
rect.height = contentItemAreaBottom - rect.y + 1
setMousePenetrateArea(rect)
}
function windowShake() {//抖动窗口
if(obj.windowShakeCount>=root.windowShakeInterval/animation_shake.duration/4){
obj.windowShakeCount=0
return
}
++obj.windowShakeCount
showFront()//先把窗口显示在最前端
animation_shake.property = "x"
animation_shake.to = root.x-20
animation_shake.backFun=function(){
animation_shake.property = "y"
animation_shake.to = root.y-20
animation_shake.backFun=function(){
animation_shake.property="x"
animation_shake.to=root.x+20
animation_shake.backFun=function(){
animation_shake.property="y"
animation_shake.to=root.y+20
animation_shake.backFun=function(){
windowShake()//进行递归调用
}
animation_shake.start()
}
animation_shake.start()
}
animation_shake.start()
}
animation_shake.start()
}
function showFront() {//显示到最前面
if(root.visible) {
if( root.visibility== MyQuickWindow.Minimized){
root.show()
}
root.requestActivate()//让窗体显示到最前端
}
}
function berthWindow(){
if( root.windowStatus!=MyQuickWindow.BerthPrepare||animation.running ) {//如果不是准停状态
return
}
if( root.x==root.borderLeft ){
root.windowStatus = MyQuickWindow.BerthLeft
animation.property = "x"
animation.to = root.borderLeft-width+1
animation.start()
}else if( root.x==root.borderRight-root.width ){
root.windowStatus = MyQuickWindow.BerthRight
animation.property = "x"
animation.to = root.borderRight-1
animation.start()
}else if( root.y==root.borderTop ){
root.windowStatus = MyQuickWindow.BerthTop
animation.property = "y"
animation.to = root.borderTop-height+1
animation.start()
}
}
function showWindow(){///从停靠状态转为可停靠状态
if( animation.running ) {//如果动画正在运行
return
}
switch( windowStatus ){
case MyQuickWindow.BerthTop:
{
animation.property = "y"
animation.to = root.borderTop
animation.start()
root.windowStatus = MyQuickWindow.BerthPrepare//进入准停靠状态
break;
}
case MyQuickWindow.BerthLeft:
{
animation.property = "x"
animation.to = root.borderLeft
animation.start()
root.windowStatus = MyQuickWindow.BerthPrepare//进入准停靠状态
gitextract_ckkfy0u8/ ├── .gitignore ├── QQStars.pro ├── README.md ├── deployment.pri ├── faces.qrc ├── images.qrc ├── other.qrc ├── qml/ │ ├── Api/ │ │ ├── QQApi.qml │ │ └── api.js │ ├── Chat/ │ │ ├── ChatPage.qml │ │ ├── ChatWindowCommand.qml │ │ ├── DiscuChatPage.qml │ │ ├── FriendChatPage.qml │ │ ├── GroupChatPage.qml │ │ └── MessageListComponent.qml │ ├── Login/ │ │ ├── LoginPanel/ │ │ │ ├── AccountList.qml │ │ │ ├── LoginCheckBox.qml │ │ │ ├── LoginInputArea.qml │ │ │ └── LoginPage.qml │ │ ├── MyLoginButton.qml │ │ ├── SettingPage.qml │ │ └── main.qml │ ├── MainPanel/ │ │ ├── ListPage/ │ │ │ ├── AllListPage.qml │ │ │ ├── DiscuList.qml │ │ │ ├── FriendList.qml │ │ │ ├── GroupAndDiscuPage.qml │ │ │ ├── GroupList.qml │ │ │ └── RecentList.qml │ │ ├── MainPanelPage.qml │ │ └── main.qml │ ├── QQItemInfo/ │ │ ├── DiscuInfo.qml │ │ ├── FriendInfo.qml │ │ └── GroupInfo.qml │ └── Utility/ │ ├── CodeInput.qml │ ├── ComboBox/ │ │ ├── MyComboBox.qml │ │ └── MyComboBoxComponent.qml │ ├── KeyboardPage/ │ │ ├── SoftKeyboard.qml │ │ └── SoftKeyboardButton.qml │ ├── MyButton.qml │ ├── MyMessageBox.qml │ ├── MyRectangularGlow.qml │ ├── MyScrollView.qml │ ├── MyTextArea.qml │ ├── MyTextField.qml │ ├── MyTextView.qml │ ├── MyWindow.qml │ ├── SystemTray.qml │ └── TrayMessageWindow.qml ├── qml.qrc ├── qmlapplicationviewer.pri ├── qt_zh_CN.qm ├── src/ │ ├── main.cpp │ ├── mywidgets/ │ │ ├── myimage.cpp │ │ ├── myimage.h │ │ ├── mymessagebox.cpp │ │ ├── mymessagebox.h │ │ ├── mysvgview.cpp │ │ ├── mysvgview.h │ │ ├── mywindow.cpp │ │ ├── mywindow.h │ │ ├── systemtrayicon.cpp │ │ └── systemtrayicon.h │ ├── qqstars/ │ │ ├── qqiteminfo.cpp │ │ ├── qqiteminfo.h │ │ ├── qqstars.cpp │ │ └── qqstars.h │ ├── qxtglobalshortcut/ │ │ ├── myshortcut.cpp │ │ ├── myshortcut.h │ │ ├── qxtglobal.h │ │ ├── qxtglobalshortcut.cpp │ │ ├── qxtglobalshortcut.h │ │ ├── qxtglobalshortcut.pri │ │ ├── qxtglobalshortcut_mac.cpp │ │ ├── qxtglobalshortcut_p.h │ │ ├── qxtglobalshortcut_win.cpp │ │ └── qxtglobalshortcut_x11.cpp │ └── utility/ │ ├── downloadimage.cpp │ ├── downloadimage.h │ ├── myhttprequest.cpp │ ├── myhttprequest.h │ ├── mynetworkaccessmanagerfactory.cpp │ ├── mynetworkaccessmanagerfactory.h │ ├── texteditplaygif.cpp │ ├── texteditplaygif.h │ ├── utility.cpp │ └── utility.h ├── style/ │ ├── menuStyle.css │ └── messageBoxStyle.css └── style.qrc
SYMBOL INDEX (167 symbols across 33 files)
FILE: qml/Api/api.js
function md5 (line 5) | function md5(a) {
function hex_md5 (line 8) | function hex_md5(a) {
function str_md5 (line 11) | function str_md5(a) {
function hex_hmac_md5 (line 14) | function hex_hmac_md5(a, b) {
function b64_hmac_md5 (line 17) | function b64_hmac_md5(a, b) {
function str_hmac_md5 (line 20) | function str_hmac_md5(a, b) {
function core_md5 (line 23) | function core_md5(p, k) {
function md5_cmn (line 110) | function md5_cmn(h, e, d, c, g, f) {
function md5_ff (line 113) | function md5_ff(g, f, k, j, e, i, h) {
function md5_gg (line 116) | function md5_gg(g, f, k, j, e, i, h) {
function md5_hh (line 119) | function md5_hh(g, f, k, j, e, i, h) {
function md5_ii (line 122) | function md5_ii(g, f, k, j, e, i, h) {
function core_hmac_md5 (line 125) | function core_hmac_md5(c, f) {
function safe_add (line 139) | function safe_add(a, d) {
function bit_rol (line 144) | function bit_rol(a, b) {
function str2binl (line 147) | function str2binl(d) {
function binl2str (line 155) | function binl2str(c) {
function binl2hex (line 163) | function binl2hex(c) {
function binl2b64 (line 171) | function binl2b64(d) {
function hexchar2bin (line 186) | function hexchar2bin(str) {
function uin2hex (line 195) | function uin2hex(str) {
function hexToString (line 211) | function hexToString( hex ) {
function encryptionPassword (line 220) | function encryptionPassword( password , uin ,code) {
function getHash (line 227) | function getHash(b, j) {//b为自己的uin(qq号),j为ptwebqq,获取地址http://web.qstatic...
FILE: src/main.cpp
function main (line 24) | int main(int argc, char *argv[])
FILE: src/mywidgets/myimage.cpp
function QUrl (line 39) | QUrl MyImage::source() const
function QUrl (line 44) | QUrl MyImage::maskSource() const
function QString (line 74) | QString MyImage::imageFormatToString(const QByteArray &array)
function QSize (line 194) | QSize MyImage::sourceSize() const
function QSize (line 199) | QSize MyImage::defaultSize() const
function QPixmap (line 204) | const QPixmap *MyImage::getPixmap() const
FILE: src/mywidgets/myimage.h
type State (line 32) | enum State{
FILE: src/mywidgets/mymessagebox.cpp
function QUrl (line 22) | QUrl MyMessageBox::styleSource() const
FILE: src/mywidgets/mymessagebox.h
function class (line 8) | class MyMessageBox : public QMessageBox
FILE: src/mywidgets/mysvgview.cpp
function QUrl (line 21) | QUrl MySvgView::source() const
function QSize (line 26) | QSize MySvgView::defaultSize() const
FILE: src/mywidgets/mywindow.cpp
function test (line 17) | bool test(QObject *, Qt::ShortcutContext)
function QPoint (line 129) | QPoint MyWindow::cursorPos() const
function QUrl (line 134) | QUrl MyWindow::windowIcon()
FILE: src/mywidgets/mywindow.h
function class (line 11) | class MyWindow : public QQuickWindow
FILE: src/mywidgets/systemtrayicon.cpp
function MyMenu (line 28) | MyMenu *SystemTrayIcon::menu() const
function QUrl (line 33) | QUrl SystemTrayIcon::windowIcon() const
function QString (line 38) | QString SystemTrayIcon::toolTip() const
function QUrl (line 108) | QUrl MyMenuItem::icon() const
function QString (line 112) | QString MyMenuItem::shortcut() const
function QUrl (line 170) | QUrl MyMenu::styleSource() const
function QString (line 185) | QString MyMenu::styleSheet() const
FILE: src/mywidgets/systemtrayicon.h
function class (line 12) | class MenuPrivate: public QMenu
function QUrl (line 29) | QUrl icon() const;
type ActivationReason (line 106) | enum ActivationReason {
FILE: src/qqstars/qqiteminfo.cpp
function QString (line 5) | QString ChatMessageInfo::senderUin() const
function QString (line 10) | QString ChatMessageInfo::contentData() const
function QDate (line 15) | QDate ChatMessageInfo::date() const
function QTime (line 20) | QTime ChatMessageInfo::time() const
function QQItemInfo (line 35) | const QQItemInfo *ChatMessageInfo::getParent()
function DatabaseOperation (line 96) | DatabaseOperation *DatabaseOperation::createDatabaseOperation()
function QString (line 301) | QString QQItemInfo::uin() const
function QString (line 306) | QString QQItemInfo::nick() const
function QString (line 311) | QString QQItemInfo::alias() const
function QString (line 317) | QString QQItemInfo::avatar40() const
function QString (line 329) | QString QQItemInfo::avatar240() const
function QString (line 341) | QString QQItemInfo::aliasOrNick()
function QString (line 349) | QString QQItemInfo::userQQ() const
function QString (line 354) | QString QQItemInfo::typeToString()
function QString (line 359) | const QString QQItemInfo::typeToString(QQItemInfo::QQItemType type)
function QString (line 374) | const QString QQItemInfo::localCachePath(QQItemInfo::QQItemType type, co...
function QString (line 395) | QString QQItemInfo::account() const
function QString (line 478) | const QString QQItemInfo::localCachePath() const
function ChatMessageInfoList (line 483) | ChatMessageInfoList *QQItemInfo::getChatRecords()
function ChatMessageInfo (line 519) | ChatMessageInfo *QQItemInfo::getChatMessageInfoById(int messageID)
function QString (line 561) | QString FriendInfo::QQSignature()
function QString (line 571) | QString FriendInfo::stateToString() const
function QString (line 713) | QString GroupInfo::code() const
function QString (line 723) | QString GroupInfo::announcement() const
function QString (line 779) | QString GroupInfo::getMemberCardByUin(const QString &uin, const QString ...
function FriendInfo (line 784) | FriendInfo *GroupInfo::getMemberInfoByIndex(int index)
function FriendInfo (line 842) | FriendInfo *DiscuInfo::getMemberInfoByIndex(int index)
function QObject (line 868) | QObject *RecentInfo::infoData() const
function FriendInfo (line 873) | FriendInfo *RecentInfo::infoToFriend() const
function GroupInfo (line 878) | GroupInfo *RecentInfo::infoToGroup() const
function DiscuInfo (line 883) | DiscuInfo *RecentInfo::infoToDiscu() const
function ChatMessageInfo (line 923) | ChatMessageInfo *ChatMessageInfoList::at(int i)
function foreach (line 956) | foreach (ChatMessageInfo* info, list) {
function ChatMessageInfo (line 964) | ChatMessageInfo *ChatMessageInfoList::dequeue()
function ChatMessageInfo (line 969) | ChatMessageInfo* ChatMessageInfoList::find(int messageID)
FILE: src/qqstars/qqiteminfo.h
function QString (line 31) | QString senderUin() const;
function class (line 80) | class DatabaseOperation:public QObject//提供数据库的操作(用于储存聊天记录)
type QQItemType (line 123) | enum QQItemType{
type States (line 215) | enum States{//登录后的用户的qq状态
function membersCount (line 297) | int membersCount() const;
FILE: src/qqstars/qqstars.cpp
function QQCommand (line 11) | QQCommand *QQCommand::getFirstQQCommand()
function QString (line 70) | QString QQCommand::userPassword() const
function QString (line 80) | QString QQCommand::userQQ() const
function QString (line 99) | QString QQCommand::codeText() const
function foreach (line 133) | foreach (QJsonValue temp, arr) {
function foreach (line 206) | foreach (QQuickItem *item, map_chatPage) {
function QString (line 342) | QString QQCommand::disposeMessage(QJsonObject &obj, ChatMessageInfo* mes...
function QString (line 640) | QString QQCommand::doubleToString(QJsonObject &obj, const QString &name)
function QString (line 650) | QString QQCommand::textToHtml(QQCommand::FontStyle &style, QString data)
function QQItemInfo (line 692) | QQItemInfo *QQCommand::createQQItemInfo(const QString& uin, const QStrin...
function FriendInfo (line 828) | FriendInfo* QQCommand::createFriendInfo(const QString uin)
function GroupInfo (line 834) | GroupInfo* QQCommand::createGroupInfo(const QString uin)
function DiscuInfo (line 840) | DiscuInfo* QQCommand::createDiscuInfo(const QString uin)
function foreach (line 915) | foreach (QQuickItem *temp, map_chatPage) {//改变当前活跃页面为首先找到的第一个不为空的chatPage
function QVariant (line 928) | QVariant QQCommand::value(const QString &key, const QVariant &defaultVal...
function QString (line 959) | QString QQCommand::getMovieImageFrameCachePath()
function QQItemInfo (line 975) | QQItemInfo *QQCommand::createQQItemInfo(const QString& uin, QQItemInfo::...
function foreach (line 983) | foreach (QQItemInfo* info, map_itemInfo) {
function QString (line 990) | QString QQCommand::disposeImageMessage(ChatMessageInfo* message_info, QS...
function QString (line 1009) | QString QQCommand::getImageUrlById(int image_id)
function QString (line 1067) | QString QQCommand::getHash()
function QString (line 1074) | QString QQCommand::encryptionPassword(const QString &uin, const QString ...
function QVariant (line 1081) | QVariant QQCommand::getLoginedQQInfo()
function foreach (line 1110) | foreach (QString qq, qq_list) {
FILE: src/qqstars/qqstars.h
function class (line 18) | class QQCommand : public FriendInfo
FILE: src/qxtglobalshortcut/myshortcut.cpp
function QString (line 26) | QString MyShortcut::shortcut() const
function QObject (line 41) | QObject *MyShortcut::target() const
function foreach (line 61) | foreach (QString key, list) {
FILE: src/qxtglobalshortcut/myshortcut.h
function class (line 17) | class MyShortcut : public QObject
FILE: src/qxtglobalshortcut/qxtglobal.h
function QXT_setPublic (line 156) | inline void QXT_setPublic(PUB* pub)
function setPublic (line 189) | inline void setPublic(PUB* pub)
function PVT (line 193) | inline PVT& operator()()
FILE: src/qxtglobalshortcut/qxtglobalshortcut.cpp
function QKeySequence (line 165) | QKeySequence QxtGlobalShortcut::shortcut() const
FILE: src/qxtglobalshortcut/qxtglobalshortcut.h
function class (line 33) | class QxtGlobalShortcut : public QObject
FILE: src/qxtglobalshortcut/qxtglobalshortcut_mac.cpp
function OSStatus (line 38) | OSStatus qxt_mac_handle_hot_key(EventHandlerCallRef nextHandler, EventRe...
function quint32 (line 73) | quint32 QxtGlobalShortcutPrivate::nativeModifiers(Qt::KeyboardModifiers ...
function quint32 (line 89) | quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key)
FILE: src/qxtglobalshortcut/qxtglobalshortcut_win.cpp
function quint32 (line 54) | quint32 QxtGlobalShortcutPrivate::nativeModifiers(Qt::KeyboardModifiers ...
function quint32 (line 72) | quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key)
FILE: src/qxtglobalshortcut/qxtglobalshortcut_x11.cpp
function qxt_x_errhandler (line 31) | static int qxt_x_errhandler(Display* display, XErrorEvent *event)
function quint32 (line 78) | quint32 QxtGlobalShortcutPrivate::nativeModifiers(Qt::KeyboardModifiers ...
function quint32 (line 95) | quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key)
FILE: src/utility/downloadimage.cpp
function MyHttpRequest (line 19) | MyHttpRequest *DownloadImage::getHttpRequest()
function QString (line 24) | QString DownloadImage::imageFormatToString(const QByteArray &array)
FILE: src/utility/downloadimage.h
function class (line 20) | class DownloadImage : public QObject
FILE: src/utility/myhttprequest.cpp
function NetworkAccessManager (line 26) | const NetworkAccessManager *MyHttpRequest::getNetworkAccessManager()
function QNetworkRequest (line 31) | QNetworkRequest* MyHttpRequest::getNetworkRequest()
function QString (line 198) | QString MyHttpRequest::errorString()
FILE: src/utility/myhttprequest.h
function Q_OBJECT (line 18) | Q_OBJECT
FILE: src/utility/mynetworkaccessmanagerfactory.cpp
function QNetworkAccessManager (line 12) | QNetworkAccessManager* MyNetworkAccessManagerFactory::create(QObject *pa...
function QNetworkReply (line 35) | QNetworkReply *NetworkAccessManager::createRequest(Operation op, const Q...
function NetworkCookieJar (line 73) | NetworkCookieJar* NetworkCookieJar::GetInstance()
FILE: src/utility/mynetworkaccessmanagerfactory.h
function class (line 21) | class NetworkAccessManager : public QNetworkAccessManager
function class (line 31) | class NetworkCookieJar : public QNetworkCookieJar
FILE: src/utility/texteditplaygif.cpp
function QQuickTextEdit (line 18) | QQuickTextEdit *TextEditPlayGif::target() const
function QUrl (line 23) | QUrl TextEditPlayGif::cachePath() const
function foreach (line 76) | foreach (MovieData data, list_movie) {
function QString (line 92) | QString TextEditPlayGif::getUrlByMovie(QMovie *movie)
function QString (line 101) | QString TextEditPlayGif::getGifNameByMovie(QMovie *movie)
function foreach (line 141) | foreach (QString str, list_errorUrl) {
function foreach (line 196) | foreach (QString img, reg.capturedTexts ()) {
function saveImage (line 267) | void saveImage(const QString& name, QImage image)
FILE: src/utility/texteditplaygif.h
function class (line 12) | class TextEditPlayGif : public QObject
FILE: src/utility/utility.cpp
function Utility (line 9) | Utility *Utility::createUtilityClass()
function QByteArray (line 36) | QByteArray Utility::strZoarium(const QByteArray &str)
function QByteArray (line 52) | QByteArray Utility::unStrZoarium(const QByteArray &str)
function QByteArray (line 77) | QByteArray Utility::fillContent(const QByteArray &str, int length)
function QString (line 99) | QString Utility::getCookie(QString cookieName)
function QQmlApplicationEngine (line 109) | QQmlApplicationEngine *Utility::qmlEngine()
function MyHttpRequest (line 114) | MyHttpRequest *Utility::getHttpRequest()
function DownloadImage (line 119) | DownloadImage *Utility::getDownloadImage()
function QPoint (line 143) | QPoint Utility::mouseDesktopPos()
function QVariant (line 162) | QVariant Utility::value(const QString &key, const QVariant &defaultValue...
function QString (line 247) | QString Utility::stringEncrypt(const QString &content, QString key)
function QString (line 271) | QString Utility::stringUncrypt(const QString &content, QString key)
function myRemovePath (line 295) | bool myRemovePath(QString dirPath, bool deleteHidden, bool deleteSelf)
FILE: src/utility/utility.h
function Q_OBJECT (line 16) | Q_OBJECT
Condensed preview — 89 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (516K chars).
[
{
"path": ".gitignore",
"chars": 284,
"preview": "# C++ objects and libs\n\n*.slo\n*.lo\n*.o\n*.a\n*.la\n*.lai\n*.so\n*.dll\n*.dylib\n\n# Qt-es\n\n/.qmake.cache\n/.qmake.stash\n*.pro.use"
},
{
"path": "QQStars.pro",
"chars": 3463,
"preview": "TEMPLATE = app\r\nTARGET = QQStars\r\n\r\nQT += widgets network webkit svg qml quick concurrent sql quick-private#widgets-priv"
},
{
"path": "README.md",
"chars": 1568,
"preview": "#### 接口都已失效,此程序不再更新。\n\nQQStars\n=======\n\n[](htt"
},
{
"path": "deployment.pri",
"chars": 601,
"preview": "android-no-sdk {\r\n target.path = /data/user/qt\r\n export(target.path)\r\n INSTALLS += target\r\n} else:android {\r\n "
},
{
"path": "faces.qrc",
"chars": 10008,
"preview": "<RCC>\r\n <qresource prefix=\"/\">\r\n <file>faces/classic/0.gif</file>\r\n <file>faces/classic/0.png</file>\r\n "
},
{
"path": "images.qrc",
"chars": 3620,
"preview": "<RCC>\n <qresource prefix=\"/\">\n <file>images/avatar.svg</file>\n <file>images/avatar_left.png</file>\n "
},
{
"path": "other.qrc",
"chars": 90,
"preview": "<RCC>\n <qresource prefix=\"/\">\n <file>qt_zh_CN.qm</file>\n </qresource>\n</RCC>\n"
},
{
"path": "qml/Api/QQApi.qml",
"chars": 14452,
"preview": "import QtQuick 2.2\r\nimport utility 1.0\r\nimport QtQuick.Window 2.1\r\nimport QQItemInfo 1.0\r\nimport qqstars 1.0\r\n\r\nQQ{\r\n "
},
{
"path": "qml/Api/api.js",
"chars": 8933,
"preview": "var hexcase = 1;\r\nvar b64pad = \"\";\r\nvar chrsz = 8;\r\nvar mode = 32;\r\nfunction md5(a) {\r\n return hex_md5(a)\r\n}\r\nfunctio"
},
{
"path": "qml/Chat/ChatPage.qml",
"chars": 6352,
"preview": "import QtQuick 2.2\r\nimport utility 1.0\r\nimport mywindow 1.0\r\nimport QQItemInfo 1.0\r\nimport \"../\"\r\nimport \"../Utility\"\r\n\r"
},
{
"path": "qml/Chat/ChatWindowCommand.qml",
"chars": 12428,
"preview": "import QtQuick 2.2\r\nimport utility 1.0\r\nimport mywindow 1.0\r\nimport QQItemInfo 1.0\r\nimport \"../Utility\"\r\n\r\nMyWindow{\r\n "
},
{
"path": "qml/Chat/DiscuChatPage.qml",
"chars": 4466,
"preview": "import QtQuick 2.2\r\nimport utility 1.0\r\nimport QQItemInfo 1.0\r\nimport mywindow 1.0\r\nimport \"../Utility\"\r\n\r\nChatPage{\r\n "
},
{
"path": "qml/Chat/FriendChatPage.qml",
"chars": 1111,
"preview": "import QtQuick 2.2\r\nimport utility 1.0\r\nimport \"../QQItemInfo\"\r\n\r\nChatPage{\r\n id: root\r\n myinfo: myuin!=\"\"?myqq.cr"
},
{
"path": "qml/Chat/GroupChatPage.qml",
"chars": 6480,
"preview": "import QtQuick 2.2\r\nimport utility 1.0\r\nimport mywindow 1.0\r\nimport QQItemInfo 1.0\r\nimport \"../Utility\"\r\n\r\nChatPage{\r\n "
},
{
"path": "qml/Chat/MessageListComponent.qml",
"chars": 4232,
"preview": "import QtQuick 2.2\r\nimport mywindow 1.0\r\nimport QQItemInfo 1.0\r\nimport MyTextEditPlugin 1.0\r\nimport \"../Utility\"\r\n\r\nComp"
},
{
"path": "qml/Login/LoginPanel/AccountList.qml",
"chars": 4050,
"preview": "import QtQuick 2.2\r\nimport QtQuick.Window 2.1\r\nimport mywindow 1.0\r\nimport utility 1.0\r\n\r\nWindow{\r\n id:root\r\n heig"
},
{
"path": "qml/Login/LoginPanel/LoginCheckBox.qml",
"chars": 1210,
"preview": "import QtQuick 2.2\r\nimport QtQuick.Controls 1.2\r\nimport QtQuick.Controls.Styles 1.2\r\nimport mywindow 1.0\r\n\r\nCheckBox {\r\n"
},
{
"path": "qml/Login/LoginPanel/LoginInputArea.qml",
"chars": 6253,
"preview": "import QtQuick 2.2\r\nimport QtQuick.Controls 1.2\r\nimport QtQuick.Controls.Styles 1.2\r\nimport mywindow 1.0\r\n\r\nItem{\r\n i"
},
{
"path": "qml/Login/LoginPanel/LoginPage.qml",
"chars": 14251,
"preview": "import QtQuick 2.2\r\nimport utility 1.0\r\nimport QtQuick.Controls 1.2\r\nimport QtQuick.Controls.Styles 1.2\r\nimport QtQuick."
},
{
"path": "qml/Login/MyLoginButton.qml",
"chars": 1045,
"preview": "import QtQuick 2.2\r\nimport mywindow 1.0\r\n\r\nSvgView{\r\n id:root\r\n //sourceSize.width: width\r\n property alias text"
},
{
"path": "qml/Login/SettingPage.qml",
"chars": 7316,
"preview": "import QtQuick 2.2\r\nimport QtQuick.Controls 1.2\r\nimport QtQuick.Controls.Styles 1.2\r\nimport utility 1.0\r\nimport mywindow"
},
{
"path": "qml/Login/main.qml",
"chars": 5280,
"preview": "import QtQuick 2.2\r\nimport QtQuick.Particles 2.0\r\nimport mywindow 1.0\r\nimport utility 1.0\r\n//import Qt.labs.settings 1.0"
},
{
"path": "qml/MainPanel/ListPage/AllListPage.qml",
"chars": 3336,
"preview": "import QtQuick 2.2\r\nimport QtQuick.Controls 1.2\r\nimport QtQuick.Controls.Styles 1.2\r\nimport mywindow 1.0\r\n\r\nTabView {\r\n "
},
{
"path": "qml/MainPanel/ListPage/DiscuList.qml",
"chars": 2326,
"preview": "import QtQuick 2.2\r\nimport mywindow 1.0\r\nimport utility 1.0\r\nimport \"../\"\r\nimport \"../../Utility\"\r\nimport QQItemInfo 1.0"
},
{
"path": "qml/MainPanel/ListPage/FriendList.qml",
"chars": 9680,
"preview": "import QtQuick 2.2\r\nimport mywindow 1.0\r\nimport utility 1.0\r\nimport \"../\"\r\nimport \"../../Utility\"\r\nimport QQItemInfo 1.0"
},
{
"path": "qml/MainPanel/ListPage/GroupAndDiscuPage.qml",
"chars": 1945,
"preview": "import QtQuick 2.2\r\nimport QtQuick.Controls 1.2\r\nimport QtQuick.Controls.Styles 1.2\r\n\r\nItem{\r\n TabView{\r\n anch"
},
{
"path": "qml/MainPanel/ListPage/GroupList.qml",
"chars": 2857,
"preview": "import QtQuick 2.2\r\nimport mywindow 1.0\r\nimport utility 1.0\r\nimport \"../\"\r\nimport \"../../Utility\"\r\nimport QQItemInfo 1.0"
},
{
"path": "qml/MainPanel/ListPage/RecentList.qml",
"chars": 5117,
"preview": "import QtQuick 2.2\r\nimport mywindow 1.0\r\nimport QQItemInfo 1.0\r\nimport \"../\"\r\nimport \"../../QQItemInfo\"\r\nimport \"../../U"
},
{
"path": "qml/MainPanel/MainPanelPage.qml",
"chars": 1104,
"preview": "import QtQuick 2.2\r\nimport QtQuick.Controls 1.2\r\nimport QtQuick.Controls.Styles 1.2\r\nimport mywindow 1.0\r\nimport \"ListPa"
},
{
"path": "qml/MainPanel/main.qml",
"chars": 2908,
"preview": "import QtQuick 2.2\r\nimport mywindow 1.0\r\nimport QtQuick.Window 2.1\r\nimport utility 1.0\r\nimport \"../Utility\"\r\nimport \"../"
},
{
"path": "qml/QQItemInfo/DiscuInfo.qml",
"chars": 85,
"preview": "import QtQuick 2.2\r\nimport QQItemInfo 1.0\r\n\r\nDiscuInfo{\r\n userQQ: myqq.userQQ\r\n}\r\n"
},
{
"path": "qml/QQItemInfo/FriendInfo.qml",
"chars": 2291,
"preview": "import QQItemInfo 1.0\r\nimport QtQuick 2.2\r\n\r\nFriendInfo{\r\n id: root\r\n \r\n property bool getImageing: false//记录是否"
},
{
"path": "qml/QQItemInfo/GroupInfo.qml",
"chars": 1608,
"preview": "import QtQuick 2.2\r\nimport QQItemInfo 1.0\r\n\r\nGroupInfo{\r\n id: root\r\n property bool getImageing: false//记录是否正在获取图片\r"
},
{
"path": "qml/Utility/CodeInput.qml",
"chars": 3490,
"preview": "import mywindow 1.0\r\nimport QtQuick 2.2\r\nimport QtQuick.Controls 1.2\r\nimport QtQuick.Controls.Styles 1.2\r\nimport utility"
},
{
"path": "qml/Utility/ComboBox/MyComboBox.qml",
"chars": 2408,
"preview": "import QtQuick 2.2\r\nimport mywindow 1.0\r\n\r\nItem{\r\n id: root\r\n signal accepted\r\n property int currentIndex\r\n "
},
{
"path": "qml/Utility/ComboBox/MyComboBoxComponent.qml",
"chars": 2185,
"preview": "import QtQuick 2.2\r\nimport QtQuick.Window 2.0\r\n\r\nWindow{\r\n id: rootwindow\r\n flags: Qt.SplashScreen\r\n color: \"tr"
},
{
"path": "qml/Utility/KeyboardPage/SoftKeyboard.qml",
"chars": 4837,
"preview": "import QtQuick 2.2\r\nimport QtQuick.Window 2.1\r\nimport mywindow 1.0\r\n\r\nWindow{\r\n id:root\r\n visible: true\r\n prope"
},
{
"path": "qml/Utility/KeyboardPage/SoftKeyboardButton.qml",
"chars": 2841,
"preview": "import QtQuick 2.2\r\n\r\nRectangle{\r\n id: root\r\n border.width: 1//control.activeFocus ? 2 : 1\r\n border.color: \"#88"
},
{
"path": "qml/Utility/MyButton.qml",
"chars": 1442,
"preview": "import QtQuick 2.2\r\n\r\nRectangle {\r\n id: root\r\n property alias pressed: mymouse.pressed\r\n property bool hovered:"
},
{
"path": "qml/Utility/MyMessageBox.qml",
"chars": 1621,
"preview": "import QtQuick 2.2\r\nimport QtQuick.Controls 1.2\r\nimport QtQuick.Controls.Styles 1.2\r\n\r\nMyWindow {\r\n id:root\r\n visi"
},
{
"path": "qml/Utility/MyRectangularGlow.qml",
"chars": 4015,
"preview": "import QtQuick 2.2\r\n\r\nItem{\r\n id: root\r\n x: actualX+glowLeftWidth\r\n y: actualY+glowTopHeight\r\n property Item"
},
{
"path": "qml/Utility/MyScrollView.qml",
"chars": 2765,
"preview": "import QtQuick 2.2\r\nimport QtQuick.Controls 1.2\r\nimport QtQuick.Controls.Styles 1.2\r\n\r\nScrollView{\r\n id:root\r\n anc"
},
{
"path": "qml/Utility/MyTextArea.qml",
"chars": 10025,
"preview": "import QtQuick 2.2\r\nimport QtQuick.Controls 1.2\r\nimport QtQuick.Controls.Styles 1.2\r\nimport QtQuick.Controls.Private 1.0"
},
{
"path": "qml/Utility/MyTextField.qml",
"chars": 1366,
"preview": "import QtQuick 2.2\r\nimport QtQuick.Controls 1.2\r\nimport QtQuick.Controls.Styles 1.2\r\n\r\nItem{\r\n id: root\r\n property"
},
{
"path": "qml/Utility/MyTextView.qml",
"chars": 362,
"preview": "import QtQuick 2.2\r\nimport QtWebKit 3.0\r\n\r\nItem{\r\n id:root\r\n property string html: \"\"\r\n property alias url: web"
},
{
"path": "qml/Utility/MyWindow.qml",
"chars": 16606,
"preview": "import QtQuick 2.2\r\nimport mywindow 1.0\r\nimport QtQuick.Window 2.1\r\n\r\nMyQuickWindow{\r\n id: root\r\n\r\n property bool "
},
{
"path": "qml/Utility/SystemTray.qml",
"chars": 6345,
"preview": "import QtQuick 2.2\r\nimport mywindow 1.0\r\nimport utility 1.0\r\nimport QQItemInfo 1.0\r\nimport qqstars 1.0\r\n\r\nMySystemTrayIc"
},
{
"path": "qml/Utility/TrayMessageWindow.qml",
"chars": 8197,
"preview": "import QtQuick 2.2\r\nimport QtQuick.Window 2.0\r\nimport mywindow 1.0\r\n//import \"../QQItemInfo\"\r\n\r\nWindow{\r\n id: root\r\n "
},
{
"path": "qml.qrc",
"chars": 2290,
"preview": "<RCC>\r\n <qresource prefix=\"/\">\r\n <file>qml/QQItemInfo/DiscuInfo.qml</file>\r\n <file>qml/QQItemInfo/Frien"
},
{
"path": "qmlapplicationviewer.pri",
"chars": 5561,
"preview": "# checksum 0x5b42 version 0x70013\n# This file was generated by the Qt Quick Application wizard of Qt Creator.\n# The code"
},
{
"path": "src/main.cpp",
"chars": 3687,
"preview": "#include <QApplication>\r\n#include <QDebug>\r\n#include <QWidget>\r\n#include <QNetworkProxy>\r\n#include <QNetworkRequest>\r\n#i"
},
{
"path": "src/mywidgets/myimage.cpp",
"chars": 7966,
"preview": "#include \"myimage.h\"\r\n#include <QPainter>\r\n#include <QBitmap>\r\n#include <QDir>\r\n#include <QDebug>\r\n#include <QPixmapCach"
},
{
"path": "src/mywidgets/myimage.h",
"chars": 2925,
"preview": "#ifndef MYIMAGE_H\r\n#define MYIMAGE_H\r\n\r\n#include <QImage>\r\n#include <QPixmap>\r\n#include <QBitmap>\r\n#include <QtNetwork>\r"
},
{
"path": "src/mywidgets/mymessagebox.cpp",
"chars": 1863,
"preview": "#include \"mymessagebox.h\"\r\n#include <QMouseEvent>\r\n#include <QDebug>\r\n#include <QLabel>\r\n#include <QPainter>\r\n#include <"
},
{
"path": "src/mywidgets/mymessagebox.h",
"chars": 779,
"preview": "#ifndef MYMESSAGEBOX_H\r\n#define MYMESSAGEBOX_H\r\n\r\n#include <QMessageBox>\r\n#include <QUrl>\r\n#include <QPixmap>\r\n\r\nclass M"
},
{
"path": "src/mywidgets/mysvgview.cpp",
"chars": 1747,
"preview": "#include \"mysvgview.h\"\r\n#include <QPainter>\r\n#include <QSvgRenderer>\r\n#include <QDebug>\r\n\r\n#if(QT_VERSION>=0x050000)\r\nM"
},
{
"path": "src/mywidgets/mysvgview.h",
"chars": 1275,
"preview": "#ifndef MYSVGVIEW_H\r\n#define MYSVGVIEW_H\r\n\r\n#include <QSvgRenderer>\r\n#if(QT_VERSION>=0x050000)\r\n#include <QQuickPaintedI"
},
{
"path": "src/mywidgets/mywindow.cpp",
"chars": 10871,
"preview": "#include \"mywindow.h\"\r\n#include \"utility.h\"\r\n#include <QDebug>\r\n#include <QQmlComponent>\r\n#include <QApplication>\r\n#incl"
},
{
"path": "src/mywidgets/mywindow.h",
"chars": 5496,
"preview": "#ifndef MYWINDOW_H\r\n#define MYWINDOW_H\r\n\r\n#include <QObject>\r\n#include <QQuickWindow>\r\n#include <QPoint>\r\n#include <QQui"
},
{
"path": "src/mywidgets/systemtrayicon.cpp",
"chars": 6471,
"preview": "#include \"systemtrayicon.h\"\r\n#include <QDebug>\r\n#include <QKeySequence>\r\n#include <QFile>\r\n#include \"utility.h\"\r\n#includ"
},
{
"path": "src/mywidgets/systemtrayicon.h",
"chars": 3892,
"preview": "#ifndef SYSTEMTRAYICON_H\r\n#define SYSTEMTRAYICON_H\r\n\r\n#include <QSystemTrayIcon>\r\n#include <QUrl>\r\n#include <QMenu>\r\n#in"
},
{
"path": "src/qqstars/qqiteminfo.cpp",
"chars": 24677,
"preview": "#include \"qqiteminfo.h\"\r\n#include \"utility.h\"\r\n#include \"qqstars.h\"\r\n\r\nQString ChatMessageInfo::senderUin() const\r\n{\r\n "
},
{
"path": "src/qqstars/qqiteminfo.h",
"chars": 11967,
"preview": "#ifndef QQITEMINFO_H\r\n#define QQITEMINFO_H\r\n\r\n#include <QtSql>\r\n#include <QSettings>\r\n#include <QObject>\r\n#include <QDat"
},
{
"path": "src/qqstars/qqstars.cpp",
"chars": 46151,
"preview": "#include \"qqstars.h\"\r\n#include \"utility.h\"\r\n#include <QJsonDocument>\r\n#include <QSettings>\r\n#include \"mywindow.h\"\r\n#incl"
},
{
"path": "src/qqstars/qqstars.h",
"chars": 9395,
"preview": "#ifndef QQCommand_H\r\n#define QQCommand_H\r\n\r\n#include <QObject>\r\n#include <QDebug>\r\n#include <QByteArray>\r\n#include <QTim"
},
{
"path": "src/qxtglobalshortcut/myshortcut.cpp",
"chars": 6082,
"preview": "#include \"myshortcut.h\"\r\n#include <QEvent>\r\n#include <QKeyEvent>\r\n#include <QCoreApplication>\r\n#include <QDebug>\r\n#inclu"
},
{
"path": "src/qxtglobalshortcut/myshortcut.h",
"chars": 2442,
"preview": "#ifndef MYSHORTCUT_H\r\n#define MYSHORTCUT_H\r\n/*!\r\n * 使用须知:\r\n * 此类为 雨后星辰后来添加,封装了app内部全局热键(通过给QApplication安装事件过滤器)\r\n * 封装了指"
},
{
"path": "src/qxtglobalshortcut/qxtglobal.h",
"chars": 5807,
"preview": "/****************************************************************************\n **\n ** Copyright (C) Qxt Foundation. Some"
},
{
"path": "src/qxtglobalshortcut/qxtglobalshortcut.cpp",
"chars": 6694,
"preview": "/****************************************************************************\r\n **\r\n ** Copyright (C) Qxt Foundation. So"
},
{
"path": "src/qxtglobalshortcut/qxtglobalshortcut.h",
"chars": 2102,
"preview": "/****************************************************************************\r\n **\r\n ** Copyright (C) Qxt Foundation. So"
},
{
"path": "src/qxtglobalshortcut/qxtglobalshortcut.pri",
"chars": 519,
"preview": "INCLUDEPATH += $$PWD \r\nDEPENDPATH += $$PWD \r\n \r\nHEADERS += $$PWD/qxtglobal.h \\ \r\n $$PWD/qxtglobalshortcut.h"
},
{
"path": "src/qxtglobalshortcut/qxtglobalshortcut_mac.cpp",
"chars": 8682,
"preview": "/****************************************************************************\r\n **\r\n ** Copyright (C) Qxt Foundation. So"
},
{
"path": "src/qxtglobalshortcut/qxtglobalshortcut_p.h",
"chars": 2668,
"preview": "/****************************************************************************\r\n **\r\n ** Copyright (C) Qxt Foundation. So"
},
{
"path": "src/qxtglobalshortcut/qxtglobalshortcut_win.cpp",
"chars": 6284,
"preview": "/****************************************************************************\r\n **\r\n ** Copyright (C) Qxt Foundation. So"
},
{
"path": "src/qxtglobalshortcut/qxtglobalshortcut_x11.cpp",
"chars": 4828,
"preview": "/****************************************************************************\r\n **\r\n ** Copyright (C) Qxt Foundation. So"
},
{
"path": "src/utility/downloadimage.cpp",
"chars": 4280,
"preview": "#include \"downloadimage.h\"\r\n#include <QDebug>\r\n#include <QTimer>\r\n#include \"utility.h\"\r\n#include \"myhttprequest.h\"\r\n\r\nD"
},
{
"path": "src/utility/downloadimage.h",
"chars": 1774,
"preview": "#ifndef DOWNLOADIMAGE_H\r\n#define DOWNLOADIMAGE_H\r\n\r\n#include <QObject>\r\n#include <QQueue>\r\n#include <QByteArray>\r\n#inclu"
},
{
"path": "src/utility/myhttprequest.cpp",
"chars": 6961,
"preview": "#include \"myhttprequest.h\"\r\n#include \"utility.h\"\r\n#include \"mynetworkaccessmanagerfactory.h\"\r\n\r\nMyHttpRequest::MyHttpReq"
},
{
"path": "src/utility/myhttprequest.h",
"chars": 3135,
"preview": "#ifndef MYHTTPREQUEST_H\r\n#define MYHTTPREQUEST_H\r\n\r\n#include <QObject>\r\n#include <QtNetwork>\r\n#include <QQueue>\r\n#if(QT_"
},
{
"path": "src/utility/mynetworkaccessmanagerfactory.cpp",
"chars": 2869,
"preview": "#include \"mynetworkaccessmanagerfactory.h\"\r\n#include <QUrl>\r\n#include <QDebug>\r\n\r\nMyNetworkAccessManagerFactory::MyNetwo"
},
{
"path": "src/utility/mynetworkaccessmanagerfactory.h",
"chars": 1414,
"preview": "#ifndef MYNETWORKACCESSMANAGERFACTORY_H\r\n#define MYNETWORKACCESSMANAGERFACTORY_H\r\n\r\n#include <QtQuick>\r\n#include <QtNetw"
},
{
"path": "src/utility/texteditplaygif.cpp",
"chars": 8833,
"preview": "#include \"texteditplaygif.h\"\r\n#include <QRegExp>\r\n#include <QLabel>\r\n#include <QMovie>\r\n#include <QTextImageFormat>\r\n#in"
},
{
"path": "src/utility/texteditplaygif.h",
"chars": 2148,
"preview": "#ifndef TEXTEDITPLAYGIF_H\r\n#define TEXTEDITPLAYGIF_H\r\n\r\n#include <QObject>\r\n#include <QQuickTextDocument>\r\n#include <QLi"
},
{
"path": "src/utility/utility.cpp",
"chars": 9357,
"preview": "#include \"utility.h\"\r\n#include <QDebug>\r\n#include <QtConcurrent>\r\n#include <QApplication>\r\n#include \"mynetworkaccessmana"
},
{
"path": "src/utility/utility.h",
"chars": 3453,
"preview": "#ifndef UTILITY_H\r\n#define UTILITY_H\r\n\r\n#include <QObject>\r\n#include <QString>\r\n#include <QByteArray>\r\n#include <QTimer>"
},
{
"path": "style/menuStyle.css",
"chars": 485,
"preview": " QMenu::item:selected {\r\n background: #F07000;\r\n color:#E6FFFF;\r\n height:25px;\r\n }\r\n "
},
{
"path": "style/messageBoxStyle.css",
"chars": 493,
"preview": "QMessageBox{\r\n background-image: url(\":/images/menu_background.png\");\r\n}\r\nQPushButton {\r\n background-color: qlinea"
},
{
"path": "style.qrc",
"chars": 151,
"preview": "<RCC>\r\n <qresource prefix=\"/\">\r\n <file>style/menuStyle.css</file>\r\n <file>style/messageBoxStyle.css</fi"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the zccrs/QQStars GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 89 files (447.0 KB), approximately 114.1k tokens, and a symbol index with 167 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.