[Solved] Qt Creator -> QToolBar



  • I was messing around in Qt Creator, and noticed, it automatically puts a QToolBar widget on the form, but when I went to look in Properties Editor Pane, on the right, there's no where, where you can put Images on it, for Open Save, I also looked in Qt Docs and other stuff, found nothing, how do I put images on the QToolBar? I named it toolBar1 under Properties Pane in Qt Creator. I figured there would have been a place in Qt Creator where it does that for you, I guess not.. Also, I noticed, I right clicked a button I put on there, clicked go to slot, then clicked clicked event, I typed in connect ( pushButton , SIGNAL ( clicked ( ) ) , this, SLOT (close ( ) ) ) ; it threw an error about not declaring the variable pushButton in this scope, I thought that's the whole point of Qt Creator, to do things quickly and efficiently? I know I can use the Signals/Slots Editor under the text editor in Qt, but I figured I could do all that within Qt Creator under Edit Mode. Anyway, thanks in advance !!



  • You most probably have a member ui in your class that contains the user interface parts, so connect( ui->pushButton, ...) should do the trick.

    See "Using a Designer UI File in Your Application":http://doc.qt.nokia.com/latest/designer-using-a-ui-file.html of the designer docs for more information.



  • [quote author="Volker" date="1298544355"]You most probably have a member ui in your class that contains the user interface parts, so connect( ui->pushButton, ...) should do the trick.

    See "Using a Designer UI File in Your Application":http://doc.qt.nokia.com/latest/designer-using-a-ui-file.html of the designer docs for more information.[/quote]

    Oh oh oh oh oh, thanks a million, that should most definitely work !!



  • [quote author="Volker" date="1298544355"]You most probably have a member ui in your class that contains the user interface parts, so connect( ui->pushButton, ...) should do the trick.

    See "Using a Designer UI File in Your Application":http://doc.qt.nokia.com/latest/designer-using-a-ui-file.html of the designer docs for more information.[/quote]

    Ok, it worked, consider this post solved, =). It does want me to double click the button, but other than that, this post can now be closed, =). Thanks a lot !!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.