Lars Gullik Bjønnes wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
| Abdelrazak Younes wrote:
| > Hello,
| > I just committed this patch the "younes" branch. I would be happy if
| > some kind sould help me verify complete that.
|
| I managed to install Qt3 so I have fixed compilation issues for qt3. I
| have a new weird issue though:
|
| D:\devel\lyx\trunk\src\frontends\qt3\QCommandBuffer.C: In member
| function `virtual void
| lyx::frontend::<unnamed>::QTempListBox::mouseReleaseEvent(QMouseEvent*)':
| D:\devel\lyx\trunk\src\frontends\qt3\QCommandBuffer.C:55: error:
| `emit' was not declared in this scope
Ahh, the lovely world of Qt.
Of Qt3! I never had a single problem like this one with Qt4. I tried to
#define and #undef a lot of things but I still have this error. I
thought the problem was that QTempListBox was not a proper Q_OBJECT but
it's more than that apparently. Here is my current patch is someone has
a clever idea for me.
Abdel.
Index: QCommandBuffer.C
===================================================================
--- QCommandBuffer.C (revision 14006)
+++ QCommandBuffer.C (working copy)
@@ -22,7 +22,9 @@
#include "support/filetools.h"
-#include <qlistbox.h>
+//#undef QT_NO_EMIT
+
+#include <qobjectdefs.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qpushbutton.h>
@@ -35,37 +37,32 @@
namespace lyx {
namespace frontend {
-namespace {
+QCommandBuffer::QTempListBox::QTempListBox()
+: QListBox(0, 0,
+ WType_Modal | WType_Popup | WDestructiveClose) {
+ setHScrollBarMode(AlwaysOff);
+}
-class QTempListBox : public QListBox {
-public:
- QTempListBox()
- : QListBox(0, 0,
- WType_Modal | WType_Popup | WDestructiveClose) {
- setHScrollBarMode(AlwaysOff);
- }
-protected:
- void mouseReleaseEvent(QMouseEvent * e) {
- if (e->x() < 0 || e->y() < 0
- || e->x() > width() || e->y() > height()) {
- hide();
- } else {
- emit selected(currentText());
- }
- }
- void keyPressEvent(QKeyEvent * e) {
- if (e->key() == Key_Escape) {
+void QCommandBuffer::QTempListBox::mouseReleaseEvent(QMouseEvent * e) {
+ if (e->x() < 0 || e->y() < 0
+ || e->x() > width() || e->y() > height()) {
hide();
- return;
- }
- QListBox::keyPressEvent(e);
+ } else {
+ emit selected(currentText());
}
-};
+}
-} // end of anon
+void QCommandBuffer::QTempListBox::keyPressEvent(QKeyEvent * e) {
+ if (e->key() == Key_Escape) {
+ hide();
+ return;
+ }
+ QListBox::keyPressEvent(e);
+}
+
QCommandBuffer::QCommandBuffer(QtView * view, QWidget * parent,
ControlCommandBuffer & control)
: QWidget(parent), view_(view), controller_(control)
{
Index: QCommandBuffer.h
===================================================================
--- QCommandBuffer.h (revision 14006)
+++ QCommandBuffer.h (working copy)
@@ -13,6 +13,7 @@
#define QCOMMANDBUFFER_H
#include <qwidget.h>
+#include <qlistbox.h>
class QListBoxItem;
@@ -52,6 +53,22 @@
/// command widget
QCommandEdit * edit_;
+
+ class QTempListBox : public QListBox {
+ Q_OBJECT
+ public:
+ ///
+ QTempListBox();
+
+ signals:
+ void selected(const QString &);
+
+ protected:
+ ///
+ void mouseReleaseEvent(QMouseEvent * e);
+ ///
+ void keyPressEvent(QKeyEvent * e);
+ };
};
} // namespace frontend