Changeset 46496 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jun 11, 2013 3:26:17 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86345
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIAdvancedSlider.cpp
r28800 r46496 44 44 , m_minErr(-1) 45 45 , m_maxErr(-1) 46 {} 46 { 47 /* Make sure ticks *always* positioned below: */ 48 setTickPosition(QSlider::TicksBelow); 49 } 47 50 48 51 int positionForValue(int val) const … … 66 69 QSize s = size(); 67 70 71 /* We want to acquire SC_SliderTickmarks sub-control rectangle 72 * and fill it with necessary background colors: */ 73 #ifdef Q_WS_MAC 74 /* Under MacOS X SC_SliderTickmarks is not fully reliable 75 * source of the information we need, providing us with incorrect width. 76 * So we have to calculate tickmarks rectangle ourself: */ 68 77 QRect ticks = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderTickmarks, this); 69 #ifdef Q_WS_MAC70 78 ticks.setRect((s.width() - available) / 2, s.height() - ticks.y(), available, ticks.height()); 71 79 #else /* Q_WS_MAC */ 72 if (ticks.isNull() || ticks.isEmpty()) 73 { 74 ticks = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this) | style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderGroove, this); 75 ticks.setRect((s.width() - available) / 2, ticks.bottom() + 1, available, s.height() - ticks.bottom() - 1); 76 } 80 /* Under Windows SC_SliderTickmarks is fully unreliable 81 * source of the information we need, providing us with empty rectangle. 82 * Under X11 SC_SliderTickmarks is not fully reliable 83 * source of the information we need, providing us with different rectangles 84 * (correct or incorrect) under different look&feel styles. 85 * So we have to calculate tickmarks rectangle ourself: */ 86 QRect ticks = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this) | 87 style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderGroove, this); 88 ticks.setRect((s.width() - available) / 2, ticks.bottom() + 1, available, s.height() - ticks.bottom() - 1); 77 89 #endif /* Q_WS_MAC */ 90 78 91 if ((m_minOpt != -1 && 79 92 m_maxOpt != -1) && … … 189 202 } 190 203 191 void QIAdvancedSlider::setTickPosition(QSlider::TickPosition fPos)192 {193 m_pSlider->setTickPosition(fPos);194 }195 196 QSlider::TickPosition QIAdvancedSlider::tickPosition() const197 {198 return m_pSlider->tickPosition();199 }200 201 204 Qt::Orientation QIAdvancedSlider::orientation() const 202 205 { -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIAdvancedSlider.h
r28800 r46496 53 53 int tickInterval() const; 54 54 55 void setTickPosition(QSlider::TickPosition fPos);56 QSlider::TickPosition tickPosition() const;57 58 55 Qt::Orientation orientation() const; 59 56 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.cpp
r41587 r46496 65 65 m_pRamSlider->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); 66 66 m_pRamSlider->setOrientation(Qt::Horizontal); 67 m_pRamSlider->setTickPosition(QSlider::TicksBelow);68 67 } 69 68 m_pRamEditor = new QILineEdit(this); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r45080 r46496 64 64 m_pRamSlider->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); 65 65 m_pRamSlider->setOrientation(Qt::Horizontal); 66 m_pRamSlider->setTickPosition(QSlider::TicksBelow);67 66 m_pRamSlider->setValue(m_pNameAndSystemEditor->type().GetRecommendedRAM()); 68 67 }
Note:
See TracChangeset
for help on using the changeset viewer.