How to change style sheet of arrow buttons in QDateEdit?



  • Sorry for this dumb question, and for my bad english, but I have a problem, and I can't solve it by myself.
    I have a QDiteEdit widget, and now it's look like that:
    !http://dl.dropbox.com/u/45704407/A.PNG(current)!

    But I need this one:
    !http://dl.dropbox.com/u/45704407/C.PNG(perfect)!
    (Not exactly this, because these arrows are painted in MS Paint :} )

    When I'm trying to change style sheets of these buttons, I'm getting this:
    !http://dl.dropbox.com/u/45704407/B.PNG(problem)!

    Where are the arrows? How can I do the style with only arrows, without background and borders?



  • For some controls, if you want to style them, you have to style them completely. I'm not sure if that is the case for QSpinBox (the base of QDateEdit). It could be that you'll need to provide images for the arrows for this styling to work.



  • Yep, QDateEdit is the case of QSpinBox. So, I have to provide images?
    I'm a newbie, learning Qt a couple days. How can I "connect" images to the project? I don't use the Qt Designer, and all project written by myself. I think in this way, I can learn Qt much faster and better.
    I know that in Qt Designer there is a resourse manager, and I can chose a image by couple clicks, but how can I do this without designer?



  • Qt Creator has a resource editor you might use, but you can also hand-craft resource files. It is a simple XML format. This is a sample from the documentation:

    @
    <!DOCTYPE RCC><RCC version="1.0">
    <qresource>
    <file>images/copy.png</file>
    <file>images/cut.png</file>
    <file>images/new.png</file>
    <file>images/open.png</file>
    <file>images/paste.png</file>
    <file>images/save.png</file>
    </qresource>
    </RCC>
    @

    However, just to try if it works with images, you can also just leave them on the file system and provide the correct path. If it works, you can stick the images in a resource and compile the images into your application that way. Note that I am not sure that this is your solution.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.