Results 1 to 12 of 12

Thread: Undo the this->setupId(this)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Undo the this->setupId(this)

    Hi there,

    I'm implementing a login/logout mechanism and I have a really strange problem.

    I have created a main window with a constructor of this type:

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui_(new Ui::MainWindow)
    {
    // call a login dialog

    // the login emits a signal with the login status
    // if ok start the application and create all the interface (calling a function that does the ui_->setupUi(this); )
    }


    when the user wants to log out he goes on the logout button.
    A function that cleans everything (for the menu I use menubar()->clean() ) is called and then the login dialog is created again.
    If the user now logs, the same function that does the ui_->setupUi(this); is called but the menu actions now are not connected

    If instead of using the designer I create the menu and the actions manually, everything works.


    I have discovered that the problem is due to a "double call" to ui_->setupUi(this);

    I have also tried to put a flag and try to not to call it if the user logs in the second time, but if I don't call that function the interface will not be showed.

    I would need a function to disconnect all the actions of the menu (like a ui_->undoSetupUi(this) )

    Any hints?

    Cheers!
    Last edited by valerianst; 1st July 2013 at 10:37.

Similar Threads

  1. qt undo/redo
    By giugio in forum Qt Programming
    Replies: 1
    Last Post: 12th November 2012, 16:31
  2. Syncing QTextDocument's undo stack with custom undo stack
    By Dini Selimović in forum Newbie
    Replies: 0
    Last Post: 24th June 2012, 13:11
  3. undo/redo example has refactored
    By n_vova in forum Qt Programming
    Replies: 1
    Last Post: 10th May 2012, 10:04
  4. QtableWidget UNDO
    By afro_cv in forum Qt Programming
    Replies: 15
    Last Post: 5th September 2011, 08:19
  5. buggy undo example
    By Gopala Krishna in forum Qt Programming
    Replies: 2
    Last Post: 21st August 2007, 19:33

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.