Results 1 to 2 of 2

Thread: Qtcreatore : UI

  1. #1
    Join Date
    Aug 2009
    Posts
    30
    Thanks
    13
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Qtcreatore : UI

    I create a new widget to display roadmaps. there is a way to add this widget to the UI designer. For the moment, I have just added direclty in my code.

    Qt Code:
    1. #ifndef QMAPS_H
    2. #define QMAPS_H
    3.  
    4. #include <QWidget>
    5. #include <QtGui>
    6.  
    7. class QMaps : public QWidget{
    8. Q_OBJECT
    9.  
    10. public:
    11. QMaps(QWidget *parent = 0);
    12. QSize sizeHint() const;
    13. QSize minimumSizeHint() const;
    14.  
    15. protected:
    16. void paintEvent(QPaintEvent *event);
    17.  
    18. private:
    19.  
    20. };
    21.  
    22. #endif // QMAPS_H
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. MainWindow::MainWindow(QWidget *parent)
    2. : QMainWindow(parent), ui(new Ui::MainWindowClass)
    3. {
    4. ui->setupUi(this);
    5. qout=new QDebugStream(std::cout, ui->textBox);
    6. qmaps=new QMaps(this);
    7. qmaps->show();
    8. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qtcreatore : UI

    Yes you can do it.
    See this.

  3. The following user says thank you to yogeshgokul for this useful post:

    shenakan (18th August 2009)

Similar Threads

  1. Qtcreator : Problem to compile examples
    By shenakan in forum Newbie
    Replies: 2
    Last Post: 18th August 2009, 09:17

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.