资源简介
这个程序是一个聊天程序,客户端的开始是基于Qt,服务端的开发是基于linux C/C++,只要有linux操作系统,并且安装了Qt,编译就能够运行。运行的时候需要安装mysql数据库,希望多大家学习linux编程和C++编程有帮助。
编辑器建议使用source insight
代码片段和文件信息
#include “addfrienddialog.h“
#include “ui_addfrienddialog.h“
#include
#include
#include
#include
AddFriendDialog::AddFriendDialog(QWidget *parent) :
QDialog(parent)
{
setupUi(this);
this->WindowsetstyleSheet();
Qt::WindowFlags flags=Qt::Dialog;
flags|=Qt::framelessWindowHint;
setWindowFlags(flags);
this->setModal(TRUE);
this->AccountNumLineEdit->setMaxLength(10);
QRegExp regx(“[0-9]+$“);
QValidator *validator = new QRegExpValidator(regx AccountNumLineEdit );
AccountNumLineEdit->setValidator( validator );
AddPushButton->setShortcut(QKeySequence::InsertLineSeparator);
connect(ClosePushButtonSIGNAL(clicked())thisSLOT(ClosePushButtonclick()));
}
AddFriendDialog::~AddFriendDialog()
{
// delete ui;
}
void AddFriendDialog::mouseReleaseEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
dragPosition = QPoint(-1 -1);
event->accept();
}
}
void AddFriendDialog::WindowsetstyleSheet()
{
ClosePushButton->setstyleSheet(“QPushButton{border-image: url(:/new/prefix1/image/delbutton_normal.png);}“
“QPushButton:hover{border-image: url(:/new/prefix1/image/delbutton_highlight.png);}“
“QPushButton:pressed{border-image: url(:/new/prefix1/image/delbutton_down.png);}“);
AddPushButton->setstyleSheet(“QPushButton{border-image: url(:/new/prefix1/image/120.jpg);}“
“QPushButton:hover{border-image: url(:/new/prefix1/image/122.jpg);}“
“QPushButton:pressed{border-image: url(:/new/prefix1/image/120.jpg);}“);
}
void AddFriendDialog::paintEvent(QPaintEvent *)
{
QPainter painter(this);
QPixmap pixmap;
pixmap.load(“:/new/prefix1/image/1.jpg.680.510.jpg“);
painter.drawPixmap(00this->width()this->height()pixmap);
}
void AddFriendDialog::ClosePushButtonclick()
{
this->close();
}
void AddFriendDialog::mousePressEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
dragPosition = event->globalPos() - frameGeometry().topLeft();
event->accept();
}
}
void AddFriendDialog::mouseMoveEvent(QMouseEvent *event)
{
if (event->buttons() &Qt::LeftButton)
{
if (dragPosition != QPoint(-1 -1))
move(event->globalPos() - dragPosition);
event->accept();
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
I.A.... 2448 2014-08-29 10:14 client\addfrienddialog.cpp
I.A.... 668 2014-08-22 14:27 client\addfrienddialog.h
I.A.... 2610 2014-08-22 14:27 client\addfrienddialog.ui
I.A.... 2520 2014-08-30 09:05 client\addgroupdialog.cpp
I.A.... 625 2014-08-22 14:45 client\addgroupdialog.h
I.A.... 2543 2014-08-22 14:48 client\addgroupdialog.ui
I.A.... 6030 2014-08-29 10:22 client\changepassworddialog.cpp
I.A.... 712 2014-08-22 09:02 client\changepassworddialog.h
I.A.... 4044 2014-08-22 10:01 client\changepassworddialog.ui
I.A.... 9970 2014-08-29 20:37 client\chatdialog.cpp
I.A.... 1592 2014-08-29 13:35 client\chatdialog.h
I.A.... 8371 2014-08-27 12:23 client\chatdialog.ui
I.A.... 1152 2014-08-28 22:12 client\client.pro
I.A.... 17792 2014-09-05 08:37 client\client.pro.user
I.A.... 10054 2014-08-29 16:58 client\communitychatdialog.cpp
I.A.... 1504 2014-08-29 14:06 client\communitychatdialog.h
I.A.... 8058 2014-08-29 23:09 client\communitychatdialog.ui
I.A.... 2259 2013-01-15 14:33 client\CustomFont\101\2010_Preview.gif
I.A.... 941 2014-03-24 15:51 client\CustomFont\101\2010_Preview.png
I.A.... 789 2013-01-15 14:33 client\CustomFont\101\CFConfig.xm
I.A.... 900 2014-03-24 15:51 client\CustomFont\101\qie17a.png
I.A.... 891 2014-03-24 15:51 client\CustomFont\101\qie17b.png
I.A.... 2922 2013-01-15 14:33 client\CustomFont\102\2014_preview.gif
I.A.... 585 2014-03-24 15:51 client\CustomFont\102\2014_preview.png
I.A.... 1486 2013-01-15 14:33 client\CustomFont\102\CFConfig.xm
I.A.... 414 2014-03-24 15:51 client\CustomFont\103\01.png
I.A.... 303 2014-03-24 15:51 client\CustomFont\103\02.png
I.A.... 587 2014-03-24 15:51 client\CustomFont\103\03.png
I.A.... 381 2014-03-24 15:51 client\CustomFont\103\04.png
I.A.... 552 2014-03-24 15:51 client\CustomFont\103\05.png
............此处省略233个文件信息
- 上一篇:滑翔段弹道程序
- 下一篇:MFC中文和英文帮助文档(各一份)
相关资源
- Linux+gladeGTK++C语言+mysql的模仿QQ聊天工
- 嵌入式linuxC语言程序设计基础教程
- C Programming in Linux Linux下C语言
- Linux软件工程师(C语言)实用教程_
- linux libstdc++.so.6库
- 基于GEC6818的电子相册和2048小游戏.z
- Linux下C语言FLV文件拆解成h264视频流和
- linux系统下的fit客户端filezilla以及安装
- 经典的编译器gcc2.95.3安装文件已编译
- vnc-4_1_3-x86_linux.tar.gz
- 零点起飞学Linux C编程PPT及习题答案
- minix(1.0-2.0)源码
- linux实验(三)
- linux电子词典小项目
- 手机缴费系统
- Linux C编程一站式学习 宋劲杉
- linux游戏编程c语言
- Linux大作业 web服务器
- libstdc++.so.6.0.18
- libstdc++.so.6.0.24.tar.gz
- linux微型web服务器
- 树莓派opencv环境搭建
- C语言实现linux系统下的MP3播放器源代
- 模拟命令解释器MyShell的设计与实现
- OPC UA C++写的服务器和客户端 linux下的
- qt-eclipse-integration-linux.x86-1.6.1.tar.gz(
- 黑马程序员 UnixLinux基础讲义
- mingw+msys已配置好,移植直接用
- gcc、g++离线安装包
- cmake-3.16.2-Linux-x86_64.tar.gz
评论
共有 条评论