#include <QApplication>
#include <QUiLoader>
#include <QWidget>
#include <QFile>
#include <QMainWindow>
#include <QtGui>
#include "QLabel.h"
#include "QGLabel.h"//???????????????????
//Qt 4.7.0
int main(int argc, char **argv)
{
Q_INIT_RESOURCE(test);
QFile uiFile
(":/test.ui");
QWidget *ui
= loader.
load(&uiFile
);
uiFile.close();
qDebug() << loader.pluginPaths();
/*
qDebug() shoes (((1))): ("C:/Qt/2010.05/qt/plugins\designer")
<<<this is designer path and >>>
<<<"QGLabelPlugin_Release.dll" is there>>>
qDebug() shoes (((2))): ("C:/TEST/test-build-desktop/release\designer")
also i copied "QGLabelPlugin_Release.dll" to c:/
*/
ui->show();
//after loading this form i need to access its child widgets
//-------------------------------------------------------------------------
//i can access Qt NORMAL widget, here i can change it and its OK
QLabel *normalWidget
= qFindChild<QLabel
*>
(ui,
"labelName");
normalWidget
->setFont
(QFont("Arial",
22,
3,
true));
normalWidget->setText("i can change Qt Normal widget...");
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//now i need to change my custom widget
QGLabel *myCustomWidget = qFindChild<QGLabel *>(ui, "g0");
myCustomWidget
->setFont
(QFont("Arial",
22,
3,
true));
myCustomWidget->setText("i can change my custom widget...");
//BUT i get this messages:
//Application Output is:
//Starting C:\TEST\test-build-desktop\release\test.exe...
//C:\TEST\test-build-desktop\release\test.exe exited with code -1073741515
/*Build Issues is:
release/moc_QGLabel.cpp:47: warning: 'QGLabel::staticMetaObject' redeclared
without dllimport attribute after being referenced with dll linkage
release/moc_QGLabel.cpp:56: warning: 'virtual const QMetaObject* QGLabel::metaObject()
const' redeclared without dllimport attribute: previous dllimport ignored
release/moc_QGLabel.cpp:61: warning: 'virtual void* QGLabel::qt_metacast(const char*)'
redeclared without dllimport attribute: previous dllimport ignored
release/moc_QGLabel.cpp:69: warning: 'virtual int QGLabel::qt_metacall
(QMetaObject::Call, int, void**)' redeclared without dllimport attribute: previous dllimport ignored
*/
/*********************************************
i found in Qt Centre Forum FAQ
-1073741515 in dec is C0000135 in hex, which is a "dll file not found" error.
but i confused i added my dll, hmmm...!!!???
*/
//-------------------------------------------------------------------------
// so i dont know how i can do that, is other way, i dont know how i can use
// my plugin dll
// any suggestion? with a simple example!?!
//THANKs in Advance
//Regards Serjik
return app.exec();
}
//============================================================
#include <QApplication>
#include <QUiLoader>
#include <QWidget>
#include <QFile>
#include <QMainWindow>
#include <QtGui>
#include "QLabel.h"
#include "QGLabel.h"//???????????????????
//Qt 4.7.0
int main(int argc, char **argv)
{
Q_INIT_RESOURCE(test);
QApplication app(argc, argv);
QUiLoader loader;
QFile uiFile(":/test.ui");
uiFile.open(QIODevice::ReadOnly);
QWidget *ui = loader.load(&uiFile);
uiFile.close();
qDebug() << loader.pluginPaths();
/*
qDebug() shoes (((1))): ("C:/Qt/2010.05/qt/plugins\designer")
<<<this is designer path and >>>
<<<"QGLabelPlugin_Release.dll" is there>>>
qDebug() shoes (((2))): ("C:/TEST/test-build-desktop/release\designer")
also i copied "QGLabelPlugin_Release.dll" to c:/
*/
ui->show();
//after loading this form i need to access its child widgets
//-------------------------------------------------------------------------
//i can access Qt NORMAL widget, here i can change it and its OK
QLabel *normalWidget = qFindChild<QLabel *>(ui, "labelName");
normalWidget->setFont(QFont("Arial", 22, 3, true));
normalWidget->setText("i can change Qt Normal widget...");
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//now i need to change my custom widget
QGLabel *myCustomWidget = qFindChild<QGLabel *>(ui, "g0");
myCustomWidget->setFont(QFont("Arial", 22, 3, true));
myCustomWidget->setText("i can change my custom widget...");
//BUT i get this messages:
//Application Output is:
//Starting C:\TEST\test-build-desktop\release\test.exe...
//C:\TEST\test-build-desktop\release\test.exe exited with code -1073741515
/*Build Issues is:
release/moc_QGLabel.cpp:47: warning: 'QGLabel::staticMetaObject' redeclared
without dllimport attribute after being referenced with dll linkage
release/moc_QGLabel.cpp:56: warning: 'virtual const QMetaObject* QGLabel::metaObject()
const' redeclared without dllimport attribute: previous dllimport ignored
release/moc_QGLabel.cpp:61: warning: 'virtual void* QGLabel::qt_metacast(const char*)'
redeclared without dllimport attribute: previous dllimport ignored
release/moc_QGLabel.cpp:69: warning: 'virtual int QGLabel::qt_metacall
(QMetaObject::Call, int, void**)' redeclared without dllimport attribute: previous dllimport ignored
*/
/*********************************************
i found in Qt Centre Forum FAQ
-1073741515 in dec is C0000135 in hex, which is a "dll file not found" error.
but i confused i added my dll, hmmm...!!!???
*/
//-------------------------------------------------------------------------
// so i dont know how i can do that, is other way, i dont know how i can use
// my plugin dll
// any suggestion? with a simple example!?!
//THANKs in Advance
//Regards Serjik
return app.exec();
}
//============================================================
To copy to clipboard, switch view to plain text mode
Bookmarks