Results 1 to 6 of 6

Thread: QSlider with double Heads..

  1. #1

    Exclamation QSlider with double Heads..

    hi,

    I need a Qslider with double headed......can any one please guide me how to do that.....



    Thanks in advance

  2. #2
    Join Date
    Jan 2006
    Location
    11 N 78 E
    Posts
    110
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QSlider with double Heads..

    Quote Originally Posted by moizahamedv
    I need a Qslider with double headed......can any one please guide me how to do that.....Thanks in advance
    Reimplement the code from qt-x11-opensource-src-4.1.1/src/gui/widgets/qslider.* or I think more likely src/gui/styles/qstyle.*
    Penguin #395953 using Qt for open-source development on X11 using C++ and
    Python via PyQt

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSlider with double Heads..

    What do you mean by "QSlider with double heads"?

    Did you try this?
    Qt Code:
    1. slider->setTickPosition( QSlider::TicksBothSides );
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QSlider with double Heads..

    I think he means a slider with an interval - like with min and max heads.

  5. #5
    Join Date
    May 2006
    Location
    Australia
    Posts
    53
    Thanks
    11
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QSlider with double Heads..

    Reimplement the code from qt-x11-opensource-src-4.1.1/src/gui/widgets/qslider.* or I think more likely src/gui/styles/qstyle.*
    When you say reimplement those files, most of the functionality of the qslider is actually contained in qabstractslider, but when I am trying to understand these files, there are two macros which are kind of confusing me

    Q_Q(QAbstractSlider) seems to give access to some member q, and likewise Q_D(QAbstractSlider) makes some member d available

    what do these macros mean? are they important for what I am doing? because I am struggling to understand how the heads on the slider are actually implemented and I think that they may hold some of the information

    thanks
    georgie

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSlider with double Heads..

    Quote Originally Posted by georgie
    Q_Q(QAbstractSlider) seems to give access to some member q, and likewise Q_D(QAbstractSlider) makes some member d available

    what do these macros mean?
    Qt Code:
    1. #define Q_D(Class) Class##Private * const d = d_func()
    2. #define Q_Q(Class) Class * const q = q_func()
    To copy to clipboard, switch view to plain text mode 
    Q_D macro declares a variable that points to the private part of the implementation, while Q_Q works the other way around --- gives you access to public part of the implementation.

    If you want to know why the implementation is split into public and private part, ask google about "pimpl".
    Last edited by jacek; 9th May 2006 at 14:30.

  7. The following 2 users say thank you to jacek for this useful post:

    cocheci (18th May 2006), georgie (10th May 2006)

Similar Threads

  1. Double Click Capturing
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2011, 14:12
  2. Scaling
    By AD in forum Qt Programming
    Replies: 16
    Last Post: 11th July 2008, 10:55

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.