Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Set Palette or stylesheet causing my application did not works properly.

Set Palette or stylesheet causing my application did not works properly.

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
6 Posts 3 Posters 401 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Buket
    wrote on last edited by
    #1

    When I assign a button or label for the application, I can get output on the target device, but when I change color, it does not give any output. Do you have an idea about it?

    jsulmJ 1 Reply Last reply
    0
    • B Buket

      When I assign a button or label for the application, I can get output on the target device, but when I change color, it does not give any output. Do you have an idea about it?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Buket said in Set Palette or stylesheet causing my application did not works properly.:

      Do you have an idea about it?

      No, you do not provide enough information.
      "When I assign a button or label for the application" - what does that mean?
      "but when I change color" - color of what? And how do you change color?
      What device?
      What Qt version?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Buket
        wrote on last edited by
        #3

        The device I am working on is ARM-based (Rockchip RK3288, ARM Cortex-A17 CPU, Mali-T760 MP4 (T764) GPU) motherboard.
        Qt version: 5.12.2

        When I change the color of the button or the color of the label I added using the palette, I cannot get the standard output I get on the target device.
        When I debug without using color, I can get output.

        faduF 1 Reply Last reply
        0
        • B Buket

          The device I am working on is ARM-based (Rockchip RK3288, ARM Cortex-A17 CPU, Mali-T760 MP4 (T764) GPU) motherboard.
          Qt version: 5.12.2

          When I change the color of the button or the color of the label I added using the palette, I cannot get the standard output I get on the target device.
          When I debug without using color, I can get output.

          faduF Offline
          faduF Offline
          fadu
          wrote on last edited by
          #4

          @Buket can you write some of your codes here

          1 Reply Last reply
          0
          • B Offline
            B Offline
            Buket
            wrote on last edited by Buket
            #5

            .pro file :

            QT       += core gui
            
            greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
            
            CONFIG += c++11
            
            # The following define makes your compiler emit warnings if you use
            # any Qt feature that has been marked deprecated (the exact warnings
            # depend on your compiler). Please consult the documentation of the
            # deprecated API in order to know how to port your code away from it.
            DEFINES += QT_DEPRECATED_WARNINGS
            
            # You can also make your code fail to compile if it uses deprecated APIs.
            # In order to do so, uncomment the following line.
            # You can also select to disable deprecated APIs only up to a certain version of Qt.
            #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
            
            SOURCES += \
                main.cpp \
                mainwindow.cpp
            
            HEADERS += \
                mainwindow.h
            
            FORMS += \
                mainwindow.ui
            
            # Default rules for deployment.
            #qnx: target.path = /tmp/$${TARGET}/bin
            #else: unix:!android: target.path = /opt/$${TARGET}/bin
            #!isEmpty(target.path): INSTALLS += target
            target.path = /usr/local/foto
            INSTALLS += target
            
            RESOURCES += \
                kaynakca.qrc
            

            .ui background image code (I add stylesheet for toolbutton):

            background-image: url(:/new/prefix1/deneme.jpg);
            

            .qrc file (resource):

            <RCC>
                <qresource prefix="/new/prefix1">
                    <file>deneme.jpg</file>
                </qresource>
            </RCC>
            

            I managed to add color. I can only change the button color when I add the stylesheet as RGB.

            background-color:rgb(138, 226, 52)
            

            I still can't see the target device when I add .png file and deploy. Only the standard button appears.

            Edit:
            I tried deploying using Label and Pixmap but the result did not change.

            1 Reply Last reply
            0
            • faduF Offline
              faduF Offline
              fadu
              wrote on last edited by
              #6

              @Buket
              image: url(:/png/copy_24px.png);

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved