[bt-devel] Run Into A Problem With Bibletime

Joachim Ansorg bt-devel@crosswire.org
Thu, 28 Jun 2001 23:24:46 +0200


Hi!

> Hello, I have been trying to modify Bibletime so that the changes to the
> up/down arrow direction occur without the user having to open up a new
> module.

> To do this I have added a changeOrder() public slot to
> CKeyChooserWidget and I am trying to connect a clicked signal from
> scrollCheckBox in COptionsDialog.cpp in the function
> COptionsDialog::initGeneralPage().  I want to connect a from the
> scrollCheckBox clicked signal to the changeOrder slot in CKeyChooserWidget.
> However I am having a major problem doing that.  I have tried doing...
> QObject::connect(scrollCheckBox, SIGNAL(clicked()),
> CBibleKeyChooser::w_book, SLOT(changeOrder())) because I made w_book public
> in CBibleKeyChooser but it gives me an error saying
> coptionsdialog.cpp:226: cannot convert a pointer of type `COptionsDialog'
> to a pointer of type `CBibleKeyChooser'

Connecting signals to slots or signals is only possible with valid objects.
If you want to connect signal signal1 to the slot slot1 of the m1 member of  
the class1 you have to write this:

object1 = new class1;
connect(this, SIGNAL(signal1()), object1->m1, SLOT(slot1()));

Connecting to w_book of CBibleKeyChooser is not possible, because it's not a 
member of an object in this context (CBibleKeyChooser::w_book is only valid 
for a static w_book member of CBibleKeyChooser).

> I think what I am trying to do should be possible(connect from
> scrollCheckBox in COptionsDialog.cpp to changeOrder in CKeyChooserWedget)
> but I cannot find a way to make it work.  If someone would please help me
> out or give me a few pointers I would be very greatful.

If you have a look at the function CBiblePresenter::refresh you see how 
changes made in the optionsdialog are processed.
We use an enum of CSwordPresenter which holds the possible changes. erefresh 
checks if the value is set and refreshes the members accordingly to this.

I'd suggest that you add the correct values to the enums in CSwordPresenter, 
that you add processing of them in the C*Presenter classes and that you set 
the values in the right function  COptionsDialog (havbe a loom into the 
COptionsDialog::save* functions how to set the values).

> P.S.  I am trying to learn about QT/KDE by programming on Bibletime and I
> have learned alot, however, I still have a long way to go  :)

I'm glad that you are still working with us. Many people have given up after 
a short time. I know it's difficult in the beginning but it's really much 
more easy later.

> Luke

Joachim

Joachim