打开设备管理器

        open_devmgmtClass->setStatusBar(statusBar);

        retranslateUi(open_devmgmtClass);
        //QObject::connect(pushButton, SIGNAL(clicked()), open_devmgmtClass, SLOT(close()));

        QMetaObject::connectSlotsByName(open_devmgmtClass);
    } // setupUi

    void retranslateUi(QMainWindow *open_devmgmtClass)
    {
        open_devmgmtClass->setWindowTitle(QApplication::translate("open_devmgmtClass", "open_devmgmt", 0, QApplication::UnicodeUTF8));
        pushButton->setText(QApplication::translate("open_devmgmtClass", "PushButton", 0, QApplication::UnicodeUTF8));
        pushButton_2->setText(QApplication::translate("open_devmgmtClass", "\350\256\276\345\244\207\347\256\241\347\220\206\345\231\250", 0, QApplication::UnicodeUTF8));
    } // retranslateUi

};

namespace Ui {
    class open_devmgmtClass: public Ui_open_devmgmtClass {};
} // namespace Ui

QT_END_NAMESPACE

#endif // UI_OPEN_DEVMGMT_H
class open_devmgmt : public QMainWindow
{
	Q_OBJECT

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

private:
	Ui::open_devmgmtClass ui;

private slots:
    void on_pushButton_clicked();
	 void on_pushButton_2_clicked();
};

void open_devmgmt::on_pushButton_clicked()
{

    //qt有类曰:QProcess。举例说明
    QProcess *process = new QProcess;
    process->start(tr("mmc devmgmt.msc"));
    //打开设备管理器
}


void open_devmgmt::on_pushButton_2_clicked()
{

    //qt有类曰:QProcess。举例说明
    QProcess *process = new QProcess;
    process->start(tr("mmc devmgmt.msc"));
    //打开设备管理器
}
相关文章
相关标签/搜索