Link to home
Start Free TrialLog in
Avatar of dwcronin
dwcroninFlag for United States of America

asked on

Qt window title alignment

I have created a window that has a title.  The title is unfortunately centered in the title across the top of window.  How do I make it left justified?

Thanks
Avatar of sunnycoder
sunnycoder
Flag of India image

Hi dwcronin,

what is the class you used - QMainWindow?

Cheers!
sunnycoder
Avatar of rajeev_devin
rajeev_devin

In Qt you cannot control the alignment of window title.
Check whether you put some whitespace in the window title.
If you want to cotrol the titlebar then do check this
http://www.trolltech.com/customer/knowledgebase/535
Avatar of dwcronin

ASKER

Sunnycoder,

The beginning of the code that creates a window is:
===========================  start code  ==========================================
    // create main screen
    MultiUsePalette.setColor(QPalette::Background, Qt::lightGray);
    PmeMockupConflict.DeviceWin = new SrtsWidget();
    PmeMockupConflict.DeviceWin->setWindowTitle("PME Mockup Conflict");
    PmeMockupConflict.DeviceWin->setPalette(MultiUsePalette);
    //set initial screen size
   PmeMockupConflict.DeviceWin->setGeometry(62, 20, 900, 450);
=========================== end code ============================================

============================  start of structure used above  ===========================
           struct PmeMockupConflict_s {
                QAction * Act;
                SrtsWidget * DeviceWin;

                QPushButton * skipLessonBtn;
                QPushButton * studentWaitBtn;
                QPushButton * editLessonListBtn;

                QLabel * windowTitleLbl;
                QLabel * listTitleLbl1;
                QLabel * listTitleLbl2;

                QLineEdit * projectIdLineEdit;
                QGridLayout *MainGrid;
                QHBoxLayout *HLButtons;
                QWidget *TopSpaceFiller;
                QWidget *BottomSpaceFiller;

                QListWidget * List;
            };
========================== end of structure used above ===============================

I am trying to left justify the window title given above: "PME Mockup Conflict"

It seems to default to the midle of the title bar and I'm not certain where I have to put a command to left justify it.

Dan
ASKER CERTIFIED SOLUTION
Avatar of mish33
mish33
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial