Results 1 to 11 of 11

Thread: show the backgroundpixmap of QMenuBar??-Qt-3.3.6

  1. #1
    Join Date
    Sep 2006
    Location
    nanjing China
    Posts
    19
    Thanks
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default show the backgroundpixmap of QMenuBar??-Qt-3.3.6

    hello,everyone!
    I have a problem between Qt-3.3.5 and Qt-3.3.6 .
    the codes like these:

    Qt Code:
    1. QPixmap app_Normal;
    2. app_Normal.convertFromImage(app_normal);
    3. menuwgt=new QFrame(this) ;
    4. menu1=new DMenuBar(menuwgt) ;
    5. menu1->setPaletteBackgroundPixmap(app_Normal);
    To copy to clipboard, switch view to plain text mode 

    it runs well when it's under FC5 ,but doesn't show the backgroundPixmap when in FC6,
    I don't know what's the problem with it??????

    it uses QT-3.3.5 in FC5 but QT-3.3.6 in FC6.

    Thanks
    Last edited by wysota; 3rd April 2007 at 09:19. Reason: reformatted to look better
    It is the same old story of not being grateful for what we have until we lose it..........

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: show the backgroundpixmap of QMenuBar??-Qt-3.3.6

    did you check if app_normal isNull()? (QImage)

  3. #3
    Join Date
    Sep 2006
    Location
    nanjing China
    Posts
    19
    Thanks
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: show the backgroundpixmap of QMenuBar??-Qt-3.3.6

    it runs well in Fedora5 ,(show the app_Normal)
    It is the same old story of not being grateful for what we have until we lose it..........

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: show the backgroundpixmap of QMenuBar??-Qt-3.3.6

    No, I meant with FC6

  5. #5
    Join Date
    Sep 2006
    Location
    nanjing China
    Posts
    19
    Thanks
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: show the backgroundpixmap of QMenuBar??-Qt-3.3.6

    I tried with other pixmap which is showing in other widget;

    logoutbtn=new QLabel(this );
    logoutbtn->setPaletteBackgroundPixmap(logoutbg);

    the code works well,
    so I tried to use the "logoutbg" ,but it didn't show the pixmap ,??
    It is the same old story of not being grateful for what we have until we lose it..........

  6. #6
    Join Date
    Sep 2006
    Location
    nanjing China
    Posts
    19
    Thanks
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: show the backgroundpixmap of QMenuBar??-Qt-3.3.6

    I tried in FC6
    It is the same old story of not being grateful for what we have until we lose it..........

  7. #7
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: show the backgroundpixmap of QMenuBar??-Qt-3.3.6

    I have trouble understanding what you tried where.
    Anyhow, it looks to me like you have a path problem.
    Make sure the path to your image is correct.
    What kind of image is it?
    Are you sure Qt is configured to support that format on the system where you have the problem?
    How do you load the image - directly or do use use an image collection?
    Please use the code tags for code.

  8. #8
    Join Date
    Sep 2006
    Location
    nanjing China
    Posts
    19
    Thanks
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: show the backgroundpixmap of QMenuBar??-Qt-3.3.6

    I tried the codes in FC6 :
    code:
    .......
    #include "../imagesource/app_hover.xpm"
    ........

    QPixmap app_Normal;
    app_Normal.convertFromImage(app_normal);
    QFile debugFile("/root/debughuiqin.txt");
    if( debugFile.open(IO_Append | IO_WriteOnly) )
    {
    QTextStream debugOut( &debugFile );
    if(app_Normal.isNull())
    debugOut<<"this is a null pixmap"<<endl;
    else debugOut<<"this is not a null pixmap"<<endl;
    debugFile.close();
    }


    menuwgt=new QFrame(this) ;
    menu1=new QMenuBar(menuwgt) ;
    menu1->setPaletteBackgroundPixmap(app_Normal);


    the result is "this is not a null pixmap"


    thank you for your reply
    It is the same old story of not being grateful for what we have until we lose it..........

  9. #9
    Join Date
    Sep 2006
    Location
    nanjing China
    Posts
    19
    Thanks
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: show the backgroundpixmap of QMenuBar??-Qt-3.3.6

    I tried the codes in FC6 :
    code:
    .......
    #include "../imagesource/app_hover.xpm"
    ........

    QPixmap app_Normal;
    app_Normal.convertFromImage(app_normal);
    QFile debugFile("/root/debughuiqin.txt");
    if( debugFile.open(IO_Append | IO_WriteOnly) )
    {
    QTextStream debugOut( &debugFile );
    if(app_Normal.isNull())
    debugOut<<"this is a null pixmap"<<endl;
    else debugOut<<"this is not a null pixmap"<<endl;
    debugFile.close();
    }


    menuwgt=new QFrame(this) ;
    menu1=new QMenuBar(menuwgt) ;
    menu1->setPaletteBackgroundPixmap(app_Normal);
    the result is "this is not a null pixmap"


    thank you for your reply
    It is the same old story of not being grateful for what we have until we lose it..........

  10. #10
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: show the backgroundpixmap of QMenuBar??-Qt-3.3.6

    What are you are trying to do?
    I think you are complecating things too much.
    Please post the code where you initilize your QImage, and the absolute paths of your project executable and of the image.
    Last edited by high_flyer; 3rd April 2007 at 13:06.

  11. The following user says thank you to high_flyer for this useful post:

    bigbigmoon (17th April 2007)

  12. #11
    Join Date
    Sep 2006
    Location
    nanjing China
    Posts
    19
    Thanks
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: show the backgroundpixmap of QMenuBar??-Qt-3.3.6

    Sorry , I don't think it's wrong with the picture (app_Normal),which I want to show as the
    background of the widget QMenuBar menu1.
    What I tried is to prove this .

    And I tried to test whether the function setPaletteBackground(QPixmap) works ,too. The result is that it works well.

    Thank you for your reply!
    It is the same old story of not being grateful for what we have until we lose it..........

Similar Threads

  1. where could QPopupMenu show besides QMenuBar !
    By bigbigmoon in forum Newbie
    Replies: 4
    Last Post: 2nd November 2006, 01:03

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.