Results 1 to 6 of 6

Thread: go next screen

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    27
    Qt products
    Qt3 Qt4
    Platforms
    Symbian S60

    Default go next screen

    i have been create a listwidget and add three items i want when touch on item then open new screen.but i can't success please help me i send the code
    ////////////////header//////////

    Qt Code:
    1. #ifndef MYWIDGET_H
    2. #define MYWIDGET_H
    3.  
    4. #include <QWidget>
    5. #include<QtGui>
    6. namespace Ui {
    7. class MyWidget;
    8. }
    9. class MyWidget : public QWidget
    10. {
    11. Q_OBJECT
    12.  
    13. public:
    14. explicit MyWidget(QWidget *parent = 0);
    15. ~MyWidget();
    16. private slots:
    17. void itemClicked(QListWidgetItem *item);
    18.  
    19. private:
    20.  
    21. QListWidget *m_myListWidget;
    22. QPushButton *widget2;
    23. QPushButton *widget3;
    24.  
    25.  
    26.  
    27. };
    28.  
    29. #endif // MYWIDGET_H
    To copy to clipboard, switch view to plain text mode 
    /////////////////////cpp////////////////
    Qt Code:
    1. #include "mywidget.h"
    2. #include "ui_mywidget.h"
    3.  
    4. MyWidget::MyWidget(QWidget *parent) :
    5. QWidget(parent)
    6.  
    7. {
    8.  
    9. m_myListWidget = new QListWidget(this);
    10. new QListWidgetItem(tr("shahid"), m_myListWidget);
    11. // new QListWidgetItem(tr("Fir"), m_myListWidget);
    12. connect( m_myListWidget, SIGNAL(itemClicked(QListWidgetItem *)), SLOT(itemClicked (QListWidgetItem *)));
    13.  
    14. }
    15. void MyWidget::itemClicked(QListWidgetItem *item)
    16. {
    17.  
    18. widget2 = new QPushButton("Text message");
    19. widget3 = new QPushButton("Create Message");
    20. QVBoxLayout *layout =new QVBoxLayout(this);
    21. layout->addWidget(widget2);
    22. layout->addWidget(widget3);
    23. setLayout(layout);
    24.  
    25.  
    26. }
    27.  
    28.  
    29. MyWidget::~MyWidget()
    30. {
    31. delete m_myListWidget;
    32. }
    To copy to clipboard, switch view to plain text mode 
    please any one can help me
    Last edited by wysota; 27th April 2011 at 09:15. Reason: missing [code] tags

Similar Threads

  1. Replies: 3
    Last Post: 25th January 2011, 13:36
  2. Replies: 0
    Last Post: 19th January 2011, 03:29
  3. application screen as screen saver
    By wizarda in forum Qt Programming
    Replies: 0
    Last Post: 6th January 2011, 19:15
  4. Replies: 2
    Last Post: 11th June 2010, 07:23
  5. Tab to new screen
    By mstegehu in forum Qt Programming
    Replies: 2
    Last Post: 22nd June 2009, 15:52

Tags for this Thread

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.