qtopia中程序( videos music等)的修改
来源:互联网 发布:最小的刻录软件 编辑:程序博客网 时间:2024/06/04 18:04
板子:helper2416 qtopia2/3 作者:帅得不敢出门 c++哈哈堂:31843264
例子1: 修改工具栏, 比如添加一个关闭按钮
修改qtopia-2.2.0/qtopia/src/libraries/mediaplayer/mediaselectorwidget.cpp
class MediaSelectorWidgetPrivate {
中添加
Action *tbQuit;
构造函数中
MediaSelectorWidget::MediaSelectorWidget
d->tbAdd = new Action( this, tr( "Add to Category..." ), "categorize",this, SLOT(categorize()) );下一行添加
d->tbQuit = new Action( this, tr( "Quit" ), "close", qApp, SLOT(quit()) );
d->tbAdd->addTo(contextMenu); 下一行添加
d->tbQuit->addTo(contextMenu);
d->tbDown->addTo( d->bar ); 下一行添加
d->tbQuit->addTo( d->bar );
然后在qtopia/pics/icons/ 下的各文件夹加close.png就行了.
注意修改libraries/mediaplayer 下的文件会同时影响videos 与music
例2 播放音视频的窗口中滑动条与时间控件的右边添加关闭按钮
qtopia/src/libraries/mediaplayer/controlwidgetbase.h中添加
#include <qpushbutton.h>
QPushButton *closeBtn;
qtopia/src/libraries/mediaplayer/controlwidgetbase.cpp 中
1
ControlWidgetBase::ControlWidgetBase( QWidget* parent, const QString &skinPath,const QString &type, const char* name ) : QWidget(parent, name), buttonCount(0), slider(Qt::Horizontal, this), time(this), sliderBeingMoved(false), volumeTimeout(this), drawVolume(false){ setCaption( tr("Media Player") ); // 添加下面这一行 closeBtn = new QPushButton( tr("close"), this);
2
connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); //添加下面这行 connect( closeBtn, SIGNAL( pressed() ), this, SLOT( close() ) );
3
imgButtonMask.fill( 0 ); // 此行下面修改如下 int closeBtnW = 48; int y1 = h - timeHeight - 2 * border; int x2 = w - timeWidth - border - cornerWidgetWidth - closeBtnW - border; QRect sliderGeometry( border, y1, x2 - 2*border, timeHeight ); QRect timeGeometry( x2, y1, timeWidth, timeHeight ); QRect closeBtnGeometry( x2 + timeWidth + border, y1, closeBtnW, timeHeight); getRect(cfg, skinType+"_slider", sliderGeometry, w, h); getRect(cfg, skinType+"_time", timeGeometry, w, h); slider.setGeometry(sliderGeometry); time.setGeometry(timeGeometry); closeBtn->setGeometry(closeBtnGeometry);
然后先编译libmediaplayer.so
再分别编译musi 与videos, 如果不重新编译运行会出现段错误.
就可以了.
例3: 给photoEdit的sider_show窗口添加 确定 与取消两个按钮
qtopia/src/applications/photoedit/slideshow/slideshowdialog.h
包含头
#include <qpushbutton.h>
private: QLabel *slide_length_label; QSlider *slide_length_slider; QCheckBox *display_name_check, *loop_through_check;//添加下面这行 QPushButton *ok_button, *cancel_button;
qtopia/src/applications/photoedit/slideshow/slideshowdialog.cpp
// Construct loop through label and check box loop_through_check = new QCheckBox( tr( "Loop through" ), this ); vbox->addWidget( loop_through_check );
// 加上下面这段 // Construct ok cancel buttons JYX_MODI add QHBoxLayout *hbox = new QHBoxLayout; ok_button = new QPushButton( tr( "Ok" ), this ); cancel_button = new QPushButton( tr( "Cancel" ), this ); connect( ok_button, SIGNAL( pressed() ), this, SLOT( accept() ) ); connect( cancel_button, SIGNAL( pressed() ), this, SLOT( reject() ) ); hbox->addWidget( ok_button ); hbox->addWidget( cancel_button ); vbox->addLayout( hbox ); // JYX_MODI add end重新编译photoEdit便可.
- qtopia中程序( videos music等)的修改
- qtopia 单独运行videos提示error initialising audio的解决方法
- qtopia改变程序中(如工具栏)图标的大小
- qtopia 编译程序中出现的重复问题---multiple definition of 、first defined 等问题的解决
- 如何在qtopia中启动QT4程序
- qtopia 的hello world程序的记录
- 安装Qtopia后的第一程序
- 系统中修改信号等的值
- 解压tiny6410开发板中x86-qtopia-20100420.tar.gz后不能安装qtopia的问题
- 行和测试Qtopia应用程序的系统程序
- QTOpia中文化
- QTOpia中文化
- [FAQ14169][Audio APP]Music、FM等apk在播放或运行时,从recent app list中删除后,如何实现music、FM等apk立即停止?
- qtopia 自动运行自己程序
- QT,QTOPIA,QT4,QTE等的区别,还有QTE在QT CREATOR上的设置
- 运行qtopia的步骤
- 关于Qt、Qt/E、Qtopia、qvfb、framebuffer、qpe等概念的对比介绍
- VS2010中修改生成程序的名称
- virtual函数中的动态、静态绑定
- Linux LVM介绍
- Servlet路径正确 运行却显示:The requested resource (/webframe/test/TestServlet) is not available
- ThreadLocal
- oracle functions-拆分人员信息
- qtopia中程序( videos music等)的修改
- 讨论一下C++中的private继承
- jquery validate
- linux 到 linux 的ssh远程复制
- iOS应用程序状态切换相关
- Xcode Instrument工具 内存泄露
- 虚基类与多重继承
- iptables 入门
- 索引