The object splitters is finally added in the top level window. This splitter object splitter1 and a bottom frame object are added in another splitter, splitter2, vertically. The following example has a splitter object, splitter1, in which a frame and QTextEdit object are horizontally added. SplitterMoved() is the only signal emitted by QSplitter object whenever the splitter handle is dragged. Returns the number of widgets in splitter widget Sets the layout of splitter to Qt.Horizontal or Qt.Vertical Returns the index of the widget in the layout The widgets in a QSplitter object are laid horizontally by default although the orientation can be changed to Qt.Vertical.įollowing are the methods and signals of QSplitter class − Sr.No. The Splitter control provides a handle that can be dragged to resize the controls. menuBar().This is another advanced layout manager which allows the size of child widgets to be changed dynamically by dragging the boundaries between them. clearRecentAct = QAction( "Liste löschen", self, triggered = self. # get default selection format from view's palette Print, statusTip = "Dokument drucken", triggered = self. printAct = QAction( "Drucken", self, shortcut = QKeySequence.
Print, statusTip = "Druckvorschau", triggered = self. printPreviewAct = QAction( "Druckvorschau", self, shortcut = QKeySequence. setIcon( QIcon( ':/icons/edit-find-and-replace')) repAllAct = QPushButton( "alles ersetzen") aboutQtAct = QAction( QIcon( ':/icons/help-about'), "über Qt", self, redoAct = QAction( QIcon( ':/icons/edit-redo'), "Wiederholen",
undoAct = QAction( QIcon( ':/icons/edit-undo'), "Rückgängig", pasteAct = QAction( QIcon( ':/icons/edit-paste'), "Einfügen", copyAct = QAction( QIcon( ':/icons/edit-copy'), "Kopieren", self, cutAct = QAction( QIcon( ':/icons/edit-cut'), "Ausschneiden", self, StatusTip = "Programm beenden", triggered = self. exitAct = QAction( QIcon( ':/icons/application-exit'), "Beenden", self, shortcut = "Ctrl+Q", StatusTip = "Dokument unter neuem Namen speichern", saveAsAct = QAction( QIcon( ':/icons/document-save'), "Speichern als.", self, StatusTip = "Dokument speichern", triggered = self. In order to enter multi-line text, QTextEdit object is required. It provides a box in which one line of text can be entered. saveAct = QAction( QIcon( ':/icons/document-save'), "Speichern", self, QLineEdit object is the most commonly used input field. StatusTip = "Datei öffnen", triggered = self. openAct = QAction( QIcon( ':/icons/document-open'), "Öffnen.", newAct = QAction( QIcon( ':/icons/document-new'), "&Neu", self, Information, title, message, QMessageBox. "Qt and the Qt logo are trademarks of The Qt Company Ltd.") "Copyright © 2018 The Qt Company Ltd and other contributors." Message = ( "QTextEdit 1.2created by" + link + " with PyQt5" getText( self, "Ersetzen", "ersetze '" + rtext + "' durch:", QLineEdit. fromTheme( "edit-find-and-replace"), "alle Übereinstimmungen ersetzen", self. homePath() + "/Dokumente/Unbenannt.txt", "Text Dateien (*.txt)" )Ĭmenu = self. getSaveFileName( self, "Speichern als.", QDir. curFile, "Text Dateien (*.txt)")įileName, _ = QFileDialog. getSaveFileName( self, "Speichern als.", self. showMessage( "kein Text")įileName, _ = QFileDialog. homePath() + "/Dokumente", "Text Dateien (*.txt *.csv *.sh *.py) alle Dateien (*.*)") getOpenFileName( self, "Datei öffnen", QDir. documentWasModified)įileName, _ = QFileDialog.
settings = QSettings( "QTextEdit", "QTextEdit") QTextEdit, QPushButton, QLineEdit, QMenu, QInputDialog) QtWidgets import ( QAction, QApplication, QFileDialog, QMainWindow, QMessageBox, QtGui import QIcon, QKeySequence, QTextCursor, QTextCharFormat, QPaletteįrom PyQt5. QtCore import ( QFile, QFileInfo, QPoint, QSettings, QSize, Qt, QTextStream, QByteArray,įrom PyQt5.