社区
Qt
帖子详情
qt焦点(播放器)
qq_26830049
2017-11-20 04:52:11
在写一个播放器,播放栏要无操作消失,用sethiden消失后,再显示回来,焦点没颜色了,虽然可以用,怎么回事?
...全文
176
3
打赏
收藏
qt焦点(播放器)
在写一个播放器,播放栏要无操作消失,用sethiden消失后,再显示回来,焦点没颜色了,虽然可以用,怎么回事?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
qq_26830049
2017-11-23
打赏
举报
回复
引用 1 楼 qqwangfan 的回复:
具体能贴下代码吗?这样看不出问题来
在楼下贴出来了
qq_26830049
2017-11-23
打赏
举报
回复
代码如下 初始化时:--------------------------------------------------------------------------------------------------------------------------------- PlayerButton::PlayerButton(QWidget *parent) : QWidget(parent) { #if 1 m_pHLayout_7 = new QHBoxLayout; m_pPlayButton = new QPushButton( this ); //播放、暂停 //m_pPauseButton = new QPushButton( this ); //暂停 m_pStopButton = new QPushButton( this ); //停止 m_pBackwardButton = new QPushButton( this ); //后退 m_pForwardButton = new QPushButton( this ); //快进 m_pCloseFileButton = new QPushButton( this ); //关闭 #endif //设置按钮图片和去焦点虚框 this->addButtonImages(m_pPlayButton,":/images/image/pause.png",QSize(38,38)); this->addButtonImages(m_pStopButton,":/images/image/stop.png",QSize(38,38)); this->addButtonImages(m_pBackwardButton,":/images/image/backward.png",QSize(38,38)); this->addButtonImages(m_pForwardButton,":/images/image/step.png",QSize(38,38)); this->addButtonImages(m_pCloseFileButton,":/images/image/openfile.png",QSize(38,38)); this->addButtonImages(m_pNextButton,":/images/image/next.png",QSize(38,38)); m_Playing=true; m_pLabelTiming = new QLabel(STR_PLAYER_TIME,this); //播放时间 QFont font1; font1.setBold(true); //加粗 font1.setPixelSize(23); m_pLabelTiming->setFont(font1); //设置控件的位置和大小 int xpos = 8+20; m_pPlayButton->setGeometry(xpos,gScreenH-LowHigh-6-15,45,45); xpos += 51; m_pNextButton->setGeometry(xpos,gScreenH-LowHigh-6-15,45,45); xpos += 51; m_pStopButton->setGeometry(xpos,gScreenH-LowHigh-6-15,45,45); xpos += 51; m_pBackwardButton->setGeometry(xpos,gScreenH-LowHigh-6-15,45,45); xpos += 51; m_pForwardButton->setGeometry(xpos,gScreenH-LowHigh-6-15,45,45); xpos += 51; m_pCloseFileButton->setGeometry(xpos,gScreenH-LowHigh-6-15,45,45); #if 1 connect( m_pNextButton, &QPushButton::clicked, this,&PlayerButton::nextplayButton); connect( m_pPlayButton, &QPushButton::clicked, this,&PlayerButton::playButton); //connect( m_pPauseButton, &QPushButton::clicked, this,&Dialog::pauseButton ); //安装事件过滤器,用于响应按键的显示 m_pNextButton->installEventFilter(this); m_pPlayButton->installEventFilter(this); m_pStopButton->installEventFilter(this); m_pBackwardButton->installEventFilter(this); m_pForwardButton->installEventFilter(this); m_pCloseFileButton->installEventFilter(this); } 添加按钮图片代码 //添加按钮图片 void PlayerButton::addButtonImages(QPushButton *button,const QString path,QSize size) { QIcon icon( path ); button->setIcon(icon); button->setIconSize(size); //隐藏边界 button->setFlat(true); //设置按钮自定义没有焦点虚框风格 button->setStyle(new noFocusStyle()); qDebug()<<"PlayerButton::addButtonImages"<<endl; }//添加图片结束 隐藏窗口 void PlayerButton::timehiden() { qDebug()<<"jindutiao hiden"<<endl; this->setHidden(true); this->update(); this->show(); this->setHidden(true); } 显示图片(在这里出问题,显示之后红框没了) void PlayerButton::setlayoutvisible() { this->setHidden(false); this->update(); this->show(); }
军神关云长_大凡
2017-11-21
打赏
举报
回复
具体能贴下代码吗?这样看不出问题来
Qt
+
播放器
+直播套餐
1、学习c++ 和
Qt
2、学习FFmpeg SDK,二次开发,打造自己的
播放器
。 3、学习直播,Nginx+Rtmp+HLS,使用FFmpeg推流,使用VLC和Videojs拉流。
Qt
实现音视频
播放器
声明:这是基于
Qt
的QMediaPlayer实现的音视频
播放器
,实现了
播放器
的常用功能,例如根据播放列表选择播放的音视频,拖动滑块控制音视频播放 第一步 新建一个
Qt
widgets Application,在Details中选择继承QWidget 第二...
Qt
视频
播放器
是
Qt
框架中的一个静态函数,主要用于获取当前系统用户的主目录路径。主目录是每个用户在系统中的个人目录,通常包含用户的文档、下载、图片等文件夹。在不同的操作系统上,主目录的路径可能会有所不同。使用函数可以...
Qt
--音乐
播放器
/* 失去
焦点
*/ this->setFocus(); } MainWindow::~MainWindow() { } /** * @brief MainWindow::initWidget * 初始化窗口 */ void MainWindow::initWidget() { this->setGeometry(0,0,800,480); QPalette pal; /* ...
QT
音乐
播放器
QT
功能十分强大,最重要的是跨平台移植性非常好,由于本人是学嵌入式的,所以做图形界面比较喜欢用
QT
,最近学习
QT
当做练习做了一个迷你版的音乐
播放器
,主要实现音乐播放、暂停、切换、音量大小调节,快进、添加和...
Qt
16,211
社区成员
26,590
社区内容
发帖
与我相关
我的任务
Qt
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
复制链接
扫一扫
分享
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章