/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
** This file is part of the tools applications of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain
** additional rights. These rights are described in the Nokia Qt LGPL
** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
** package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qvfb.h"
#include "qvfbview.h"
#ifdef Q_WS_X11
#include "qvfbx11view.h"
#endif
#include "qvfbratedlg.h"
#include "ui_config.h"
#include "qanimationwriter.h"
#include <deviceskin.h>
#include <QMenuBar>
#include <QMenu>
#include <QApplication>
#include <QMessageBox>
#include <QComboBox>
#include <QLabel>
#include <QFileDialog>
#include <QSlider>
#include <QSpinBox>
#include <QLayout>
#include <QRadioButton>
#include <QImage>
#include <QPixmap>
#include <QCheckBox>
#include <QCursor>
#include <QTime>
#include <QScrollArea>
#include <QProgressBar>
#include <QPushButton>
#include <QTextStream>
#include <QFile>
#include <QFileInfo>
#include <QDebug>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
QT_BEGIN_NAMESPACE
// =====================================================================
static const char *red_on_led_xpm[] = {
"11 11 10 1",
" c None",
". c #FF0000",
"+ c #FF4C4C",
"@ c #FF7A7A",
"# c #D30000",
"$ c #FF9393",
"% c #BA0000",
"& c #FFFFFF",
"* c #7F0000",
"= c #000000",
" ",
" .++@@ ",
" .....+@ ",
" ##...$.+@ ",
" %#..$&$.+ ",
" *#...$..+ ",
" *%#...... ",
" =*%#..... ",
" =*%###. ",
" ===*. ",
" "};
static const char *red_off_led_xpm[] = {
"11 11 12 1",
" c None",
". c #CDB7B4",
"+ c #D2BFBD",
"@ c #DBCBCA",
"# c #E5D9D8",
"$ c #BC9E9B",
"% c #E2D6D5",
"& c #AD8986",
"* c #FFFFFF",
"= c #A8817D",
"- c #B2908D",
"; c #6F4D4A",
" ",
" .++@# ",
" .....@# ",
" $$...%.@# ",
" &$..%*%.@ ",
" =-...%..+ ",
" =&-...... ",
" ;==-..... ",
" ;=&-$$. ",
" ;==&$ ",
" "};
static bool copyButtonConfiguration(const QString &prefix, int displayId)
{
const QString destDir = QString(QLatin1String("/tmp/qtembedded-%1/")).arg(displayId);
const QFileInfo src(prefix + QLatin1String("defaultbuttons.conf"));
const QFileInfo dst(destDir + QLatin1String("defaultbuttons.conf"));
unlink(dst.absoluteFilePath().toLatin1().constData());
if (!src.exists())
return false;
const bool rc = QFile::copy(src.absoluteFilePath(), dst.absoluteFilePath());
if (!rc)
qWarning() << "Failed to copy the button configuration file " << src.absoluteFilePath() << " to " << dst.absoluteFilePath() << '.';
return rc;
}
// =====================================================================
class AnimationSaveWidget : public QWidget {
Q_OBJECT
public:
AnimationSaveWidget(QVFbAbstractView *v);
~AnimationSaveWidget();
bool detectPpmtoMpegCommand();
void timerEvent(QTimerEvent *te);
void convertToMpeg(QString filename);
void removeTemporaryFiles();
protected slots:
void toggleRecord();
void reset();
void save();
private:
QVFbAbstractView *view;
QProgressBar *progressBar;
QLabel *statusText;
bool haveMpeg, savingAsMpeg, recording;
QCheckBox *mpegSave;
QAnimationWriter *animation;
QPushButton *recBt, *resetBt, *saveBt;
QLabel *timeDpy, *recLED;
int timerId, progressTimerId;
QPixmap recOn, recOff;
QTime tm;
int elapsed, imageNum;
};
// =====================================================================
Zoomer::Zoomer(QVFb* target) :
qvfb(target)
{
QVBoxLayout *layout = new QVBoxLayout(this);
QSlider *sl = new QSlider(Qt::Horizontal);
sl->setMinimum(10);
sl->setMaximum(64);
sl->setPageStep(1);
sl->setValue(32);
layout->addWidget(sl);
connect(sl,SIGNAL(valueChanged(int)),this,SLOT(zoom(int)));
label = new QLabel();
layout->addWidget(label);
}
void Zoomer::zoom(int z)
{
double d = (double)z/32.0;
qvfb->setZoom(d);
label->setText(QString::number(d,'g',2));
}
// =====================================================================
QVFb::QVFb( int display_id, int w, int h, int d, int r, const QString &skin, DisplayType displayType, QWidget *parent, Qt::WindowFlags flags )
: QMainWindow( parent, flags )
{
this->displayType = displayType;
view = 0;
secondaryView = 0;
scroller = 0;
this->skin = 0;
currentSkinIndex = -1;
findSkins(skin);
zoomer = 0;
QPixmap pix(":/res/images/logo.png");
setWindowIcon( pix );
rateDlg = 0;
refreshRate = 30;
#if QT_VERSION >= 0x030000
// When compiling with Qt 3 we need to create the menu first to
// avoid scroll bars in the main window
createMenu( menuBar() );
init( display_id, w, h, d, r, skin );
enableCursor( true );
#else
init( display_id, w, h, d, r, skin );
createMenu( menuBar() );
#endif
}
QVFb::~QVFb()
{
}
void QVFb::popupMenu()
{
QMenu *pm = new QMenu( this );
createMenu( pm );
pm->exec(QCursor::pos());
}
void QVFb::init( int display_id, int pw, int ph, int d, int r, const QString& skin_name )
{
delete view;
view = 0;
delete secondaryView;
secondaryView = 0;
delete scroller;
scroller = 0;
delete skin;
skin = 0;
skinscaleH = skinscaleV = 1.0;
QVFbView::Rotation rot = ((r == 90) ? QVFbView::Rot90 :
((r == 180) ? QVFbView::Rot180 :
((r == 270) ? QVFbView::Rot270 :
QVFbView::Rot0 )));
if ( !skin_name.isEmpty() ) {
const bool vis = isVisible();
DeviceSkinParameters parameters;
QString readError;
if (parameters.read(skin_name,DeviceSkinParameters::ReadAll, &readError)) {
skin = new DeviceSkin(parameters, this);
connect(skin, SIGNAL(popupMenu()), this, SLOT(popupMenu()));
const int sw = parameters.screenSize().width();
const int sh = parameters.screenSize().height();
const int sd = parameters.screenDepth;
if (!pw) pw = sw;
if (!ph) ph = sh;
if (d < 0) {
if (sd)
d = sd;
else
d = -d;
}
if (vis)
hide();
menuBar()->hide();
scroller = 0;
#ifdef Q_WS_X11
if (displayType == X11)
view = new QVFbX11View( display_id, pw, ph, d, rot, skin );
else
#endif
view = new QVFbView( display_id, pw, ph, d, rot, skin );
没有合适的资源?快使用搜索试试~ 我知道了~
qvfb.tar.gz_qt4.5 qv_qt4.5 qvfb_qvfb_qvfb qt4.5
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 106 浏览量
2022-09-24
14:11:43
上传
评论
收藏 2.5MB GZ 举报
温馨提示
共91个文件
png:27个
h:14个
cpp:12个
Qt4.5 提供的qvfb,最新版本,没有鼠标乱动的问题
资源推荐
资源详情
资源评论
收起资源包目录
qvfb.tar.gz (91个子文件)
qvfb
TouchscreenPhone.qrc 121B
qvfbshmem.cpp 8KB
pda.qrc 108B
qlock.cpp 9KB
qvfb.h 4KB
x11keyfaker.h 2KB
SmartPhone2.skin
SmartPhone2.skin 1KB
defaultbuttons.conf 984B
SmartPhone2-pressed.png 132KB
SmartPhone2.png 119KB
qvfbprotocol.h 5KB
images
logo-nt.png 2KB
logo.png 2KB
pda_up.png 98KB
qanimationwriter.h 2KB
qvfbmmap.cpp 6KB
qvfb.qrc 148B
qanimationwriter.cpp 13KB
qvfbview.h 7KB
qvfbratedlg.h 2KB
qvfbratedlg.cpp 3KB
DualScreenPhone.skin
defaultbuttons.conf 1KB
DualScreenPhone.skin 1KB
DualScreen-pressed.png 113KB
DualScreen.png 102KB
PortableMedia.qrc 118B
PDAPhone.skin
defaultbuttons.conf 645B
pda_up.png 98KB
PDAPhone.skin 696B
finger.png 39KB
pda_down.png 51KB
qvfbmmap.h 3KB
qvfb.cpp 33KB
README 3KB
qvfbx11view.cpp 10KB
qvfbview.cpp 23KB
qvfbshmem.h 3KB
ClamshellPhone.qrc 119B
pda_down.png 100KB
Trolltech-Touchscreen.skin
defaultbuttons.conf 1KB
Trolltech-Touchscreen-down.png 130KB
Trolltech-Touchscreen.png 130KB
Trolltech-Touchscreen.skin 764B
SmartPhone2.qrc 116B
main.cpp 5KB
SmartPhoneWithButtons.skin
defaultbuttons.conf 2KB
SmartPhoneWithButtons-pressed.png 101KB
SmartPhoneWithButtons.skin 2KB
SmartPhoneWithButtons.png 86KB
qtopiakeysym.h 3KB
SmartPhone.qrc 115B
qvfbprotocol.cpp 6KB
TouchscreenPhone.skin
defaultbuttons.conf 848B
TouchscreenPhone.png 60KB
TouchscreenPhone.skin 686B
TouchscreenPhone-pressed.png 87KB
qwssignalhandler_p.h 3KB
x11keyfaker.cpp 27KB
Trolltech-Touchscreen.qrc 126B
qvfbx11view.h 4KB
translations
translations.pro 1KB
Trolltech-Keypad.qrc 121B
Trolltech-Keypad.skin
defaultbuttons.conf 3KB
Trolltech-Keypad.png 225KB
Trolltech-Keypad-down.png 236KB
Trolltech-Keypad-closed.png 68KB
Trolltech-Keypad.skin 2KB
gammaview.h 2KB
PortableMedia.skin
portablemedia-pressed.png 6KB
defaultbuttons.conf 340B
portablemedia.xcf 41KB
PortableMedia.skin 504B
portablemedia.png 6KB
PDAPhone.qrc 113B
qwssignalhandler.cpp 4KB
SmartPhone.skin
defaultbuttons.conf 1KB
SmartPhone-pressed.png 109KB
SmartPhone.skin 1KB
SmartPhone.png 99KB
config.ui 75KB
qvfb.pro 2KB
ClamshellPhone.skin
ClamshellPhone1-5-pressed.png 111KB
defaultbuttons.conf 1KB
ClamshellPhone1-5-closed.png 67KB
ClamshellPhone1-5.png 111KB
ClamshellPhone.skin 1KB
qlock_p.h 3KB
SmartPhoneWithButtons.qrc 126B
pda.skin 411B
qvfbhdr.h 3KB
LICENSE.GPL 15KB
共 91 条
- 1
资源评论
寒泊
- 粉丝: 75
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- mybatis动态sql及其JAVA示例
- 微软常用运行库 游戏运行库 VC++各个版本
- 微信小程序开发教程.pptx
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- 锐捷网络认证中心网络管理.pdf
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- SD8233LF是一款用于单按键触摸及接近感应开关,其用途是替代传统的机械型开关芯片IC
- 基于YOLOv5的烟雾火焰检测算法研究
- 基于STM32的联合调试侦听设备解决方案原理图PCB源文件调试工具视频(大赛作品)
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功