[Kde-bindings] Qt, Qyoto buttons work intermediately

linuxoid.au at gmail.com linuxoid.au at gmail.com
Tue Feb 16 09:29:11 UTC 2010


> I need the exact code please. With code snippets alone I can't reproduce what 
> you did there.

Please download the code from here: http://qt-giraff.svn.sourceforge.net/viewvc/qt-giraff/trunk/source/

MainApplication - main window class
startui - 1st stacked widget page
basicvideo.cs - 2nd stacked widget page

What I want to do is to take all these signals from StartVideoCodec() in MainApplication and corresponding SLOTS:

		private void StartVideoCodec() {
		    basicVideoPage = new QWidget();
			stackWidget.AddWidget(basicVideoPage);
			stackWidget.SetCurrentIndex(1);
			basicvideowin = new BasicVideoWindowUI();
			basicvideowin.BasicVideoUI(this, basicVideoPage);
			Connect(basicvideowin.txtSource, SIGNAL("textChanged(QString)"), this, SLOT("enableStart()")); // - this one
			Connect(basicvideowin.btnSource, SIGNAL("clicked()"), this, SLOT("GetSource()")); // - this one
			Connect(basicvideowin.btnDestination, SIGNAL("clicked()"), this, SLOT("GetDestination()")); // - this one
			Connect(basicvideowin.btnStart, SIGNAL("clicked()"), this, SLOT("StartCodec()")); // - this one
			Connect(basicvideowin.btnQuit, SIGNAL("clicked()"), qApp, SLOT("quit()")); // - this one
		}

		[Q_SLOT]
		private void GetSource() {
			string dir = QFileDialog.GetExistingDirectory(this);
			basicvideowin.txtSource.Text = dir;
		}
		
		[Q_SLOT]
		private void GetDestination() {
			string dir = QFileDialog.GetExistingDirectory(this);
			basicvideowin.txtDestination.Text = dir;
		}
		
		[Q_SLOT]
		private void StartCodec() {
				string param = "kwrite " + QFileDialog.GetOpenFileName(this);
				QProcess play = new QProcess(this);
				play.Start(param);
		}
		
and use them from the BasicVideoWindowUI class instead. Othewise it looks like I have to pile up all signals/slots from all separate classes into the MainApplication class, otherwise they won't work.



More information about the Kde-bindings mailing list