[QScintilla] [PATCH] SciClasses: fix build problems

Chris Packham judge.packham at gmail.com
Fri Jan 15 14:54:33 GMT 2010


This patch addresses build issues with the 2.4.1 GPL release.
---

Looks like there were also problems with the Qt3 version. My fix to the Qt3
stuff is completely untested as I don't have access to a Qt3 development
system.

 Qt3/SciClasses.cpp |   29 ++++-------------------------
 Qt4/SciClasses.cpp |   23 +----------------------
 2 files changed, 5 insertions(+), 47 deletions(-)

diff --git a/Qt3/SciClasses.cpp b/Qt3/SciClasses.cpp
index 059182f..7aa8188 100644
--- a/Qt3/SciClasses.cpp
+++ b/Qt3/SciClasses.cpp
@@ -112,7 +112,11 @@ void SciPopup::on_triggered(int cmd)
     sci->Command(cmd);
 }
 
+#include <QListWidgetItem>
 
+SciListBox::SciListBox(QWidget *parent, ListBoxQt *lbx_)
+    : QListWidget(parent), lbx(lbx_)
+{
     setWindowFlags(Qt::Tool|Qt::FramelessWindowHint);
     setAttribute(Qt::WA_StaticContents);
 
@@ -174,31 +178,6 @@ void SciListBox::keyPressEvent(QKeyEvent *e)
     }
 }
 
-#else
-
-SciListBox::SciListBox(QWidget *parent, ListBoxQt *lbx_)
-    : QListBox(parent,0,Qt::WType_Popup|Qt::WStyle_Customize|Qt::WStyle_NoBorder|Qt::WStaticContents), lbx(lbx_)
-{
-    setFocusProxy(parent);
-
-    setFrameShape(StyledPanel);
-    setFrameShadow(Plain);
-
-    connect(this,SIGNAL(doubleClicked(QListBoxItem *)),
-        SLOT(handleSelection()));
-
-    connect(this,SIGNAL(highlighted(QListBoxItem *)),
-        SLOT(ensureCurrentVisible()));
-}
-
-
-int SciListBox::find(const QString &prefix)
-{
-    return index(findItem(prefix, Qt::CaseSensitive|Qt::BeginsWith));
-}
-
-#endif
-
 
 SciListBox::~SciListBox()
 {
diff --git a/Qt4/SciClasses.cpp b/Qt4/SciClasses.cpp
index b097ad7..26f136d 100644
--- a/Qt4/SciClasses.cpp
+++ b/Qt4/SciClasses.cpp
@@ -131,7 +131,7 @@ SciListBox::SciListBox(QWidget *parent, ListBoxQt *lbx_)
 #if QT_VERSION >= 0x040500
     setWindowFlags(Qt::ToolTip|Qt::WindowStaysOnTopHint);
     setAttribute(Qt::WA_StaticContents);
-
+#endif
     setFocusProxy(parent);
 
     setFrameShape(StyledPanel);
@@ -190,32 +190,11 @@ void SciListBox::keyPressEvent(QKeyEvent *e)
     }
 }
 
-#else
-
-SciListBox::SciListBox(QWidget *parent, ListBoxQt *lbx_)
-    : QListBox(parent,0,Qt::WType_Popup|Qt::WStyle_Customize|Qt::WStyle_NoBorder|Qt::WStaticContents), lbx(lbx_)
-{
-    setFocusProxy(parent);
-
-    setFrameShape(StyledPanel);
-    setFrameShadow(Plain);
-
-    connect(this,SIGNAL(doubleClicked(QListBoxItem *)),
-        SLOT(handleSelection()));
-
-    connect(this,SIGNAL(highlighted(QListBoxItem *)),
-        SLOT(ensureCurrentVisible()));
-}
-
-
 int SciListBox::find(const QString &prefix)
 {
     return index(findItem(prefix, Qt::CaseSensitive|Qt::BeginsWith));
 }
 
-#endif
-
-
 SciListBox::~SciListBox()
 {
     // Ensure that the main widget doesn't get a focus out event when this is
-- 
1.6.4.2



More information about the QScintilla mailing list