Results 1 to 2 of 2

Thread: Porting from Qt3 to Qt4

  1. #1
    Join Date
    Sep 2006
    Posts
    339
    Thanks
    15
    Thanked 21 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Porting from Qt3 to Qt4

    Hi guys,
    Seems to be silly question but I'm unable to achieve it.

    I'm porting my application from Qt3 to Qt4 and is using Qt3 support classes for a while. The problem is I use Q3MainWindows, Q3DockWindow, QSplitter, Q3Frame as shown in code below. Now I want to hide/unhide the dockWindow. I do this by right clicking on toolBar. First I right click and the dockWindow is hidden then again I rightClick and click on 'routes' but the dockWindow doesnt appear. I dont know why.

    Please dont suggest me to use QMainWindow, QDockWidget or so... I have already made lots of changes and cant revert back. Please help me to rectify this problem with the solution given
    Qt Code:
    1. #include <Q3MainWindow>
    2. #include <QSplitter>
    3.  
    4. class MainWindow : public Q3MainWindow
    5. {
    6. Q_OBJECT
    7.  
    8. public:
    9. MainWindow(QWidget *parent = 0);
    10. ~MainWindow();
    11.  
    12. private:
    13. Q3DockWindow *treeDock;
    14. QSplitter *s2;
    15. Q3Frame *frame;
    16.  
    17. };
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. MainWindow::MainWindow(QWidget *parent)
    2. : Q3MainWindow(parent)
    3. {
    4. treeDock = new Q3DockWindow( this, "routes" );
    5. Q_CHECK_PTR( treeDock );
    6. moveDockWindow( treeDock, Qt::Left );
    7. treeDock->setHorizontallyStretchable( true );
    8. treeDock->setVerticallyStretchable( true );
    9. treeDock->setResizeEnabled( true );
    10. treeDock->setOrientation( Qt::Vertical );
    11. treeDock->setCaption( tr("Routes") );
    12.  
    13. s2 = new QSplitter( Qt::Vertical, this, "splitter" );
    14. Q_CHECK_PTR( s2 );
    15. setCentralWidget( s2 );
    16. frame = new Q3Frame( s2 );
    17. frame->setBackgroundColor( Qt::white );
    18. frame->setAutoFillBackground( true );
    19.  
    20. Q3PopupMenu *file = new Q3PopupMenu;
    21. Q_CHECK_PTR( file );
    22.  
    23. int openId = file->insertItem( tr("&Open..."), this, SLOT(fileOpen()),
    24. Qt::CTRL+Qt::Key_O );
    25.  
    26. Q3PopupMenu *edit = new Q3PopupMenu;
    27. Q_CHECK_PTR( edit );
    28. int copyId = edit->insertItem( tr("&Copy"), this, SLOT(copy()), Qt::CTRL+Qt::Key_C );
    29.  
    30. menuBar()->insertItem( tr("&File"), file );
    31. menuBar()->insertItem( tr("&Edit"), edit );
    32. }
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. #include <QtGui/QApplication>
    2. #include "mainwindow.h"
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication a(argc, argv);
    7. MainWindow w;
    8. w.show();
    9. a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
    10. return a.exec();
    11. }
    To copy to clipboard, switch view to plain text mode 

    Thanks in advance

  2. #2
    Join Date
    Sep 2006
    Posts
    339
    Thanks
    15
    Thanked 21 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Porting from Qt3 to Qt4

    Can someone please help me out with this.

    Thanks

Similar Threads

  1. Common question about porting Qt3 to Qt4
    By zlatko in forum Qt Programming
    Replies: 4
    Last Post: 21st February 2007, 10:57
  2. Problem porting Kivio MP on win32 from Qt 3 to Qt 4
    By Amanda in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2006, 19:40
  3. Porting from Qt3 to Qt4
    By kemp in forum Qt Programming
    Replies: 1
    Last Post: 23rd August 2006, 14:30
  4. Problem in porting Main window on linux
    By jyoti kumar in forum Qt Tools
    Replies: 2
    Last Post: 2nd June 2006, 08:35
  5. Porting from Qt3 to Qt4
    By Opilki_Inside in forum Installation and Deployment
    Replies: 1
    Last Post: 1st February 2006, 18:20

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.