##// END OF EJS Templates
donutbreakdown example now has customized legendmarkers
donutbreakdown example now has customized legendmarkers

File last commit:

r2232:e10ccc2f806c
r2233:222c26d04db8
Show More
widget.cpp
46 lines | 1.2 KiB | text/x-c | CppLexer
Marek Rosa
Added simple demoLauncher application
r2229 #include "widget.h"
#include <QPushButton>
#include <QDir>
#include <QGridLayout>
#include <QApplication>
#include <QProcess>
#include <QTimer>
Widget::Widget(QWidget *parent)
: QWidget(parent),
m_demoApp(0)
{
QList<QFileInfo> appList;
QDir appFolder(QApplication::applicationDirPath());
appList = appFolder.entryInfoList(QDir::Files);
Marek Rosa
demolauncher fix
r2232 for (int k = appList.count() - 1; k >= 0; k--) {
QString name = appList[k].fileName();
if (name.endsWith("exp") || name.endsWith("dll") || name.endsWith("lib") || name.startsWith("tst_"))
appList.removeAt(k);
}
Marek Rosa
Added simple demoLauncher application
r2229 QGridLayout* demosLayout = new QGridLayout;
for( int i = 0; i < appList.count(); i++) {
QPushButton *button = new QPushButton(appList[i].fileName());
connect(button, SIGNAL(clicked()), this, SLOT (runApp()));
demosLayout->addWidget(button, i%10, i/10);
}
setLayout(demosLayout);
}
Widget::~Widget()
{
Marek Rosa
demolauncher fix
r2232 if (m_demoApp)
m_demoApp->close();
Marek Rosa
Added simple demoLauncher application
r2229 }
void Widget::runApp()
{
QString name = qobject_cast<QPushButton *>(sender())->text();
QString program = QApplication::applicationDirPath() + QDir::separator() + name;
m_demoApp = new QProcess(this);
m_demoApp->start(program);
}