Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2007-07

New qt bugfix patch

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Felipe Monteiro de Carvalho
to zeljko

thanks, applied

By the way, do you remember when Den comes back? I am anxious for the new bindings =) I need them to test some things.

Felipe Monteiro de Carvalho

Reply by email

zeljko
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote
thanks, applied By the way, do you remember when Den comes back? I am anxious for the new bindings =) I need them to test some things.

AFAIK he said that he'll return on 29.06.2007. Hey Den you lazy man where are you ? ;)))))

Reply by email

Den Jean
to zeljko
am zeljko wrote
AFAIK he said that he'll return on 29.06.2007. Hey Den you lazy man where are you ? ;)))))

I am back and I am looking into the widestring problem.

regards,

Den Jean

Reply by email

Unknown author
to Den Jean

Quoting Den Jean :

Show quoted text 5 lines
On Monday 02 July 2007 09:38:14 am zeljko wrote: > AFAIK he said that he'll return on 29.06.2007. Hey Den you lazy man where > are you ? ;))))) I am back and I am looking into the widestring problem.

Hi,
Nice to see you here again :)
I think that you've seen what have to be done with pwidestrings in bindings. Another thing we have to do is small changes in bindings code.
1. This have to be added for QWidget, QMainWindow & QMdiSubWindow Why ? Because QWidget's closeEvent() call is per default accepted, so we cannot control it via LCL.
before QWidget_create you should add this code.
QWidget_create doesn't need to be changed like here, but can be added another constructor like QWidget_createLCL() which returns QWidgetHack (it can be named QWidgetLCL) ...
/* QWidgetHack class is "howto" override some protected functions for our bindings
or howto get some voids into class public.
*/
class QWidgetHack: public QWidget
{
public:
QWidgetHack(QWidget* parent, Qt::WindowFlags f): QWidget(parent, f) { }
protected:
void closeEvent(QCloseEvent* event)
{
/* our qt bindings windows are happy now
but we should take care of QEvent::accept()
or QEvent::ignore() !*/

          };
     };

QWidgetH QWidget_create(QWidgetH parent, unsigned int f) {
/* here we create our hack widget */

	return (QWidgetH) new QWidgetHack ((QWidget*)parent, (Qt::WindowFlags)f);

}

Same thing have to be maded for QMainWindow (QMainWindowHack) and QMdiSubWindow (QMdiSubWindowHack)

2.Add helper functions for QStringList
here they are:
class QStringListHack: public QStringList
{
     public:
     QStringListHack(): QStringList(){
     };
     public:
     int base_count(){
       return count();
     };
     void base_append(QString &value){
      append(value);
     };
     void base_begin(){
     begin();
     };
     void base_clear(){
     clear();
     };
     void base_end(){
     end();
     };
     void base_insert(int i, QString value){
     insert(i, value);
     }
     bool base_Empty(){
     return empty();
     };
     QString base_last(){
     return last();
     };
     void base_move(int from, int to){
      move(from, to);
     };
     void base_removeAt(int i){
      removeAt(i);
     }
     QString base_value(int i){
      return value(i);
     };
};

QStringListH QStringList_create()
{
/* we create hacked stringlist by default */

	return (QStringListH) new QStringListHack();

}

with this QStringList hack we get basic QStringList handling, so it will be easy to make converter function TStringList2QStringList() and QStringList2TStringList()

All changes are tested and works nice.

zeljko

Reply by email

Den Jean
to Unknown author
pm wrote 11 lines
bindings. Another thing we have to do is small changes in bindings code. 1. This have to be added for QWidget, QMainWindow & QMdiSubWindow Why ? Because QWidget's closeEvent() call is per default accepted, so ? we cannot control it via LCL. before QWidget_create you should add this code. QWidget_create doesn't need to be changed like here, but can be added ? another constructor like QWidget_createLCL() which returns QWidgetHack ? (it can be named QWidgetLCL) ... /* QWidgetHack class is "howto" override some protected functions for ? our bindings ? ? or howto get some voids into class public.

This need some thinking ...
The binding is generated, so not everything is that easy to change. But I will look into it.

regards,

Den Jean

Reply by email

zeljko
to Den Jean
Den Jean wrote 16 lines
On Monday 02 July 2007 07:55:26 pm wrote: > bindings. Another thing we have to do is small changes in bindings code. > 1. This have to be added for QWidget, QMainWindow & QMdiSubWindow > Why ? Because QWidget's closeEvent() call is per default accepted, so ? > we cannot control it via LCL. > before QWidget_create you should add this code. > QWidget_create doesn't need to be changed like here, but can be added ? > another constructor like QWidget_createLCL() which returns QWidgetHack ? > (it can be named QWidgetLCL) ... > /* QWidgetHack class is "howto" override some protected functions for ? > our bindings > ? ? or howto get some voids into class public. This need some thinking ... The binding is generated, so not everything is that easy to change. But I will look into it.

Maybe you can add some small script which will be executed after generator finishes it's job, and add addons to bindings (for the first time, until generator fixed).
This is not a fancy feature, but this drives us in bugs which cannot be fixed via LCL.
eg. assign OnCloseQuery() for you main app window, put there something like CanClose := MessageDlg('fasdfsdfdsf',mtConfirmation,[mbYes, mbNo],0) = mrYes, compile and then try to close your app via "X" button. Now you'll see why this is so important. closeEvent() for windowing widgets have to be overriden in this or that way :), so think good ;)
Also it's very important that we get useable QStringList (which is btw. unuseable now, because you cannot do anything without Add(), Insert() etc..)

zeljko

Reply by email