Results 1 to 3 of 3

Thread: New user of QT

  1. #1
    Join Date
    Feb 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default New user of QT

    Hi,

    I am a very new user of Qt, I've just downloaded QT Creator and did this simple form to test what QT was about:



    It is a simple form, with a window and a GraphicsView in it ...

    I have been checking the souce files, I cannot see that GraphicsView anywhere.

    How can I rewrite the paint mathod of that object ???

    I am used to work with Visual Basic, and it's surprising for me I cannot access through the IDE to the paint method or any other method of that object ...
    Thanks.

  2. #2
    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

  3. #3
    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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.