Unsolved Set Palette or stylesheet causing my application did not works properly.
-
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?
-
@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? -
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.2When 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. -
@Buket can you write some of your codes here
-
.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. -
@Buket
image: url(:/png/copy_24px.png);