LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-10-2007, 03:10 PM   #1
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Rep: Reputation: 50
python + qt/kde: layout problems


I am trying to make a small and simple application using pykde and pyqt.. I have figured out how to create a statusbar and menubar, but when I add something "in the middle" it gets placed underneath the menubar.. I use a KListView as an example here but it doesn't matter what widget I use.

I want the widget to be placed below the menubar, not underneath it.

The code (not all of the code is shown):
Code:
class MainWindow(KMainWindow):
        def __init__(self):
                KMainWindow.__init__(self)

                self.view = KListView(self)
                self.view.addColumn("this text is not visible")
                self.view.resize(300, 250)
                self.view.show()

                self.setCaption(i18n("Simple example"))

                self.file = QPopupMenu()
                self.file.insertItem(i18n("&Exit"), self.slotExit)

                self.menu = self.menuBar()
                self.menu.insertItem(i18n("&File"), self.file)
                self.menu.insertItem(i18n("&Help"), KHelpMenu(self, aboutData, 0).menu())

                #self.tb = self.toolBar()
                #self.tb.insertButton(Icon("exit.xpm"), MainWindow.TOOLBAR_EXIT, 1, i18n("Exit"))
                #self.connect(self.toolBar(), SIGNAL("clicked(int)"), self.slotToolbarClicked)

                self.statusbar = self.statusBar()
                self.statusbar.insertItem(i18n("Test statusbar"), ID_WELCOME, 1)


        #def closeEvent(self, QCloseEvent):
        #       QCloseEvent.accept()


        #
        # Slots
        #                
        def slotExit(self):
                self.close()

 
# main
app = KApplication()
mw = MainWindow()
mw.resize(500, 400)
mw.show()       
app.exec_loop()
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Keyboard layout on RH 9.0 with KDE is gone. massacre Linux - Newbie 2 07-27-2005 05:39 AM
Keyboard layout switching in KDE kornerr Linux - General 2 02-04-2005 09:16 AM
kde: change keyboard layout kpachopoulos Linux - Newbie 3 09-29-2004 03:01 PM
KDE 3.1 & Keyb Layout ..:eMa:.. Slackware 7 09-25-2003 10:41 AM
KDE virtual desktop layout Marcos Van Linux - Newbie 1 05-07-2003 06:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration