Skip to content
QtWS25 Last Chance
  • 0 Votes
    3 Posts
    479 Views
    J
    @Jammin44fm OK I've solved it. The entire application has a Stylesheet applied, including settings for a QMenu, and QMenu item, with custom padding. By overriding the padding for the specific Menu in question I am setting the left padding to be the check icon size smaller than the normal padding size. Now when the menu is draw it is consistent in padding size with all other menu's. I still dont think i should have to do it this way, but it's working.
  • 0 Votes
    2 Posts
    427 Views
    SGaistS
    Hi, Please provide a minimal compilable example to reproduce your issue.
  • 0 Votes
    4 Posts
    996 Views
    ndiasN
    Hi @Kyeiv , I didn't realize that you wanted the elements of each line to line up with each other. In this case you can use GridLayout: import QtQuick import QtQuick.Window import QtQuick.Controls import QtQuick.Layouts Window { GridLayout { anchors.fill: parent columns: 3 //rows: 5 Text { Layout.fillWidth: true text: "Text1a Looooooooog" horizontalAlignment : Text.AlignHCenter elide: Text.ElideRight } Text { Layout.fillWidth: true text: "Text1b" horizontalAlignment : Text.AlignHCenter elide: Text.ElideRight } Text { Layout.fillWidth: true text: "Text1c" horizontalAlignment : Text.AlignHCenter elide: Text.ElideRight } Item { Layout.columnSpan: 3 Layout.fillWidth: true height: 10 Rectangle { height: 1 width: parent.width anchors.centerIn: parent color: "grey" } } Text { Layout.fillWidth: true text: "Text2a" horizontalAlignment : Text.AlignHCenter elide: Text.ElideRight } Text { Layout.fillWidth: true text: "Text2b Looooooooog" horizontalAlignment : Text.AlignHCenter elide: Text.ElideRight } Text { Layout.fillWidth: true text: "Text2c" horizontalAlignment : Text.AlignHCenter elide: Text.ElideRight } ´ Item { Layout.columnSpan: 3 Layout.fillWidth: true height: 10 Rectangle { height: 1 width: parent.width anchors.centerIn: parent color: "grey" } } Text { Layout.fillWidth: true text: "Text3a" horizontalAlignment : Text.AlignHCenter elide: Text.ElideRight } Text { Layout.fillWidth: true text: "Text3b" horizontalAlignment : Text.AlignHCenter elide: Text.ElideRight } Text { Layout.fillWidth: true text: "Text3c Looooooooog" horizontalAlignment : Text.AlignHCenter elide: Text.ElideRight } } } [image: 0b3cd8d6-2c52-40b8-af61-96a93000ca55.png] [image: 460c2b36-ce52-4b8a-bc58-32630a1b634b.png]
  • 0 Votes
    9 Posts
    7k Views
    SGaistS
    Use QScreen::availableGeometry. It provides the geometry excluding window manager reserved areas.
  • 0 Votes
    6 Posts
    977 Views
    L
    My sampleColor function was called from the QScrollArea::mouseMoveEvent and the QPoint mousePos was pass in from the mouseEvent there. What I'm suspecting is that when the image was loaded, the default alignment AlignTop & AlignLeft kicked in, then the mouseMoveEvent followed and the sampleColor function somehow took a snapshot of the imageLabel, before the AlignCenter setting in the constructor. That's why my mouse was still seeing the image at the pre-aligncenter position in the snapshot.
  • 1 Votes
    6 Posts
    3k Views
    Y
    @Maikkannan said in How to fix scaling issue in Qt desktop application.: increased Do you run it on a 2K screen?
  • 0 Votes
    7 Posts
    2k Views
    K
    Thanks everyone for help. For me solution is using QGraphicsSimpleTextItem and translate by value calculate by QFontMetricsF::tightBoundingRect / QFontMetricsF::boundingRect. [image: 57d4ed18-460c-483f-afd1-40bef7f8771b.png] Now yellow is QGraphicsSimpleTextItem::boundingRect.
  • QComboBox align text stylesheet?

    Unsolved General and Desktop qcombobox align text alignment stylesheet
    8
    0 Votes
    8 Posts
    12k Views
    S
    QComboBox {background-color:rgb(190,190,190);color:black;padding-left: 10px;padding-right: 30px;border-style: solid;border-width: 0px;} "padding-left: 10px;" the padding will shift the combo-box displayed content form the left edge QComboBox::drop-down {subcontrol-origin: padding; subcontrol-position: top right;width: 40px;border: 0px ;} "subcontrol-position: top right;" and the above will position wot text to the right. Hopefully this helps.