+ Reply to Thread
Results 1 to 5 of 5

Thread: why the painted Button can‘t show

  1. #1
    Join Date
    Sep 2010
    Posts
    12
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question why the painted Button can‘t show

    I painting the Button,it is able to show on the widget, but when I do this like that
    MyButton s; s.show(); it doesn't work. the error says
    void QWidget::show() is inaccessible
    within this context

  2. The following user says thank you to insert for this useful post:


  3. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,317
    Thanks
    20
    Thanked 377 Times in 371 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: why the painted Button can‘t show

    We can't tell with out the code.
    Recommended off-line reading:
    The Foundations of Qt Development (ISBN: 1-59059-831-8)

  4. #3
    Join Date
    Sep 2010
    Posts
    12
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: why the painted Button can‘t show

    what you meaning


    Added after 6 minutes:


    painted Button from http://www.qtcentre.org/wiki/index.php?title=AeroButton
    Button show in this way
    Button s;
    s.show();
    don't work
    but
    use this method
    QPushButton btn;
    btn.show();
    it works. why?
    Last edited by insert; 15th November 2010 at 09:16.

  5. #4
    Join Date
    May 2010
    Location
    Romania->Felnac;
    Posts
    1,015
    Thanks
    62
    Thanked 259 Times in 246 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: why the painted Button can‘t show

    One possible reason is that you inherit private from QPushButton, check the line:
    Qt Code:
    1. class AeroButton : public QPushButton //make sure you didn't forgot 'public'
    To copy to clipboard, switch view to plain text mode 

    LE: Why did you posted the topic in here, next time post technical issues in NewBie or Programming if is Qt related topic, or General Programming if is' general C++ topic, you get answers faster because many more people see your question.
    Last edited by Zlatomir; 15th November 2010 at 09:34.

  6. #5
    Join Date
    Sep 2010
    Posts
    12
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Smile Re: why the painted Button can‘t show

    thanks, but it's not really effectively. maybe some else mistake.


    Added after 4 minutes:


    sorry, it works. you say is correct! thank you !
    Last edited by insert; 15th November 2010 at 09:48.

+ Reply to Thread

Similar Threads

  1. Replies: 9
    Last Post: 23rd February 2011, 01:09
  2. Show maximize button in the title bar of a QDialog under GNOME
    By lalesculiviu in forum Qt Programming
    Replies: 1
    Last Post: 25th June 2010, 07:46
  3. How to erase everything widget has painted?
    By TheNewGuy in forum Newbie
    Replies: 1
    Last Post: 12th December 2009, 07:23
  4. Replies: 2
    Last Post: 13th May 2009, 19:01
  5. How to show QProgressDialog without cancel button
    By rajesh in forum Qt Programming
    Replies: 1
    Last Post: 30th January 2007, 09:53

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