/div

The other side

Posts

  • Parámetros de main, argc y argv

     The other side

    Hace un rato, por medio de comentarios (1 y 2) aclaré que significaban los parámetros de la función main(argc, argv). Pues retomo y doy un ejemplo. Ambas variables contienen la información de los argumentos que se enviaron al programa cuando se indicó su ejecución desde la línea de comandos. El primero de los parámetros es argc y es un entero, cuyo valor es el número elementos utilizados durante la llamada del programa, esto quiere decir, que tambien se incluye el nombre del programa, tal y como fue llamado. El segundo es un arreglo de char* el cual contiene el valor de cada argumento pasado al programa. Ejemplos:
    • cat /etc/hosts (linux) El valor para argc será 2, el primer argumento es cat y el segundo /etc/hosts
    • type c:\windows\system32\drivers\etc\hosts (windows) El valor para argc será tambien 2, el primer argumento es type y el segundo c:\windows\system32\drivers\etc\hosts
    • copy c:\windows\setuplog.txt c:temp (windows) argc tendrá un valor igual a 3, mientras que en argv los valores seran [copy, c:\windows\setuplog.txt, c:\temp]
    • top -b -n 1 (linux) En este caso, 4 parametros, el valor de argc, y argv = [top, -b, -n, 1]. Para aquellos que conocen este comando en linux, sabran que -n 1 especifica que se realice una sola iteración, en una situacion similar, por supuesto que es el programador el que deberá determinar por el orden de los argumentos, los modificadores que se apliquen a las opciones aplicadas al comando.
    Esta es la forma que se tiene para la obtención de los argumentos de llamada del programa y nos viene desde c, no es algo propio o exclusivo de Qt o c++. El compilador, a menos que se especifique lo contrario, informará de todos aquellos argumentos de funciones que no se estan utilizando, que por algun motivo se incluyeron en el encabezado, algo razonable. En Qt, el macro En Qt, el macro Q_UNUSED, se utiliza para indicar que no se debe indicar la no utilización de algun parametro, y por lo que no se tendran mensajes que adviertan sobre esto. Q_UNUSED ( name ) Este es un ejemplo simple, para algo que en realidad lo es. Al ejecutarse, se imprime el numero de argumentos y luego cada uno de ellos.  
    #include  <QtDebug>
    
    int main(int argc, char *argv[])
    {
            //print the parameter count
            qDebug() << "Parameter count: " << argc;
    
            //print every parameter used to call the program.
            //The entry 0 will the the called program
            for (int i = 0; i < argc; i++)
                    qDebug() << "Parameter " << i << " value: " << QString(argv[i]);
    
            return argc;
    }
      Para correr este ejemplo bastaría con crear un nuevo proyecto desde Qt Creator de tipo Console Application. Los argumentos para el programa se especifican en la configuración de proyecto, en el tab Run settings, separados por un espacio entre cada uno de ellos.   Si esta entrada te ha servido de algo, deja un comentario como realimentación :)
  • Sobre la nueva relación Nokia - Microsoft [caption id="" align="aligncenter" width="250" caption="QT - Code less. Create more. Deploy everywhere"] The other side[/caption] Hace ya una semana que se oficializó la relación entre Nokia y Microsoft. Los nuevos dispositivos de Nokia llevaran el Windows Phone 7 (WP7). Muchas son las reacciones que se han dado en estos días, entre ellos rescato algunas conclusiones con respecto a el impacto que habrá en Qt, con las que estoy de acuerdo. Nokia está dejando su herramienta de desarrollo sin posibilidad de ser utilizada para sus propios futuros teléfonos. No habrá soporte para WP7 y mucho menos para Android o algo diferente. Debo admitir que uno de mis mayores deseos era el soporte para Android en Qt de forma oficial y así no tener que experimentar y valorar el proyecto Lighthouse. Además, la creación de aplicaciones para WP7 se deberá utilizar el framework .Net, con lo que habría que invertir bastantes $$$ en Visual studio, algo que algunos desarrolladores o grupos de desarrolladores con proyectos independientes no pueden darse el lujo de adquirir. Está matando la plataforma Symbian. Nokia ha mencionado que no hay que preocuparse por Symbian, ya que habra telefonos con este sistema por algunos años, y luego qué? Qué pasara cuando los usuarios renueven sus teléfonos con WP7? No creo que los programadores que tratamos de hacer software independiente y empresas de desarrollo, se dediquen a crear software para una plataforma cuyas ventas bajaran. Está matando la plataforma Meego. Un dispositivo Meego? Algunos dispositivos Meego? Igual, nadie desea programar para una plataforma muerta o casi muerta. La comunidad rescatara Qt. Cierto, la comunidad lo ha hecho anteriormente y ha creado proyectos muy robustos, pero no siempre pasa así. La cantidad de commits por parte de la comunidad contra los de los programadores pagados de Nokia es insignificante. Un proyecto que no cuenta con un fuerte desarrollo, dinero para pagar programadores y/o dirección, por lo general termina en uno o más forks, cada uno con sus propias características. Como decimos en mi tierra: se embarreala la cancha (todo se complica y confunde). Algunos programadores en sus comentarios en el blog oficial de Qt han expresado que de darse el fork (por el cual algunos ya están clamando), decidirán si continúan desarrollando en Qt dependiendo de qué tan fuerte sea el que tome la responsabilidad del fork. Desde que Nokia tomó Qt, el crecimiento en la parte desktop ha sido lento, y ahora la parte móvil se ve afectada. Muchos programadores ya han expresado un cambio de rumbo con respecto al desarrollo de su software. Tendremos que estar atentos.
  • QString::split manteniendo un separador El método QString::split permite separar un string en múltiples partes delimitadas por un separador, el cual, en este caso esta definido por una expresión regular. También existe una versión en la que el separador esta constituido por un char o un string. Trabajando en un experimento, me vi con la necesidad de crear una versión propia de este método. Al tener un string como este: “Substring1nSubstring2nSubstring3;Substring4nSubstring5“ y utilizar como expresión regular: "n|;" obtuve el siguiente resultado en el QstringList:

    Substring1 Substring2 Substring3 Substring4 Substring5

    lo cual es el resultado esperado. El problema vino, al necesitar que uno de los separadores se mantuviera, para mi caso “;”. Tome el código de los fuentes de Qt, he hice la modificación, dejo por acá mi versión modificada, tal vez, le pueda servir a alguna persona, que enfrente algo similar.
    QStringList string_split(const QString &str, const QRegExp &sep, const QString preserved, QString::SplitBehavior behavior = QString::KeepEmptyParts) Q_REQUIRED_RESULT;
    QStringList string_split(const QString &str, const QRegExp &rx, const QString preserved, QString::SplitBehavior behavior)
    {
    	QRegExp rx2(rx);
    	QStringList list;
    	int start = 0;
    	int extra = 0;
    	int end;
    	while ((end = rx2.indexIn(str, start + extra)) != -1)
    	{
    		int matchedLen = rx2.matchedLength();
    		if (start != end || behavior == QString::KeepEmptyParts)
    			list.append(str.mid(start, end - start + ((str.mid(end,matchedLen).contains(preserved)) ? matchedLen : 0)));
    		start = end + matchedLen;
    		extra = (matchedLen == 0) ? 1 : 0;
    	}
    	if (start != str.size() || behavior == QString::KeepEmptyParts)
    		list.append(str.mid(start));
    	return list;
    }
    Y su utilización de esta forma:
    QString tmp = "Substring1nSubstring2nSubstring3;Substring4nSubstring5";
    qDebug() << string_split(tmp, QRegExp("n|;"), ";");
    El resultado obtenido con la misma seria:

    Substring1 Substring2 Substring3; Substring4 Substring5

    Una modificación que mejore esta función seria la posibilidad que las partes producto de la separación, puedan mantener n separadores.
  • Como construir un menu de contexto con contextMenuPolicy Es normal que algunos elementos de la interfaz gráfica tengan un menú de contexto. Este menú depende, como su nombre lo indica, del contexto; la función del elemento y el estado en el que se encuentre.
    [caption id="" align="aligncenter" width="540" caption="Context menu example from the Qt Creator IDE"] The other side[/caption]
    Por ejemplo, un contenedor de texto puede tener muchas opciones para su menú de contexto, pero soló unas cuantas de estas, estarán disponibles/habilitadas para el estado del mismo. Básicamente, las opciones en este caso podrian ser:
    • Cortar
    • Copiar
    • Pegar
    • Borrar
    • Seleccionar todo
    Estando activas o no según el estado del contenedor. Si hay algún texto seleccionado, las opciones de Cortar, Copiar, Pegar y Borrar pueden estar activas. Pero en caso de no haberlo, las opciones Cortar, Copiar y Borrar podrían estar desactivadas y Seleccionar todo si. En las diferentes páginas de este post abordaré las cinco formas en la que a un widget cualquiera se le puede generar un menú de contexto. Como siempre, incluiré el código fuente de la aplicación. En Qt, el comportamiento del menú de contexto de los elementos en la interfaz gráfica es controlado por la propiedad contextMenuPolicy para cada widget, a la cual se le puede asignar un valor utilizando el método void setContextMenuPolicy(Qt::ContextMenuPolicy policy). Qt::ContextMenuPolicy es un enum con cinco diferentes formas para trabajar con los menú de contexto:
    • Qt::NoContextMenu
    • Qt::DefaultContextMenu
    • Qt::ActionsContextMenu
    • Qt::CustomContextMenu
    • Qt::PreventContextMenu
    He preparado una aplicación que mostrará la utilización de cada una de las diferentes opciones.
    [caption id="" align="aligncenter" width="540" caption="Application"] The other side[/caption]
    Como parte de esto, he creado una clase que hereda de QWidget a la cual nombre tmy_widget, esto para poder trabajar algunos eventos, necesarios para la aplicación.
    class tmy_widget : public QWidget
    {
    	Q_OBJECT
    
    public:
    	tmy_widget(QWidget *parent = 0, Qt::WindowFlags f = 0);
    	void contextMenuEvent(QContextMenuEvent *event);
    	void mouseReleaseEvent(QMouseEvent * event);
    
    private slots:
    	void action_option1_triggered();
    	void action_option2_triggered();
    	void action_option3_triggered();
    
    	void widget_custom_context_menu_requested(const QPoint &pos);
    };
    
    Los menú empleados, estan compuestos básicamente por instancias de QAction, estos objetos deben conectar su respectiva señal void QAction::triggered(bool checked = false).

    Qt::NoContextMenu

    El widget no tiene menú de contexto propio, si el padre posee uno, el widget desplegará este. Para la aplicación de ejemplo, se podrá observar el menú de la ventana principal, la cual es el padre del widget. Asigné a la propiedad contextMenuPolicy del Main Window, Qt::ActionsContextMenu.
    	this->setContextMenuPolicy(Qt::ActionsContextMenu);
    
    [caption id="" align="aligncenter" width="540" caption="Main Window menu"] The other side[/caption]
    La generación de este menú ha sido completa, es decir, generé los respectivos slots para cada QAction.
    	//QActions for the main window
    	QAction *action_main = new QAction("Option 1 MainWindow", this);
    	connect(action_main, SIGNAL(triggered()), this, SLOT(main_option1_triggered()));
    	this->addAction(action_main);
    
    	action_main = new QAction("Option 2 MainWindow", this);
    	connect(action_main, SIGNAL(triggered()), this, SLOT(main_option2_triggered()));
    	this->addAction(action_main);
    
    	action_main = new QAction("Option 3 MainWindow", this);
    	connect(action_main, SIGNAL(triggered()), this, SLOT(main_option3_triggered()));
    	this->addAction(action_main);
    
    private slots:
    	void main_option1_triggered();
    	void main_option2_triggered();
    	void main_option3_triggered();
    
    void MainWindow::main_option1_triggered()
    {
    	qDebug() < < "Main Window OPTION 1";
    }
    
    void MainWindow::main_option2_triggered()
    {
    	qDebug() << "Main Window OPTION 2";
    }
    
    void MainWindow::main_option3_triggered()
    {
    	qDebug() << "Main Window OPTION 3";
    }
    
    De este forma, al seleccionar en el combo Qt::NoContextMenu:
    	this->ui->widget->setContextMenuPolicy(Qt::NoContextMenu);
    
    Se desplegará el menú perteneciente al Main Window.
    [caption id="" align="aligncenter" width="540" caption="NoContextMenu"] The other side[/caption]

    Qt::DefaultContextMenu

    Si el widget tiene algun menú de contexto predefinido, este será el que se desplegará, como en el caso de un QTextEdit (ver detalle más abajo). En caso de ser un widget sin un menú de contexto predefinido, se disparará el evento void QWidget::contextMenuEvent(QContextMenuEvent *event). El cual ha sido reimplementado de la siguiente forma, para generar el menu de contexto:
    void contextMenuEvent(QContextMenuEvent *event);
    
    void tmy_widget::contextMenuEvent(QContextMenuEvent *event)
    {
    	QMenu menu(this);
    	qDebug() < < "Reimplementacion: void QWidget::contextMenuEvent ( QContextMenuEvent * event )";
    
    	menu.addAction("Event context menu Option 1");
    	menu.addAction("Event context menu Option 2");
    	menu.addAction("Event context menu Option 3");
    
    	menu.exec(event->globalPos());
    }
    
    Esto, en la clase tmy_widget. Se podrá utilizar un menú de contexto de esta forma, seleccionando en el combo Qt::DefaultContextMenu.
    	this->ui->widget->setContextMenuPolicy(Qt::DefaultContextMenu);
    
    [caption id="" align="aligncenter" width="540" caption="DefaultContextMenu"] The other side[/caption]
    Tal y como mencione algunos widgets por su función y contexto pueden tener un menú de contexto predefinido (talvez llamado, auto generado) y mencioné el QTextEdit. En esta clase esta definido el metodo QMenu *QTextEdit::createStandardContextMenu(const QPoint &position) que retorna el QMenu ya construido, con las opciones establecidas.

    Qt::ActionsContextMenu

    El widget desplegará un menú basado en los QAction que se hayan agregado al mismo, por medio del método void QWidget::addAction(QAction *action), justamente como está definido el menú de la Main Window también. El texto desplegado para cada "item" del menú creado de esta forma será el parámetro text en caso de utilizar el constructor QAction::QAction(const QString &text, QObject *parent); si, en otro caso se utilizará el contructor QAction::QAction(QObject *parent), el método void setText ( const QString & text ) podrá asignar el texto a cada QAction para su despliegue en el menú. El tooltip o hint como se le llama en otros ambientes, será el mismo texto; en caso de desearse uno diferente, se podrá utilizar el método void setToolTip(const QString &tip) para asignarlo. Para este caso, también he generado los respectivos slots, y los he conectado a las señales de cada QAction.
    	QAction *action = new QAction("ACTION Option 1", this->ui->widget);
    	connect(action, SIGNAL(triggered()), this->ui->widget, SLOT(action_option1_triggered()));
    	this->ui->widget->addAction(action);
    
    	action = new QAction("ACTION Option 2", this->ui->widget);
    	connect(action, SIGNAL(triggered()), this->ui->widget, SLOT(action_option2_triggered()));
    	this->ui->widget->addAction(action);
    
    	action = new QAction("ACTION 1Option 3", this->ui->widget);
    	connect(action, SIGNAL(triggered()), this->ui->widget, SLOT(action_option3_triggered()));
    	this->ui->widget->addAction(action);
    
    private slots:
    	void action_option1_triggered();
    	void action_option2_triggered();
    	void action_option3_triggered();
    
    void tmy_widget::action_option1_triggered()
    {
    	qDebug() < < "ACTION OPTION 1";
    }
    
    void tmy_widget::action_option2_triggered()
    {
    	qDebug() << "ACTION OPTION 2";
    }
    
    void tmy_widget::action_option3_triggered()
    {
    	qDebug() << "ACTION OPTION 3";
    }
    
    Esta forma se podrá utilizar al seleccionar en el combo Qt::ActionsContextMenu
    this->ui->widget->setContextMenuPolicy(Qt::ActionsContextMenu);
    
    Como nota muy personal, esta y la siguiente, son las opciones que me parecen más comodas para generar los menú de contexto.
    [caption id="" align="aligncenter" width="540" caption="ActionsContextMenu"] The other side[/caption]

    Qt::CustomContextMenu

    En este caso se emite la señal void QWidget::customContextMenuRequested(const QPoint &pos), la cual puede ser conectada a un slot. Y construir en este slot, el menú a desplegar. En este caso no he definido los QAction, separadamente, he utilizado el método QAction *QMenu::addAction(const QString &text) definido en el QMenu para agregar directamente un void QWidget::addAction(QAction *action) al menú.
    void widget_custom_context_menu_requested(const QPoint &pos);
    
     void tmy_widget::widget_custom_context_menu_requested(const QPoint &pos)
    {
    	QMenu menu(this);
    	qDebug() < < "Slot for signal void QWidget::customContextMenuRequested ( const QPoint & pos )   [signal]";
    
    	menu.addAction("Signal context menu Option 1");
    	menu.addAction("Signal context menu Option 2");
    	menu.addAction("Signal context menu Option 3");
    
    	menu.exec(this->mapToGlobal(pos));
    }
    
    Esta opción se podrá probar seleccionando Qt::CustomContextMenu en el combo.
    this->ui->widget->setContextMenuPolicy(Qt::CustomContextMenu);
    
    [caption id="" align="aligncenter" width="540" caption="CustomContextMenu"] The other side[/caption]

    Qt::PreventContextMenu

    No se despliega un menú de contexto, ni siquiera el del padre. Todos los eventos del boton derecho del mouse, del widget son enviados a él mismo, a traves de los eventos void QWidget::mousePressEvent(QMouseEvent *event) y void QWidget::mouseReleaseEvent(QMouseEvent *event). Un menú también puede ser construido acá, de ser necesario o desearse.
    void mouseReleaseEvent(QMouseEvent * event);
    
     void tmy_widget::mouseReleaseEvent(QMouseEvent * event)
     {
    	if (Qt::RightButton == event->button())
    	{
    		QMenu menu(this);
    		qDebug() < < "Reimplementacion: void mouseReleaseEvent(QMouseEvent * event)";
    
    		menu.addAction("Mouse release event menu Option 1");
    		menu.addAction("Mouse release event menu Option 2");
    		menu.addAction("Mouse release event menu Option 3");
    
    		menu.exec(event->globalPos());
    	}
     }
    
    La última opción para la generación de un menú. Esto, seleccionando en el combo Qt::PreventContextMenu
    this->ui->widget->setContextMenuPolicy(Qt::PreventContextMenu);
    
    [caption id="" align="aligncenter" width="540" caption="PreventContextMenu"] The other side[/caption]

    Código fuente

  • De 0 a Hello World en pocos pasos Un pequeño ejemplo, conectando un signal de un boton a un slot definido en el main form. Al dar click en el boton, el texto "Hello World!!!" se imprimirá en una etiqueta. Algunos conceptos previos: QPushButton QLabel Signals and Slots QObject::connect Header:
    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    
    #include <QtGui/QMainWindow>
    
    namespace Ui
    {
    	class MainWindow;
    }
    
    class MainWindow : public QMainWindow
    {
    	Q_OBJECT
    
    	public:
    		MainWindow(QWidget *parent = 0);
    		~MainWindow();
    	private:
    		Ui::MainWindow *ui;
    	private slots:
    		//define the slot
    		void hello_world_button_clicked();
    };
    
    #endif // MAINWINDOW_H
    Code:
    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    
    MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
    {
    	ui->setupUi(this);
    	//connect the button signal clicked with the slot defined
    	connect(this->ui->hello_world_button, SIGNAL(clicked()), this, SLOT(hello_world_button_clicked()));
    }
    
    MainWindow::~MainWindow()
    {
    	delete ui;
    }
    //slot code
    void MainWindow::hello_world_button_clicked()
    {
    	//set the text for the label
    	this->ui->hello_world_label->setText("Hello World!!!");
    }

    Código fuente

  • Leer y escribir archivos binarios usando QDataStream Este post es muy similar al anterior sólo que el archivo no contiene texto, mas bien es una serie de registros con PDT's (Primitive Data Types), lo cual puede servir para tener una idea, para el manejo datos binarios en archivos. En este caso, la clase a utilizada es QDataStream.
    #include <QFile>
    #include <QDataStream>
    #include <QDebug>
    
    #define string_length 20
    
    //a structure to set the information with some pdt's
    struct dummy_struct
    {
    
    	int i;
    	char c;
    	bool b;
    	float f;
    	char s[string_length];
    	//for convenience
    	void set(int i, char c, bool b, float f, const char s[])
    	{
    		this->i = i;
    		this->c = c;
    		this->b = b;
    		this->f = f;
    		for (int j = 0; j < string_length; j++)
    			this->s[j] = s[j];
    	}
    };
    
    int main(int argc, char *argv[])
    {
    	//to avoid warnings.
    	Q_UNUSED(argc);
    	Q_UNUSED(argv);
    
    	dummy_struct d;
    
    	//Open the file for writing, and set the data stream to write, to the file.
    	QFile file_for_writing("file.dat");
    	file_for_writing.open(QIODevice::WriteOnly);
    	QDataStream stream_for_writing(&file_for_writing);
    
    	//set/write the first record
    	d.set(102, 'A', true, 157.63, "First Record");
    	stream_for_writing.writeRawData(reinterpret_cast<char *>(&d), sizeof(d));
    
    	//set/write the second record
    	d.set(235, 'M', false, 290.26, "Second Record");
    	stream_for_writing.writeRawData(reinterpret_cast<char *>(&d), sizeof(d));
    
    	//set/write the third record
    	d.set(347, 'z', true, 385.48, "Third Record");
    	stream_for_writing.writeRawData(reinterpret_cast<char *>(&d), sizeof(d));
    
    	//close the file
    	file_for_writing.close();
    
    	//Open the file for reading, and set the data stream to read from the file.
    	QFile file_for_reading("file.dat");
    	file_for_reading.open(QIODevice::ReadOnly);
    	QDataStream stream_for_reading(&file_for_reading);
    
    	//read and prints the first record.
    	stream_for_reading.readRawData(reinterpret_cast<char *>(&d), sizeof(d));
    	qDebug() << d.i << " " << d.c << " " << d.b << " " << d.f << " " << d.s;
    
    	//reads and prints the second record.
    	stream_for_reading.readRawData(reinterpret_cast<char *>(&d), sizeof(d));
    	qDebug() << d.i << " " << d.c << " " << d.b << " " << d.f << " " << d.s;
    
    	//reads and prints the third record.
    	stream_for_reading.readRawData(reinterpret_cast<char *>(&d), sizeof(d));
    	qDebug() << d.i << " " << d.c << " " << d.b << " " << d.f << " " << d.s;
    
    	//close the file
    	file_for_reading.close();
    }
    Código fuente
  • Leer y escribir archivos de texto usando QTextStream Este es un ejemplo básico sobre como utilizar la clase QTextStream para escribir texto a un archivo, y tambien, para leerlo. (Archivos de texto)
    #include <QFile>
    #include <QTextStream>
    #include <QDebug>
    
    int main(int argc, char *argv[])
    {
    	//to avoid warnings.
    	Q_UNUSED(argc);
    	Q_UNUSED(argv);
    
    	QString text;
    
    	//Open the file for writing, and set the text stream to write, to the file.
    	QFile file_for_writing("file.txt");
    	file_for_writing.open(QIODevice::WriteOnly | QIODevice::Truncate); //
    	QTextStream text_stream_for_writing(&file_for_writing);
    
    	//set the text of the file
    	text = "My son ask for thyself another Kingdom, for that which I leave is too small for thee - King Philip of Macedonia";
    
    	//Write the text on the stream
    	text_stream_for_writing << text;
    
    	//close the file
    	file_for_writing.close();
    
    	//empty the text.
    	text.clear();
    
    	//Open the file for reading and set the text stream to read, from the file.
    	QFile file_for_reading("file.txt");
    	file_for_reading.open(QIODevice::ReadOnly);
    	QTextStream text_stream_for_reading(&file_for_reading);
    
    	//read 6 characters
    	qDebug() << text_stream_for_reading.read(6);
    
    	//Reset the position on the file
    	text_stream_for_reading.seek(0);
    	//read a word
    	text_stream_for_reading >> text;
    	qDebug() << text;
    
    	//Reset the position on the file
    	text_stream_for_reading.seek(0);
    	//read a line
    	qDebug() << text_stream_for_reading.readLine();
    
    	//Reset the position on the file
    	text_stream_for_reading.seek(0);
    	//read the entire content of the file
    	qDebug() << text_stream_for_reading.readAll();
    
    	//close the file
    	file_for_reading.close();
    }
    

    Código fuente

  • Http Post request usando QNetworkAccessManager Una aplicación en donde se utiliza QNetworkAccessManager y QNetworkReply para hacer un http request. El código php:
    <?php
    
    $result = "Error ABC";
    
    if ( (isset($_POST['parameter1'])) && (isset($_POST['parameter2'])) && (isset($_POST['parameter3'])) )
    {
    	if ( ($_POST['parameter1'] == '1') and ($_POST['parameter2'] == 'Z') and ($_POST['parameter3'] == "2Y") )
    	{
    		$result = "Success XYZ";
    	}
    }
    
    echo($result);
    
    ?>
    
    La definición:
    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    
    #include "ui_mainwindow.h"
    #include <QNetworkAccessManager>
    #include <QNetworkReply>
    
    class MainWindow : public QMainWindow
    {
    	Q_OBJECT
    public:
    	MainWindow(QWidget *parent = 0);
    	QNetworkAccessManager network_access_manager;
    protected:
    	void changeEvent(QEvent *e);
    private:
    	Ui::MainWindow ui;
    private slots:
    	void network_reply_finished(QNetworkReply* network_reply);
    	void request_button_clicked();
    };
    
    #endif // MAINWINDOW_H
    
    La implementación:
    #include "mainwindow.h"
    
    MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
    {
    	ui.setupUi(this);
    
    	//connects the QNetworkAccessManager object with the finished slot.
    	connect(&network_access_manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(network_reply_finished(QNetworkReply*)));
    	//connect the request button with the slot.
    	connect(this->ui.request_button, SIGNAL(clicked()), this, SLOT(request_button_clicked()));
    }
    
    void MainWindow::changeEvent(QEvent *e)
    {
    	QMainWindow::changeEvent(e);
    	switch (e->type())
    	{
    		case QEvent::LanguageChange:
    			ui.retranslateUi(this);
    			break;
    		default:
    			break;
    	}
    }
    
    //request button slot for clicked signal
    void MainWindow::request_button_clicked()
    {
    	//set the url for the request
    	QString url = "SET THE URL HERE!!!";
    	QStringList parameters;
    
    	//set the parameters for the request
    	parameters.append("parameter1=1");
    	parameters.append("parameter2=Z");
    	parameters.append("parameter3=2Y");
    
    	//make the post request
    	this->network_access_manager.post(QNetworkRequest(QUrl(url)), parameters.join("&").toUtf8());
    }
    
    //QNetworkAccessManager slot for the finished signal
    void MainWindow::network_reply_finished(QNetworkReply* network_reply)
    {
    	QVariant statusCodeV;
    	bool conversion_status = false;
    
    	// Reading attributes of the reply
    	// e.g., the HTTP status code
    	int status_code = (statusCodeV = network_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute)).toInt(&conversion_status);
    
    	//print the status code of the operation
    	if (conversion_status)
    	{
    		switch (status_code)
    		{
    			case 200:
    				this->ui.listWidget->addItem("Http status code : 200 : OK");
    				break;
    			case 304:
    				this->ui.listWidget->addItem("Http status code : 300 : Redirection");
    				break;
    			case 404:
    				this->ui.listWidget->addItem("Http status code : 404 : Not Found");
    				break;
    			case 401:
    				this->ui.listWidget->addItem("Http status code : 401 : Unauthorized");
    				break;
    			default:
    				this->ui.listWidget->addItem("Http status code : " + QString::number(status_code));
    				break;
    		}
    	}
    	else //error on conversion.
    	{
    		this->ui.listWidget->addItem("Error: conversion of status code.");
    		return;
    	}
    
    	// if no error received
    	if (network_reply->error() == QNetworkReply::NoError)
    	{
    		QByteArray data = network_reply->readAll();
    		this->ui.listWidget->addItem(QString(data));
    	}
    	// Some http error received
    	else //handle errors here
    	{
    		this->ui.listWidget->addItem("Error: " + network_reply->errorString());
    	}
    }
    

    Código fuente

  • Como usar la clase QSystemTrayIcon Por aca les dejo una pequeña aplicacion que utiliza, me parece, toda la funcionalidad del QSystemTrayIcon Espero que les sea de utilidad. La definición:
    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    
    #include "ui_mainwindow.h"
    #include "qsystemtrayicon.h"
    #include <QCloseEvent>
    #include <QMenu>
    
    class MainWindow : public QMainWindow
    {
    	Q_OBJECT
    public:
    	MainWindow(QWidget *parent = 0);
    	QSystemTrayIcon tray_icon;
    	QMenu *context_menu;
    
    protected:
    	void changeEvent(QEvent *e);
    	void showEvent(QShowEvent * event);
    	void closeEvent(QCloseEvent *event);
    
    private:
    	Ui::MainWindow ui;
    
    	void show_noicon_message(QString message = "NOICON MESSAGE", int ms_to_close = 5000);
    	void show_information_message(QString message = "INFORMATION MESSAGE", int ms_to_close = 5000);
    	void show_warning_message(QString message = "WARNING MESSAGE", int ms_to_close = 5000);
    	void show_critical_message(QString message = "CRITICAL MESSAGE", int ms_to_close = 5000);
    	QMenu *build_context_menu();
    
    public slots:
    	void noicon_pushbutton_clicked();
    	void information_pushbutton_clicked();
    	void warning_pushbutton_clicked();
    	void critical_pushbutton_clicked();
    
    	void tray_icon_message_clicked();
    
    	void tray_icon_activated(QSystemTrayIcon::ActivationReason reason);
    
    	void menu_option1_triggered();
    	void menu_option2_triggered();
    	void menu_option3_triggered();
    };
    
    #endif // MAINWINDOW_H
    La implementación:
    #include "mainwindow.h"
    #include <QDir>
    
    //usual constructor and some tray icon setup...
    MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
    {
    	ui.setupUi(this);
    
    	//connect buttons signals with slots
    	//on noicon button clicked
    	connect(this->ui.noicon_pushbutton, SIGNAL(clicked()), this, SLOT(noicon_pushbutton_clicked()));
    	//on information button clicked
    	connect(this->ui.information_pushbutton, SIGNAL(clicked()), this, SLOT(information_pushbutton_clicked()));
    	//on warning button clicked
    	connect(this->ui.warning_pushbutton, SIGNAL(clicked()), this, SLOT(warning_pushbutton_clicked()));
    	//on critical button clicked
    	connect(this->ui.critical_pushbutton, SIGNAL(clicked()), this, SLOT(critical_pushbutton_clicked()));
    
    	//connect tray icon signals with slots.
    	//on tray icon message clicked
    	connect(&tray_icon, SIGNAL(messageClicked()), this, SLOT(tray_icon_message_clicked()));
    	//connect the activated signal from the tray icon to a slot.
    	connect(&tray_icon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(tray_icon_activated(QSystemTrayIcon::ActivationReason)));
    }
    
    //auto generated :)
    void MainWindow::changeEvent(QEvent *e)
    {
    	QMainWindow::changeEvent(e);
    	switch (e->type())
    	{
    	case QEvent::LanguageChange:
    		ui.retranslateUi(this);
    		break;
    	default:
    		break;
    	}
    }
    
    //on show this window
    void MainWindow::showEvent(QShowEvent * event)
    {
    	//build the path to the icon file
    	QString icon_path = QApplication::applicationDirPath() + QDir::separator() + "icon.ico";
    
    	//check availability
    	if (QSystemTrayIcon::isSystemTrayAvailable())
    	{
    		//set the icon using the builded path
    		this->tray_icon.setIcon(QIcon(icon_path));
    		//shows the tray icon on the notification section when the window shows
    		this->tray_icon.show();
    		//set the tool tip or Hint
    		this->tray_icon.setToolTip("The ToolTip");
    		//set the context menu for the tray icon.
    		this->tray_icon.setContextMenu(this->context_menu = this->build_context_menu());
    	}
    }
    
    //on close this window
    void MainWindow::closeEvent(QCloseEvent *event)
    {
    	//hide the tray icon when closing the window
    	this->tray_icon.hide();
    	event->accept();
    }
    
    //slot for noicon button clicked
    void MainWindow::noicon_pushbutton_clicked()
    {
    	this->show_noicon_message();
    }
    
    //slot for information button clicked
    void MainWindow::information_pushbutton_clicked()
    {
    	this->show_information_message();
    }
    
    //slot for warning button clicked
    void MainWindow::warning_pushbutton_clicked()
    {
    	this->show_warning_message();
    }
    
    //slot for critical button clicked
    void MainWindow::critical_pushbutton_clicked()
    {
    	this->show_critical_message();
    }
    
    //show a noicon message
    void MainWindow::show_noicon_message(QString message, int ms_to_close)
    {
    	if (this->tray_icon.supportsMessages())
    		this->tray_icon.showMessage("No icon", message, QSystemTrayIcon::NoIcon, ms_to_close);
    }
    
    //show a information message
    void MainWindow::show_information_message(QString message, int ms_to_close)
    {
    	if (this->tray_icon.supportsMessages())
    		this->tray_icon.showMessage("Information", message, QSystemTrayIcon::Information, ms_to_close);
    }
    
    //show a warning message
    void MainWindow::show_warning_message(QString message, int ms_to_close)
    {
    	if (this->tray_icon.supportsMessages())
    		this->tray_icon.showMessage("Warning", message, QSystemTrayIcon::Warning, ms_to_close);
    }
    
    //show a critical message
    void MainWindow::show_critical_message(QString message, int ms_to_close)
    {
    	if (this->tray_icon.supportsMessages())
    		this->tray_icon.showMessage("Critical", message, QSystemTrayIcon::Critical, ms_to_close);
    }
    
    //slot for tray icon activaded
    void MainWindow::tray_icon_activated(QSystemTrayIcon::ActivationReason reason)
    {
    	//add the reason of activation, to the list widget.
    	switch (reason)
    	{
    	case QSystemTrayIcon::Unknown :
    		this->ui.listWidget->addItem("Unknown reason");
    		break;
    	case QSystemTrayIcon::Context :
    		this->ui.listWidget->addItem("The context menu for the system tray entry was requested");
    		break;
    	case QSystemTrayIcon::DoubleClick :
    		this->ui.listWidget->addItem("The system tray entry was double clicked");
    		break;
    	case QSystemTrayIcon::Trigger :
    		this->ui.listWidget->addItem("The system tray entry was clicked");
    		break;
    	case QSystemTrayIcon::MiddleClick :
    		this->ui.listWidget->addItem("The system tray entry was clicked with the middle mouse button");
    		break;
    	default:
    		break;
    	}
    }
    
    //build the context menu of the tray icon
    QMenu *MainWindow::build_context_menu()
    {
    	//set the new menu
    	QMenu *context_menu = new QMenu("Context Menu", this);
    
    	//set the first option
    	QAction *newAct = new QAction("Option 1", context_menu);
    	connect(newAct, SIGNAL(triggered()), this, SLOT(menu_option1_triggered()) );
    	context_menu->addAction(newAct);
    
    	//set the second option
    	newAct = new QAction("Option 2", context_menu);
    	connect(newAct, SIGNAL(triggered()), this, SLOT(menu_option2_triggered()) );
    	context_menu->addAction(newAct);
    
    	//set the third option
    	newAct = new QAction("Option 3", context_menu);
    	connect(newAct, SIGNAL(triggered()), this, SLOT(menu_option3_triggered()) );
    	context_menu->addAction(newAct);
    
    	return context_menu;
    }
    
    //slot for the option 1 of the menu
    void MainWindow::menu_option1_triggered()
    {
    	this->ui.listWidget->addItem("Menu option 1 selected");
    }
    
    //slot for the option 2 of the menu
    void MainWindow::menu_option2_triggered()
    {
    	this->ui.listWidget->addItem("Menu option 2 selected");
    }
    
    //slot for the option 3 of the menu
    void MainWindow::menu_option3_triggered()
    {
    	this->ui.listWidget->addItem("Menu option 3 selected");
    }
    
    //slot for the tray icon message clicked
    void MainWindow::tray_icon_message_clicked()
    {
    	this->ui.listWidget->addItem("Message clicked");
    }

    Código fuente

  • Qt: opciones de configure Actualmente me encuentro ocupado instalando un Qt custom con ciertas opciones que necesito. Todavía no he avanzado mucho al respecto en ningún sabor (mac, windows, linux) pero estoy en eso. Acá, las opciones del ejecutable configure, presente en cualquier sabor de Qt, al menos en linux y windows, talvez les pueda ser de utilidad. Mac es un misterio para mí, al cual tendré que afrontar próximamente. Todo un detalle por parte de la gente de Qt, fue el incluir el archivo configure.cache, en el sabor de windows, el cual muestra las opciones que se utilizaron para esa “build”; sirve de mucho para darse una idea de como empezar en este asunto. configure --help > <Nombre de archivo> Acá... ejecutado desde linux. Espero tener tiempo de poner algunos post sobre mis experiencias al respecto y poner la configuración que utilice, así como los pasos que tuve que realizar. Good Luck!!! :) Usage:  configure [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir <dir>] [-docdir <dir>] [-headerdir <dir>] [-plugindir <dir> ] [-datadir <dir>] [-translationdir <dir>] [-sysconfdir <dir>] [-examplesdir <dir>] [-demosdir <dir>] [-buildkey <key>] [-release] [-debug] [-debug-and-release] [-developer-build] [-shared] [-static] [-no-fast] [-fast] [-no-largefile] [-largefile] [-no-exceptions] [-exceptions] [-no-accessibility] [-accessibility] [-no-stl] [-stl] [-no-sql-<driver>] [-sql-<driver>] [-plugin-sql-<driver>] [-system-sqlite] [-no-qt3support] [-qt3support] [-platform] [-D <string>] [-I <string>] [-L <string>] [-help] [-qt-zlib] [-system-zlib] [-no-gif] [-qt-gif] [-no-libtiff] [-qt-libtiff] [-system-libtiff] [-no-libpng] [-qt-libpng] [-system-libpng] [-no-libmng] [-qt-libmng] [-system-libmng] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make <part>] [-nomake <part>] [-R <string>]  [-l <string>] [-no-rpath]  [-rpath] [-continue] [-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv] [-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked] [-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2] [-qtnamespace <namespace>] [-qtlibinfix <infix>] [-separate-debug-info] [-armfpa] [-no-optimized-qmake] [-optimized-qmake] [-no-xmlpatterns] [-xmlpatterns] [-no-multimedia] [-multimedia] [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend] [-no-audio-backend] [-audio-backend] [-no-openssl] [-openssl] [-openssl-linked] [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit] [-no-javascript-jit] [-javascript-jit] [-no-script] [-script] [-no-scripttools] [-scripttools] [-no-declarative] [-declarative] [additional platform specific options (see below)] Installation options: These are optional, but you may specify install directories. -prefix <dir> ...... This will install everything relative to <dir> (default /usr/local/Trolltech/Qt-4.6.2) * -prefix-install .... Force a sandboxed "local" installation of Qt. This will install into /usr/local/Trolltech/Qt-4.6.2, if this option is disabled then some platforms will attempt a "system" install by placing default values to be placed in a system location other than PREFIX. You may use these to separate different parts of the install: -bindir <dir> ......... Executables will be installed to <dir> (default PREFIX/bin) -libdir <dir> ......... Libraries will be installed to <dir> (default PREFIX/lib) -docdir <dir> ......... Documentation will be installed to <dir> (default PREFIX/doc) -headerdir <dir> ...... Headers will be installed to <dir> (default PREFIX/include) -plugindir <dir> ...... Plugins will be installed to <dir> (default PREFIX/plugins) -datadir <dir> ........ Data used by Qt programs will be installed to <dir> (default PREFIX) -translationdir <dir> . Translations of Qt programs will be installed to <dir> (default PREFIX/translations) -sysconfdir <dir> ..... Settings used by Qt programs will be looked for in <dir> (default PREFIX/etc/settings) -examplesdir <dir> .... Examples will be installed to <dir> (default PREFIX/examples) -demosdir <dir> ....... Demos will be installed to <dir> (default PREFIX/demos) You may use these options to turn on strict plugin loading. -buildkey <key> .... Build the Qt library and plugins using the specified <key>.  When the library loads plugins, it will only load those that have a matching key. Configure options: The defaults (*) are usually acceptable. A plus (+) denotes a default value that needs to be evaluated. If the evaluation succeeds, the feature is included. Here is a short explanation of each option: *  -release ........... Compile and link Qt with debugging turned off. -debug ............. Compile and link Qt with debugging turned on. -debug-and-release . Compile and link two versions of Qt, with and without debugging turned on (Mac only). -developer-build.... Compile and link Qt with Qt developer options (including auto-tests exporting) -opensource......... Compile and link the Open-Source Edition of Qt. -commercial......... Compile and link the Commercial Edition of Qt. *  -shared ............ Create and use shared Qt libraries. -static ............ Create and use static Qt libraries. *  -no-fast ........... Configure Qt normally by generating Makefiles for all project files. -fast .............. Configure Qt quickly by generating Makefiles only for library and subdirectory targets.  All other Makefiles are created as wrappers, which will in turn run qmake. -no-largefile ...... Disables large file support. +  -largefile ......... Enables Qt to access files larger than 4 GB. -no-exceptions ..... Disable exceptions on compilers that support it. *  -exceptions ........ Enable exceptions on compilers that support it. -no-accessibility .. Do not compile Accessibility support. *  -accessibility ..... Compile Accessibility support. -no-stl ............ Do not compile STL support. *  -stl ............... Compile STL support. -no-sql-<driver> ... Disable SQL <driver> entirely. -qt-sql-<driver> ... Enable a SQL <driver> in the QtSql library, by default none are turned on. -plugin-sql-<driver> Enable SQL <driver> as a plugin to be linked to at run time. Possible values for <driver>: [  db2 ibase mysql oci odbc psql sqlite sqlite2 sqlite_symbian tds ] -system-sqlite ..... Use sqlite from the operating system. -no-qt3support ..... Disables the Qt 3 support functionality. *  -qt3support ........ Enables the Qt 3 support functionality. -no-xmlpatterns .... Do not build the QtXmlPatterns module. +  -xmlpatterns ....... Build the QtXmlPatterns module. QtXmlPatterns is built if a decent C++ compiler is used and exceptions are enabled. -no-multimedia ..... Do not build the QtMultimedia module. +  -multimedia ........ Build the QtMultimedia module. -no-audio-backend .. Do not build the platform audio backend into QtMultimedia. +  -audio-backend ..... Build the platform audio backend into QtMultimedia if available. -no-phonon ......... Do not build the Phonon module. +  -phonon ............ Build the Phonon module. Phonon is built if a decent C++ compiler is used. -no-phonon-backend.. Do not build the platform phonon plugin. +  -phonon-backend..... Build the platform phonon plugin. -no-svg ............ Do not build the SVG module. +  -svg ............... Build the SVG module. -no-webkit ......... Do not build the WebKit module. +  -webkit ............ Build the WebKit module. WebKit is built if a decent C++ compiler is used. -no-javascript-jit . Do not build the JavaScriptCore JIT compiler. +  -javascript-jit .... Build the JavaScriptCore JIT compiler. -no-script ......... Do not build the QtScript module. +  -script ............ Build the QtScript module. -no-scripttools .... Do not build the QtScriptTools module. +  -scripttools ....... Build the QtScriptTools module. +  -no-declarative .....Do not build the declarative module. -declarative ....... Build the declarative module. -platform target ... The operating system and compiler you are building on (linux-g++-64). See the README file for a list of supported operating systems and compilers. -graphicssystem <sys> Sets an alternate graphics system. Available options are: raster - Software rasterizer opengl - Rendering via OpenGL, Experimental! -no-mmx ............ Do not compile with use of MMX instructions. -no-3dnow .......... Do not compile with use of 3DNOW instructions. -no-sse ............ Do not compile with use of SSE instructions. -no-sse2 ........... Do not compile with use of SSE2 instructions. -qtnamespace <name>  Wraps all Qt library code in 'namespace <name> {...}'. -qtlibinfix <infix>  Renames all libQt*.so to libQt*<infix>.so. -D <string> ........ Add an explicit define to the preprocessor. -I <string> ........ Add an explicit include path. -L <string> ........ Add an explicit library path. -help, -h .......... Display this information. Third Party Libraries: -qt-zlib ........... Use the zlib bundled with Qt. +  -system-zlib ....... Use zlib from the operating system. See http://www.gzip.org/zlib -no-gif ............ Do not compile the plugin for GIF reading support. *  -qt-gif ............ Compile the plugin for GIF reading support. See also src/plugins/imageformats/gif/qgifhandler.h -no-libtiff ........ Do not compile the plugin for TIFF support. -qt-libtiff ........ Use the libtiff bundled with Qt. +  -system-libtiff .... Use libtiff from the operating system. See http://www.libtiff.org -no-libpng ......... Do not compile in PNG support. -qt-libpng ......... Use the libpng bundled with Qt. +  -system-libpng ..... Use libpng from the operating system. See http://www.libpng.org/pub/png -no-libmng ......... Do not compile the plugin for MNG support. -qt-libmng ......... Use the libmng bundled with Qt. +  -system-libmng ..... Use libmng from the operating system. See http://www.libmng.com -no-libjpeg ........ Do not compile the plugin for JPEG support. -qt-libjpeg ........ Use the libjpeg bundled with Qt. +  -system-libjpeg .... Use libjpeg from the operating system. See http://www.ijg.org -no-openssl ........ Do not compile support for OpenSSL. +  -openssl ........... Enable run-time OpenSSL support. -openssl-linked .... Enabled linked OpenSSL support. -ptmalloc .......... Override the system memory allocator with ptmalloc. (Experimental.) Additional options: -make <part> ....... Add part to the list of parts to be built at make time. (libs tools examples demos docs translations) -nomake <part> ..... Exclude part from the list of parts to be built. -R <string> ........ Add an explicit runtime library path to the Qt libraries. -l <string> ........ Add an explicit library. -no-rpath .......... Do not use the library install path as a runtime library path. +  -rpath ............. Link Qt libraries and executables using the library install path as a runtime library path. Equivalent to -R install_libpath -continue .......... Continue as far as possible if an error occurs. -verbose, -v ....... Print verbose information about each step of the configure process. -silent ............ Reduce the build output so that warnings and errors can be seen more easily. *  -no-optimized-qmake ... Do not build qmake optimized. -optimized-qmake ...... Build qmake optimized. -no-nis ............ Do not compile NIS support. *  -nis ............... Compile NIS support. -no-cups ........... Do not compile CUPS support. *  -cups .............. Compile CUPS support. Requires cups/cups.h and libcups.so.2. -no-iconv .......... Do not compile support for iconv(3). *  -iconv ............. Compile support for iconv(3). -no-pch ............ Do not use precompiled header support. *  -pch ............... Use precompiled header support. -no-dbus ........... Do not compile the QtDBus module. +  -dbus .............. Compile the QtDBus module and dynamically load libdbus-1. -dbus-linked ....... Compile the QtDBus module and link to libdbus-1. -reduce-relocations ..... Reduce relocations in the libraries through extra linker optimizations (Qt/X11 and Qt for Embedded Linux only; experimental; needs GNU ld >= 2.18). -no-separate-debug-info . Do not store debug information in a separate file. *  -separate-debug-info .... Strip debug information into a separate .debug file. Qt/X11 only: -no-gtkstyle ....... Do not build the GTK theme integration. +  -gtkstyle .......... Build the GTK theme integration. *  -no-nas-sound ...... Do not compile in NAS sound support. -system-nas-sound .. Use NAS libaudio from the operating system. See http://radscan.com/nas.html -no-opengl ......... Do not support OpenGL. +  -opengl <api> ...... Enable OpenGL support. With no parameter, this will auto-detect the "best" OpenGL API to use. If desktop OpenGL is available, it will be used. Use desktop, es1, es1cl or es2 for <api> to force the use of the Desktop (OpenGL 1.x or 2.x), OpenGL ES 1.x Common profile, 1.x Common Lite profile or 2.x APIs instead. On X11, the EGL API will be used to manage GL contexts in the case of OpenGL ES -no-openvg ........ Do not support OpenVG. +   -openvg ........... Enable OpenVG support. Requires EGL support, typically supplied by an OpenGL or other graphics implementation. -no-sm ............. Do not support X Session Management. *  -sm ................ Support X Session Management, links in -lSM -lICE. -no-xshape ......... Do not compile XShape support. *  -xshape ............ Compile XShape support. Requires X11/extensions/shape.h. -no-xsync .......... Do not compile XSync support. *  -xsync ............. Compile XSync support. Requires X11/extensions/sync.h. -no-xinerama ....... Do not compile Xinerama (multihead) support. *  -xinerama .......... Compile Xinerama support. Requires X11/extensions/Xinerama.h and libXinerama. By default, Xinerama support will be compiled if available and the shared libraries are dynamically loaded at runtime. -no-xcursor ........ Do not compile Xcursor support. *  -xcursor ........... Compile Xcursor support. Requires X11/Xcursor/Xcursor.h and libXcursor. By default, Xcursor support will be compiled if available and the shared libraries are dynamically loaded at runtime. -no-xfixes ......... Do not compile Xfixes support. *  -xfixes ............ Compile Xfixes support. Requires X11/extensions/Xfixes.h and libXfixes. By default, Xfixes support will be compiled if available and the shared libraries are dynamically loaded at runtime. -no-xrandr ......... Do not compile Xrandr (resize and rotate) support. *  -xrandr ............ Compile Xrandr support. Requires X11/extensions/Xrandr.h and libXrandr. -no-xrender ........ Do not compile Xrender support. *  -xrender ........... Compile Xrender support. Requires X11/extensions/Xrender.h and libXrender. -no-mitshm ......... Do not compile MIT-SHM support. *  -mitshm ............ Compile MIT-SHM support. Requires sys/ipc.h, sys/shm.h and X11/extensions/XShm.h -no-fontconfig ..... Do not compile FontConfig (anti-aliased font) support. *  -fontconfig ........ Compile FontConfig support. Requires fontconfig/fontconfig.h, libfontconfig, freetype.h and libfreetype. -no-xinput.......... Do not compile Xinput support. *  -xinput ............ Compile Xinput support. This also enabled tablet support which requires IRIX with wacom.h and libXi or XFree86 with X11/extensions/XInput.h and libXi. -no-xkb ............ Do not compile XKB (X KeyBoard extension) support. *  -xkb ............... Compile XKB support. -no-glib ........... Do not compile Glib support. +  -glib .............. Compile Glib support.

Deja un comentario

Switch to our mobile site