LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-04-2006, 12:56 AM   #1
pranav_kavi
LQ Newbie
 
Registered: Jan 2006
Posts: 2

Rep: Reputation: 0
how do i design items in QIconView


hi all,

I am a beginner in qt programming. I have come across a problem while
developing a chat server.

I want to get different functions called by clicking different items
in qiconview. Example : one click on the item in the qiconview a new
window has to be opened

My code is:

QIconViewItem *item=new QIconViewItem(
iv,result,QPixmap("/home/sindhu/BuddyList/offline.gif" ) );
connect(iv,SIGNAL(clicked(QIconViewItem*)),this,SLOT(itemDoubleClicked(QIconViewItem*)));
.
.
.
.
.
.
void BList::itemDoubleClicked(QIconViewItem *item)
{
QMessageBox::warning( this,"check","hi");
}

During qmake of the project i am getting the following messages:
.ui/Blist.h:31:`QIconViewItem' was not declared in this scope
.ui/Blist.h:31: `item' was not declared in this scope
.ui/Blist.h:31: invalid data member initialization
.ui/Blist.h:31: (use `=' to initialize static data members)
.ui/Blist.h:31: variable or field `itemDoubleClicked' declared void
.ui/Blist.h:31: `itemDoubleClicked' declared as a `virtual' field


I request you to solve the problem.

Thanking you,
With warm regards,
kavitha
 
Old 01-04-2006, 09:22 AM   #2
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
what files are you #include ing ..

also if possible
if you post all of the code for Blist.h it may help a little more..
 
Old 01-04-2006, 04:22 PM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Quote:
Originally Posted by pranav_kavi
hi all,

I am a beginner in qt programming. I have come across a problem while
developing a chat server.

I want to get different functions called by clicking different items
in qiconview. Example : one click on the item in the qiconview a new
window has to be opened
You say here that you want one click, but name the slot DoubleClicked. Do you know
that you can have both clicked() and doubleClicked() signals (and corresponding slots)in this case?

Code:
QIconViewItem *item=new QIconViewItem(
iv,result,QPixmap("/home/sindhu/BuddyList/offline.gif" ) );
connect(iv,SIGNAL(clicked(QIconViewItem*)),this,SLOT(itemDoubleClicked(QIconViewItem*)));
Add:
Code:
#include <qiconview.h>
 
Old 01-04-2006, 11:39 PM   #4
pranav_kavi
LQ Newbie
 
Registered: Jan 2006
Posts: 2

Original Poster
Rep: Reputation: 0
hi again...

actually i'm quiet aware of the header files that have 2 b included & i have solved the problem...thanx alot for replying 2 my query.
rgards,
kavitha
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux for Graphic Design, web design, and publishing maelstrom209 Linux - Software 8 07-17-2011 11:35 AM
Desktop items johnnydangerous Fedora 2 03-05-2005 09:34 AM
Startup items Ishkabibble Linux - Newbie 2 08-13-2003 11:42 PM
website design wlfdgcrkz Programming 2 04-27-2003 03:59 AM
OS Design Shak Programming 2 08-26-2002 04:12 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration