Results 1 to 6 of 6

Thread: Handle of MainWindow using CheckBox

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Posts
    54
    Qt products
    Qt/Embedded
    Platforms
    Symbian S60

    Default Handle of MainWindow using CheckBox

    Hi All

    I have a small issue where I need to resize the mainwindow using the checkbox. My environment is Linkat( linux) and Qt.
    Issue is when I check the checkbox, the window resizes to the size given in isFloating(), but when I uncheck the box, it does not return to isDocked() size
    The default size is isDocked();

    In the MainWindow class , I have the following code
    MainWindow.h
    /************************************************** ********/
    class MainWindow : public QMainWindow
    {
    Q_OBJECT
    public:
    MainWindow();
    ~MainWindow();
    public slots:
    void isDocked();
    void isFloated();
    public:
    Qt::CheckState state;
    QCheckBox *m_CheckBox;
    }
    /************************************************** **/
    MainWindow.cpp
    /************************************************** ****/
    MainWindow::MainWindow()
    {
    m_CheckBox = new QCheckBox(this);
    m_CheckBox->setGeometry(20,460,270,700);
    state = Qt::Unchecked;

    connect(m_CheckBox,SIGNAL(clicked()),this,SLOT(isD ocked()),Qt::AutoConnection); connect(m_CheckBox,SIGNAL(clicked()),this,SLOT(isF loated()),Qt::AutoConnection);
    }

    void MainWindow::isDocked()
    {
    this->setGeometry(20,460,270,700);
    state = Qt::Checked;

    }

    void MainWindow::isFloated()
    {
    this->setGeometry(0,0,766,566);
    state =Qt::Unchecked;

    }
    Last edited by kamlmish; 8th December 2010 at 05:06.

Similar Threads

  1. HOw to handle checkBox event occured in qlistwidget
    By sanket.mehta in forum Qt Programming
    Replies: 0
    Last Post: 16th November 2010, 09:36
  2. checkbox
    By fluefiske in forum Newbie
    Replies: 3
    Last Post: 5th October 2010, 22:41
  3. CheckBox in treeview
    By ansar in forum Qt Programming
    Replies: 2
    Last Post: 16th December 2009, 05:41
  4. checkbox
    By nErnie in forum Qt Programming
    Replies: 1
    Last Post: 25th September 2006, 21:59
  5. checkBox
    By mickey in forum Qt Programming
    Replies: 8
    Last Post: 1st April 2006, 23:05

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
  •  
Qt is a trademark of The Qt Company.