Chinaunix首页 | 论坛 | 博客
  • 博客访问: 210354
  • 博文数量: 145
  • 博客积分: 3000
  • 博客等级: 中校
  • 技术积分: 1720
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-14 18:42
文章分类

全部博文(145)

文章存档

2011年(1)

2009年(144)

我的朋友

分类: LINUX

2009-07-22 19:33:13

by tangke <> 2009-06-09

The Virtual Framebuffer (QVFb) application requires the libxtst library in addition to the libraries used to build Qt for X11. This library enables the use of the Record extension to the X protocol to be used in applications.


如何更换主题?
Installing an Updated Theme

To install a modified theme run :

  cd $QPEDIR
  bin/qbuild image

Installing a New Theme

To install a new theme follow these steps :

  1. modify $QPEDIR/src/custom.pri to have an additional THEME_PROJECT entry that states the theme directory.
  2. create the qbuild.pro, .conf, .xml and image files that define the theme
  3. run bin/qbuild image to install the theme.


Installing a new theme also requires the following files:

File   Location   Description
Theme Project File   $QPEDIR/etc/themes/   defines the files to be installed for the theme.
Theme Configuration File   $QPEDIR/etc/themes/   defines the theme.

如何编写一个qt-extends的实例
Introduction

This page provides instructions for creating a new application that will run within Qt Extended. The information presented here is suitable for third party users of Qt Extended.

The name of the new application is MyNewApp, but a different name can be substituted. The example provided in examples/application in the Qt Extended directory, will provide a base for the new application.
Prerequisites

The instructions assume the following:

  * The work is being done within a Linux environment
  * Qt Extended has already been installed, configured and built with quicklaunching enabled.

Important Files for New Applications

When creating a new Qt Extended application the following files are of particular importance

File Name   Description
qbuild.pro   The qbuild.pro file is used to describe how the application is to be built. For hints on what content be added see the example application's qbuild.pro; see also Project Files
.desktop   Each application will have a .desktop file to give application information to Qt Extended, such as what icon to use to display the application in the application launcher list, see also Desktop File Standard
.ui   Some applications will have .ui files that has been generated by Qt Designer to specify the user interface for the application, see Qt Designer Manual
.ts   Some applications will have .ts files to support Internationalization, see also Internationalization
Suggested Steps in Creating New Application From Example Application

  1. Set up the environment to point to the Qt Extended source directory and the Qt Extended build directory. For example:

      export QTOPIA_SOURCE_PATH=$HOME/src/qt-extended-
      export QPEDIR=$HOME/build/qt-extended--qvfb

    (Note that these are example locations, only.) This assumes that the source directory and the build directory are in different locations; these variables might point to the same location.
  2. Create a directory for the new application (e.g. $HOME/src/mynewapp), and copy over the example files, for example:

      mkdir $HOME/src/mynewapp
      cd $HOME/src/mynewapp
      cp -r $QTOPIA_SOURCE_PATH/examples/application/* .
      chmod +w *

  3. Modify the filenames of the application appropriately using the rename and mv commands, for example:

      rename example mynewapp example*
      mv help/html/example.html help/html/mynewapp.html
      mv pics/Example.png pics/MyNewApp.png

  4. If desired, use a program like gimp to change the application's icon pics/MyNewApp.png to something more suitable.
  5. Modify all instances of "example", "Example" and "EXAMPLE" to "mynewapp", "MyNewApp" and "MYNEWAPP" respectively in the files:
      * qbuild.pro
      * mynewapp.desktop
      * mynewapp.h and mynewapp.cpp
      * main.cpp
      * mynewappbase.ui
      * help/html/mynewapp.html
  6. In mynewapp.desktop, check that the entry for "Icon" suits the application icon's name, eg "mynewapp/MyNewApp".
  7. In help/html/mynewapp.html, check that "img" node has a "src" attribute that suits the applications icon, eg ":image/mynewapp/MyNewApp".
  8. Ensure that qbuild becomes aware of the new project file:
  9. Build the application:

      $QPEDIR/bin/qbuild     # build source files
      $QPEDIR/bin/qbuild image # install the created application into image

    There should now be an executable version of mynewapp in the directory $QPEDIR/image/bin.
10. Run Qt Extended:

      $QPEDIR/bin/runqtopia

    The application MyNewApp should appear in the Applications list on the desktop display. Running the application should reveal a simple UI containing a label and a button. Help documentation is also available from the context menu.

MyNewApp can now be modified to incorporate new or existing code. Qt and Qt Extended public classes can be used to facilitate this process. Qt Designer can be used to generate a new user interface file (mynewappbase.ui) for the application. Alternatively, a new user interface can be coded by hand. Help documentation should be provided by modifying help/html/mynewapp.html.
Creating a New qbuild.pro for Existing Application

To generate a completely new qbuild.pro file with the files found in the current directory, use the command:

  $QPEDIR/bin/qbuild -project

then edit the qbuild.pro project as required. See also Create a new project file.

For information on how to improve application startup times (including the use of Quicklauncher), please refer to: Writing Applications that Start Quickly.

目录结构
bin   contains binaries and scripts needed to build Qt Extended.
config.tests   contains configuration tests for external components.
devices   contains device configuration profiles.
dist   contains additional fonts for Qt Extended.
doc   contains the reference documentation.
examples   contains example applications.
i18n   contains global translation files.
qtopiacore/qt   contains the Qt/Embedded (and some X11) source files.
scripts   contains additional scripts.
src   contains the Qt Extended source files.


编译安装应用程序
Compile the Example Application

This section describes how to compile the example application. A list of the commands used to create the example application sources is available at: Tutorial: Creating a New Application.

To compile the example, follow these steps:

  1. Create a copy of the example:

      cd somewhere
      cp -R $QTOPIA_DEPOT_PATH/examples/application .
      chmod +w application/*
      cd application

  2. Build the Example:

      qbuild

Run the Example Application

Before you can run the example application you must install it. There are two ways to achieve this. The first is to install it directly into a Qt Extended image. The second is to create a package and install it via the Package Manager.

Installing directly to the image requires that Qt Extended is not running. It is convenient when developing to install in this way because a single command can be used to install the application. This method also allows more flexibility than installing a package but this method does not support uninstalling. See Package Limitations for more information.
Install directly to the image

To install directly to the image, simply run:

  qbuild image

You can now start Qt Extended via the runqtopia script. The example application can be found in the Applications menu.
Install via a package

To create a package, simply run:

  qbuild packages

This will tell you what packages were created.

  Creating packages...

  Created /home/user/build/qtopia/example_app/pkg/example_1.0.0-1_i386.qpk

You will now need to follow the instructions in Qpk Packages to install the package.

运行 qt extended

在~/build目录下面执行bin/runqtopia就可以
bin/runqtopia -qvfb "-width 320 -height 180 -depth 16 -skin /root/build/sdk/src/tools/qt/qvfb/N810.skin"


Qt       PREFIX     = /usr
Qt       LIBRARIES   = /usr/lib
Qt       BINARIES   = /usr/bin
Qt       HEADERS   = /usr/include/qt4
Qt Embedded SOURCE tree = /root/qt-extended-4.4.3/qtopiacore/qt
Qt Embedded BUILD tree = /root/build/qtopiacore/target
Qt Extended SOURCE tree = /root/qt-extended-4.4.3
Qt Extended BUILD tree = /root/build
Qt Extended SDK   tree = /root/build/sdk
阅读(657) | 评论(0) | 转发(0) |
0

上一篇:firefox 问题相关

下一篇:Qt python

给主人留下些什么吧!~~