View Full Version : KColorCombo problem
Maxilys
8th May 2006, 14:15
Hi there,
I'm trying to use KColorCombo. Everything works except that I can't retrieve the selected color. Any attempt to use KColorCombo::color() leads to a failure during compile.
serenity.cpp:(.text+0x138d1): undefined reference to `KColorCombo::color() const'
collect2: ld returned 1 exit status
The include is there. What else can I do and that I don't know? :confused:
(My config: KDE 3.5.2)
I'm trying to use KColorCombo. Everything works except that I can't retrieve the selected color. Any attempt to use KColorCombo::color() leads to a failure during compile.
Could you show a snippet of the code where you call KColorCombo::color() method? Unless you have subclassed KColorCombo, the syntax KColorCombo::color() is wrong. It's not a static method. You should be calling it through the instance, eg. something like combo->color().
What else can I do and that I don't know?
Are you sure that you link your application with all required libraries?
Maxilys
10th May 2006, 03:43
The code snippet won't tell much since I don't actually want to use a KColorCombo but only access it for my style plugin. Here's what I do in the event filter:
if ( (::qt_cast<QComboBox*>(obj)) && (obj->inherits("KColorCombo"))
&& (ev->type() == QEvent::Paint) )
{
KColorCombo* combo = static_cast<KColorCombo*>(obj);
bool enabled = combo->isEnabled();
bool mouseOver = combo->hasMouse();
QColorGroup cg = combo->colorGroup();
QColor innerColor = combo->color(); // <-Splash!
//
// etc...
}
As for linking the necessary libs, I think I do. I already managed to style the very KDE specific widgets KKeyButton and KColorButton. I don't think KColorCombo has special needs. Am I wrong?
undefined reference
maybe some library is not used when linking
wysota
18th May 2006, 11:02
Show us the compilation line which fails (especially the list of libraries it tries to link with).
Maxilys
18th May 2006, 12:18
Show us the compilation line which fails (especially the list of libraries it tries to link with).
Thanks but it's too late. I already solved the problem. The kdeui library wasn't linked because of a bad bad makefile. :o
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.