Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. style
    Log in to post
    • All categories
    • K

      Unsolved Customizing style with fallback style with non-default theme
      QML and Qt Quick • style customizing theme • • KPiach

      1
      0
      Votes
      1
      Posts
      49
      Views

      No one has replied

    • A

      Solved Palette overriding style sheet
      General and Desktop • stylesheet palette style • • aljoachim

      8
      0
      Votes
      8
      Posts
      265
      Views

      S

      @JonB said in Palette overriding style sheet:

      Any reason why you didn't use, say, static QPushButton dummyButton; here?

      I guess I fumbled to long to actually get the style sheet to apply. I tried many different things (because I didn't see this documented anywhere). Must have overlooked this when cleaning up. Thank you! Will fix it in my code.

    • S

      Unsolved Color set by QPalette not working for some QPushButtons.
      General and Desktop • palette qpushbutton color style • • schrute

      2
      0
      Votes
      2
      Posts
      119
      Views

      SGaist

      Hi,

      I would start by checking if there where any changes to the style classes between the two releases.

      Also, since you are using 5.15.8, it means you have a commercial license and thus can contact the Qt Company for support.

    • T

      Solved Checkable QAction with icon does not show state on Windows 11 with qwindowsvistastyle
      General and Desktop • qaction checkable style windowsvista • • Tudal

      5
      0
      Votes
      5
      Posts
      219
      Views

      T

      Issue can be found here : https://bugreports.qt.io/browse/QTBUG-98354

    • R

      Unsolved End of MenuBar not visible if window is not wide enough.
      QML and Qt Quick • qml menubar style • • reverse-engineer

      1
      0
      Votes
      1
      Posts
      68
      Views

      No one has replied

    • S

      Unsolved Override PCLVisualizerInteractorStyle mouse click
      General and Desktop • vtk pcl interactive gui style • • surajj4837

      4
      0
      Votes
      4
      Posts
      245
      Views

      SGaist

      C++ does not work like that. Create a proper subclass and then use that one for the member variable.

    • leafmaple

      Unsolved Cross platform Qt program GUI library plug-in
      Announcements • style plugin gui • • leafmaple

      1
      0
      Votes
      1
      Posts
      374
      Views

      No one has replied

    • lopeztel

      Solved QtQuick Controls: Material Style not found?
      QML and Qt Quick • material qml style qtquick control • • lopeztel

      3
      0
      Votes
      3
      Posts
      659
      Views

      lopeztel

      Solved it by adding the line

      qputenv("QT_STYLE_OVERRIDE","Material");

      in main.cpp

    • N

      Unsolved Styling / background color of QPrintPreviewWidget
      General and Desktop • qprintpreviewwi style • • Nando

      8
      0
      Votes
      8
      Posts
      338
      Views

      D

      @Nando, @SGaist
      QPrintPreviewWidget used QGraphicsView in source code so solution in qss is

      QGraphicsView { qproperty-backgroundBrush: "red"; }
    • T

      Unsolved How to implement custon control to play well with any style?
      QML and Qt Quick • style quick2 qml • • travnick

      3
      0
      Votes
      3
      Posts
      170
      Views

      T

      As I mentioned, I would like to play with any style, so I guess I'm not able to hardcode use of Material style.

    • X

      Unsolved How to recognize padding for a QTableView table item?
      General and Desktop • padding qtreeview item style • • xintrea

      2
      0
      Votes
      2
      Posts
      962
      Views

      Christian Ehrlicher

      @xintrea said in How to recognize padding for a QTableView table item?:

      not the default style.

      Only the stylesheet style provides a padding (see box model), all other styles don't have a 'padding' value at all. So what do you want exactly (and why)?

    • K

      Unsolved QML proper using nested functions
      QML and Qt Quick • qml function nested style button • • Kyeiv

      2
      0
      Votes
      2
      Posts
      250
      Views

      rrlopez

      Hi @Kyeiv, I just did a quick test application and it worked for me:

      main.qml

      import QtQuick 2.9 import QtQuick.Window 2.2 import "someJSscriptFile.js" as Jss Window { visible: true width: 640 height: 480 title: qsTr("Hello World") Rectangle { id: rect color: Jss.getCurrentColor() anchors.fill: parent } }

      someJSScriptFile.js

      function getCurrentColor() { return __getColor(rect.currentValue) } function __getColor(value) { if (rect.pressed) { return "grey" } if(rect.activated === false) { return "white" } if(value ===0) { return "red"; } return "green"; }

      Is the variable "control" defined in your QML? Or what are you trying to use it for?

    • E

      Unsolved Theme enum for custom styles?
      QML and Qt Quick • qml controls 2 theme style • • EStudley

      1
      0
      Votes
      1
      Posts
      156
      Views

      No one has replied

    • R

      Solved lines around Imagine style assets [maybe only Android]
      QML and Qt Quick • qml imagine style • • refaQtor

      6
      0
      Votes
      6
      Posts
      1322
      Views

      jpnurmi

      First, you need to download the plugin... in a way or another. :) You can, for example, clone the qt/qtquickcontrols2.git repo, or grab qtquickcontrols2-everywhere-src-5.10.1.zip from download.qt.io. Then, browse to src/imports/controls/imagine/design and double click 9-patch-export.sketchplugin. Sketch should inform that the 9-patch export plugin has been installed.

      You can export individual image assets from the Export pane, or export all exportable image assets with the Export tool button in the top right corner. The script callback gets called either way, and 9-patch image assets are simply detected by the ".9" suffix in the image asset export names.

      PS. Yeah, the whole process should be documented and there should be a simple download link in the docs. I guess somebody forgot something. :)

    • M

      Solved Accessing SliderStyle's components to change opacity
      QML and Qt Quick • slider style accessible states target • • MoaMoaK

      2
      0
      Votes
      2
      Posts
      849
      Views

      M

      OK
      found a solution, for those interested, it's based on the fact that maybe the root item can't access the handle but the handle on the other hand can access the root item. So I created a binding between handle's state and slider's state :

      Slider { anchors { fill: parent margins: 10; } id: slider value: 0.5 style : SliderStyle { groove: Rectangle { id: background /* ... */ } handle: Rectangle { id: handle /* ... */ opacity: 0.0 // Bind slider's state and handle's state state: slider.state == "hovered" ? "hovered" : "" states : [ State { name: "hovered" PropertyChanges { target: handle ; opacity: 1.0 } } ] } } MouseArea { anchors.fill: parent hoverEnabled: true onEntered: { slider.state = "hovered" } onExited: { slider.state = "" } } states: [ State { name: "hovered" } ] }
    • gabodev

      Solved Element color in custom style
      General and Desktop • style qproxystyl qstyle painter color • • gabodev

      3
      0
      Votes
      3
      Posts
      1278
      Views

      gabodev

      @mrjj Thank you very much! I have researched and been able to do what I was looking for. Here's what I did:

      def drawPrimitive(self, element, opt, painter, widget): if element == QStyle.PE_PanelButtonTool: pressed = (opt.state & STATE_SUNKEN | opt.state & STATE_ON) color = QColor("#323232") if pressed: color = QColor("#222222") elif opt.state & STATE_ENABLED and opt.state & STATE_MOUSEOVER: color = QColor("#4e4e4e") painter.fillRect(opt.rect, color) elif element == QStyle.PE_IndicatorArrowDown or \ element == QStyle.PE_IndicatorArrowUp: r = opt.rect size = min(r.height(), r.width()) image = QImage(size, size, QImage.Format_ARGB32_Premultiplied) image.fill(Qt.transparent) image_painter = QPainter(image) image_painter.setPen(QColor("#bdbfc0")) image_painter.setBrush(QColor("#bdbfc0")) polygon = QPolygon() polygon.append(QPoint(0, r.width() * 0.5)) if element == QStyle.PE_IndicatorArrowDown: polygon.append(QPoint(size, size * 0.6)) polygon.append(QPoint(size / 2, size * 0.1)) else: polygon.append(QPoint(size, size * 0.5)) polygon.append(QPoint(size / 2, size * 0.9)) image_painter.drawPolygon(polygon) image_painter.end() pixmap = QPixmap.fromImage(image) painter.drawPixmap(r.x() + (r.width() - size) / 2, r.y() + (r.height() - size) / 2, pixmap) else: QProxyStyle.drawPrimitive(self, element, opt, painter, widget)

      Regards!

    • S

      Unsolved QTabWidget: style each tab differently
      General and Desktop • qtabwidget qtabbar style c++ qt5 • • Sebbo

      5
      0
      Votes
      5
      Posts
      1765
      Views

      S

      @raven-worx
      ah right, couldn't be easier. :)
      Maybe I'll come up with another solution for my issue like subclassing and repainting the tabbar. For now that'll do the trick.
      Cheers

    • km2442

      Solved Material design in standard windows application
      General and Desktop • style qt5.6 • • km2442

      3
      0
      Votes
      3
      Posts
      1121
      Views

      km2442

      Thank you for answer :)