Results 1 to 3 of 3

Thread: Weird problem with MainWindow

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2008
    Posts
    276
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default Weird problem with MainWindow

    Maybe today I must have something in my head very odd, because I cannot see why this simple program does not work.
    The problem is that I cannot change at all the MainWindow's title, neither add some Menu,toolbar....
    For example, in the code below, the word "OmniVision" doesnot appear in the MainWindow top bar, it just writes "MainWindow".
    Qt Code:
    1. MainWindow::MainWindow( )
    2.  
    3. {
    4. this->setWindowTitle(tr("OminiVision "));
    5.  
    6.  
    7.  
    8.  
    9. }
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. #ifndef MAINWINDOW_H
    2. #define MAINWINDOW_H
    3.  
    4. #include <QMainWindow>
    5.  
    6.  
    7.  
    8.  
    9. class MainWindow : public QMainWindow {
    10. Q_OBJECT
    11. public:
    12. MainWindow( );
    To copy to clipboard, switch view to plain text mode 

    and the main.cpp is
    Qt Code:
    1. #include <QtGui/QApplication>
    2. #include "mainwindow.h"
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication a(argc, argv);
    7. MainWindow w;
    8. a.setApplicationName("OmniVision Japita SE");
    9. w.show();
    10. return a.exec();
    11. }
    To copy to clipboard, switch view to plain text mode 

    Simpler than this...
    I noted that if I put in the .pro "CONFIG = release", the problem is ther.
    BUT: if I put "CONFIG = debug_and_release" everything is working (title, button, menu,and so on).
    Why I have to use also debug?
    Last edited by giusepped; 23rd July 2011 at 15:49.

Similar Threads

  1. Weird problem with translate()
    By romariorios in forum Qt Programming
    Replies: 8
    Last Post: 27th July 2011, 20:31
  2. Weird text input problem
    By zeldaknight in forum Qt Programming
    Replies: 6
    Last Post: 10th July 2010, 21:19
  3. weird problem in QGraphicsView / QGraphicsScene
    By Mrdata in forum Qt Programming
    Replies: 3
    Last Post: 24th November 2009, 19:26
  4. QFtp weird problem on windows
    By vcp in forum Qt Programming
    Replies: 0
    Last Post: 19th August 2009, 15:13
  5. Weird problem while porting from Qt3 to Qt4
    By vermarajeev in forum Qt Programming
    Replies: 4
    Last Post: 8th August 2007, 07:51

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.