def test(): from qt import QWidget class W(QWidget): def __init__(self): QWidget.__init__(self) def create(): global _list s = SampleControl() s.load('/home/ajole/wav/trance.wav') s.slotStart() s.slotSetZone(0, True) _list.append(s) import pkaudio from qt import QApplication, QPushButton, QObject, SIGNAL pkaudio.connect_to_host(startserver=0) a = QApplication([]) w1 = SampleControl() w1.load('/home/ajole/wav/track.wav') w1.slotStart() w1.slotSetZone(0, True) b = QPushButton('create', None) QObject.connect(b, SIGNAL('clicked()'), create) b.show() a.setMainWidget(b) a.exec_loop()
def main(argv): filename = argv.pop() app = QApplication(argv) demo = Demo(filename) app.setMainWidget(demo) demo.show() app.exec_loop()
def main(): """ Start function. """ application = QApplication(sys.argv) splashScreen = utils.showSplash("splash_datafinder_admin.png") splashScreen.show() repositoryManager = RepositoryManager() repositoryManager.load() adminMainWindow = AdminMain(repositoryManager) application.connect(application, SIGNAL("lastWindowClosed()"), application, SLOT("quit()")) application.setMainWidget(adminMainWindow) screen = QApplication.desktop().screenGeometry() adminMainWindow.move(QPoint(screen.center().x() - adminMainWindow.width() / 2, screen.center().y() - adminMainWindow.height() / 2)) adminMainWindow.show() splashScreen.close(True) adminMainWindow.fileConnectSlot() application.exec_loop()
def main(): """ Start function. """ application = QApplication(sys.argv) splashScreen = utils.showSplash("splash_datafinder_admin.png") splashScreen.show() repositoryManager = RepositoryManager() repositoryManager.load() adminMainWindow = AdminMain(repositoryManager) application.connect(application, SIGNAL("lastWindowClosed()"), application, SLOT("quit()")) application.setMainWidget(adminMainWindow) screen = QApplication.desktop().screenGeometry() adminMainWindow.move( QPoint(screen.center().x() - adminMainWindow.width() / 2, screen.center().y() - adminMainWindow.height() / 2)) adminMainWindow.show() splashScreen.close(True) adminMainWindow.fileConnectSlot() application.exec_loop()
self.setOrientation(QSplitter.Horizontal) self.listbox = QListView(self) #self.insertWidget(self.listbox) self.notebook = QTabBar(self) #self.addWidget(self.notebook) cfg = PaellaConfig('database') conn = PaellaConnection() cursor = StatementCursor(conn) app = QApplication(sys.argv) #lv = QListView(None) #lv.addColumn('section') #for s in cursor.tables(): # lv.insertItem(QListViewItem(lv, s)) #lv.show() hello = QLabel('<font color=blue>%s <i>Qt!</i></font>' % str(cfg.section), None) #lb = Listbox(None, cursor.select(table='gunny_templates')) ln = ListNotebook() ln.show() ln.listbox.addColumn('table') for t in cursor.tables(): ln.listbox.insertItem(QListViewItem(ln.listbox, t)) app.setMainWidget(ln) hello.show() hello.setText(str(cfg.sections())) app.exec_loop()
self.resetButtons() return def stopCommand(self): self.resetButtons() self.process.tryTerminate() QTimer.singleShot(5000, self.process, SLOT("kill()")) def readOutput(self): self.textBrowser.append(QString(self.process.readStdout())) def readErrors(self): self.textBrowser.append("error: " + QString(self.process.readLineStderr())) def resetButtons(self): self.startButton.setEnabled(True) self.stopButton.setEnabled(False) if __name__ == "__main__": app = QApplication(sys.argv) window = Window() app.setMainWidget(window) window.show() sys.exit(app.exec_loop())
import sys from qt import QApplication, QPushButton app=QApplication(sys.argv) button=QPushButton(None) button.setText("Hello World") app.setMainWidget(button) button.show() app.exec_loop()
def main(args): app = QApplication(args) demo = make() app.setMainWidget(demo) app.exec_loop()
db.open() else: raise Error, 'bad db' s = Statement() cursor = QSqlCursor(None, True, QSqlDatabase.database(dbdriver, True)) #s.table = 'suites' s.table = 'gunny_templates' #query = QSqlQuery(q) #cursor = query print cursor.execQuery(str(s)) #print q print cursor.size() print dir(cursor) fields = cursor.driver().recordInfo(cursor) for f in fields: cursor.append(f) cursor.setName(s.table) #cursor.setMode(QSqlCursor.ReadOnly) #cursor.execQuery(str(s)) dt = QDataTable(None) dt.show() dt.setSqlCursor(cursor, True, True) #dt.setSort(cursor.primaryIndex()) dt.refresh() #dt.refresh(QDataTable.RefreshAll) hello = QLabel('<font color=blue>%s <i>Qt!</i></font>' % str(s), None) app.setMainWidget(dt) hello.setText('rows returned: %s' % str(cursor.size())) hello.show() app.exec_loop()
QSplitter.__init__(self, parent, 'hsplit') self.setOrientation(QSplitter.Horizontal) self.listbox = QListView(self) #self.insertWidget(self.listbox) self.notebook = QTabBar(self) #self.addWidget(self.notebook) cfg = PaellaConfig('database') conn = PaellaConnection() cursor = StatementCursor(conn) app = QApplication(sys.argv) #lv = QListView(None) #lv.addColumn('section') #for s in cursor.tables(): # lv.insertItem(QListViewItem(lv, s)) #lv.show() hello = QLabel('<font color=blue>%s <i>Qt!</i></font>' % str(cfg.section), None) #lb = Listbox(None, cursor.select(table='gunny_templates')) ln = ListNotebook() ln.show() ln.listbox.addColumn('table') for t in cursor.tables(): ln.listbox.insertItem(QListViewItem(ln.listbox, t)) app.setMainWidget(ln) hello.show() hello.setText(str(cfg.sections())) app.exec_loop()
def __prepare(self, hostUri, configurationPath, dataPath, username, password): """ Performs basic checks in thread. """ try: self.__model.prepareConfiguration(hostUri, configurationPath, dataPath, username, password) except ConfigurationError, error: self.__errorMessage = error.message def __performConfigurationCreation(self, overwrite): """ Performs the configuration creation and handles errors. """ try: self.__model.createConfiguration(overwrite) except ConfigurationError, error: self.__errorMessage = error.message def __getView(self): """ Returns the generated view class. """ return self.__view.view view = property(__getView) # simple self-test if __name__ == "__main__": application = QApplication(sys.argv) controller = CreateConfigurationController() application.setMainWidget(controller.view) application.exec_loop()
""" Performs basic checks in thread. """ try: self.__model.prepareConfiguration(hostUri, configurationPath, dataPath, username, password) except ConfigurationError, error: self.__errorMessage = error.message def __performConfigurationCreation(self, overwrite): """ Performs the configuration creation and handles errors. """ try: self.__model.createConfiguration(overwrite) except ConfigurationError, error: self.__errorMessage = error.message def __getView(self): """ Returns the generated view class. """ return self.__view.view view = property(__getView) # simple self-test if __name__ == "__main__": application = QApplication(sys.argv) controller = CreateConfigurationController() application.setMainWidget(controller.view) application.exec_loop()