Results 1 to 10 of 10

Thread: Qt4 with VS2005

  1. #1
    Join Date
    Oct 2007
    Posts
    18
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Qt4 with VS2005

    Hello all,

    this is my first post so I hope I will do it allright. I'm using Qt4 4.3.1 with VS2005.NET and I'm working on a application for configuring a device I made. All widgets are drawn from code. I have two questions. First, i'm getting a warning that sasy:

    1>Moc'ing serviscenter.cpp...
    1>.\serviscenter.cpp(0): Warning: No relevant classes found. No output generated.

    I don't know why I'm getting this warning.

    Second, the appliation resize event is veeery slow. So far only widgets are used and when i try to resize the window this is done with a few delays while resize is done.

    Can someone give some suggestions how to improve resizeing and why i'm getting that warning?

    Thank you all for your time.

    Best regards,

    borut

  2. #2
    Join Date
    Jan 2006
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt4 with VS2005

    Using Q_OBJECT macros in *.h file?

  3. #3
    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: Qt4 with VS2005

    Quote Originally Posted by bkastel1 View Post
    Second, the appliation resize event is veeery slow. So far only widgets are used and when i try to resize the window this is done with a few delays while resize is done.
    How many widgets do you have there? Are they custom widgets or ones that come with Qt?

  4. #4
    Join Date
    Oct 2006
    Posts
    279
    Thanks
    6
    Thanked 40 Times in 39 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt4 with VS2005

    THe reason for the warning is that when you ran qmake, you had a class declaration with the Q_OBJECT macro in serviscenter.cpp which leads to moc being executed on the file, generating a file called serviscenter.moc, containing the signal n' slot stuff for the class. Apparently you've sinced removed the class or at least the Q_OBJECT macro, which is why moc is complaining. You only need to rerun qmake to remove the warning.

  5. #5
    Join Date
    Oct 2007
    Posts
    18
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Qt4 with VS2005

    yes i am. and i'm also usign some QItemDelegate in my TreeWidget. Could this have something to do with it?

  6. #6
    Join Date
    Oct 2007
    Posts
    18
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Qt4 with VS2005

    All widgets are the one from Qt except that i dont use ui designer but i make them from my C++ code and one TreeWidget uses QItemDelegate.

  7. #7
    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: Qt4 with VS2005

    Could we see the code of the constructor and any events you might have reimplemented?

  8. #8
    Join Date
    Oct 2007
    Posts
    18
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Qt4 with VS2005

    Here is the function for creating ui:

    Qt Code:
    1. void ServisCenter::createUi()
    2. {
    3. this->setWindowIcon( QIcon(":/Resources/navigator.png") );
    4.  
    5. QStringList headers;
    6. QSizePolicy *DetailsPolicy = new QSizePolicy( );
    7.  
    8.  
    9. m_VSplitter = new QSplitter( ui.centralWidget );
    10. m_VSplitter->setObjectName( "m_VSplitter ");
    11. m_VSplitter->setOrientation( Qt::Vertical );
    12.  
    13. m_HSplitter = new QSplitter( m_VSplitter );
    14. m_HSplitter->setObjectName( "m_HSplitter" );
    15. m_HSplitter->setOrientation( Qt::Horizontal );
    16.  
    17.  
    18. headers.clear();
    19. headers << tr("ETC ID") << tr("File name") << tr("Size [B]") << tr("Status")
    20. << tr("Transfered [B]") << tr("Progress") << ("Time");
    21.  
    22.  
    23. m_TransfersTree = new QTreeWidget( m_VSplitter );
    24. m_TransfersTree->setHeaderLabels( headers );
    25. m_TransfersTree->setAlternatingRowColors( true );
    26. m_TransfersTree->setRootIsDecorated( false );
    27. m_TransfersTree->setContentsMargins( 0, 0, 0, 0 );
    28. m_TransfersTree->setItemDelegateForColumn( 5, new ItemDelegate( m_TransfersTree ));
    29. m_TransfersTree->setSelectionBehavior( QAbstractItemView::SelectRows );
    30. m_TransfersTree->setSelectionMode( QAbstractItemView::SingleSelection );
    31. m_TransfersTree->setFocusPolicy(Qt::ClickFocus);
    32.  
    33. headers.clear();
    34.  
    35.  
    36. m_ETCTree = new QTreeWidget( m_HSplitter );
    37. m_ETCTree->setHeaderLabel( "ETC Devices" );
    38. m_ETCTree->setContentsMargins( 0, 0, 0, 0 );
    39. m_ETCTree->setRootIsDecorated( true );
    40.  
    41.  
    42. widget = new QWidget( m_HSplitter );
    43. m_VLayout = new QVBoxLayout( widget );
    44. m_VLayout->setSpacing( 0 );
    45. m_VLayout->setMargin( 0 );
    46. m_ETCTab = new QTabWidget( widget );
    47.  
    48. m_ETCTab->setObjectName( "tabWidget" );
    49.  
    50. tab1 = new QWidget();
    51. tab1->setObjectName( "tab1" );
    52. tab2 = new QWidget();
    53. tab2->setObjectName( "tab2" );
    54.  
    55. gridTab = new QGridLayout( tab1 );
    56. gridTab->setSpacing( 0 );
    57. gridTab->setMargin( 0 );
    58.  
    59. m_ETCTab->addTab( tab1, QString() );
    60. m_ETCTab->addTab( tab2, QString() );
    61.  
    62. m_ETCTab->setTabText( 0, tr("Files") );
    63. m_ETCTab->setTabText( 1, tr("Terminal") );
    64.  
    65. headers.clear();
    66. headers << tr("File name") << tr("Version") << tr("Boot count") << tr("Date modified")
    67. << tr("Start sector") << tr("End sector") << tr("Reserved sectors")
    68. << tr("File size");
    69.  
    70. m_FilesTree = new QTreeWidget( tab1 );
    71. m_FilesTree->setHeaderLabels( headers );
    72. m_FilesTree->setContentsMargins( 0, 0, 0, 0 );
    73. m_FilesTree->setRootIsDecorated( false );
    74.  
    75. gridTab->addWidget( m_FilesTree, 0, 0, 1, 1 );
    76.  
    77. headers.clear();
    78. headers << tr("S/N") << tr("id") << tr("bla") << tr("blabla") << tr("blablabla");
    79.  
    80. m_ETCDetails = new QTreeWidget( widget );
    81. m_ETCDetails->setHeaderLabels( headers );
    82. m_ETCDetails->setContentsMargins( 0, 0, 0, 0 );
    83. m_ETCDetails->setRootIsDecorated( false );
    84.  
    85. m_VLayout->addWidget( m_ETCDetails, 1 );
    86. m_VLayout->addWidget( m_ETCTab, 9 );
    87.  
    88. m_HSplitter->addWidget( m_ETCTree );
    89. m_HSplitter->addWidget( widget );
    90. m_VSplitter->addWidget( m_HSplitter );
    91. m_VSplitter->addWidget( m_TransfersTree );
    92.  
    93. gridMain = new QGridLayout( ui.centralWidget );
    94. gridMain->setSpacing( 0 );
    95. gridMain->setMargin( 0 );
    96. gridMain->addWidget( m_VSplitter, 1, 0 );
    97.  
    98. ServisCenter::ServisCenter( QWidget *parent, Qt::WFlags flags )
    99. : QMainWindow( parent, flags )
    100. {
    101. ui.setupUi( this );
    102.  
    103. createUi();
    104.  
    105.  
    106. createActions();
    107. createToolBars();
    108. createStatusBar();
    109. createContextMenus();
    110. readSettings();
    111. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 6th November 2007 at 12:04.

  9. #9
    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: Qt4 with VS2005

    Is your final design similar to the one in attachment? Could you check if you experience any slowdowns when using it (for example by previewing it in Designer)?

    Additionally, how much data do you insert into each of the tree widgets and when do you insert it? Maybe you could show us the code used for populating the tree widgets?
    Attached Files Attached Files

  10. #10
    Join Date
    Oct 2007
    Posts
    18
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Qt4 with VS2005

    I've found that even Qt Assistant and Qt demo are working slow. So maybe there is something else that is wrong here. I changed my local pc accout to a domain account a few days ago and maybe i didn't copy all the setting correctly. I will reinstall the VS 2005 and Qt and will let you know what happened.
    Thank you all for your time.

Similar Threads

  1. VS2005 Deployment Problem
    By musaulker in forum Installation and Deployment
    Replies: 6
    Last Post: 20th July 2008, 19:43
  2. WCHAR to QString giving error in vs2005
    By ucomesdag in forum Qt Programming
    Replies: 2
    Last Post: 1st May 2008, 23:25
  3. Replies: 4
    Last Post: 2nd May 2007, 18:47
  4. Qt 4.1.4 on VS2005 error- cannot open input file 'qtmain.lib'
    By Ashish in forum Installation and Deployment
    Replies: 10
    Last Post: 11th October 2006, 16:05
  5. Installing Qt 4.1.4 (open source) on windows with vs2005
    By Randulf in forum Installation and Deployment
    Replies: 1
    Last Post: 19th August 2006, 12:22

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.