Solved

Qt window title alignment

Posted on 2006-11-16
5
1,324 Views
Last Modified: 2013-11-23
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
0
Comment
Question by:dwcronin
5 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 17963366
Hi dwcronin,

what is the class you used - QMainWindow?

Cheers!
sunnycoder
0
 
LVL 12

Expert Comment

by:rajeev_devin
ID: 17963539
In Qt you cannot control the alignment of window title.
Check whether you put some whitespace in the window title.
0
 
LVL 12

Expert Comment

by:rajeev_devin
ID: 17963545
If you want to cotrol the titlebar then do check this
http://www.trolltech.com/customer/knowledgebase/535
0
 

Author Comment

by:dwcronin
ID: 17964812
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
0
 
LVL 15

Accepted Solution

by:
mish33 earned 500 total points
ID: 17973124
Window title is controlled by OS window manager according with QStyle.
Try apply different style or create your own.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Embarcadero C++ Builder XE2 TDateTime 8 75
eclipse formatting 6 106
egit plugin on eclipse 8 82
C++ help/ Toy problem 19 31
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question