Results 1 to 5 of 5

Thread: Qt as only Gui Module (QMainWindow Params)

  1. #1

    Default Qt as only Gui Module (QMainWindow Params)

    Hello all!

    This my first thread, I`ve just started my adventure with qt but i have problem I cannot not find the solutions.

    Ok, I want to send parameter into qmainwindow, Beacuse I dont want to put my application Logic there. I will use not one, but three or four windows. I would like to have myApp manager which will call mywindows with parameter ( an object wchich holds data gathered and filled by window) to another module which will use this data and eventualy fill it and then this data will be set in Window. Is there any way to do this a i was trying to add my constructor to MainWindow but i`ve failed, Maybe to override QApplication in some way? And another thing is that i don`t want to use a singleton for my Data class.

    Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Qt as only Gui Module (QMainWindow Params)

    Create a constructor with more parameters.

  3. #3

    Default Re: Qt as only Gui Module (QMainWindow Params)

    I`ve trying to do this and can`t do it could you give me an example? please,
    Default constructor has QWidget param which i cannot create and send beacuse its private, the only way to create mainwindow is

    MainWindow w;

    when i use new, i can`t send ptr to QWidget, which is used in QMainWindow class constructor as parent. I didnt manage to made MainWindow object using "new" operator and cannot made good constructor with addinational param pls help
    Last edited by radex99; 30th August 2010 at 16:47.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt as only Gui Module (QMainWindow Params)

    You have to create a constructor in the code of the MainWindow class. There already is one taking a QWidget pointer as a parameter. Add another (or extend the one that is already there) that takes the parameters you want. This is basic C++!
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5

    Default Re: Qt as only Gui Module (QMainWindow Params)

    Sorry for mess it was my stupid mistake sorry again, for close and thx
    Last edited by radex99; 30th August 2010 at 18:27.

Similar Threads

  1. QMainWindow as a child of QMainWindow
    By Elder Orb in forum Qt Programming
    Replies: 8
    Last Post: 12th February 2011, 21:31
  2. Qt Svg Module
    By onurozcelik in forum Qt Programming
    Replies: 5
    Last Post: 14th March 2010, 06:47
  3. Zip module for Qt
    By arpspatel in forum Qt Programming
    Replies: 1
    Last Post: 28th October 2009, 06:34
  4. SVG module
    By mind_freak in forum Qt Programming
    Replies: 6
    Last Post: 21st August 2009, 05:01
  5. SQL-Module
    By phil_ in forum Newbie
    Replies: 7
    Last Post: 22nd January 2006, 16:24

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.