Results 1 to 4 of 4

Thread: QTableWidget and DoubleClicked(QtableWidgetItem *) problem

  1. #1
    Join Date
    Aug 2007
    Location
    Wroclaw
    Posts
    20
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTableWidget and DoubleClicked(QtableWidgetItem *) problem

    Hi,

    When I doubleclick in item of QTableWidget it connect with given slot.
    This slot for end of it functionality send signal, there is nothing after this signal.
    Siganal run method which delete current class in center of MainWidget and show another.
    But my program don't show this another, program close.

    When I use button to emit these same signal everythink is ok.

    Everything is in deleted widget.

    Anybody knows why is that??

  2. #2
    Join Date
    Aug 2007
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget and DoubleClicked(QtableWidgetItem *) problem

    show some code,
    it is not clear what you are talking about.

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QTableWidget and DoubleClicked(QtableWidgetItem *) problem

    Seeing some code would indeed help in understanding the problem. Sounds like QObject::deleteLater() might be required.
    J-P Nurmi

  4. #4
    Join Date
    Aug 2007
    Location
    Wroclaw
    Posts
    20
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget and DoubleClicked(QtableWidgetItem *) problem

    Important code:

    Qt Code:
    1. class1
    2. {
    3. class1
    4. {
    5. ...
    6. connect(this->ui.List,SIGNAL(itemDoubleClicked(QTableWidgetItem *)),this,SLOT(slot1(QTableWidgetItem *)));
    7. ...less important things
    8. }
    9.  
    10. ...
    11. slot1
    12. {
    13. emit this->anotherView();
    14. }
    15. }
    To copy to clipboard, switch view to plain text mode 

    and in main class:

    Qt Code:
    1. MainClass
    2. {
    3. ...
    4. //anotherView run this method:
    5. void changeanotherWidget(){
    6. QWidget *buffor;
    7. buffor = this->centralWidget();
    8. if(buffor)
    9. delete buffor;
    10.  
    11. this->anotherWidget= new AnotherWidget();
    12. this->setCentralWidget(viewPatient);
    13.  
    14. ...
    15. //some connections
    16. ...
    17. }
    18. }
    To copy to clipboard, switch view to plain text mode 

    there is no more, i connect to signal anotherView only this slot

    QObject::deleteLater -- don't help
    Last edited by skrzypu; 11th August 2007 at 10:02. Reason: answer to one more post

Similar Threads

  1. experiencing problem at printing out QTableWidget
    By rmagro in forum Qt Programming
    Replies: 9
    Last Post: 27th June 2007, 16:04
  2. QTableWidget Problem, setRowWidget? :P
    By VireX in forum Newbie
    Replies: 17
    Last Post: 6th April 2007, 18:12
  3. QTableWidget editing question
    By Trasmeister in forum Qt Programming
    Replies: 1
    Last Post: 20th September 2006, 18:46
  4. Problem inserting in QTableWidget
    By DPinLV in forum Qt Programming
    Replies: 2
    Last Post: 2nd August 2006, 00:10
  5. Replies: 6
    Last Post: 5th March 2006, 21:05

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.