Results 1 to 2 of 2

Thread: custom maximize button---

  1. #1

    Question custom maximize button---

    i will take some time to understand this..please have patience...please

    i'm collapsing the titlebar by writing the following code in the main....


    WId hWnd = w.winId();
    long lStyle = GetWindowLong(hWnd, GWL_STYLE);
    lStyle &= ~WS_CAPTION;
    SetWindowLong(hWnd, GWL_STYLE, lStyle);


    and I'm three buttons and setting the pixmap like this

    m_Minimize = new CCustomIconButtons(this);
    QPixmap minimizePixmap = style()->standardPixmap(QStyle::SP_TitleBarMinButton);
    m_Minimize->AddIcons(new QPixmap(minimizePixmap));


    restorePixmap = style()->standardPixmap(QStyle::SP_TitleBarNormalButton) ;

    m_Maximize = new CCustomIconButtons(this);
    maximizePixmap = style()->standardPixmap(QStyle::SP_TitleBarMaxButton);

    m_cbtnMaximize->AddIcons(new QPixmap(restorePixmap));

    m_cbtnClose = new CCustomIconButtons(this);
    closePixmap = style()->standardPixmap(QStyle::SP_TitleBarCloseButton);
    m_cbtnClose->AddIcons(new QPixmap(closePixmap));


    and I'm taking a boolean variale maxNormal=true;

    I'm having problem only with maximize and Restore button.....


    what I'm doing is


    void CNavigationBar:n_but_maximize_clicked()
    {
    if (m_maxNormal)
    {
    m_maxNormal = !m_maxNormal;
    m_Maximize->AddIcons(new QPixmap(maximizePixmap));
    parentWidget()->showNormal();


    }
    else
    {
    parentWidget()->showMaximized();
    m_maxNormal = !m_maxNormal;
    m_cbtnMaximize->AddIcons(new QPixmap(restorePixmap));
    }
    }


    If you could understand till here ....Read through to know the problem.....

    First when i running the application..

    it is first showing me the Maximized window with
    1)Minimize button
    2)Restore button
    3)close Button

    and when i click the Restore button the window size is decreasing and the buttons i'm getting is
    1)minimize button
    2)maximize button(instead of Restore button)
    3)close button

    now when i again click the maximize button i'm getting back

    1)Minimize button
    2)Restore button
    3)close Button

    and when i again maximize this and press the Minimize button ..
    it is going to the toolbar and when i left click on it....
    it is comming onto the screen and

    NOW THE RESTORE AND MAXIMIZE ARE NOT FUNCTIONING PROPERLY


    COULD ANYONE HELP



    Thanks in Advance

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: custom maximize button---

    What does the AddIcons() method do?

Similar Threads

  1. how to disable the maximize button?
    By zabeehkhan in forum Qt Programming
    Replies: 4
    Last Post: 14th April 2010, 07:26
  2. How can I add a custom button to a QWidget's title bar
    By JPNaude in forum Qt Programming
    Replies: 4
    Last Post: 22nd February 2010, 10:40
  3. Replies: 4
    Last Post: 13th January 2009, 15:32
  4. Maximize Window button of Manin Window
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 1st August 2007, 08:20
  5. Replies: 2
    Last Post: 1st August 2006, 10:23

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.