Results 1 to 3 of 3

Thread: [SOLVED] problem in signal/slot for QPushButton

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Posts
    54
    Qt products
    Qt/Embedded
    Platforms
    Symbian S60

    Default [SOLVED] problem in signal/slot for QPushButton

    Hi
    I have a button created in mainwindow and I connect the button "clicked " signal to the slot.
    But I think Theres issue in the connection , thats the reason the slot is not called for the same

    Qt Code:
    1. MainWindow::MainWindow()
    2. {
    3. //window specs
    4. setWindowTitle(tr("GALLERY"));
    5. resize(1350,1700);
    6. //Allocation of items
    7. settTree = new SettingsTree(this);
    8. settTree->setGeometry(10,10,250,420);
    9. listwidget = new QListWidget(this);
    10. grid_button = new QPushButton(this);
    11. grid_button->setGeometry(39,670,31,22);
    12. list_button = new QPushButton(this);
    13. addbutton = new QPushButton(this);
    14. deletebutton = new QPushButton(this);
    15. objectbutton = new QPushButton(this);
    16. pf = new PanelFrame(this);
    17. m_CheckBox = new QCheckBox(this);
    18. m_CheckBox->setGeometry(230,14,21,21);
    19. state = Qt::Unchecked;
    20. m_Slider = new QSlider(Qt::Horizontal,this);
    21. m_Slider->setGeometry(160,672,101,21);
    22.  
    23. //previewpane
    24. /* previewpane = new QStandardItemModel(8,3,this);
    25.   setupmodel();
    26.   setupview();
    27. */
    28.  
    29. //functions to be called
    30. Menu();
    31.  
    32. //connections:signal & slots
    33. connect(list_button,SIGNAL(clicked()),this,SLOT(listdisplay()),Qt::DirectConnection);
    34. connect(m_CheckBox,SIGNAL(stateChanged(int)),this,SLOT(isMainWindowDocked()),Qt::AutoConnection);
    35. [B]connect(addbutton,SIGNAL(clicked()),this,SLOT(appLauncher()),Qt::DirectConnection);[/B]
    36. //connect(&process,SIGNAL(error(QProcess::ProcessError)),this,SLOT(processerror(QProcess::ProcessError)),Qt::AutoConnection);
    37.  
    38. }
    39.  
    40. SLOT function
    41.  
    42. [code]
    43. void MainWindow::appLauncher()
    44. {
    45. qDebug()<<"App Launcher";
    46. QString app = "/home/kamlesh/Gall/AddFolder/AddFolder-build-desktop/AddFolder";
    47. process.start(app);
    48. }
    To copy to clipboard, switch view to plain text mode 
    [/code]
    Last edited by kamlmish; 13th December 2010 at 10:32. Reason: updated contents

Similar Threads

  1. Signal and Slot Problem
    By waynew in forum Qt Programming
    Replies: 3
    Last Post: 5th June 2010, 10:49
  2. signal / slot problem
    By franco.amato in forum Newbie
    Replies: 13
    Last Post: 8th December 2009, 18:10
  3. Problem with New Slot/Signal in QTDesigner4.4.3
    By durgarao in forum Qt Tools
    Replies: 1
    Last Post: 27th December 2008, 12:39
  4. signal-slot problem with QVector
    By stefan in forum Qt Programming
    Replies: 1
    Last Post: 12th October 2008, 13:58
  5. problem with signal/slot
    By ihoss in forum Newbie
    Replies: 2
    Last Post: 24th August 2007, 22:59

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.