
Originally Posted by
Serge_RUS
to foxe6 (and other devels):
Please, post a "Hello world!" program with this SDK.
PHP Code:
// wintest.h
#ifndef __WINTEST_H__
#define __WINTEST_H__
#include <zmainwidget.h>
class WinTest : public ZMainWidget
{
public:
WinTest();
~WinTest();
public slots:
void btnClicked();
};
#endif //__WINTEST_H__
PHP Code:
// wintest.cpp
#include <stdio.h>
#include <qwidget.h>
#include <qscrollview.h>
#include <qpushbutton.h>
#include <ezxutilcst.h>
#include <zpushbutton.h>
#include <zapplication.h>
#include <qpopupmenu.h>
#include "wintest.h"
QLabel *lp = 0;
WinTest::WinTest()
:ZMainWidget(false, NULL, NULL, 0)
{
UTIL_CST *cst;
ZPushButton *wp;
QPopupMenu *pp;
cst = new UTIL_CST(this, "");
setCSTWidget(cst);
cst->show();
wp = cst->getRightBtn();
connect(wp, SIGNAL(clicked()), qApp, SLOT(slotQuickQuit()));
pp = new QPopupMenu(cst, NULL);
//connect(pp, SIGNAL(activated(int)), SLOT(menuSelect(int)));
pp->insertItem(tr("Test Menu 1"));
pp->insertItem(tr("Test Menu 2"));
pp->insertItem(tr("Test Menu 3"));
wp = cst->getLeftBtn();
wp->setPopup(pp);
pp = new QPopupMenu(cst, NULL);
//connect(pp, SIGNAL(activated(int)), SLOT(menuSelect(int)));
pp->insertItem(tr("Mid Menu 1"));
pp->insertItem(tr("Mid Menu 2"));
pp->insertItem(tr("Mid Menu 3"));
wp = cst->getMidBtn();
wp->setPopup(pp);
QScrollView *content = new QScrollView(this);
setContentWidget(content);
content->show();
ZPushButton *qwp = new ZPushButton(this);
qwp->setText("TEST");
qwp->setGeometry(90,120,100,26);
qwp->show();
connect(qwp, SIGNAL(clicked()), this, SLOT(btnClicked()));
content->addChild(qwp, 90, 120);
lp = new QLabel("Hello, world!n" "Try the menu!", this, "main_label");
//setContentWidget(lp);
lp->show();
content->addChild(lp, 10, 25);
}
WinTest::~WinTest()
{
if (lp) delete lp;
}
void WinTest::btnClicked()
{
printf("qwp::clicked()n");
lp->close(TRUE);
delete lp;
lp = 0;
}
PHP Code:
// main.cpp
#include <zapplication.h>
#include "wintest.h"
int main(int argc, char** argv)
{
ZApplication app(argc, argv);
app.enableTouchSound(FALSE);
app.showMainWidget(new WinTest());
return app.exec();
}