Results 1 to 3 of 3

Thread: Opening a qDialog

  1. #1
    Join Date
    Aug 2010
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Opening a qDialog

    Hai all,
    I am new to qt. I want to open a dialog box . I created the dialog using form designer. But when i try to create a object to it , it shows an error

    /home/bharani/browser/mainwindow.cpp:258: error: variable ‘Ui:ialog d’ has initializer but incomplete type

    After googling a found that the error is duo to missing header file. I have added both
    dialog.h and qdialog to the mainwindow.cpp file. But the error is still there.

    mainwindow.cpp file is

    #include <QtGui>
    #include <QtWebKit>
    #include "mainwindow.h"
    #include <QtDebug>
    #include <QDialog>
    #include "dialog.h"

    void MainWindow:penPreferences()
    {
    Ui:ialog d(this); //error
    }

    Any body tell me what i am missing here.
    Thanks .

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Opening a qDialog

    You also have to include the header which is generated by uic. it should be named something like ui_dialog.h.

    EDIT: Question: how does your dialog.h look like? If it is a "ui formula" class then write:
    Qt Code:
    1. Dialog d;
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to Lykurg for this useful post:

    bharanideepan (4th August 2010)

  4. #3
    Join Date
    Aug 2010
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Opening a qDialog

    Quote Originally Posted by Lykurg View Post
    You also have to include the header which is generated by uic. it should be named something like ui_dialog.h.
    Thanks . That solved the problem.

Similar Threads

  1. Opening a psmap from Qt
    By prasenjit in forum Qt-based Software
    Replies: 0
    Last Post: 22nd March 2010, 12:31
  2. closing a Qdialog called from a Qdialog
    By OverTheOCean in forum Qt Programming
    Replies: 3
    Last Post: 28th September 2009, 08:02
  3. Opening a browser in MAC
    By gren15 in forum Newbie
    Replies: 2
    Last Post: 30th June 2009, 16:54
  4. Opening file
    By Salazaar in forum Newbie
    Replies: 5
    Last Post: 5th June 2007, 18:15
  5. Help with opening many pictures
    By philipp1 in forum Qt Programming
    Replies: 3
    Last Post: 14th October 2006, 00:13

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.