Solved

Qt window title alignment

Posted on 2006-11-16
5
1,249 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now