Showing posts with label QT. Show all posts
Showing posts with label QT. Show all posts

Monday, July 16, 2018

Qt Layout on QMainWindow ( work in pyqt as well )

 


 

Taken from https://stackoverflow.com/questions/1508939/qt-layout-on-qmainwindow as note

You don't have to create a QVBoxLayout manually. Just select your central QWidget and press a make-layout button
https://stackoverflow.com/a/1508954


Add at least one widget on your MainWindow. Then select your window by clicking on it and click on the VerticalLayout Button at the top of QTCreator. You Vertical Layout is automatically added to the central widget and fills all the surface.

https://stackoverflow.com/a/1508969


Wednesday, September 21, 2016

QT C++ Tip: Code folding ( C# region equivalent )

 

 

Tip: Code folding

I build my applications using QTCreator.

It is a very nice environment but it lacks the ability to store all active editor settings. One thing that I use a lot is folding code, that way the edited file is easier to maintain. However each time I start the editor I again have to fold every function because these settings are not stored.

After some experimenting I found the following simple solution to this problem:

Right before the block that you want to fold you place the following define:
#define FOLDINGSTART {
and directly after the block you place:
#define FOLDINGEND }

Now you have created the ability to fold the complete block between FOLDINGSTART and FOLDINGEND. Of course it is still not stored but at least you don't have to manually fold all the seperate functions and other code fragments by hand.

Arie