Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to change style sheet of arrow buttons in QDateEdit?
Forum Updated to NodeBB v4.3 + New Features

How to change style sheet of arrow buttons in QDateEdit?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 4.1k Views 1 Watching
  • 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.
  • D Offline
    D Offline
    DarthRamone
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DarthRamone
        wrote on last edited by
        #3

        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?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          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.

          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