資源簡(jiǎn)介
輕松實(shí)現(xiàn)qt下點(diǎn)擊按鈕所實(shí)現(xiàn)的外部程序的調(diào)用!

代碼片段和文件信息
#include
Hello::Hello()
{
// frame->hide();
this->resize(271?239);
????????frame?=?new?Qframe(this);
frame->hide();
????????frame->setGeometry(QRect(40?120?191?111));
????????frame->setframeShape(Qframe::styledPanel);
????????frame->setframeShadow(Qframe::Raised);
????????pushButton?=?new?QPushButton(tr(“Close“)frame);
????????pushButton->setGeometry(QRect(20?20?75?26));
????????radioButton?=?new?QRadioButton(tr(“Clear“)frame);
????????radioButton->setEnabled(true);
????????radioButton->setGeometry(QRect(90?60?95?22));
????????widget?=?new?QWidget(this);
????????widget->setGeometry(QRect(40?50?186?28));
????????gridLayout?=?new?QGridLayout(widget);
????????gridLayout->setContentsMargins(0?0?0?0);
????????hellolabel?=?new?QLabel(tr(“Hello?Qt“)widget);
????????gridLayout->addWidget(hellolabel?0?0?1?1);
????????horizontalSpacer?=?new?QSpacerItem(40?20?QSizePolicy::Expanding?QSizePolicy::Minimum);
????????gridLayout->addItem(horizontalSpacer?0?1?1?1);
????????OkButton?=?new?QToolButton();
OkButton->setText(tr(“OK“));
OkButton->setIcon(QPixmap(“bb.png“));
OkButton->setIconSize(QPixmap(“bb.png“).size());
OkButton->setAutoRaise(true);
OkButton->setToolButtonstyle(Qt::ToolButtonTextUnderIcon);
// widget=new?QWidget();
// QToolTip::showText(OkButtontr(“asdfasdf“)widget);??????
?
????????gridLayout->addWidget(OkButton?0?2?1?1);
????????connect(OkButton?SIGNAL(clicked())?frame?SLOT(show()));
????????connect(pushButton?SIGNAL(clicked())?this?SLOT(close()));
????????connect(radioButton?SIGNAL(clicked(bool))?hellolabel?SLOT(setShown(bool)));
connect(OkButton?SIGNAL(clicked())thisSLOT(slotGame()));
}
void??Hello::slotGame()
{
//Qobject?*parent=new?Qobject;
QString?program=“./Tetrix/Tetrix“;
//QStringList?arguments;
//arguments<<““;
QProcess?*game=new?QProcess();
game->start(programQStringList());
//QProcess::execute(program);
}?
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件???????6956??2010-05-20?00:22??hello\bb.png
?????文件??????28781??2010-05-21?16:36??hello\hello
?????文件???????1934??2010-05-21?16:36??hello\hello.cpp
?????文件????????422??2010-05-20?17:09??hello\hello.h
?????文件??????10720??2010-05-21?16:36??hello\hello.o
?????文件????????325??2010-05-21?16:12??hello\hello.pro
?????文件??????29355??2010-05-20?17:54??hello\hello.rar
?????文件????????321??2010-05-20?14:12??hello\main.cpp
?????文件???????3000??2010-05-20?17:09??hello\main.o
?????文件???????7896??2010-05-21?16:12??hello\Makefile
?????文件???????1986??2010-05-20?17:09??hello\moc_hello.cpp
?????文件???????7000??2010-05-20?17:09??hello\moc_hello.o
?????文件???????1217??2010-05-21?16:35??hello\Tetrix\debug\box.gif
?????文件???????7496??2010-05-21?16:35??hello\Tetrix\debug\changeItem.wav
?????文件?????356303??2010-05-21?16:35??hello\Tetrix\debug\gamearea.o
?????文件?????115127??2010-05-21?16:35??hello\Tetrix\debug\main.o
?????文件???????2376??2010-05-21?16:35??hello\Tetrix\debug\moc_gamearea.cpp
?????文件?????136095??2010-05-21?16:35??hello\Tetrix\debug\moc_gamearea.o
?????文件???????3667??2010-05-21?16:35??hello\Tetrix\debug\moc_widget.cpp
?????文件?????127581??2010-05-21?16:35??hello\Tetrix\debug\moc_widget.o
?????文件???????5226??2010-05-21?16:35??hello\Tetrix\debug\moveDown.wav
?????文件???????3264??2010-05-21?16:35??hello\Tetrix\debug\moveLeft.wav
?????文件???????6308??2010-05-21?16:35??hello\Tetrix\debug\myitem.o
?????文件????1245066??2010-05-21?16:35??hello\Tetrix\debug\Tetrix.exe
?????文件?????240226??2010-05-21?16:35??hello\Tetrix\debug\widget.o
?????文件??????16126??2010-05-21?16:35??hello\Tetrix\gamearea.cpp
?????文件???????3766??2010-05-21?16:35??hello\Tetrix\gamearea.h
?????文件??????18904??2010-05-21?16:35??hello\Tetrix\gamearea.o
?????文件????????594??2010-05-21?16:35??hello\Tetrix\main.cpp
?????文件???????1656??2010-05-21?16:35??hello\Tetrix\main.o
............此處省略25個(gè)文件信息
評(píng)論
共有 條評(píng)論