Results 1 to 2 of 2

Thread: Multiple sliders for drawing

  1. #1
    Join Date
    Jul 2007
    Posts
    16
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Multiple sliders for drawing

    Hi,

    I want to connect multiple sliders to drawing different things.
    Since I can only have 1 paintEvent-function, i'll have to do something with the event-pointer, i guess, like in:
    void SomeClass:aintEvent(QPaintEvent *e)
    and then like in Java using something like: if (e.getSource() == sldValue1) ...
    But I don't know the QT-equivalence...
    If you know a different way to do this, also welcome to mention...

    Thx in Advance!
    Misko

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Multiple sliders for drawing

    I think you're doing something wrong here... paintEvent is called on each object when it needs to be repainted. If you have different objects which you want to be painted differently either make them separate classes and provide different paintEvent implementations or make a property that will hold some state which will cause the painting routine to behave differently (like "orientation" property of QAbstractSlider).

Similar Threads

  1. Multiple styles for sliders
    By Lele in forum Qt Programming
    Replies: 2
    Last Post: 27th October 2006, 17:08
  2. how to corss compile for windows in Linux
    By safknw in forum Qt Programming
    Replies: 24
    Last Post: 13th May 2006, 06:23

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
  •  
Qt is a trademark of The Qt Company.