Results 1 to 5 of 5

Thread: Opening a Dialog from a MainWindow FileMenu

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2007
    Posts
    59
    Thanks
    7

    Default Opening a Dialog from a MainWindow FileMenu

    All I have created a MainWindow Application Called "porcupine" This has a File menu where you *should* be able to open a QDialog (preferences.ui) file to set the application preferences.

    I set the Signals and Slots to point to a Function:

    Qt Code:
    1. void Porcupine::showPrefs()
    2. {
    3.  
    4. qDebug("Open Prefs Window");
    5.  
    6. Preferences *prefs = new Preferences(this);
    7. prefs.exec();
    8.  
    9. }
    To copy to clipboard, switch view to plain text mode 

    I get the following errors...

    Qt Code:
    1. porcupine.cpp: In member function `void Porcupine::showPrefs()':
    2. porcupine.cpp:257: error: no matching function for call to `Preferences::Preferences(Porcupine* const)'
    3. preferences.h:18: note: candidates are: Preferences::Preferences(const Preferences&)
    4. preferences.h:22: note: Preferences::Preferences()
    5. porcupine.cpp:258: error: request for member `exec' in `prefs', which is of non-class type `Preferences*'
    To copy to clipboard, switch view to plain text mode 

    I know this is a classing problem, but i keep getting all messed up dealing with the autocreated H files from designer...

    Thanks...
    Attached Files Attached Files

Similar Threads

  1. Replies: 1
    Last Post: 1st February 2007, 17:07
  2. Replies: 3
    Last Post: 23rd July 2006, 18:02
  3. Show/hide part of dialog with resizing.
    By Spockmeat in forum Qt Tools
    Replies: 6
    Last Post: 7th June 2006, 08:22
  4. Dialog positioning in GNOME
    By simk in forum Qt Programming
    Replies: 2
    Last Post: 16th March 2006, 09:41
  5. dialog box
    By Bahar in forum Qt Programming
    Replies: 3
    Last Post: 31st January 2006, 14:52

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.