×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Nov 2011
    Posts
    104

    What is the code used to navigate pages in QT?

    I have designed a page with four different buttons with four pages inside a stacked widget.What i am trying for is if i click anyone of those buttons it must navigate to a different page...


    For Example:If i click the first button it must open page1,if i click button 2 it must open page2 and so on..

    I have tried to write the code and when compiled its showing that [error: undefined reference to `checkin::setPage() in QT]

    I had tried my level best but still not able to found the result can anyone help me with this?

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: What is the code used to navigate pages in QT?

    You can put all widget in QStackedWidget and then change current index using setCurrentIndex().

    Regarding error you talking about which class?

  3. #3
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: What is the code used to navigate pages in QT?

    Show us some part of your code ?

    Your concept is given as article using Qt quick components : http://doc.qt.nokia.com/qt-component...-overview.html

    regards,
    rahul

  4. #4
    Regular Contributor
    Join Date
    Nov 2011
    Posts
    104

    Re: What is the code used to navigate pages in QT?

    Hi savaj,
    I did the same thing which you have asked me to try,it got worked....
    Thank You for your answer and reply.....

  5. #5
    Regular Contributor
    Join Date
    Nov 2011
    Posts
    104

    Re: What is the code used to navigate pages in QT?

    #include "checkin.h"
    #include "ui_checkin.h"
    #include<QStackedWidget>
    #include<QtGui>


    checkin::checkin(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::checkin)
    {
    ui->setupUi(this);
    // ui->stackedWidget->setCurrentIndex(3);

    connect( ui->map, SIGNAL( clicked() ), this, SLOT( setPage1()));
    connect( ui->call , SIGNAL( clicked() ), this, SLOT( setPage2()));
    connect( ui->editinfo , SIGNAL( clicked() ), this, SLOT( setPage3()));
    connect( ui->venudetails , SIGNAL( clicked() ), this, SLOT( setPage4()));
    connect( ui->report , SIGNAL( clicked() ), this, SLOT( setPage5()));

    }

    checkin::~checkin()
    {

    delete ui;
    }


    void checkin :: setPage1()
    {

    ui->stackedWidget->setCurrentIndex(0);
    }

    void checkin:: setPage2()
    {
    ui->stackedWidget->setCurrentIndex(1);
    }

    void checkin:: setPage3()
    {
    ui->stackedWidget->setCurrentIndex(2);
    }

    void checkin:: setPage4()
    {
    ui->stackedWidget->setCurrentIndex(3);
    }

    void checkin:: setPage5()
    {
    ui->stackedWidget->setCurrentIndex(4);
    }

  6. #6
    Nokia Developer Champion
    Join Date
    Sep 2007
    Location
    Bhavnagar
    Posts
    928

    Re: What is the code used to navigate pages in QT?

    @mkhpad : you can put this sample code on wiki.
    Jajal Mehul

Similar Threads

  1. Ensymble web pages have moved to Google Code
    By jethro.fn in forum Symbian
    Replies: 3
    Last Post: 2008-10-17, 21:05
  2. UTF-8 Supported code pages
    By nagkumar in forum Mobile Java General
    Replies: 3
    Last Post: 2008-09-05, 18:39
  3. Navigate back between WML pages
    By ernitingoel in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2004-09-30, 05:01
  4. code pages and SWITCH_PAGE
    By sbarlow in forum OMA DM/DS/CP
    Replies: 2
    Last Post: 2004-01-22, 09:34
  5. 6310, russian names, wrong code pages
    By vtimofeyuk in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-03-20, 11:28

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×