<?xml version="1.0" encoding="UTF-8" ?><rdf:RDF 
  xmlns="http://purl.org/rss/1.0/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xml:lang="ja">
  <channel rdf:about="http://w.atwiki.jp/qtlab/">
    <title>qtlab</title>
    <link>http://w.atwiki.jp/qtlab/</link>
    <atom:link href="https://w.atwiki.jp/qtlab/rss10.xml" rel="self" type="application/rss+xml" />
    <atom:link rel="hub" href="https://pubsubhubbub.appspot.com" />
    <description>qtlab</description>

    <dc:language>ja</dc:language>
    <dc:date>2013-08-02T14:04:57+09:00</dc:date>
    <utime>1375419897</utime>

    <items>
      <rdf:Seq>
                <rdf:li rdf:resource="https://w.atwiki.jp/qtlab/pages/30.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/qtlab/pages/29.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/qtlab/pages/28.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/qtlab/pages/27.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/qtlab/pages/26.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/qtlab/pages/25.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/qtlab/pages/24.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/qtlab/pages/23.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/qtlab/pages/22.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/qtlab/pages/21.html" />
              </rdf:Seq>
    </items>
	
		
    
  </channel>
    <item rdf:about="https://w.atwiki.jp/qtlab/pages/30.html">
    <title>メニューバー</title>
    <link>https://w.atwiki.jp/qtlab/pages/30.html</link>
    <description>
      **メニューバーの表示と非表示

	//表示
	menuBar-&gt;setVisible(true);

	//非表示
	menuBar-&gt;setVisible(false);    </description>
    <dc:date>2013-08-02T14:04:57+09:00</dc:date>
    <utime>1375419897</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/qtlab/pages/29.html">
    <title>キーボード押下</title>
    <link>https://w.atwiki.jp/qtlab/pages/29.html</link>
    <description>
      **キープレスイベントの実装
ヘッダーにプロテクトで宣言

	protected:
	//イベント関数
	void keyPressEvent(QKeyEvent *event);

関数のソースは以下
	//========================================
	//キープレスイベント キーが押されたとき
	//========================================
	void YLAnalys::keyPressEvent(QKeyEvent *event)
	{
		switch(event-&gt;key())
		{
		//Mキーが押されたとき
		case Qt::Key_M:
			//Mボタンが押された時の処理
			
			break;
			
		//デフォルトでの処理
		default:
			break;
		}
	}    </description>
    <dc:date>2013-08-02T13:59:04+09:00</dc:date>
    <utime>1375419544</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/qtlab/pages/28.html">
    <title>PDF出力</title>
    <link>https://w.atwiki.jp/qtlab/pages/28.html</link>
    <description>
      **QPrinterを使ってPDF出力

	//QPrinterの設定
	QPrinter printer(QPrinter::ScreenResolution);
	
	//プリンターダイアログの設定を開く
	QPrintDialog printDialog(&amp;printer, this);		//プリンターの設定ダイアログ
	
	//出力ファイルの名前設定 フォーマット設定
	printer.setOutputFileName(&quot;test.pdf&quot;);			//出力ファイル名
	printer.setOutputFormat(QPrinter::PdfFormat);	//出力フォーマット
	printer.setOrientation(QPrinter::Landscape);	//縦・横
	printer.setPaperSize(QPrinter::A4);				//出力サイズ
	
	//OKなら
	if(printDialog.exec() == QDialog::Accepted)		//プリンタの設定画面表示
	{
		//ペインターに出力
		QPainter painter(&amp;printer);		//prinnterとPainterを接続
		QRect rect = painter.viewport();
		QSize size = image.size();
		size.scale(rect.size(), Qt::KeepAspectRatio);
	
		//サイズの指定
		painter.setViewport(rect.x(), rect.y(), size.width(), size.height());
		painter.setWindow(image.rect());
	
		//QImageをPainterに描画
		painter.drawImage(0, 0, image);
	}    </description>
    <dc:date>2013-03-13T14:41:35+09:00</dc:date>
    <utime>1363153295</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/qtlab/pages/27.html">
    <title>QGraphicsViewへの表示</title>
    <link>https://w.atwiki.jp/qtlab/pages/27.html</link>
    <description>
      **unsigned char データからの描画
unsigned char image_data_rgba データからの描画ソース

↓メンバ変数として宣言・コンストラクタで初期化
	mScene = new QGraphicsScene();
	graphicsView-&gt;setScene(mScene);
	mPixmapItem = new QGraphicsPixmapItem();

↓描画時に呼び出し
	//QImage作成
	QImage fixedImage(image_data_rgba, sizeX, sizeY, QImage::Format_ARGB32_Premultiplied);
	QPixmap *pixmap = new QPixmap();
	pixmap-&gt;convertFromImage(fixedImage);
	mPixmapItem = mScene-&gt;addPixmap(*pixmap);


**QGraphicsViewを透過して配置
QｔDesignerのQGraphicsViewのプロパティ設定で
Styleseetを background: transparent に設定する。    </description>
    <dc:date>2013-08-01T13:03:03+09:00</dc:date>
    <utime>1375329783</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/qtlab/pages/26.html">
    <title>タイマー</title>
    <link>https://w.atwiki.jp/qtlab/pages/26.html</link>
    <description>
      **タイマーイベントの追加

①タイマーイベント関数を追加（※protected で宣言）
	//========================================
	//タイマーイベント（一定時間ごとに発生）
	//========================================
	void window::timerEvent(QTimerEvent *)
	{
		//処理の記述
	}

②タイマーイベントを有効にする
	int myTimerID = startTimer(1000);
　引数 startTimer
 int タイマーイベント発生間隔 [msec]

③タイマーイベントを無効にする
	killTimer(myTimerID);
　startTimer 関数で取得したIDを渡してタイマーを無効にする    </description>
    <dc:date>2013-03-11T14:15:58+09:00</dc:date>
    <utime>1362978958</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/qtlab/pages/25.html">
    <title>設定の保存・読込</title>
    <link>https://w.atwiki.jp/qtlab/pages/25.html</link>
    <description>
      **設定の保存・読込
-設定の保存

☆ラインエディットの保存

	//設定名の保存　独自名
	QSettings setting(&quot;RSLM&quot;,&quot;LumAnlyzeParameter&quot;);
	
	setting.setValue(&quot;設定名&quot;, (値)uiRecipe.lightSpanEdit-&gt;text());

☆ラインエディットの読込

	//設定名の読込　独自名
	QSettings setting(&quot;RSLM&quot;,&quot;LumAnlyzeParameter&quot;);
	
	uiRecipe.lightSpanEdit-&gt;setText(setting.value(&quot;設置値名&quot;, 初期値).toString());    </description>
    <dc:date>2012-12-11T13:31:28+09:00</dc:date>
    <utime>1355200288</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/qtlab/pages/24.html">
    <title>QMessageBox</title>
    <link>https://w.atwiki.jp/qtlab/pages/24.html</link>
    <description>
      **メッセージボックス
-標準メッセージボックス
ボタン三つ配置

	//テストメッセージボックス
	QMessageBox messageBox(tr(&quot;キャプション&quot;), tr(&quot;メッセージ&quot;), QMessageBox::Warning, 
	Button1, Button2, Button3);

☆引数 
	キャプション　[[QString]]　QString::fromLocal8Bit(&quot;タイトル&quot;)
	メッセージ　  QString　QString::fromLocal8Bit(&quot;メッセージ&quot;)
	アイコン　　　QMessageBox:: Warning など
	Button1~3　 QMessageBox:: Yes, No など

-警告など表示するだけのもの
	QMessageBox msgBox;	//宣言
	msgBox.setText(&quot;完了！&quot;);	//表示テキストセット
	msgBox.exec();		//表示     </description>
    <dc:date>2013-01-10T12:07:28+09:00</dc:date>
    <utime>1357787248</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/qtlab/pages/23.html">
    <title>URLオープン</title>
    <link>https://w.atwiki.jp/qtlab/pages/23.html</link>
    <description>
      **URLおーぷえん
アプリケーション上より、
ウェブURLやローカルのファイルを開く場合

↓WEBアドレスを開く
	QUrl url = QUrl( &quot;WEBアドレス&quot;);
	QDesktopServices::openUrl( url );

↓ローカルファイルを開く
	QUrl url = QUrl::fromLocalFile( &quot;ローカルパス&quot;);
	QDesktopServices::openUrl( url );    </description>
    <dc:date>2012-09-27T11:51:52+09:00</dc:date>
    <utime>1348714312</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/qtlab/pages/22.html">
    <title>ドラッグ＆ドロップ</title>
    <link>https://w.atwiki.jp/qtlab/pages/22.html</link>
    <description>
      **ドラッグ＆ドロップイベントの取得
-GraphicsViewでのファイル名取得

①QUrlをインクルード
②コンストラクタでドラッグ受け取りの許可をする。
　　setAcceptDrops( true );
③ドラッグの二つのイベントをオーバーライドする。
    void dragMoveEvent( QDragMoveEvent *e ) {}
    void dragLeaveEvent( QDragLeaveEvent * e ) {}
④ドラッグ・ドロップのイベント関数を表記
　　//========================================
　　//ドラッグイベント
　　//========================================
　　void QGraphicsViewEx::dragEnterEvent(QDragEnterEvent *e) 
　　{
	e-&gt;accept();

	if(e-&gt;mimeData()-&gt;hasFormat(&quot;text/uri-list&quot;))
	{
		//これがないと受付られない。
		e-&gt;acceptProposedAction();
	} 
　　}

　　//========================================
　　//ドロップイベント
　　//========================================
　　void QGraphicsViewEx::dropEvent(QDropEvent *e)
　　{
	//ドロップの際の動作を記述
	std::string str = e-&gt;mimeData()-&gt;urls().first().toLocalFile().toLocal8Bit　　();//first().toLocal8Bit();

	//とりあえず描画
	this-&gt;DrawImage(str);

　　}    </description>
    <dc:date>2012-08-03T10:04:33+09:00</dc:date>
    <utime>1343955873</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/qtlab/pages/21.html">
    <title>スタイル</title>
    <link>https://w.atwiki.jp/qtlab/pages/21.html</link>
    <description>
      **GUIのスタイル
[[QWidget]]の持つスタイルタイプ
	(QWidget)::setStyle(new (スタイルタイプ));
にて設定可能。
ダイアログ、メッセージボックスにも設定可能。
設定できるスタイルタイプは以下の7つ。

	this-&gt;setStyle(new QPlastiqueStyle);
	this-&gt;setStyle(new QWindowsXPStyle);
	this-&gt;setStyle(new QWindowsVistaStyle);
	this-&gt;setStyle(new QCDEStyle);
	this-&gt;setStyle(new QCleanlooksStyle);
	this-&gt;setStyle(new QWindowsStyle);
	this-&gt;setStyle(new QMotifStyle);    </description>
    <dc:date>2012-07-30T13:36:31+09:00</dc:date>
    <utime>1343622991</utime>
  </item>
  </rdf:RDF>
