Results 1 to 4 of 4

Thread: Qt 4.6.0: Opening a dialog from a main window

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    8
    Thanked 3 Times in 3 Posts

    Default Re: Qt 4.6.0: Opening a dialog from a main window

    I think that may be the problem!

    So I need:

    CameraConnectDialog.cpp
    Qt Code:
    1. #include <QtGui>
    2. #include "CameraConnectDialog.h"
    3.  
    4. CameraConnectDialog::CameraConnectDialog(QWidget *parent) : QDialog(parent)
    5. {
    6. setupUi();
    7. }
    To copy to clipboard, switch view to plain text mode 

    How would I go about inheriting the Ui class though? (I'm kinda new to OOP...)

    Thanks!

  2. #2
    Join Date
    Jan 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    8
    Thanked 3 Times in 3 Posts

    Default Re: Qt 4.6.0: Opening a dialog from a main window

    Thanks for the tip! Got it working with the following:

    CameraConnectDialog.cpp
    Qt Code:
    1. #include <QtGui>
    2. #include "CameraConnectDialog.h"
    3.  
    4. CameraConnectDialog::CameraConnectDialog(QWidget *parent) : QDialog(parent)
    5.  
    6. {
    7. setupUi(this);
    8. }
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. #include "ui_CameraConnectDialog.h"
    2.  
    3. [B]
    4. CameraConnectDialog.h[/B]
    5. class CameraConnectDialog : public QDialog, private Ui::CameraConnectDialog
    6. {
    7. Q_OBJECT
    8. public:
    9. CameraConnectDialog(QWidget *parent = 0);
    10. };
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. QInput dialog is always opening twice
    By phillip_Qt in forum Qt Programming
    Replies: 3
    Last Post: 13th November 2009, 12:46
  2. Replies: 11
    Last Post: 11th August 2008, 09:14
  3. Opening a Dialog from a MainWindow FileMenu
    By nbkhwjm in forum Newbie
    Replies: 4
    Last Post: 17th April 2007, 12:24
  4. Replies: 15
    Last Post: 23rd March 2007, 16:16
  5. Crash during sending list from dialog to main window
    By Djony in forum Qt Programming
    Replies: 5
    Last Post: 23rd November 2006, 19:43

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.