Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Nov 2011
    Location
    Tunisia
    Posts
    81

    Question [Qt] how to hide the toolbar?

    Hi,
    Please how I can hide the bottom toolbar and let the statusbar visible in my Qt app?
    My app is based on Qt C++ (QWidget) and not QML.
    I tried this main.cpp code but I get an error: Recipe linkandpostlink failed with exit code 1.


    Code:
    #include <QtGui/QApplication>
    #include <QWidget>
    
    #ifdef Q_OS_SYMBIAN
    #include <eikbtgpc.h>
    #include <avkon.rsg>
    #include <aknenv.h>
    #endif
    
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QWidget *mainWidget = new QWidget();
        mainWidget->setStyleSheet("background-color: yellow");
        mainWidget->showMaximized();
    
    
    #ifdef Q_OS_SYMBIAN
        CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
        cba->MakeVisible( EFalse );
    #endif
    
    
        return app.exec();
    }

    My .pro file:
    Code:
    QT += core gui
    
    symbian:TARGET.UID3 = 0xE07B6619
    
    symbian:LIBS += -llibssl -lcrypto -lcone -lws32 -leikcore -lavkon
    
    symbian:TARGET.CAPABILITY += NetworkServices
    
    SOURCES += main.cpp
    
    # Please do not modify the following two lines. Required for deployment.
    include(deployment.pri)
    qtcAddDeployment()
    Last edited by aymen_ka; 2013-12-05 at 18:15.

  2. #2
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: [Qt] how to hide the toolbar?

    I have not verified this but based on http://developer.nokia.com/document/...Container.html your project needs also eikcoctl.lib
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  3. #3
    Regular Contributor
    Join Date
    Nov 2011
    Location
    Tunisia
    Posts
    81

    Re: [Qt] how to hide the toolbar?

    Thank you Lucian, I added this library to my .pro file:

    symbian:LIBS += -llibssl -lcrypto -lcone -lws32 -leikcore -lavkon -leikcoctl

    Now the build is successful, but the app crash before showing anything, this line is causing the crash: cba->MakeVisible( EFalse );
    Last edited by aymen_ka; 2013-12-05 at 17:58.

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,805

    Re: [Qt] how to hide the toolbar?

    Perhaps I am old-school, but getting the panic code should not hurt. http://developer.nokia.com/Community...ded_panic_code

  5. #5
    Regular Contributor
    Join Date
    Nov 2011
    Location
    Tunisia
    Posts
    81

    Re: [Qt] how to hide the toolbar?

    Quote Originally Posted by wizard_hu_ View Post
    Perhaps I am old-school, but getting the panic code should not hurt. http://developer.nokia.com/Community...ded_panic_code
    Hi wizard_hu,
    I did as in the wiki article, but I don't get any panic code.
    The app crash just after this line of the code: cba->MakeVisible( EFalse );
    And I have this error shown in the output console of Qt Creator:
    Launched.
    Thread has crashed: A data abort exception has occurred accessing 0x0.
    Process has finished.

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,805

    Re: [Qt] how to hide the toolbar?

    This extended panic code thing should work with actual devices and emulators of Symbian/S60 SDK-s. The emulator of Qt Creator might not support it, I do not know.
    However the "accessing 0x0" part indicates that there is a null pointer somewhere. A first guess could be 'cba', which you can explicitly check.

  7. #7
    Regular Contributor
    Join Date
    Nov 2011
    Location
    Tunisia
    Posts
    81

    Re: [Qt] how to hide the toolbar?

    I'm not expert in Symbian C++
    After retrying I get the panic code:
    Application closed:
    testApp006
    KERN-EXEC 3

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,805

    Re: [Qt] how to hide the toolbar?

    KERN-EXEC 3 often means null-pointer usage. It may also mean stack overflow and a couple other things. However the older error message already suggests null-pointer access (0x0 is null), so you may really want to check for null pointers first.
    What happens if you write
    Code:
    if(cba)cba->MakeVisible( EFalse );
    ?

  9. #9
    Regular Contributor
    Join Date
    Nov 2011
    Location
    Tunisia
    Posts
    81

    Re: [Qt] how to hide the toolbar?

    Quote Originally Posted by wizard_hu_ View Post
    KERN-EXEC 3 often means null-pointer usage. It may also mean stack overflow and a couple other things. However the older error message already suggests null-pointer access (0x0 is null), so you may really want to check for null pointers first.
    What happens if you write
    Code:
    if(cba)cba->MakeVisible( EFalse );
    ?
    That's right, now the app run without any crash, but the toolbar still visible.
    any idea how to fix this null-pointer access to hide the toolbar?
    Or maybe I can show my app in fullscreen (then the toolbar will be hidden) and set status bar visible using some Symbian C++ code, but I don't know how to to that

  10. #10
    Registered User
    Join Date
    Jun 2012
    Posts
    43

    Re: [Qt] how to hide the toolbar?

    try to use fullscreen and CEikStatusPane* sp = StatusPane();
 sp->MakeVisible(EFalse);

Similar Threads

  1. how to hide toolbar?
    By ShekChien in forum [Archived] Qt Quick
    Replies: 1
    Last Post: 2011-04-19, 07:48
  2. Run Application in background and hide from toolbar
    By Abhishek_karmakar in forum Symbian
    Replies: 3
    Last Post: 2008-12-31, 11:09
  3. ToolBar!
    By zhang198544 in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-07-08, 08:48

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×