I have made all the changes you told me to, still the prob exists.
No link between pushButton and label.
#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
namespace Ui
{
class DialogClass;
}
{
Q_OBJECT
public:
~Dialog();
public slots:
void myFunction1();
private:
Ui::DialogClass *ui;
};
#endif // DIALOG_H
#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
class QLabel;
class QPushButton;
namespace Ui
{
class DialogClass;
}
class Dialog : public QDialog
{
Q_OBJECT
public:
Dialog(QWidget *parent = 0);
~Dialog();
public slots:
void myFunction1();
private:
QLabel *disLabel;
QPushButton *pushButton;
Ui::DialogClass *ui;
};
#endif // DIALOG_H
To copy to clipboard, switch view to plain text mode
#include "dialog.h"
#include "ui_dialog.h"
#include <QLibrary>
#include <QtGui>
: QDialog(parent
) ,ui
(new Ui
::DialogClass) {
ui->setupUi(this);
pushButton->setDefault(true);
connect(pushButton, SIGNAL(clicked()), this, SLOT(myFunction1()));
setWindowTitle(tr("Desktop Uploader"));
}
void Dialog::myFunction1()
{
typedef char* (*MyPrototype)();
MyPrototype myFunction
= (MyPrototype
) QLibrary::resolve("dllprog",
"TestDll");
char *b = myFunction();
disLabel->setText(tr(b));
}
Dialog::~Dialog()
{
delete ui;
}
#include "dialog.h"
#include "ui_dialog.h"
#include <QLibrary>
#include <QtGui>
Dialog::Dialog(QWidget *parent)
: QDialog(parent) ,ui(new Ui::DialogClass)
{
ui->setupUi(this);
disLabel = new QLabel;
pushButton = new QPushButton(tr("Sync"));
pushButton->setDefault(true);
connect(pushButton, SIGNAL(clicked()), this, SLOT(myFunction1()));
setWindowTitle(tr("Desktop Uploader"));
}
void Dialog::myFunction1()
{
QLibrary myLib("dllprog");
typedef char* (*MyPrototype)();
MyPrototype myFunction = (MyPrototype) QLibrary::resolve("dllprog", "TestDll");
char *b = myFunction();
disLabel->setText(tr(b));
}
Dialog::~Dialog()
{
delete ui;
}
To copy to clipboard, switch view to plain text mode
#include <QtGui/QApplication>
#include "dialog.h"
int main(int argc, char *argv[])
{
Dialog dialog;
dialog.show();
return dialog.exec();
}
#include <QtGui/QApplication>
#include "dialog.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Dialog dialog;
dialog.show();
return dialog.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks