91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 736KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-14
  • 語言: 其他
  • 標簽: qt??vs??桌面精靈??

資源簡介

vs2019+qt擴展模塊 桌面精靈可以實現獲取在桌面的位置,產生相應的變化,比如用鼠標將他拖到電腦屏幕邊緣,會吸附到電腦邊緣(其實就是換了一張圖片,對窗口進行一些操作,比如動畫、透明度調整),單擊右鍵會出現菜單,點擊菜單可以做一些事情。

資源截圖

代碼片段和文件信息

#include?“evle.h“
//記錄上一時刻的坐標
QPoint?lastPos;
int?i?=?1;
evle::evle(QWidget?*parent)
:?QWidget(parent)
{
????label?=?new?QLabel(this);
this->setAttribute(Qt::WA_TranslucentBackground?true);
????setWindowFlags(Qt::framelessWindowHint);?//只是使窗口的標題欄隱藏
QPixmap?pixw?=?QPixmap(“Resources/1.png“);
????label->setPixmap(pixw);
????label->resize(128128);
????lastPos?=?this->pos();
}
evle::~evle()?{}
void?evle::mousePressEvent(QMouseEvent*?event)
{
????//pos()為局部坐標?globalPos()為全局坐標
????if?(event->button()?==?Qt::LeftButton)?
????{//左鍵拖動窗體
????????relativePos?=?this->pos()?-?event->globalPos();
????????
????}
????if?(event->button()?==?Qt::MidButton)?
????{
????????speak();
????}
????if?(event->button()?==?Qt::RightButton)?
????{

????????QTextCodec*?codec?=?QTextCodec::codecForName(“System“);
????????codec->setCodecForLocale(QTextCodec::codecForName(“UTF8“));
????????QAction*?act_about?=?new?QAction(codec->toUnicode(“關于“)?this);
????????QAction*?act_mainwindow?=?new?QAction(codec->toUnicode(“打開主窗口“)?this);
????????QAction*?act_exit?=?new?QAction(codec->toUnicode(“退出“)?this);
????????Qobject::connect(act_about?SIGNAL(triggered())?this?SLOT(about_window()));
????????Qobject::connect(act_exit?SIGNAL(triggered())?this?SLOT(close()));
????????QMenu?*menu?=?new?QMenu(this);
????????menu->addAction(act_about);?//添加菜單項1
????????menu->addAction(act_mainwindow);
????????menu->addAction(act_exit);?//添加菜單項2
????????menu->exec(QCursor::pos());
????}
}
void?evle::mouseMoveEvent(QMouseEvent*?event)//移動窗體
{
????????if?(event->globalPos().x()?????????{
????????????QPixmap?pixw?=?QPixmap(“Resources/3.png“);
????????????label->setPixmap(pixw);
????????}
????????else
????????{
????????????QPixmap?pixw?=?QPixmap(“Resources/2.png“);
????????????label->setPixmap(pixw);
????????}
????????lastPos?=?event->globalPos();
????????
????this->move(event->globalPos()?+?relativePos);
}
void?evle::enterEvent(QEvent*)
{
????QRect?rc;
????QRect?rect;
????rect?=?this->geometry();
????rc.setRect(rect.x()?rect.y()?rect.width()?rect.height());
????if?(rect.top()?????{
????????rect.setX(rc.x());
????????rect.setY(0);
????????move(rc.x()?-2);
????}
}

void?evle::leaveEvent(QEvent*)
{
????QRect?rc;
????QRect?rect;
????rect?=?this->geometry();
????rc.setRect(rect.x()?rect.y()?rect.width()?rect.height());
????if?(rect.top()?????{
????????move(rc.x()?-rc.height()?+?2);
????}
}
void?evle::mouseReleaseEvent(QMouseEvent*?event)?????//松開鼠標后自動貼邊隱藏并且透明
{
????QPropertyAnimation*?pAnimation?=?new?QPropertyAnimation(this?“geometry“);
????QDesktopWidget*?pDesktopWidget?=?QApplication::desktop();//獲得桌面
????//窗口的寬和高
????int?tx?=?width();
????int?ty?=?height();
????//QRect?clientRect?=?desktopWidget->availableGeometry();得到相對于屏幕的絕對坐標
????//QRect?applicationRect?=?desktopWidget->screenGeometry();得到應用程序矩形
????//獲得屏幕寬度
????int?lx?=?pDesktopWidget->availableGeometry().width();

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2020-04-02?13:03??evle\
?????目錄???????????0??2020-04-02?13:03??evle\evle\
?????文件????????1070??2020-03-28?10:00??evle\evle.sln
?????文件????????5724??2020-04-02?12:59??evle\evle\evle.cpp
?????文件????????1106??2020-04-02?12:13??evle\evle\evle.h
?????文件?????????859??2020-04-01?20:41??evle\evle\evle.ui
?????文件????????5194??2020-04-02?13:03??evle\evle\evle.vcxproj
?????文件????????1608??2020-04-02?13:03??evle\evle\evle.vcxproj.filters
?????文件?????????168??2020-03-28?10:00??evle\evle\evle.vcxproj.user
?????文件?????????167??2020-03-28?10:00??evle\evle\main.cpp
?????目錄???????????0??2020-04-01?21:37??evle\evle\Resources\
?????文件???????13231??2013-08-02?14:19??evle\evle\Resources\1.png
?????文件???????13244??2013-08-02?14:36??evle\evle\Resources\2.png
?????文件???????13350??2013-08-02?14:36??evle\evle\Resources\3.png
?????文件???????12253??2013-08-02?15:10??evle\evle\Resources\4.png
?????文件???????14615??2020-04-01?20:29??evle\evle\Resources\4_2.png
?????文件???????10318??2013-08-02?16:05??evle\evle\Resources\5.png
?????文件???????16022??2013-08-02?16:00??evle\evle\Resources\6.png
?????文件???????13349??2013-08-02?14:35??evle\evle\Resources\7.png
?????文件???????19974??2020-04-01?21:37??evle\evle\Resources\8.png
?????文件???????27317??2019-05-14?17:30??evle\evle\Resources\anniu.png
?????文件?????????695??2013-08-02?16:54??evle\evle\Resources\icon.png
?????文件???????17551??2020-04-01?20:22??evle\evle\Resources\lazy.png
?????文件???????13948??2013-08-02?14:43??evle\evle\Resources\shime10.png
?????文件???????14448??2013-08-02?15:04??evle\evle\Resources\shime11.png
?????文件???????12399??2013-08-02?15:12??evle\evle\Resources\shime13.png
?????文件???????12253??2013-08-02?15:10??evle\evle\Resources\shime14.png
?????文件???????14127??2013-08-02?15:26??evle\evle\Resources\shime15.png
?????文件???????15218??2013-08-02?15:27??evle\evle\Resources\shime16.png
?????文件???????18231??2013-08-02?15:28??evle\evle\Resources\shime17.png
?????文件???????13718??2013-08-02?15:40??evle\evle\Resources\shime18.png
............此處省略31個文件信息

評論

共有 條評論