##// END OF EJS Templates
demoLauncher fixed again
Marek Rosa -
r2236:3577330858e8
parent child
Show More
@@ -15,17 +15,15 Widget::Widget(QWidget *parent)
15
15
16 for (int k = appList.count() - 1; k >= 0; k--) {
16 for (int k = appList.count() - 1; k >= 0; k--) {
17 QString name = appList[k].fileName();
17 QString name = appList[k].fileName();
18 if (name.endsWith("exp")
18 if (name.startsWith("tst_")
19 || name.endsWith("dll")
19 || name.startsWith("demoLauncher")
20 || name.endsWith("lib")
20 || (name.right(4).left(1) == "." && !name.endsWith("exe")))
21 || name.startsWith("tst_")
22 || name.startsWith("demoLauncher"))
23 appList.removeAt(k);
21 appList.removeAt(k);
24 }
22 }
25
23
26 QGridLayout* demosLayout = new QGridLayout;
24 QGridLayout* demosLayout = new QGridLayout;
27 for( int i = 0; i < appList.count(); i++) {
25 for( int i = 0; i < appList.count(); i++) {
28 QPushButton *button = new QPushButton(appList[i].fileName());
26 QPushButton *button = new QPushButton(appList[i].baseName());
29 connect(button, SIGNAL(clicked()), this, SLOT (runApp()));
27 connect(button, SIGNAL(clicked()), this, SLOT (runApp()));
30 demosLayout->addWidget(button, i%10, i/10);
28 demosLayout->addWidget(button, i%10, i/10);
31 }
29 }
@@ -41,7 +39,7 Widget::~Widget()
41 void Widget::runApp()
39 void Widget::runApp()
42 {
40 {
43 QString name = qobject_cast<QPushButton *>(sender())->text();
41 QString name = qobject_cast<QPushButton *>(sender())->text();
44 QString program = QApplication::applicationDirPath() + QDir::separator() + name;
42 QString program = QDir(BINPATH).absolutePath() + QDir::separator() + name;
45
43
46 m_demoApp = new QProcess(this);
44 m_demoApp = new QProcess(this);
47 m_demoApp->start(program);
45 m_demoApp->start(program);
General Comments 0
You need to be logged in to leave comments. Login now