[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KNumInput::setLabel and ugly dialogs
From:       Holger Freyther <zecke () selfish ! org>
Date:       2008-05-08 9:24:35
Message-ID: 200805081124.36884.zecke () selfish ! org
[Download RAW message or body]

On Sunday 27 April 2008 12:37:43 Holger Freyther wrote:

> Is there anything we can do to KNumInput to fix it? Using a layout, using a
> QSpacerIterm? Provide a QLabel* KNumInput::label() and then put that into a
> QFormLayout ourselves?

Okay,
I consulted with my master and proposed a couple of approaches to fix this and 
we came to the conclusion that it is best to just deprecate setLabel and to 
take care of creating the label yourself.

I would like to commit the below patch and then go through the code and fix 
the usage of setLabel and improve the look of the dialogs...

comments?

z.

["deprecate_set_label.diff" (text/x-diff)]

Index: knuminput.h
===================================================================
--- knuminput.h	(Revision 805013)
+++ knuminput.h	(Arbeitskopie)
@@ -65,23 +65,13 @@
     ~KNumInput();
 
     /**
-     * Sets the text and alignment of the main description label.
+     * @deprecated since 4.1
      *
-     * @param label The text of the label.
-     *              Use QString() to remove an existing one.
-     *
-     * @param a The alignment of the label (Qt::Alignment).
-     *          Default is @p Qt:AlignLeft | @p Qt:AlignTop.
-     *
-     * The vertical alignment flags have special meaning with this
-     * widget:
-     *
-     *     @li @p Qt:AlignTop     The label is placed above the edit/slider
-     *     @li @p Qt:AlignVCenter The label is placed left beside the edit
-     *     @li @p Qt:AlignBottom  The label is placed below the edit/slider
-     *
+     * You are encouraged to create a QLabel yourself and properly position
+     * it or add it to a QLayout. For forms the QFormLayout class could be
+     * used. This way all labels and inputs will align properly.
      */
-    virtual void setLabel(const QString & label, Qt::Alignment a = Qt::AlignLeft | \
Qt::AlignTop); +    KDE_DEPRECATED virtual void setLabel(const QString & label, \
Qt::Alignment a = Qt::AlignLeft | Qt::AlignTop);  
     /**
      * @return the text of the label.



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic