Results 1 to 2 of 2

Thread: addToolBar, but only once please

  1. #1
    Join Date
    Jan 2008
    Location
    Davao City, Philippines
    Posts
    77
    Thanks
    16
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default addToolBar, but only once please

    Hello!

    With Qt4, is there a way to make sure, that this toolBar

    Qt Code:
    1. toolBarKunden = new QToolBar(this);
    2. setObjectName(QString::fromUtf8("toolBarKunden"));
    3. addToolBar(Qt::TopToolBarArea, toolBarKunden);
    4. setWindowTitle(QApplication::translate("Erpel", "toolBarKunden", 0, QApplication::UnicodeUTF8));
    To copy to clipboard, switch view to plain text mode 

    will be created only once?

    Something like

    Qt Code:
    1. if (!toolBarKunden)
    2. {
    3. // createToolBar ...
    4. }
    To copy to clipboard, switch view to plain text mode 

    Thanks in advance,

    Guenther

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: addToolBar, but only once please

    It's called C++. Did you remember to initialize the pointer?
    J-P Nurmi

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.