Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Qt window title alignment

Posted on 2006-11-16
5
Medium Priority
?
1,533 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 1500 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

636 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