Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

KDevelop tutorials

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
View previous topic :: View next topic  
Author Message
pikkewyn



Joined: Fri Jul 08, 2005 7:40 am
Posts: 3

PostPosted: Fri Jul 08, 2005 7:42 am    Post subject: KDevelop tutorials Reply with quote

I have just started following the KDE development tuorials from 2004. Everything has gone well and I have managed to work through most problems I have encountered. However this one has me stumped. Tutorial 5 from LXF58 (Oct 2004) contains the code ( in selectionbarcode.cpp )

#include "selectionbarcode.h"
#include <qmessagebox.h>
#include <qdir.h>
#include <qimage.h>
#include <qpixmap.h>


SelectionBarCode::SelectionBarCode(QWidget *parent, const char *name)
: SelectionBar(parent, name)
{
QDir dir("/sources/lxfgallery/testalbum");
if (!dir.exists())
{
qWarning("Cannot find the example directory");
}
else
{
const QFileInfoList *list = dir.entryInfoList("*.jpg *.png *.jpeg *.bmp *.tiff *.gif *.xpm");
QFileInfoListIterator iter( *list );
QFileInfo *fileinc;
while ( (fileinc = iter.current()) !=0)
{
QImage img(fileinc->absFilePath().latin1());
QPixmap pix(img.scale(64, 48, QImage::ScaleFree));

picList->insertItem(pix, fileinc->fileName().latin1());
++iter;
}


}


SelectionBarCode::~SelectionBarCode()
{
}

void SelectionBarCode::addAlbum()
{ QMessageBox::information( this,"LXFGallery","This Feature is not implemented yet.\n Because Your the developer couldn't be arsed!");
}


if I try and build this I get the following error

"/home/matthew/lxfgallery/src/selectionbarcode.cpp:45: error: `picList' undeclared (first use this function)
*** Exited with status: 2 ***"

Has anyone done the tutorials and had the same problem? if not where do I declare "picList"
Back to top
View user's profile Send private message
Nigel
LXF regular


Joined: Fri Apr 08, 2005 9:03 pm
Posts: 1141
Location: Gloucestershire, UK

PostPosted: Fri Jul 08, 2005 10:02 am    Post subject: RE: KDevelop tutorials Reply with quote

I've just skimmed through the articles, and it isn't obvious Sad

However, I think the clue may lie on page 84 of LXF58, at the start of the "Beginning to code" paragraph.
It says "Before we go any further, ensure that you give the bottom list box widget a name in QT Designer". Taking that in conjunction with the comments on page 86, where the picList->Insert command is discussed, I would hazard a guess that you are supposed to have given the bottom list box widget the name "picList"...

Also note the Top Tip on page 97 of LXF59 about doing a Build->Distclean.
_________________
Hope this helps,

Nigel.
Back to top
View user's profile Send private message
pikkewyn



Joined: Fri Jul 08, 2005 7:40 am
Posts: 3

PostPosted: Fri Jul 08, 2005 6:05 pm    Post subject: Reply with quote

Thanks Nigel.
Will have a look at those points and let you know How I get on Smile
Back to top
View user's profile Send private message
pikkewyn



Joined: Fri Jul 08, 2005 7:40 am
Posts: 3

PostPosted: Sat Jul 09, 2005 12:16 pm    Post subject: out of the frying pan Reply with quote

Hi there.
in an earlier tutorial this lower KListBox was called thumbnailList not picList. however when I changed the name to picList I get the error
"/home/matthew/lxfgallery/src/selectionbarcode.cpp:45: error: invalid use of undefined type `struct KListBox'
./selectionbar.h:20: error: forward declaration of `struct KListBox'
which is referencing to selectionbar.h the file automatically created by Qt Designer

has anyone succeeded with this set of tutorials and have the code or do you think I should e-mail Jono Bacon
Back to top
View user's profile Send private message
Nigel
LXF regular


Joined: Fri Apr 08, 2005 9:03 pm
Posts: 1141
Location: Gloucestershire, UK

PostPosted: Sat Jul 09, 2005 6:48 pm    Post subject: RE: out of the frying pan Reply with quote

This could be where you need to do the Build->Distclean to make sure that all related files are recompiled/remade, especially selectionbar.h

Failing that, I think an email to Jono would be the fastest way to get you back on track.

Sorry, I haven't worked through these tutorials myself.
_________________
Hope this helps,

Nigel.
Back to top
View user's profile Send private message
kimdino



Joined: Sun Jul 24, 2005 8:18 pm
Posts: 2

PostPosted: Sun Jul 24, 2005 8:43 pm    Post subject: Reply with quote

pikkewyns's problem is exactly the same as what brought me here. The difference is that I had tried using 'thumbnailList->insetItem' & have also tried DistClean. No joy with either Sad

thumbnailList has no visible sign of an insertItem method though, being a listbox, there must be some way of adding items? The only functions I can find any mention of are those created in LXFGallery code.

My plan was then to compare his, presumably working, version with my typed-in-from-the-mag version to see where they differ. I was unable to find the code on the DVDs, but the mag gives the address as <www.jonobacon.org/minisites/linuxformat/kdevelopment> but this is a dead link. Does anyone know where I can pick up a copy of Jono's code?
Back to top
View user's profile Send private message
holbromf



Joined: Fri Jul 29, 2005 7:42 am
Posts: 5

PostPosted: Fri Jul 29, 2005 7:49 am    Post subject: LXFGallery Reply with quote

Hi,
I am also going to complete Jono's tutorial even if it kills me.
I found that thumbnailList and picList are the same and I have used the latter.
Jono's site is under construction so we will have to wait to see the magic code.
I have a problem with the connect statement in LXF58. Did you guys manage to solve this? The message suggested the signature did not match anything in qlabel.h. I would appreciate some help here.

Cheers Mike
Back to top
View user's profile Send private message
holbromf



Joined: Fri Jul 29, 2005 7:42 am
Posts: 5

PostPosted: Fri Jul 29, 2005 12:53 pm    Post subject: Reply with quote

Hi,
I just solved the 'connect' problem.
I cast 'selectionBar' with (QObject*) i.e.

connect ( (QObject*)selectionBar->picList, SIGNAL( highlighted(QString&) ), etc, etc

Cheers Mike
Back to top
View user's profile Send private message
holbromf



Joined: Fri Jul 29, 2005 7:42 am
Posts: 5

PostPosted: Sun Aug 07, 2005 12:55 pm    Post subject: Reply with quote

Hi,
I have got through the eleven tutorials. I have a question about the resource file. I get the runtime message the system " cannot find .rc file lxfgalleryui.rc". Does anyone know which directory this file should go for the progran to find it automatically? I have tried src, debug/src and debug but to no availe. I would like to get the middle item in the file menu. Does this message mean the file was found but is incorrect in some way?


Cheers Mike
Back to top
View user's profile Send private message
lcoopman



Joined: Fri Aug 26, 2005 7:41 pm
Posts: 1

PostPosted: Mon Aug 29, 2005 7:28 pm    Post subject: Reply with quote

picList problem solved.
Open selectionbar.ui in Qt3 en change the name "thumbnailList" to "picList".
Another solution is the change the name "picList" to "thumbnailList" each time you need it in the code.
In selectionbarcode.h add the line #include <klistbox.h>.
Back to top
View user's profile Send private message
Goran



Joined: Wed Aug 17, 2005 8:52 pm
Posts: 5

PostPosted: Mon Aug 29, 2005 8:03 pm    Post subject: Reply with quote

I wanted to go through the tutorial, but I only have the parts starting from part 3. So I am waiting for the the first two parts to become avilable on the website so I can begin my journey. Are the old tutorials going to be uploaded any time soon ? I sure hope so Sad
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast