首页| 论坛| 消息

标题:一段程序..如何编译..在QT中显示出所要得的图形呢
作者:snipertheone
日期:2006-05-24 22:01
内容:

class MyWidgetWidget : public QHBox
{
public:
MyWidgetWidget( QWidget *parent=0, char *name=0 ) : QHBox( parent, name )
{
// A knob
QwtKnob *knob = new QwtKnob( this );
// A slider
QwtSlider *slider = new QwtSlider( this, "", Qt::Vertical, QwtSlider::Left );
// A wheel
QwtWheel *wheel = new QwtWheel( this );
wheel->setOrientation( Qt::Vertical );
wheel->setTotalAngle( 360*5 );
// Setup the ranges
knob->setRange( 0.0, 1000.0 );
slider->setRange( 0.0, 1000.0 );
wheel->setRange( 0.0, 1000.0 );
// Connect the widgets to each other
connect( knob, SIGNAL(valueChanged(double)), slider, SLOT(setValue(double)) );
connect( knob, SIGNAL(valueChanged(double)), wheel, SLOT(setValue(double)) );
connect( slider, SIGNAL(valueChanged(double)), knob, SLOT(setValue(double)) );
connect( slider, SIGNAL(valueChanged(double)), wheel, SLOT(setValue(double)) );
connect( wheel, SIGNAL(valueChanged(double)), knob, SLOT(setValue(double)) );
connect( wheel, SIGNAL(valueChanged(double)), slider, SLOT(setValue(double)) );
}
};
int main( int argc, char **argv )
{
QApplication a( argc, argv );
MyWidgetWidget w;
a.setMainWidget( &w );
w.show();
return a.exec();
}
如何在QT中运行产生所示的图形呢??我用的是QT designer
怎么编译..那位仁兄能给我个步骤吗


#1 [snipertheone 05-29 16:58]
昨就没人回复呢....

回复 发表
主题 版块