Results 1 to 2 of 2

Thread: sliderrect() replacement not working..

  1. #1
    Join Date
    Jan 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default sliderrect() replacement not working..

    1. //please ignore the syntax...

    ABC :: ABC()
    2.
    {
    3.
    sArea = new QScrollArea(this);
    4.
    SArea->setVeritcalPolicy(off);
    5.
    SArea->setHorizontalPolicy(off);
    6.
    ..............
    7.
    .................
    8.
    }
    9.

    10.
    //this will be called when when slider's value of the scrollbar changes
    11.
    ABC::valuechanged(int value)
    12.
    {
    13.
    //adding property value to slideroption
    14.
    QStyleOptionSlider* sliderOption = new QStyleOptionSlider();
    15.
    sliderOption->maximum = Area->verticalScrollBar()->maximum();
    16.
    sliderOption->minimum = Area->verticalScrollBar()->minimum();
    17.
    ...
    18.
    ...
    19.
    ...
    20.
    int height = sArea->verticalScrollBar()->style()->subControlRect(QStyle::CC_Slider, sliderOption,QStyle::SC_SliderHandle, slider).height(); //here it always show 11 even though the element in scrollarea has be increased
    21.
    int y = sArea->verticalScrollBar()->style()->subControlRect(QStyle::CC_Slider, sliderOption,QStyle::SC_SliderHandle, slider).y();//here also y coordinate always show zero even though i have scroll the QWidget(here Qwidget is scrolling properly) of the scrollarea.
    22.

    23.
    }

    //I just want the height of the slider of particular scrollbar and also the y-cordinate of the slider when it slides..Please help me

  2. #2
    Join Date
    Jan 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default sliderrect() replacement in qt4 not working...

    ABC :: ABC()
    2.
    {
    3.
    sArea = new QScrollArea(this);
    4.
    SArea->setVeritcalPolicy(off);
    5.
    SArea->setHorizontalPolicy(off);
    6.
    ..............
    7.
    .................
    8.
    }
    9.

    10.
    //this will be called when when slider's value of the scrollbar changes
    11.
    ABC::valuechanged(int value)
    12.
    {
    13.
    //adding property value to slideroption
    14.
    QStyleOptionSlider* sliderOption = new QStyleOptionSlider();
    15.
    sliderOption->maximum = Area->verticalScrollBar()->maximum();
    16.
    sliderOption->minimum = Area->verticalScrollBar()->minimum();
    17.
    ...
    18.
    ...
    19.
    ...
    20.
    int height = sArea->verticalScrollBar()->style()->subControlRect(QStyle::CC_Slider, sliderOption,QStyle::SC_SliderHandle, slider).height(); //here it always show 11 even though the element in scrollarea has be increased
    21.
    int y = sArea->verticalScrollBar()->style()->subControlRect(QStyle::CC_Slider, sliderOption,QStyle::SC_SliderHandle, slider).y();//here also y coordinate always show zero even though i have scroll the QWidget(here Qwidget is scrolling properly) of the scrollarea.
    22.

    23.
    }

    //I just want the height of the slider of particular scrollbar and also the y-cordinate of the slider when it slides..Please help me

Similar Threads

  1. Using QTabBar as QTabWidget replacement
    By invictus in forum Qt Programming
    Replies: 0
    Last Post: 16th August 2008, 01:57
  2. Replacement for CMapStringToPtr
    By rajeshs in forum Newbie
    Replies: 3
    Last Post: 21st December 2007, 12:25
  3. Replacement for MESSAGE_MAP()
    By krishbhala in forum Qt Programming
    Replies: 2
    Last Post: 4th December 2007, 15:20
  4. Console replacement
    By aegis in forum Qt Programming
    Replies: 14
    Last Post: 3rd April 2007, 00:38
  5. Replacement of Images
    By merry in forum Qt Programming
    Replies: 5
    Last Post: 1st March 2007, 10:16

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.