Results 1 to 2 of 2

Thread: QToolBar

  1. #1
    Join Date
    Jul 2007
    Posts
    166
    Thanks
    25
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy QToolBar

    Hi,
    I am using QT 4.3. I nned to create a toolbar. So I create the code like this.

    ================================================== =================
    QToolBar *bar = new QToolBar("main", this);
    pButton[pbt_ctl_size ] = new QToolButton;
    pButton[pbt_ctl_size ]->setIcon(QPixmap((const char **)ctl_size_xpm));
    pButton[pbt_ctl_size ]->setToolTip("Size and framerate");
    connect(pButton[pbt_ctl_size ], SIGNAL(clicked()), pVideo, SLOT(ShowFormatDialog()));
    pButton[pbt_ctl_size ]->setCheckable(true);
    pButton[pbt_ctl_size ]->setEnabled(true);
    bar->addWidget(pButton[pbt_ctl_size ]);



    pButton[pbt_ctl_video ] = new QToolButton;
    pButton[pbt_ctl_video]->setIcon(QPixmap((const char **)ctl_video_xpm));
    pButton[pbt_ctl_video]->setToolTip("Video adjustments");
    connect(pButton[pbt_ctl_video ], SIGNAL(clicked()), pVideo, SLOT(ShowFormatDialog()));
    pButton[pbt_ctl_video]->setEnabled(true);
    bar->addWidget(pButton[pbt_ctl_video ]);

    ================================================== ===========================

    after this code QT display a toolbar and two icons in my window. But it is not activate. If any error in this code? How can I use the click event of this toolbar?
    Please help me....

  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: QToolBar

    What do you mean by "is not active"? Did you add the tool bar to main window with QMainWindow::addToolBar()?
    J-P Nurmi

Similar Threads

  1. QToolbar in Window Vista prob.
    By patrick772goh in forum Qt Programming
    Replies: 3
    Last Post: 20th August 2007, 10:35
  2. Various icon sizes for QToolButtons on QToolbar
    By Erlendhg in forum Qt Programming
    Replies: 4
    Last Post: 30th June 2007, 18:35
  3. How Do I Float a QToolBar?
    By dvmorris in forum Qt Programming
    Replies: 7
    Last Post: 29th April 2007, 19:01
  4. QToolBar in a new UI form?
    By gfunk in forum Qt Tools
    Replies: 7
    Last Post: 2nd June 2006, 11:19
  5. Insert separate QToolBar into QMainWindow
    By YuriyRusinov in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 10:37

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.