Results 1 to 4 of 4

Thread: QDialog - no title bar

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2010
    Location
    Poland
    Posts
    184
    Thanks
    70
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QDialog - no title bar

    Hello!

    I've wrote simple program that have main window and dialog window which can by open by clicking a button. Code of that dialog window looks like this:

    Qt Code:
    1. #include <QGridLayout>
    2. #include <QPushButton>
    3. #include <QIcon>
    4.  
    5. #include "pomiary.h"
    6.  
    7. Pomiary::Pomiary(QWidget *parent)
    8. : QDialog(parent)
    9. {
    10. setupUI();
    11. }
    12.  
    13. void Pomiary::setupUI()
    14. {
    15. setModal(true);
    16. setGeometry(QRect(50,0,100,150));
    17. setWindowIcon(QIcon(":/images/icon.png"));
    18.  
    19. QGridLayout* PomiaryLayout = new QGridLayout;
    20. setLayout(PomiaryLayout);
    21.  
    22. QPushButton *button = new QPushButton();
    23. button->setIcon(QIcon(":/images/icon2.png"));
    24. button->setIconSize(QSize(48, 48));
    25. button->setFixedSize(60, 60);
    26. PomiaryLayout->addWidget(button,0,0,Qt::AlignHCenter);
    27.  
    28. }
    To copy to clipboard, switch view to plain text mode 

    and when I open my application i don't have title bar on dialog window so I can't close it. I've tried to use setWindowFlags() but with no result. Only If I delete 'setGeometry()' window has title bar but is very small, and I want specific size. What I'm doing wrong?

    thanks in advance
    best regards
    Tomasz
    Last edited by Tomasz; 22nd July 2010 at 10:25.

Similar Threads

  1. Show maximize button in the title bar of a QDialog under GNOME
    By lalesculiviu in forum Qt Programming
    Replies: 1
    Last Post: 25th June 2010, 07:46
  2. stylesheet to QDialog Title Bar
    By srinirc in forum Qt Programming
    Replies: 2
    Last Post: 24th November 2009, 15:32
  3. closing a Qdialog called from a Qdialog
    By OverTheOCean in forum Qt Programming
    Replies: 3
    Last Post: 28th September 2009, 08:02
  4. Replies: 5
    Last Post: 21st April 2008, 07:54
  5. window title bar
    By moowy in forum Qt Programming
    Replies: 4
    Last Post: 21st September 2006, 16:56

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.