半碗蛋炒饭的Blog 的评论 http://blog.donews.com/netexe 把你的名字写在烟上,吸到我的肺里,那里离我的心很近很近... Thu, 11 Sep 2008 00:27:00 +0000 http://wordpress.org/?v=2.9.2 hourly 1 linuxping 对《undefined reference to vtable for “xxx::xxx”》的评论 http://blog.donews.com/netexe/archive/2006/02/09/720544.aspx/comment-page-1#comment-3 linuxping Thu, 11 Sep 2008 00:27:00 +0000 http://blog.donews.com/netexe/archive/2006/02/09/720544.aspx#comment-3 出现了您的错误,但解决不了 <br> <br>代码: <br>./include/FindDlg.h <br> <br> <br>#ifndef FINDDLG_H <br>#define FINDDLG_H <br> <br>#include <QDialog> <br>#include <QWidget> <br>class QCheckBox; <br>class QLabel; <br>class QLineEdit; <br>class QPushButton; <br> <br> <br>class FindDlg : public QDialog <br>{ <br> Q_OBJECT <br>private: <br> QLabel *label; <br> QLineEdit *lineEdit; <br> QCheckBox *caseCheckBox; <br> QCheckBox *backwardCheckBox; <br> QPushButton *findButton; <br> QPushButton *closeButton; <br> <br>public: <br> FindDlg(); <br>signals: <br> void findNext(const QString &str, Qt::CaseSensitivity cs); <br> void findPrevious(const QString &str, Qt::CaseSensitivity cs); <br>private slots: <br> void findClicked(); <br> void enableFindButton(const QString &text); <br> <br>}; <br> <br>#endif // FINDDLG_H <br> <br> <br> <br> <br> <br>./src/FindDlg.cpp <br> <br>#include "FindDlg.h" <br>#include <QtGui> <br> <br> <br>FindDlg::FindDlg():QDialog(NULL) <br>{ <br> label = new QLabel(tr("Find &what:")); <br> lineEdit = new QLineEdit; <br> label->setBuddy(lineEdit); <br> caseCheckBox = new QCheckBox(tr("Match &case")); <br> backwardCheckBox = new QCheckBox(tr("Search &backward")); <br> findButton = new QPushButton(tr("&Find")); <br> findButton->setDefault(true); <br> findButton->setEnabled(false); <br> closeButton = new QPushButton(tr("Close")); <br> <br> connect(lineEdit, SIGNAL(textChanged(const QString &)), <br> this, SLOT(enableFindButton(const QString &))); <br> connect(findButton, SIGNAL(clicked()), <br> this, SLOT(findClicked())); <br> connect(closeButton, SIGNAL(clicked()), <br> this, SLOT(close())); <br> <br> QHBoxLayout *topLeftLayout = new QHBoxLayout; <br> topLeftLayout->addWidget(label); <br> topLeftLayout->addWidget(lineEdit); <br> QVBoxLayout *leftLayout = new QVBoxLayout; <br> leftLayout->addLayout(topLeftLayout); <br> leftLayout->addWidget(caseCheckBox); <br> leftLayout->addWidget(backwardCheckBox); <br> QVBoxLayout *rightLayout = new QVBoxLayout; <br> rightLayout->addWidget(findButton); <br> rightLayout->addWidget(closeButton); <br> rightLayout->addStretch(); <br> QHBoxLayout *mainLayout = new QHBoxLayout; <br> mainLayout->addLayout(leftLayout); <br> mainLayout->addLayout(rightLayout); <br> setLayout(mainLayout); <br> <br> setWindowTitle(tr("Find")); <br> setFixedHeight(sizeHint().height()); <br>} <br> <br> <br>void FindDlg::findClicked() <br>{ <br> QString text = lineEdit->text(); <br> Qt::CaseSensitivity cs = <br> caseCheckBox->isChecked() ? Qt::CaseSensitive : Qt::CaseInsensitive; <br> if (backwardCheckBox->isChecked()) <br> { <br> emit findPrevious(text, cs); <br> } <br> else <br> { <br> emit findNext(text, cs); <br> } <br>} <br> <br> <br>void FindDlg::enableFindButton(const QString &text) <br>{ <br> findButton->setEnabled(!text.isEmpty()); <br>} <br> <br> <br> <br>./main.cpp <br> <br> <br>#include <QApplication> <br>#include <QFont> <br>#include <QPushButton> <br>#include <QWidget> <br>#include <QLabel> <br>#include <QHBoxLayout> <br>#include <QSpinBox> <br>#include <QVBoxLayout> <br>#include <QSlider> <br> <br> <br>int main(int argc, char* argv[]) <br>{ <br> QApplication app(argc, argv); <br> QLabel *lbl=new QLabel("this is a demo."); <br> QPushButton quit("Quit"); <br> <br> QWidget *window=new QWidget(); <br> window->setWindowTitle("title"); <br> <br> QHBoxLayout *layout=new QHBoxLayout(); <br> QVBoxLayout *vlayout=new QVBoxLayout(); <br> layout->addWidget(lbl); <br> layout->addWidget(&quit); <br> layout->addLayout(vlayout); <br> <br> QSpinBox *spin=new QSpinBox(); <br> spin->setValue(35); <br> spin->setRange(0,120); <br> vlayout->addWidget(spin); <br> <br> QSlider *slider=new QSlider(); <br> slider->setValue(35); <br> slider->setRange(0,120); <br> vlayout->addWidget(slider); <br> <br> QObject::connect(slider,SIGNAL(valueChanged(int)),spin,SLOT(setValue(int))); <br> QObject::connect(spin,SIGNAL(valueChanged(int)),slider,SLOT(setValue(int))); <br> <br> window->setLayout(layout); <br> quit.resize(75, 30); <br> quit.setFont(QFont("Times", 18, QFont::Bold)); <br> <br> QObject::connect(&quit, SIGNAL(clicked()), &app, SLOT(quit())); <br> <br> window->show(); <br> <br> return app.exec(); <br>} <br> <br> <br>错误很多啊: <br>obj\Debug\src\FindDlg.o||In function `_ZN7FindDlgC2Ev':| <br>\find\src\FindDlg.cpp|6|undefined reference to `vtable for FindDlg'| <br>\find\src\FindDlg.cpp|6|undefined reference to `vtable for FindDlg'| <br>obj\Debug\src\FindDlg.o||In function `_ZN7FindDlgC1Ev':| <br>\find\src\FindDlg.cpp|6|undefined reference to `vtable for FindDlg'| <br>\find\src\FindDlg.cpp|6|undefined reference to `vtable for FindDlg'| <br>obj\Debug\src\FindDlg.o||In function `_ZN7FindDlg11findClickedEv':| <br>\find\src\FindDlg.cpp|52|undefined reference to `FindDlg::findPrevious(QString const&, Qt::CaseSensitivity)'| <br>\find\src\FindDlg.cpp|56|undefined reference to `FindDlg::findNext(QString const&, Qt::CaseSensitivity)'| <br>obj\Debug\src\FindDlg.o||In function `_ZN6QFlagsIN2Qt10WindowTypeEEC1EPPv':| <br>)]+0x1c)||undefined reference to `FindDlg::staticMetaObject'| <br>||=== Build finished: 7 errors, 0 warnings ===| <br> <br> <br>帮忙! <br>多谢!!! <br> <br> 出现了您的错误,但解决不了

代码:

./include/FindDlg.h

#ifndef FINDDLG_H

#define FINDDLG_H

#include <QDialog>

#include <QWidget>

class QCheckBox;

class QLabel;

class QLineEdit;

class QPushButton;

class FindDlg : public QDialog

{

Q_OBJECT

private:

QLabel *label;

QLineEdit *lineEdit;

QCheckBox *caseCheckBox;

QCheckBox *backwardCheckBox;

QPushButton *findButton;

QPushButton *closeButton;

public:

FindDlg();

signals:

void findNext(const QString &str, Qt::CaseSensitivity cs);

void findPrevious(const QString &str, Qt::CaseSensitivity cs);

private slots:

void findClicked();

void enableFindButton(const QString &text);

};

#endif // FINDDLG_H

./src/FindDlg.cpp

#include "FindDlg.h"

#include <QtGui>

FindDlg::FindDlg():QDialog(NULL)

{

label = new QLabel(tr("Find &what:"));

lineEdit = new QLineEdit;

label->setBuddy(lineEdit);

caseCheckBox = new QCheckBox(tr("Match &case"));

backwardCheckBox = new QCheckBox(tr("Search &backward"));

findButton = new QPushButton(tr("&Find"));

findButton->setDefault(true);

findButton->setEnabled(false);

closeButton = new QPushButton(tr("Close"));

connect(lineEdit, SIGNAL(textChanged(const QString &)),

this, SLOT(enableFindButton(const QString &)));

connect(findButton, SIGNAL(clicked()),

this, SLOT(findClicked()));

connect(closeButton, SIGNAL(clicked()),

this, SLOT(close()));

QHBoxLayout *topLeftLayout = new QHBoxLayout;

topLeftLayout->addWidget(label);

topLeftLayout->addWidget(lineEdit);

QVBoxLayout *leftLayout = new QVBoxLayout;

leftLayout->addLayout(topLeftLayout);

leftLayout->addWidget(caseCheckBox);

leftLayout->addWidget(backwardCheckBox);

QVBoxLayout *rightLayout = new QVBoxLayout;

rightLayout->addWidget(findButton);

rightLayout->addWidget(closeButton);

rightLayout->addStretch();

QHBoxLayout *mainLayout = new QHBoxLayout;

mainLayout->addLayout(leftLayout);

mainLayout->addLayout(rightLayout);

setLayout(mainLayout);

setWindowTitle(tr("Find"));

setFixedHeight(sizeHint().height());

}

void FindDlg::findClicked()

{

QString text = lineEdit->text();

Qt::CaseSensitivity cs =

caseCheckBox->isChecked() ? Qt::CaseSensitive : Qt::CaseInsensitive;

if (backwardCheckBox->isChecked())

{

emit findPrevious(text, cs);

}

else

{

emit findNext(text, cs);

}

}

void FindDlg::enableFindButton(const QString &text)

{

findButton->setEnabled(!text.isEmpty());

}

./main.cpp

#include <QApplication>

#include <QFont>

#include <QPushButton>

#include <QWidget>

#include <QLabel>

#include <QHBoxLayout>

#include <QSpinBox>

#include <QVBoxLayout>

#include <QSlider>

int main(int argc, char* argv[])

{

QApplication app(argc, argv);

QLabel *lbl=new QLabel("this is a demo.");

QPushButton quit("Quit");

QWidget *window=new QWidget();

window->setWindowTitle("title");

QHBoxLayout *layout=new QHBoxLayout();

QVBoxLayout *vlayout=new QVBoxLayout();

layout->addWidget(lbl);

layout->addWidget(&quit);

layout->addLayout(vlayout);

QSpinBox *spin=new QSpinBox();

spin->setValue(35);

spin->setRange(0,120);

vlayout->addWidget(spin);

QSlider *slider=new QSlider();

slider->setValue(35);

slider->setRange(0,120);

vlayout->addWidget(slider);

QObject::connect(slider,SIGNAL(valueChanged(int)),spin,SLOT(setValue(int)));

QObject::connect(spin,SIGNAL(valueChanged(int)),slider,SLOT(setValue(int)));

window->setLayout(layout);

quit.resize(75, 30);

quit.setFont(QFont("Times", 18, QFont::Bold));

QObject::connect(&quit, SIGNAL(clicked()), &app, SLOT(quit()));

window->show();

return app.exec();

}

错误很多啊:

obj\Debug\src\FindDlg.o||In function `_ZN7FindDlgC2Ev’:|

\find\src\FindDlg.cpp|6|undefined reference to `vtable for FindDlg’|

\find\src\FindDlg.cpp|6|undefined reference to `vtable for FindDlg’|

obj\Debug\src\FindDlg.o||In function `_ZN7FindDlgC1Ev’:|

\find\src\FindDlg.cpp|6|undefined reference to `vtable for FindDlg’|

\find\src\FindDlg.cpp|6|undefined reference to `vtable for FindDlg’|

obj\Debug\src\FindDlg.o||In function `_ZN7FindDlg11findClickedEv’:|

\find\src\FindDlg.cpp|52|undefined reference to `FindDlg::findPrevious(QString const&, Qt::CaseSensitivity)’|

\find\src\FindDlg.cpp|56|undefined reference to `FindDlg::findNext(QString const&, Qt::CaseSensitivity)’|

obj\Debug\src\FindDlg.o||In function `_ZN6QFlagsIN2Qt10WindowTypeEEC1EPPv’:|

)]+0×1c)||undefined reference to `FindDlg::staticMetaObject’|

||=== Build finished: 7 errors, 0 warnings ===|

帮忙!

多谢!!!

]]>
kjpioo.cublog.cn 对《今天上午搞定中文界面了。》的评论 http://blog.donews.com/netexe/archive/2006/02/17/730313.aspx/comment-page-1#comment-5 kjpioo.cublog.cn Sat, 08 Mar 2008 13:47:00 +0000 http://blog.donews.com/netexe/archive/2006/02/17/730313.aspx#comment-5 上面需要改正一个说法,我在linux fedora core5下独立编译了mediaplayer(是应用程序形式,qtopia-opensource 2.2.0) 是这样运行的./setQpeEnv ./runqvfb ./mediaplayer -qws。结果直接提示Warning: QSocket::writeBlock: Socket is not open , 上面需要改正一个说法,我在linux fedora core5下独立编译了mediaplayer(是应用程序形式,qtopia-opensource 2.2.0) 是这样运行的./setQpeEnv ./runqvfb ./mediaplayer -qws。结果直接提示Warning: QSocket::writeBlock: Socket is not open ,

]]>
kjpioo.cublog.cn 对《今天上午搞定中文界面了。》的评论 http://blog.donews.com/netexe/archive/2006/02/17/730313.aspx/comment-page-1#comment-4 kjpioo.cublog.cn Sat, 08 Mar 2008 13:34:00 +0000 http://blog.donews.com/netexe/archive/2006/02/17/730313.aspx#comment-4 你好,非常羡慕你的成就。请问你的qtopia视频模块可以播放媒体文件吗?我现在的qtopia video界面能打开,但是不能找到媒体文件(/root/Documents已经保存了一份.mp4文件).运行video时候提示Warning: QSocket::writeBlock: Socket is not open .(qtopia已经通过设置环境变量和./runqvfb ,./runqpe启动了)。有什么解决思路吗? <br> 你好,非常羡慕你的成就。请问你的qtopia视频模块可以播放媒体文件吗?我现在的qtopia video界面能打开,但是不能找到媒体文件(/root/Documents已经保存了一份.mp4文件).运行video时候提示Warning: QSocket::writeBlock: Socket is not open .(qtopia已经通过设置环境变量和./runqvfb ,./runqpe启动了)。有什么解决思路吗?

]]>
匿名 对《野果》的评论 http://blog.donews.com/netexe/archive/2007/05/18/1166233.aspx/comment-page-1#comment-2 匿名 Wed, 21 Nov 2007 05:16:00 +0000 http://blog.donews.com/netexe/archive/2007/05/18/1166233.aspx#comment-2 哪里有??????? 哪里有???????

]]>
猪猪 对《Qtopia的启动界面终于被我改编了。》的评论 http://blog.donews.com/netexe/archive/2006/02/09/720789.aspx/comment-page-1#comment-7 猪猪 Tue, 09 Oct 2007 01:29:00 +0000 http://blog.donews.com/netexe/archive/2006/02/09/720789.aspx#comment-7 你好:能不能说说怎么样更改qtopia的启动界面? 你好:能不能说说怎么样更改qtopia的启动界面?

]]>
willfly 对《makeqpf, qmake, qws, keyevent》的评论 http://blog.donews.com/netexe/archive/2006/02/21/736514.aspx/comment-page-1#comment-6 willfly Thu, 23 Feb 2006 07:00:00 +0000 http://blog.donews.com/netexe/archive/2006/02/21/736514.aspx#comment-6 <br> <br>做的挺漂亮的 hoho 做的挺漂亮的 hoho

]]>