2008年11月21日 星期五

Qt Example範例



Example.pro

TEMPLATE += app
CONFIG += qt warn_on
SOURCES += main.cpp form.cpp
HEADERS += form.h ui_Form.h
TARGET = Example
win32:debug:CONFIG += console
INCLUDEPATH += C:\Programs\systemc-2.2.0\src
LIBS += C:\Programs\systemc-2.2.0\msvc71\SystemC\Debug\SystemC.lib

win32 {
QMAKE_CFLAGS_DEBUG -= -MDd
QMAKE_CXXFLAGS_DEBUG -= -MDd
QMAKE_CFLAGS_DEBUG += -MTd -vmg
QMAKE_CXXFLAGS_DEBUG += -MTd -vmg
}


main.cpp

#include <QtGui/QApplication>
#include "form.h"

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Form w;
w.show();
return a.exec();
}


form.cpp

#include "form.h"
//#include "systemc.h"

Form::Form(QWidget *parent, Qt::WFlags flags)
: QWidget(parent, flags)
{
ui.setupUi(this);
ui.horizontalSlider->setRange(0, 130);
ui.spinBox->setRange(0, 130);
connect(ui.spinBox, SIGNAL(valueChanged(int)), ui.horizontalSlider, SLOT(setValue(int)));
connect(ui.horizontalSlider, SIGNAL(valueChanged(int)), ui.spinBox, SLOT(setValue(int)));
ui.spinBox->setValue(35);
}

Form::~Form()
{

}


form.h

#ifndef FORM_H
#define FORM_H

#include <QtGui/QWidget>
#include "ui_Form.h"

class Form : public QWidget
{
Q_OBJECT

public:
Form(QWidget *parent = 0, Qt::WFlags flags = 0);
~Form();

private:
Ui::Form ui;
};
#endif // FORM_H


ui_Form.h
Generated by Qt Designer

Qt + SystemC on VS2005

.pro file

TEMPLATE += app
CONFIG += qt warn_on
SOURCES += main.cpp
TARGET = QtSysC
win32:debug:CONFIG += console
INCLUDEPATH += C:\Programs\systemc-2.2.0\src
LIBS += C:\Programs\systemc-2.2.0\msvc71\SystemC\Debug\SystemC.lib

win32 {
QMAKE_CFLAGS_DEBUG -= -MDd
QMAKE_CXXFLAGS_DEBUG -= -MDd
QMAKE_CFLAGS_DEBUG += -MTd -vmg
QMAKE_CXXFLAGS_DEBUG += -MTd -vmg
}

2008年11月13日 星期四

Installing Qt-4.4.3

1. error: X11/Xlib.h: No such file or directory
yum -y install libX11-devel

2008年10月23日 星期四

Installing OpenRisc1k on Fedora8

1. The following tools are important for building the OpenRisc SDK:
yum -y install autoconf automake bison flex
2. Change to the top level directory (binutils-2.16.1)

3. Type the following commands:
mkdir b-b
cd b-b
../configure --prefix=/cad/or32-uclinux
make all install
Note: make sure you have created the target directory before installing the package.

2008年10月22日 星期三

Installing Fedora8 on VirtualBox 1.6.6

1. Please install the build and header files for your current Linux kernel.
yum -y install gcc gcc-c++ kernel-devel

Installing SystemC-2.2.0 on Fedora8

1. Change to the top level directory (systemc-2.2.0)

2. Create a temporary directory, e.g.,
mkdir objdir

3. Change to the temporary directory, e.g.,
cd objdir

4. Configure the package for your system, e.g., ( usr/local/systemc-2.2.0 )
../configure --prefix=/usr/local/systemc-2.2.0

Note: make sure you have created the target directory before installing the package.
Do _not_ use /usr/local as a prefix.

5. Compile the package.

For an optimized SystemC library, enter:
gmake

6. Install the package.
gmake install

7. At this point you may wish to verify the installation by testing the example suite.
gmake check

this will compile and run the examples in the subdirectory examples.

2008年9月29日 星期一