Results 1 to 3 of 3

Thread: PushButton

  1. #1
    Join Date
    Jul 2012
    Posts
    1

    Smile PushButton

    I am writing a .EXE to load a .DLL file which someone provided before, There is a PushButton in the .DLL,
    i want to rotate the PushButton to 90 degree.How to do it?

    By the way, i do not have original source code of the DLL

    Thanks buddy.

  2. #2
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Wink Re: PushButton

    change the pushbutton coordinate as per your rotation.
    Heavy Metal Rules. For those about to rock, we salute you.
    HIT THANKS IF I HELPED.

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: PushButton

    By the way, i do not have original source code of the DLL
    I assume that somehow you can get a pointer to the QPushButton instance that you want to rotate, is that right? You either need to get that directly, or somehow search for it in the list of children of some widget that contains it.

    More to the point - I don't know of any way that you can rotate a standard QPushButton. If you make a custom pushbutton class derived from QPushButton, you can set a QPainter transform in the paint event, but you have no way to do that on an already-created QPushButton in a DLL. Not only that, but if the button is embedded in a form or other composite widget controlled by a layout, the layout might prevent the resizing needed to show the button correctly after it has been rotated.

    Changing the position or geometry will simply move the button around (if allowed by the layout); it won't rotate it.

    Edit: There is one possible way that might work but you will have to test it: If you can embed the QWidget pointer to the button into a QGraphicsProxyWidget, you can use it in the Graphics/View environment and rotate it that way. But that's a hack.
    Last edited by d_stranz; 13th July 2012 at 20:11.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 3
    Last Post: 29th April 2011, 08:54
  2. How to use a QPolygon as a Pushbutton?
    By Manish.S in forum Newbie
    Replies: 4
    Last Post: 6th December 2010, 10:57
  3. Add pushbutton to QTreewidgetitem
    By sudhansu in forum Qt Programming
    Replies: 5
    Last Post: 23rd June 2010, 10:39
  4. add an icon to a pushbutton
    By sophister in forum Qt Programming
    Replies: 8
    Last Post: 25th June 2009, 10:50
  5. how to reshape pushbutton??
    By anupamgee in forum Qt Programming
    Replies: 2
    Last Post: 24th April 2009, 12:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.