From faa630b567299bb59faf7f62a75f4360814712a3 Mon Sep 17 00:00:00 2001 From: Laurent Carlier Date: Tue, 15 Aug 2017 15:39:49 +0200 Subject: [PATCH] [GB.QT5.EXT] * NEW: Add the LCDNumber class from gb.qt4.ext also remove the Qt3 transitional header/code --- gb.qt4/src/ext/CLCDNumber.cpp | 12 +++++++++--- gb.qt5/src/ext/CLCDNumber.cpp | 1 + gb.qt5/src/ext/CLCDNumber.h | 1 + gb.qt5/src/ext/Makefile.am | 1 + gb.qt5/src/ext/main.cpp | 3 +++ 5 files changed, 15 insertions(+), 3 deletions(-) create mode 120000 gb.qt5/src/ext/CLCDNumber.cpp create mode 120000 gb.qt5/src/ext/CLCDNumber.h diff --git a/gb.qt4/src/ext/CLCDNumber.cpp b/gb.qt4/src/ext/CLCDNumber.cpp index 28fe2342c..21e22a37f 100644 --- a/gb.qt4/src/ext/CLCDNumber.cpp +++ b/gb.qt4/src/ext/CLCDNumber.cpp @@ -27,8 +27,6 @@ #include #include -//Added by qt3to4: -#include #include "gambas.h" @@ -44,7 +42,7 @@ BEGIN_METHOD(CLCDNUMBER_new, GB_OBJECT parent) QT.InitWidget(wid, _object, false); //QT.SetBackgroundRole(_object, QColorGroup::Base); - wid->setFrameStyle(Q3Frame::NoFrame); + wid->setFrameStyle(QFrame::NoFrame); wid->show(); @@ -62,7 +60,11 @@ END_PROPERTY BEGIN_PROPERTY(CLCDNUMBER_digits) if (READ_PROPERTY) + #if (HAVE_QTEXT_COMPONENT) GB.ReturnInteger(WIDGET->numDigits()); + #else + GB.ReturnInteger(WIDGET->digitCount()); + #endif else { int n = VPROP(GB_INTEGER); @@ -72,7 +74,11 @@ BEGIN_PROPERTY(CLCDNUMBER_digits) else if (n > 32) n = 32; + #if (HAVE_QTEXT_COMPONENT) WIDGET->setNumDigits(n); + #else + WIDGET->setDigitCount(n); + #endif /* Increasing the number of digits does not redisplay value */ WIDGET->repaint(); WIDGET->display(WIDGET->value()); diff --git a/gb.qt5/src/ext/CLCDNumber.cpp b/gb.qt5/src/ext/CLCDNumber.cpp new file mode 120000 index 000000000..fbf45409b --- /dev/null +++ b/gb.qt5/src/ext/CLCDNumber.cpp @@ -0,0 +1 @@ +../../../gb.qt4/src/ext/CLCDNumber.cpp \ No newline at end of file diff --git a/gb.qt5/src/ext/CLCDNumber.h b/gb.qt5/src/ext/CLCDNumber.h new file mode 120000 index 000000000..d4a7dc789 --- /dev/null +++ b/gb.qt5/src/ext/CLCDNumber.h @@ -0,0 +1 @@ +../../../gb.qt4/src/ext/CLCDNumber.h \ No newline at end of file diff --git a/gb.qt5/src/ext/Makefile.am b/gb.qt5/src/ext/Makefile.am index 37a1aaade..406367411 100644 --- a/gb.qt5/src/ext/Makefile.am +++ b/gb.qt5/src/ext/Makefile.am @@ -11,5 +11,6 @@ gb_qt5_ext_la_CPPFLAGS = @QT5EXT_INC@ -I$(top_srcdir)/share -I$(top_srcdir)/src/ gb_qt5_ext_la_SOURCES = \ main.h main.cpp \ + CLCDNumber.h CLCDNumber_moc.cpp CLCDNumber.cpp \ CDial.h CDial_moc.cpp CDial.cpp \ CTextEdit.h CTextEdit_moc.cpp CTextEdit.cpp diff --git a/gb.qt5/src/ext/main.cpp b/gb.qt5/src/ext/main.cpp index 516544db9..421fee295 100644 --- a/gb.qt5/src/ext/main.cpp +++ b/gb.qt5/src/ext/main.cpp @@ -30,6 +30,7 @@ #include "main.h" +#include "CLCDNumber.h" #include "CDial.h" #include "CTextEdit.h" @@ -40,6 +41,8 @@ QT_INTERFACE QT; GB_DESC *GB_CLASSES[] EXPORT = { + CLCDNumberDesc, + CDialDesc, CTextEditSelectionDesc,