Results 1 to 3 of 3

Thread: New user of QT

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2009
    Posts
    90
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: New user of QT

    graphics (now you name them widgets!) are in .ui file
    you can simply create widgets and other objects, both in run time and using Qt Designer

    work with examples and read helps

  2. #2
    Join Date
    Oct 2009
    Posts
    151
    Thanks
    6
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: New user of QT

    Iif you double click your mainwindow.ui file you will see a visual representation of your gui.

    If you right click the GraphicsView object you can select 'Goto slot' to begin programming the objects signals & slots.


    Click on the GraphicsView and you can see its properties on the right hand side.

    The object's name is probably graphicsView in this case

    Back in mainwindow.cpp you can access / programme this objects methods and members:

    Qt Code:
    1. #include "mainwindow.h"
    2. #include "ui_mainwindow.h"
    3.  
    4. MainWindow::MainWindow(QWidget *parent)
    5. : QMainWindow(parent), ui(new Ui::MainWindow)
    6. {
    7. ui->setupUi(this);
    8. ui->graphicsView->setDragMode(QGraphicsView::ScrollHandDrag);
    9.  
    10. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Get user name
    By klipko in forum Newbie
    Replies: 5
    Last Post: 19th December 2008, 12:07
  2. Replies: 2
    Last Post: 27th November 2008, 10:16
  3. User recognition
    By eu.x in forum Qt Programming
    Replies: 4
    Last Post: 13th March 2007, 03:16

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.