Results 1 to 8 of 8

Thread: Help me to load one form over another form PushButton

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Re: Help me to load one form over another form PushButton

    hi.
    I went through the dialog examples but i still cant learn about how to connect a new dialog
    along with the parent and inside that dialog i should open pushbutton and labels...
    please help me...

  2. #2
    Join Date
    Mar 2008
    Posts
    141
    Thanks
    10
    Thanked 9 Times in 9 Posts

    Default Re: Help me to load one form over another form PushButton

    hi,

    Take a look at the QDialog Class Reference. There is some example code:

    Qt Code:
    1. void MyFirstDialog::on_myPushButton_clicked()
    2. {
    3. MySecondDialog dialog(this);
    4. dialog.exec(); //opens the second Dialog
    5. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Nov 2008
    Posts
    22
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11

    Default Re: Help me to load one form over another form PushButton

    Janus:

    What about when you wan to launch a new window?, hide the parent window, but keep track of it to recall it later. I have an intro window with buttons and one of these should launch the "main window" that I call the admin window:

    Qt Code:
    1. void introWindow::adminstart() {
    2. hide();
    3. adminwin = new AdminWindow(this);
    4. }
    To copy to clipboard, switch view to plain text mode 
    my header file has the following:

    Qt Code:
    1. #ifndef INTROWINDOW_H
    2. #define INTROWINDOW_H
    3.  
    4. #include <QWidget>
    5. #include <QtGui>
    6. #include <QPushButton>
    7. #include <QtGui/QGraphicsView>
    8. #include <QtGui/QPushButton>
    9. #include <QtGui/QVBoxLayout>
    10. #include <QtGui/QHBoxLayout>
    11. //#include "adminWindow.h"
    12. class QAction;
    13. class QMenu;
    14. class AdminWindow;
    15. class introWindow : public QWidget
    16. {
    17. Q_OBJECT
    18. public:
    19. introWindow(QWidget *parent = 0);
    20. //introWindow();
    21. ~introWindow();
    22.  
    23. QGraphicsView *graphicsView;
    24. QPushButton *adminButton;
    25. QPushButton *measureButton;
    26. QPushButton *viewButton;
    27. QPushButton *quitButton;
    28. QVBoxLayout *vboxLayout;
    29. QHBoxLayout *hboxLayout;
    30. private slots:
    31. void adminstart();
    32. private:
    33. AdminWindow *adminwin;
    34. };
    35. #endif
    To copy to clipboard, switch view to plain text mode 

    when I compile I get the following error msg:
    Undefined symbols:
    "AdminWindow::AdminWindow(QWidget*)", referenced from:
    introWindow::adminstart() in introwindow.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status

  4. #4
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Help me to load one form over another form PushButton

    Hi,

    1)If you paste the code we will surely help you( whole app or a reasonable example/minimm compilable )
    2)If you explain in detail what you want exactly I will help you as well.
    3)If you show the adminWindow implementation we can look for problems.

    The code you need is rather simple so if you provide your code or explanation surely someone will help you within a short period of time.

    Kacper
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

Similar Threads

  1. Load form mdi child plugin
    By estanisgeyer in forum Qt Programming
    Replies: 4
    Last Post: 10th February 2008, 14:27

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.