Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to create back function using Qt
Forum Updated to NodeBB v4.3 + New Features

How to create back function using Qt

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 3.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    biel_max
    wrote on last edited by
    #1

    hai all...
    i have a problem when make a project for symbian mobile,
    can you give me source example about how to create back function, form to another form...
    thank you........

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rahul Das
      wrote on last edited by
      #2

      You have too many ways to make "back fuction" button. One of the easiest way is to use QStackedWidget and setting the index of each pages.


      Declaration of (Platform) independence.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        Or, perhaps, if your application is suitable for it, you could use [[doc:QWizard]] and [[doc:QWizardPage]]. This is designed for step-wise processes, including the ability to go back.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          biel_max
          wrote on last edited by
          #4

          can you give me source example?

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

            There is an example on wizards in the Qt documentation. Did you study that?

            1 Reply Last reply
            0
            • B Offline
              B Offline
              biel_max
              wrote on last edited by
              #6

              this is my source

              mainwindow.h
              @#ifndef MAINWINDOW_H
              #define MAINWINDOW_H

              #include <QtGui/QMainWindow>
              #include <menuadm.h>
              #include <menuinform.h>
              #include <menubeli.h>
              #include <menubayar.h>
              #include <menutransfer.h>
              #include <promo.h>

              namespace Ui {
              class MainWindow;
              }

              class MainWindow : public QMainWindow
              {
              Q_OBJECT
              public:
              enum ScreenOrientation {
              ScreenOrientationLockPortrait,
              ScreenOrientationLockLandscape,
              ScreenOrientationAuto
              };

              explicit MainWindow(QWidget *parent = 0);
                  MenuAdm *objmain1;
                  MenuInform *objmain2;
                  MenuBeli *objmain3;
                  MenuBayar *objmain4;
                  MenuTransfer *objmain5;
                  Promo *objmain6;
              
              virtual ~MainWindow();
              
              void setOrientation(ScreenOrientation orientation);
              void showExpanded();
              

              private slots:
              void btnaction();
              void btnaction1();
              void btnaction2();
              void btnaction3();
              void btnaction4();
              void btnaction5();

              private:
              Ui::MainWindow *ui;

              };

              #endif // MAINWINDOW_H@

              mainwindow.cpp
              @
              #include "mainwindow.h"
              #include "ui_mainwindow.h"

              #include <QtCore/QCoreApplication>

              MainWindow::MainWindow(QWidget *parent)
              : QMainWindow(parent), ui(new Ui::MainWindow)
              {
              ui->setupUi(this);
              connect(ui->pushButton,SIGNAL(clicked()),this,SLOT(btnaction()));
              connect(ui->pushButtonInf,SIGNAL(clicked()),this,SLOT(btnaction1()));
              connect(ui->pushButtonBeli,SIGNAL(clicked()),this,SLOT(btnaction2()));
              connect(ui->pushButtonBayar,SIGNAL(clicked()),this,SLOT(btnaction3()));
              connect(ui->pushButtonTransfer,SIGNAL(clicked()),this,SLOT(btnaction4()));
              connect(ui->pushButtonPromo,SIGNAL(clicked()),this,SLOT(btnaction5()));

              }
              void MainWindow::btnaction()
              {
              objmain1 = new MenuAdm;
              objmain1->showFullScreen(); //opening form kedua
              }
              void MainWindow::btnaction1()
              {
              objmain2 = new MenuInform;
              objmain2->showFullScreen();
              }
              void MainWindow::btnaction2()
              {
              objmain3 = new MenuBeli;
              objmain3->showFullScreen();
              }
              void MainWindow::btnaction3()
              {
              objmain4 = new MenuBayar;
              objmain4->showFullScreen();
              }
              void MainWindow::btnaction4()
              {
              objmain5 = new MenuTransfer;
              objmain5->showFullScreen();
              }
              void MainWindow::btnaction5()
              {
              objmain6 = new Promo;
              objmain6->showFullScreen();
              }
              MainWindow::~MainWindow()
              {
              delete ui;
              }@

              menuadm.h
              @#ifndef MENUADM_H
              #define MENUADM_H

              #include <QMainWindow>
              #include <menudaftar.h>
              #include <menugantipin.h>

              namespace Ui {
              class MenuAdm;
              }

              class MenuAdm : public QMainWindow
              {
              Q_OBJECT

              public:
              explicit MenuAdm(QWidget *parent = 0);
              MenuDaftar *objmain7;
              MenuGantiPin *objmain8;

              ~MenuAdm();
              

              private slots:
              void btnaction6();
              void btnaction7();
              void btnaction8();

              private:
              Ui::MenuAdm *ui;
              };

              #endif // MENUADM_H
              @

              menuadm.cpp
              @#include "menuadm.h"
              #include "ui_menuadm.h"

              MenuAdm::MenuAdm(QWidget *parent) :
              QMainWindow(parent),
              ui(new Ui::MenuAdm)
              {
              ui->setupUi(this);
              connect(ui->pushButtonDaftar,SIGNAL(clicked()),this,SLOT(btnaction6()));
              connect(ui->pushButtonPin,SIGNAL(clicked()),this,SLOT(btnaction7()));
              }

              void MenuAdm::btnaction6()
              {
                  objmain7 = new MenuDaftar;
                  objmain7->showFullScreen();
              }
              void MenuAdm::btnaction7()
              {
                  objmain8 = new MenuGantiPin;
                  objmain8->showFullScreen();
              }
              

              MenuAdm::~MenuAdm()
              {
              delete ui;
              }
              @

              what should i do?
              i want create a function back push button in menuadm.ui,
              when the push button clicked, i can return to mainwindow.ui....
              help me,
              thanks

              1 Reply Last reply
              0
              • B Offline
                B Offline
                biel_max
                wrote on last edited by
                #7

                hei all,
                anybody can help?
                thanks...

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on last edited by
                  #8

                  You got tips, do something completely different, dump a large piece of code without explaining what that code is supposed to do, and then ask for comments... That simply isn't an effective way to solicit help.

                  Read Eric Steven Raymonds "article on how to ask questions":http://www.catb.org/~esr/faqs/smart-questions.html if you don't understand the above.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved