Results 1 to 4 of 4

Thread: Gauge does not display resized

  1. #1
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Question Gauge does not display resized

    I have a "subclassed" Gauge:
    Qt Code:
    1. import QtQuick 2.3
    2. import QtAudioEngine 1.0
    3. import QtQuick.Window 2.2
    4. import QtQuick.XmlListModel 2.0
    5. import QtDataVisualization 1.2
    6. import QtSensors 5.4
    7. import QtQuick.Layouts 1.0
    8. import QtWebKit 3.0
    9. import QtQuick.LocalStorage 2.0
    10. import QtQuick.Controls 1.2
    11. import QtPositioning 5.4
    12. import QtTest 1.1
    13. import QtQuick.Enterprise.Controls 1.3
    14. import QtCharts 2.0
    15.  
    16. Item
    17. {
    18. id: fsaGauge
    19.  
    20. property color fsaBackgroundColor
    21. property int fsaLegendAlignment
    22. property int fsaWidth
    23. property int fsaHeight
    24.  
    25. width: fsaWidth
    26. height: fsaHeight
    27.  
    28. Column
    29. {
    30. id: fsaColumnGauge
    31.  
    32. spacing: 16
    33.  
    34. Gauge
    35. {
    36. id: fsaGaugeWaterLevel
    37.  
    38. minimumValue: 0
    39. maximumValue: 100
    40. value: 37
    41.  
    42. tickmarkStepSize: 1
    43. tickmarkAlignment: fsaLegendAlignment
    44.  
    45. antialiasing: true
    46. }
    47. }
    48. }
    To copy to clipboard, switch view to plain text mode 
    that is used as:
    Qt Code:
    1. import QtQuick 2.3
    2. import QtAudioEngine 1.0
    3. import QtQuick.Window 2.2
    4. import QtQuick.XmlListModel 2.0
    5. import QtDataVisualization 1.2
    6. import QtSensors 5.4
    7. import QtQuick.Layouts 1.0
    8. import QtWebKit 3.0
    9. import QtQuick.LocalStorage 2.0
    10. import QtQuick.Controls 1.2
    11. import QtPositioning 5.4
    12. import QtTest 1.1
    13. import QtQuick.Enterprise.Controls 1.3
    14. import QtCharts 2.0
    15.  
    16. Rectangle
    17. {
    18. id: fsaRoot
    19.  
    20. width: 800
    21. height: 600
    22.  
    23. color: "black"
    24.  
    25. Row
    26. {
    27. id: fsaRowMain
    28.  
    29. anchors.fill: parent
    30.  
    31. FsaGauge
    32. {
    33. id: emeWaterTankLevelIndicatorLeft
    34.  
    35. y: 0
    36.  
    37. width: parent.width/4
    38. height: parent.height
    39.  
    40. clip: false
    41. antialiasing: true
    42.  
    43. fsaBackgroundColor: "black"
    44. fsaLegendAlignment: Qt.AlignLeft
    45. }
    46. }
    47. }
    To copy to clipboard, switch view to plain text mode 
    Why does gauge does not "inherit" parent's window height?gaugeWrongSize.jpg
    Qt 5.3 Opensource & Creator 3.1.2

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

    Default Re: Gauge does not display resized

    Because nowhere in the definition of FsaGauge you told your Gauge object to do it.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Gauge does not display resized

    Quote Originally Posted by wysota View Post
    Because nowhere in the definition of FsaGauge you told your Gauge object to do it.
    I did set width and height.
    Qt 5.3 Opensource & Creator 3.1.2

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

    Default Re: Gauge does not display resized

    No, you didn't:

    javascript Code:
    1. Gauge
    2. {
    3. id: fsaGaugeWaterLevel
    4.  
    5. minimumValue: 0
    6. maximumValue: 100
    7. value: 37
    8.  
    9. tickmarkStepSize: 1
    10. tickmarkAlignment: fsaLegendAlignment
    11.  
    12. antialiasing: true
    13. }
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QPixmap not getting resized with scaled()
    By DURGAPRASAD NEELAM in forum Qt Programming
    Replies: 1
    Last Post: 20th March 2014, 09:47
  2. Add letterbox to resized QPixmap
    By Jay-D in forum Qt Programming
    Replies: 2
    Last Post: 6th April 2013, 04:52
  3. Dial Gauge
    By jeff28 in forum Newbie
    Replies: 1
    Last Post: 23rd August 2012, 00:35
  4. widget not resized within QDockWidget
    By pospiech in forum Qt Programming
    Replies: 2
    Last Post: 4th December 2008, 19:19
  5. QMdiSubWindow problem with resized window
    By estanisgeyer in forum Qt Programming
    Replies: 2
    Last Post: 7th January 2008, 15:39

Tags for this Thread

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.