資源簡介
該源碼為多媒體播放器源碼包,是基于linux下Qt編寫的程序,具有一般多媒體播放器的功能:快進,快退,音量,時間等等。對Qt學習很有幫助。

代碼片段和文件信息
#include?“frame.h“
#include?
#include?
#include?
#include?yle>
#include?
#include?ame>
frame::frame()
{
??????m_mouse_down?=?false;
????????setframeShape(Panel);
????????//?Make?this?a?borderless?window?which?can‘t
????????//?be?resized?or?moved?via?the?window?system
????????setWindowFlags(Qt::framelessWindowHint);
????????setMouseTracking(true);
????????m_titleBar?=?new?titleBar(this);
????????m_content?=?new?QWidget(this);
????????QVBoxLayout?*vbox?=?new?QVBoxLayout(this);
????????vbox->addWidget(m_titleBar);
????????vbox->setMargin(0);
????????vbox->setSpacing(0);
????????QVBoxLayout?*layout?=?new?QVBoxLayout(this);
????????layout->addWidget(m_content);
????????layout->setMargin(0);
????????layout->setSpacing(0);
????????vbox->addLayout(layout);
}
void?frame::mousePressEvent(QMouseEvent?*e)
{
??m_old_pos?=?e->pos();
??????m_mouse_down?=?e->button()?==?Qt::LeftButton;
}
void?frame::mouseMoveEvent(QMouseEvent?*e)
{
????????int?x?=?e->x();
????????int?y?=?e->y();
????????if?(m_mouse_down)?{
????????????int?dx?=?x?-?m_old_pos.x();
????????????int?dy?=?y?-?m_old_pos.y();
????????????QRect?g?=?geometry();
????????????if?(left)
????????????????g.setLeft(g.left()?+?dx);
????????????if?(right)
????????????????g.setRight(g.right()?+?dx);
????????????if?(bottom)
????????????????g.setBottom(g.bottom()?+?dy);
????????????setGeometry(g);
????????????m_old_pos?=?QPoint(!left???e->x()?:?m_old_pos.x()?e->y());
????????}?else?{
????????????QRect?r?=?rect();
????????????left?=?qAbs(x?-?r.left())?<=?5;
????????????right?=?qAbs(x?-?r.right())?<=?5;
????????????bottom?=?qAbs(y?-?r.bottom())?<=?5;
????????????bool?hor?=?left?|?right;
????????????if?(hor?&&?bottom)?{
????????????????if?(left)
????????????????????setCursor(Qt::SizeBDiagCursor);
????????????????else
????????????????????setCursor(Qt::SizeFDiagCursor);
????????????}?else?if?(hor)?{
????????????????setCursor(Qt::SizeHorCursor);
????????????}?else?if?(bottom)?{
????????????????setCursor(Qt::SizeVerCursor);
????????????}?else?{
????????????????setCursor(Qt::ArrowCursor);
????????????}
????????}
}
void?frame::mouseReleaseEvent(QMouseEvent?*e)
?{
??????m_mouse_down?=?false;
?}
void?frame::set_titleBartxt(?QString?txt)
{
????this->m_titleBar->settitletxt(txt);
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????614454??2010-09-26?23:35??haohao_old\ti
?????文件????????421??2010-09-28?04:05??haohao_old\haohao.pro
?????文件??????47972??2010-09-28?13:52??haohao_old\qrc_haohao.o
?????文件???????5454??2010-09-26?06:13??haohao_old\play.bmp
?????文件???????2654??2010-09-26?07:27??haohao_old\quit.bmp
?????文件???????9887??2010-09-28?04:04??haohao_old\haohao.pro.user
?????文件?????196170??2010-09-28?13:52??haohao_old\haohao_old
?????文件???????2317??2010-09-27?08:14??haohao_old\fr
?????文件??????11330??2010-09-27?00:56??haohao_old\widget.ui
?????文件?????262946??2010-09-26?05:50??haohao_old\bj1.bmp
?????文件????????421??2010-09-28?13:51??haohao_old\haohao_old.pro
?????文件???????1592??2010-09-28?08:55??haohao_old\haohao.h
?????文件????????651??2010-09-27?08:14??haohao_old\fr
?????文件????2749646??2010-10-10?15:48??haohao_old\riben.mp4
?????文件???????2986??2010-09-27?07:56??haohao_old\ti
?????文件??????10776??2010-09-28?13:51??haohao_old\fr
?????文件???????8556??2010-09-28?13:52??haohao_old\moc_ti
?????文件???????9605??2010-09-28?13:51??haohao_old\Makefile
?????文件??????11395??2010-09-28?13:51??haohao_old\ui_widget.h
?????文件???????3153??2010-09-28?13:52??haohao_old\moc_widget.cpp
?????文件?????221238??2010-09-26?23:43??haohao_old\ti
?????文件???????8708??2010-09-28?13:52??haohao_old\moc_widget.o
?????文件?????501138??2010-09-26?05:45??haohao_old\vback.bmp
?????文件???????5454??2010-09-26?08:00??haohao_old\play_stop.bmp
?????文件????????726??2010-09-28?13:51??haohao_old\main.cpp
?????文件???????5454??2010-09-26?06:13??haohao_old\next1.bmp
?????文件???????5454??2010-09-26?06:13??haohao_old\pre.bmp
?????文件????????786??2010-09-27?07:57??haohao_old\ti
?????文件???????2263??2010-09-28?13:51??haohao_old\moc_ti
?????文件???13047402??2010-09-27?16:41??haohao_old\mpla
............此處省略14個文件信息
- 上一篇:語音增強算法
- 下一篇:802.3bw-2015
評論
共有 條評論