首页| 论坛| 消息

回复: 【提问】如何做…按一button…彈出一個視窗
#6 [running 11-26 11:38]
请参考如下:
本版里的"修罗王1981 problem:两程序间的通讯"
#7 [btopcst 11-26 11:43]
謝謝反語的幫忙…讓我想通…雖然只是一個
小小的程式…但是也能爽一下…呵呵…
/////////////////////interface.h////////////////
#ifndef MY_WIDGET_H
#define MY_WIDGET_H
#include
#include
#include"point.h"
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QPushButton;
class my_widget : public QDialog
{
Q_OBJECT
public:
my_widget( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~my_widget();
QPushButton* pushButton;
DrawView *draw;
protected:
protected slots:
virtual void languageChange();
};
#endif // MY_WDGET_H
/////////////////////interface.cpp//////////////
#include "interface.h"
#include
#include
#include
#include
#include
my_widget::my_widget( QWidget* parent, const char* name, bool modal, WFlags fl )
: QDialog( parent, name, modal, fl )
{
pushButton = new QPushButton( this, "pushButton" );
pushButton->setGeometry( QRect( 120, 150, 121, 41 ) );
languageChange();
draw = new DrawView();
draw->setCaption("Drawdemo");
draw->resize(352,288);
QObject::connect( pushButton, SIGNAL(clicked()), this, SLOT(ShowForm()) );
}
my_widget::~my_widget()
{
}
void my_widget::languageChange()
{
setCaption( tr( "QT" ) );
pushButton->setText( tr( "Button" ) );
}
/////////////////////point.h////////////////////////////
#include
#include
#include
#include
#include
#include
#include
#include
#include
class DrawView : public QWidget
{
Q_OBJECT
public:
DrawView();
~DrawView();
};
//////////////////////// ..
#8 [drowsyboy 11-30 11:12]
学到了

<< 1 2 >> (2/2)

回复 发表
主题 版块