Results 1 to 4 of 4

Thread: There is no event(Signal) after using insertWidget() method on stackedWidget

  1. #1
    Join Date
    Mar 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default There is no event(Signal) after using insertWidget() method on stackedWidget

    hi there!
    when i have made a application with imagebutton which come from Qpushbutton.

    and I have just made stackedWidget in QtDesigner.
    and i put my button widget in editor. like this...
    Qt Code:
    1. QPixmap *sImg1 = new QPixmap("images/go_contact.png");
    2. QPixmap *sImg2 = new QPixmap("images/go_contact_press.png");
    3. QString *startTitle = new QString("Start");
    4. startBtn = new CImageButton(startTitle, this);
    5. startBtn->setGeometry((width()-373)/2, 200, 373, 71);
    6. startBtn->setImage(sImg1, sImg2);
    7. ui.stackedWidget->insertWidget(0, startBtn);
    8. startBtn->show();
    9. connect(startBtn, SIGNAL(clicked()), this, SLOT(clicked_start_btn())
    To copy to clipboard, switch view to plain text mode 

    nomally most widget is show state in QtDesigner.
    the button is my own button so i realized that i need show() method to draw button on screen.
    so that i can see the button.. but the button doesn't work.. no event.... what happen~~~

    please give me a hint as soon as possible.. thank you!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: There is no event(Signal) after using insertWidget() method on stackedWidget

    Did you change the current index of the stacked widget to the one that represents the page holding the button?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: There is no event(Signal) after using insertWidget() method on stackedWidget

    Quote Originally Posted by wysota View Post
    Did you change the current index of the stacked widget to the one that represents the page holding the button?
    sure! i have used curentIndex(0) for stackedWidget in initiate method

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: There is no event(Signal) after using insertWidget() method on stackedWidget

    In that case I don't know what you want... Please try to focus at one thing at a time and describe what you would like to get and what the current result is. insertWidget() doesn't emit any signals so obviously there are none emitted.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. disabling the signal event
    By aj2903 in forum Qt Programming
    Replies: 6
    Last Post: 13th July 2012, 11:26
  2. Signal/slot or direct method call within a class
    By mike_the_tv in forum Newbie
    Replies: 6
    Last Post: 11th March 2010, 18:49
  3. QObject's event method not being called
    By jkburges in forum Qt Programming
    Replies: 1
    Last Post: 4th September 2009, 09:02
  4. Replies: 6
    Last Post: 3rd September 2008, 14:27
  5. QTreeWidgetItem signal or event
    By db in forum Newbie
    Replies: 1
    Last Post: 20th October 2007, 14:18

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
  •  
Qt is a trademark of The Qt Company.