Advertisement
Ollii

QFileDialog goes wrong

Jan 19th, 2014
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.01 KB | None | 0 0
  1. class MainWindow(QtWidgets.QMainWindow):
  2.    
  3.     """Main window in GUI.
  4.  
  5.    Attributes:
  6.    
  7.    Methods:
  8.    """
  9.  
  10.     def __init__(self, app, parent=None):
  11.         """Initializes all childs and layouts for MainWindow"""
  12.        
  13.         # base class constructor
  14.         super(MainWindow, self).__init__(parent)
  15.        
  16.         # create child widgets
  17.         menu_bar = MenuBar(app, self)
  18.         self.setMenuBar(menu_bar)
  19.        
  20.         central_widget = QtWidgets.QWidget(self)
  21.         widgets = [ UrlWidget(self), ButtonBar(self), HistoryWidget(self), OutputWidget(self) ]
  22.          
  23.         # set central widget layout and add widgets
  24.         set_layout(central_widget, QtWidgets.QVBoxLayout(), widgets)
  25.  
  26.         # set central_widget as central layout for self and edit window title
  27.         self.setCentralWidget(central_widget)
  28.         self.setWindowTitle("Konbāta")
  29.        
  30.         path = QtWidgets.QFileDialog.getOpenFileName(self, caption="Select an output folder", directory="home/olivier/")[0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement